Sponsored Content
Full Discussion: Expire license
Top Forums Shell Programming and Scripting Expire license Post 302956684 by Don Cragun on Friday 2nd of October 2015 03:21:55 AM
Old 10-02-2015
As Peasant said, we need to know what operating system you are using. You are using several features in your script that are not included in the standards (date -d option, date +'%s' format specifier, and ((expression)) arithmetic commands). The awk strftime() function Peasant suggested is also an extension to the standards. None of these are available on some operating systems, some of these are available on some other operating systems, and all of these are available on some other operating systems when using some shells.

It looks like date -d is what is keeping your script from working, but in addition to that, there are many extremely inefficient invocations of external utilities that could easily be replaced by redirections (commonly known as useless uses of cat), replaced by variable expansions (instead of invoking awk), or arithmetic expansions (instead of invoking expr).
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

password will expire

login: TEST7 TEST7's Password: Your password will expire: Wed Feb 19 14:28:08 2003 How can I the same information become in a script (as example in the .profile)????????? My login starts with .profile. These File is a menue with 24 lines and the message " Your password ....." disappear to... (8 Replies)
Discussion started by: Erwin Stocker
8 Replies

2. Shell Programming and Scripting

Telnet session does not expire

Dear friends.. Our project has a module that runs on handheld devices. Through the handheld we telnet to solaris where the application actually runs. I noticed that after starting a session through the handheld, if i go out of range or if i remove and replace the battery in the handheld, the... (1 Reply)
Discussion started by: deepsteptom
1 Replies

3. Shell Programming and Scripting

Password expire

Hi, Is there any way to find out the UNIX user's password expire date?. It'll we helpful to inform the users to change the password before it get expires.(FYI - I am not having only admin previlege.) (1 Reply)
Discussion started by: sharif
1 Replies

4. Solaris

Set Password Never Expire

Hello I want to set the password for user never expire through the command line. For your information the box is running under Solaris 8 platform. (2 Replies)
Discussion started by: shamsul
2 Replies

5. Shell Programming and Scripting

Expire Command | Need Help

Hi , I am trying to execute the ipl file as below : my $user="iwadmin"; chomp $user; system("passwd -x 29 $user"); The ipl file executes with out any issues when i have logged in as root in solaris .but when when i try to execute the same file with other user id ie iwadmin ,it says... (3 Replies)
Discussion started by: abhishek1979
3 Replies

6. Solaris

user to be never expire ..

Hi All, I have Solaris 9 and there is user created in that server called appuser That user should to be never expire.. can anyone advice me how can I modify that user to be never expire thru the command line without using GUI tool. (1 Reply)
Discussion started by: Mr.AIX
1 Replies

7. Shell Programming and Scripting

Updating the license tag in XML file with new license

Hi All, I have a XML file : System.xml in which I want to update the license tag with the new data from file licence.xml. The content of files is in following format: System.xml: <?xml version="1.0"?> <!DOCTYPE Configuration SYSTEM "SystemVariables.dtd"> <usageConfiguration... (2 Replies)
Discussion started by: Pramod_T
2 Replies

8. AIX

Password Expire Message

Does anyone know if the default message displayed when a users password has expired can be changed? I am just assuming the message below is the default one. If so please tell. Using username "justinxx". justinxx@160.23.12.44's password: WARNING: Your password has expired. You must... (2 Replies)
Discussion started by: juredd1
2 Replies

9. Shell Programming and Scripting

Software License Expire in 30 days

I wrote code to read a file text with contents of expiration dates and products. The products expire in thirty days and each day an email message is send as a reminder of the number of days left before the license expires. The code generates errors when executed . Here is part of the code.... (2 Replies)
Discussion started by: dellanicholson
2 Replies

10. Solaris

Never Expire & Never Lock

Hi There, Actually I'm looking for command in Solaris 11 for the following Command to do User Never Expire. Command to return the user Expire to normal mode. Command to do User Never Lock. Command to return the user Never Lock to normal mode. Please advice .. (1 Reply)
Discussion started by: roooooooooot
1 Replies
STRPTIME(3)								 1							       STRPTIME(3)

strptime - Parse a time/date generated withstrftime(3)

SYNOPSIS
array strptime (string $date, string $format) DESCRIPTION
strptime(3) returns an array with the $date parsed, or FALSE on error. Month and weekday names and other language dependent strings respect the current locale set with setlocale(3) ( LC_TIME). PARAMETERS
o $date ( string) - The string to parse (e.g. returned from strftime(3)). o $format ( string) - The format used in $date (e.g. the same as used in strftime(3)). Note that some of the format options available to strf- time(3) may not have any effect within strptime(3); the exact subset that are supported will vary based on the operating system and C library in use. For more information about the format options, read the strftime(3) page. RETURN VALUES
Returns an array or FALSE on failure. The following parameters are returned in the array +-----------+---------------------------------------------------+ |parameters | | | | | | | Description | | | | +-----------+---------------------------------------------------+ | | | | "tm_sec" | | | | | | | Seconds after the minute (0-61) | | | | | | | | "tm_min" | | | | | | | Minutes after the hour (0-59) | | | | | | | |"tm_hour" | | | | | | | Hour since midnight (0-23) | | | | | | | |"tm_mday" | | | | | | | Day of the month (1-31) | | | | | | | | "tm_mon" | | | | | | | Months since January (0-11) | | | | | | | |"tm_year" | | | | | | | Years since 1900 | | | | | | | |"tm_wday" | | | | | | | Days since Sunday (0-6) | | | | | | | |"tm_yday" | | | | | | | Days since January 1 (0-365) | | | | | | | |"unparsed" | | | | | | | the $date part which was not recognized using the | | | specified $format | | | | +-----------+---------------------------------------------------+ EXAMPLES
Example #1 strptime(3) example <?php $format = '%d/%m/%Y %H:%M:%S'; $strf = strftime($format); echo "$strf "; print_r(strptime($strf, $format)); ?> The above example will output something similar to: 03/10/2004 15:54:19 Array ( [tm_sec] => 19 [tm_min] => 54 [tm_hour] => 15 [tm_mday] => 3 [tm_mon] => 9 [tm_year] => 104 [tm_wday] => 0 [tm_yday] => 276 [unparsed] => ) NOTES
Note This function is not implemented on Windows platforms. Note Internally, this function calls the strptime() function provided by the system's C library. This function can exhibit noticeably different behaviour across different operating systems. The use of date_parse_from_format(3), which does not suffer from these issues, is recommended on PHP 5.3.0 and later. Note "tm_sec" includes any leap seconds (currently upto 2 a year). For more information on leap seconds, see the Wikipedia article on leap seconds. Note Prior to PHP 5.2.0, this function could return undefined behaviour. Notably, the "tm_sec", "tm_min" and "tm_hour" entries would return undefined values. SEE ALSO
checkdate(3), strftime(3), date_parse_from_format(3), DateTime.createFromFormat(3). PHP Documentation Group STRPTIME(3)
All times are GMT -4. The time now is 01:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy