>>>>> "CA" == Christopher Adams <chris@sparkie.osl.state.or.us> writes:
CA> # for L in `/bin/ls -1 | grep -v '\.'`; do
CA> > rm -f $L.passwd
CA> > ln MASTER.PASSWD $L.passwd
CA> > done
CA> What is 'do'
Part of the shell looping construct:
for VARIABLE in LIST; do COMMANDS; done
Look at the manual page for 'sh' or consult a basic UNIX book for more
info.
CA> What is '\.' (a regular expression?)
Yes, one matching any string containing a single period.
CA> So, could someone explain line-by-line what this is doing?
for L in `/bin/ls -1 | grep -v '\.'`; do
Loop over all files with names not containing dots. In other words, the
names of all of the lists. (All files without dots in the list directory
are by definition the names of lists. List names absolutely cannot contain
periods.) Each time through the loop, store the name in $L.
rm -f $L.passwd
Delete $L.passwd if it exists; don't complain if it doesn't.
ln MASTER.PASSWD $L.passwd
Link $L.passwd to MASTER.PASSWD.
done
End of the loop.
CA> I realize that the idea is to link list.passwd files to
CA> MASTER.PASSWD. I am just a little hazy about the syntax and some of the
CA> characters.
I really recommend getting a book like _Unix in a Nutshell_ or any of
the other basic Unix books from O'Reilly (www.ora.com). This really isn't
the place to discuss these things.
- J<
Follow-Ups:
References:
|
|