Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!texbell!nuchat!buster!rli From: rli@buster.irby.com (Buster Irby) Newsgroups: comp.unix.wizards Subject: Re: ls -A Message-ID: <602@buster.irby.com> Date: 9 Oct 89 07:20:58 GMT References: <15@minya.UUCP> <14611@bloom-beacon.MIT.EDU> <1989Oct6.201107.9465@eci386.uucp> <1989Oct7.032907.27496@rpi.edu> <1989Oct8.212100.12355@rpi.edu> <6468@ficc.uu.net> Distribution: na Organization: Buster Irby, Stafford, Tx Lines: 23 peter@ficc.uu.net (Peter da Silva) writes: >In article <1989Oct8.212100.12355@rpi.edu> tale@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