Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi all
i m just stuffed in a problem if somebody can help me out
i hav /etc/shadow file with enteries likebin:*:9797:0:::::
daemon:*:9797:0:::::
adm:*:9797:0:::::
lp:*:9797:0:::::
sync:*:9797:0:::::
shutdown:*:9797:0:::::
halt:*:9797:0:::::
mail:*:9797:0:::::
news:*:9797:0:::::
uucp:*:9797:0:::::
abhargav:$1$c6F/ngOF$drzN.QbsW2VK69SgHXsRL/:12868:0:99999:7:::
aby:$1$KkQ0GmPM$0Huso4Y.16OI9clt3keeU0:12890:0:99999:7:::now i want to check whether the second entry with "*" wildcard is there or not
so my code is
#!/bin/shfor WHO in `awk -F":" '{print $2}' /etc/shadow` ; do
if [ "${WHO}" = '*' ] ; then
echo "they are not the real users "
else
echo "they are users ${WHO} "
fi
donebut some how it doesnt take "*" it starts counting the files in the directories
i m getting mad @ it.plz helphi
my question is abt scripting.
i want to find the diffrence in two dates.
dates are in /var/log/messagesMar 27 05:48:02 abhargav sshd[1151]:
Apr 2 15:31:17 abhargav sshd[1151]:no

cat /etc/shadow | while read LINE
do
WHO="\\"`echo $LINE | cut -d":" -f2`
if [ $WHO = '\*' ] ; then
echo "they are not the real users "
else
echo "they are users `echo $WHO | cut -c2-"
fi
doneLuke Chi

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |