Computing.Net > Forums > Unix > echo wildcard in variable

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

echo wildcard in variable

Reply to Message Icon

Name: abhargav
Date: May 14, 2005 at 02:25:52 Pacific
OS: unix
CPU/Ram: 256 SDRAM
Comment:

hi
i m iterating /etc/shadow file
now i want to pick the second field which is a wild card "*" or encrypted password i m using a simple for loop

#/bin/sh

for WHO in `awk -F":" '{print $2}' /etc/shadow` ; do
echo "$WHO"
echo ${WHO}
done
i m just wants to print if it is a "*" then
it should be * but it prints out the files in that directory becoz by default echo "*"
will list files.is there any way i can print
"*"
root:$1$Kij0PSF0$b8zSNlahpjmC1wlqA6seZ1:12868:0:::::
bin:*: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:::::
operator:*:9797:0:::::

hi
my question is abt scripting.
i want to find the diffrence in two dates.
dates are in /var/log/messages

Mar 27 05:48:02 abhargav sshd[1151]:
Apr 2 15:31:17 abhargav sshd[1151]:

no



Sponsored Link
Ads by Google

Response Number 1
Name: Luke Chi
Date: May 14, 2005 at 14:27:16 Pacific
Reply:

#/bin/sh

cut -d":" -f2 /etc/shadow

Luke Chi


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: echo wildcard in variable

problem in variable www.computing.net/answers/unix/problem-in-variable/5970.html

wildcard in loop awk www.computing.net/answers/unix/wildcard-in-loop-awk/6914.html

store a line from file in variable www.computing.net/answers/unix/store-a-line-from-file-in-variable/4659.html