bourne shell /etc/passwd /etc/shadow
#!/bin/sh
TEMPFILE1=/tmp/ehong.1.$$ IFS=":" ; export IFS cat /cygdrive/h/etc/passwd | while read username passwd_placeholder userid groupid gecos home_dir shell; do if [ $userid -gt 500 ] ; then shadow_line=`grep "^$username:" /cygdrive/h/etc/shadow` `echo $shadow_line | awk -F: '{ print $1":"$3":"$4":"$5":"$6 }' /cygdrive/h/etc/shadow` > $TEMPFILE1 fi done i have been figuring out abt this for a week. i have problem extracting info from /etc/shadow with username input from /etc/passwd & output to a temp file for comparing data later on. help is appreciated! thanks!:newbie: |
In the line:
`echo $shadow_line | awk -F: '{ print $1":"$3":"$4":"$5":"$6 }' /cygdrive/h/etc/shadow` > $TEMPFILE1 use echo $shadow_line | awk -F: '{ print $1":"$3":"$4":"$5":"$6 }' /cygdrive/h/etc/shadow > $TEMPFILE1 Hope that helps ... |
thanks, i have long discarded that, did it another way. :D
|
All times are GMT -5. The time now is 08:33 PM. |