ls -A

Buster Irby rli at buster.irby.com
Mon Oct 9 17:20:58 AEST 1989


peter at ficc.uu.net (Peter da Silva) writes:

>In article <1989Oct8.212100.12355 at rpi.edu> tale at pawl.rpi.edu (David C Lawrence) writes:
>>What about
>>when I do want to grep all of the files (but not . and ..) in the
>>current directory?  Shell globbing alone is not sufficient for this
>>where .files exist.

>grep 'pattern' .??* *

Sorry Peter, but you just flunked your Unix Wizards Test!  The
'.??*' you mentioned above will not only exclude '.' and '..'
from the glob, but will exclude all '.?' files such as ".a", ".B", 
from the glob as well.  If you are using the Bourne or the Korn shell, 
you can try this instead:

grep 'pattern' .[!.]* ..?* *

The middle pattern '..?*' is only needed if you are in the habit of
creating hidden files with two or more leading dots instead of 
just one, such as '..a' or '..B', otherwise it can be excluded.
-- 
Buster Irby  buster!rli



More information about the Comp.unix.wizards mailing list