home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
- From: etxmesa@eos.ericsson.se (Michael Salmon)
- Subject: Re: Action of `echo */'
- Message-ID: <1992Nov19.125814.9086@ericsson.se>
- Sender: news@ericsson.se
- Nntp-Posting-Host: eos6c02.ericsson.se
- Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
- Organization: Ericsson Telecom AB
- References: <1eg04jINN9go@sprocket.csv.warwick.ac.uk>
- Date: Thu, 19 Nov 1992 12:58:14 GMT
- Lines: 71
-
- In article <1eg04jINN9go@sprocket.csv.warwick.ac.uk>
- cudcv@csv.warwick.ac.uk (Rob McMahon) writes:
- |> SunOS 4.1.3, tcsh 6.02.00, bash 1.12.1.
- |>
- |> I was asked how to list just the subdirectories using ls, and said "easy, just
- |> do `ls -d */'". He was using tcsh, and it didn't work:
- |>
- |> cudcv (2525) > \ls -F
- |> xx/ yy* zz/
- |> cudcv (2526) > \ls -d */
- |> xx/ yy/ zz/
- |> cudcv (2527) >
- |>
- |> "Eek!" thought I, a bug in tcsh!, so just to check I tried csh:
- |>
- |> cudcv (2527) > csh -c 'ls -d */'
- |> xx/ zz/
- |> cudcv (2528) >
- |>
- |> Fine. "Hmm," I continued muttering to myself, "I wonder if bash has this
- |> problem ?":
- |>
- |> cudcv (2529) > bash -c 'ls -d */'
- |> xx/ yy/ zz/
- |> cudcv (2530) >
- |>
- |> Yes, it does. sh ?
- |>
- |> cudcv (2530) > sh -c 'ls -d */'
- |> ls: */: No such file or directory
- |> Exit 1
- |> cudcv (2531) >
- |>
- |> Aagh! Say what ? I'm sure this used to work, in sh, csh, and tcsh.
- |> Somewhere along the line it's all gone horribly wrong. What's this crud from
- |> tcsh and bash, and ls for that matter (/bin/ls and GNU ls behave the same).
- |> Why won't /bin/sh expand `*/'. `*/.' works in all cases of course.
-
- SunOS 4.1.1, tcsh 6.02
-
- eos6 ~ 115 > /bin/ls -d */
- C/ Wingz/ c/ ibm/ misc/ shql/
- Calendar/ X11/ doc/ images/ motif/ sun/
- MH/ apstools/ eXclaim/ include/ perl/ tmp/
- Mail/ asa/ emacs/ incoming/ ps/ verilog/
- News/ awk/ fig/ ipu21220/ rfc/ x/
- SGML_docs/ b/ frame/ lib/ sc/ xview/
- VILEARN/ bin/ hdl/ man/ shell/
- eos6 ~ 116 > ls-F -d */
- C// Wingz// c// ibm// misc// shql//
- Calendar// X11// doc// images// motif// sun//
- MH// apstools// eXclaim// include// perl// tmp//
- Mail// asa// emacs// incoming// ps// verilog//
- News// awk// fig// ipu21220// rfc// x//
- SGML_docs// b// frame// lib// sc// xview//
- VILEARN// bin// hdl// man// shell//
- eos6 ~ 117 > ls -l lstest
- -rw-r--r-- 1 etxmesa z 0 Nov 19 13:53 lstest
-
- bash and sh both refuse to expand */.
-
- --
-
- Michael Salmon
-
- #include <standard.disclaimer>
- #include <witty.saying>
- #include <fancy.pseudo.graphics>
-
- Ericsson Telecom AB
- Stockholm
-