![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| suggest book | haripatn | UNIX for Advanced & Expert Users | 6 | 05-02-2008 02:14 PM |
| Can you suggest a more efficient way for this? | mikie | Shell Programming and Scripting | 1 | 11-20-2006 06:49 AM |
| Two SQL connections..suggest changes. | bhagat.singh-j | Shell Programming and Scripting | 0 | 10-24-2006 11:21 PM |
| Suggest me the easiest method | shihabvk | UNIX for Advanced & Expert Users | 1 | 08-11-2006 03:40 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Look into this and suggest if any changes needed
Hi,
I am new script programming, I have written a script shown velow to read username and passwd from /etc/security/passwd, i am able to read username, but unable to grep lastupdate. please look into the code and suggest if any changes need. #!/bin/ksh USERNAME="" fname=/usr/bin/lastupdate ftemp=./temp cat /etc/security/passwd | \ while read LINE do echo "$LINE" > fstring USERWORDCNT=`grep ":" fstring | wc -w` if [ $USERWORDCNT = 1 ] then USERNAME=$LINE fi UPDATEWORDCNT=`grep "lastupdate" fstring | wc -w` if [ $UPDATEWORDCNT = 1 ] then UPDATE=`cat fstring | cut -d= -f2` echo "$UPDATE" STRING=$USERNAME$UPDATE echo $STRING >> $fname USERNAME="" UPDATE="" fi done chmod 666 $fname Note: The output of programme should write username and lastupdate values ony to another new file in this format as shown below: smith:12445 grith:34455 |
| Forum Sponsor | ||
|
|
|
||||
|
Helo.
You've been asking the same thing repeatedly. Have a look at the forum rules (#4). Besides, I gave you some tips for what you are asking: how to read password information on the AIX Have you read/tested them? I'm afraid you have not... Regards. |
||||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|