HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

script help

 
SOLVED
Go to solution
balaji_vvv
Frequent Advisor

script help

http://www11.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=USECKBAN00000934

I'm trying to use this script for password expiry. But i dont understand how to compile or this is one c prog and a script?

Anyone explain how to compile this? It says time.c, user_expire.sh etc, but i didnt see that? any help please.
6 REPLIES
Hein van den Heuvel
Honored Contributor
Solution

Re: script help

If you read to the end, then you'll see that the time program is only a simple helper which is providing a time in seconds, and which can be replaced by a PERL command.

Best I can tell the time.c source got 'eaten' by the html formatter but should have looked like:
---------------------------
#include
#include
main(){
printf ("%d\n",time(0));
}
----------------------------

No more, no less.
Enjoy,
Hein

balaji_vvv
Frequent Advisor

Re: script help

Thanks Hein, time works now. But what is the start of user_expire.sh script?
I'm getting syntax error. Is "set -u " is the starting point of the script??
Patrick Wallek
Honored Contributor

Re: script help

The script should start at the 'set -u' and end at the 'exit 0'.

However, you really should add a first line of:

#!/usr/bin/sh

to the script so that it will use the POSIX shell as its interpreter.

If modify the line so that it is:

#!/usr/bin/sh -x

The you will get debug messages which should help you in troubleshooting the script.
balaji_vvv
Frequent Advisor

Re: script help

balaji_vvv
Frequent Advisor

Re: script help

see above.

Re: script help

> Hein: should have looked like:

Better to look like: :-)
#include
#include
int main(){
printf("%ld\n", time(NULL));
return 0;
}