home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!dattier
- From: dattier@ddsw1.mcs.com (David W. Tamkin)
- Subject: Re: A question on ls
- Message-ID: <1992Aug31.183110.2176@ddsw1.mcs.com>
- Organization: Contributor Account at ddsw1, Chicago, Illinois 60657
- References: <6786@tekig7.PEN.TEK.COM> <1992Aug29.233534.27967@umbc3.umbc.edu>
- Distribution: na
- Date: Mon, 31 Aug 1992 18:31:10 GMT
- X-Disclaimer: Material posted in this article is the sole responsibility of
- the poster and does not represent MCSNet or the system owners.
- Lines: 32
-
- rouben@math9.math.umbc.edu (Rouben Rostamian) wrote in
- <1992Aug29.233534.27967@umbc3.umbc.edu>:
-
- | In article <6786@tekig7.PEN.TEK.COM> naren@tekig5.pen.tek.com (Naren Bala)
- | writes:
-
- | >What command would I type to display all files that do not have a .Z
- | >extension ?
-
- | The wildcards are expanded by the shell, so the answer is: it depends on
- | the shell you are using. In tcsh, you type:
- | % ls ^*.Z
- | In sh and csh you are out of luck. In other shells, I don't know.
-
- In ksh, ls -d !(*.Z) .!(*.Z)
-
- In sh, you aren't very far out of luck:
-
- ls -d `for i in .* *
- do
- case $i in
- *.Z|.*.Z) ;;
- *) echo $i ;;
- esac
- done`
-
- The sh running here under Dell SVR4 doesn't consider initial periods special
- for pattern matching with "case", so *.Z) ;; is enough without |.*.Z, but
- your sh's mileage may very.
-
- David W. Tamkin Box 59297 Northtown Station, Illinois 60659-0297
- dattier@ddsw1.mcs.com CompuServe: 73720,1570 MCI Mail: 426-1818
-