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
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]:
Summary: The ${var#pat} and ${var%pat} constructs do not recognize begin-of-line and end-of-line anchors because their logic is already targeted to either the front or the end of the variable with # or %. If ^...
Summary: hi all i m just stuffed in a problem if somebody can help me out i hav /etc/shadow file with enteries like bin:*:9797:0::::: daemon:*:9797:0::::: adm:*:9797:0::::: lp:*:9797:0::::: sync:*:9797:0:::::...
Summary: hi, i need to pick up a line from a file and store it in a variable.i dont know the number of lines that the file contains...so i cannot specify it by a linenumber. i need to continue this till the la...