1753435 Members
4622 Online
108794 Solutions
New Discussion юеВ

Re: 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 6
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.
Dennis Handly
Acclaimed Contributor

Re: script help

> Hein: should have looked like:

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