home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!warwick!warwick!not-for-mail
- From: cudcv@csv.warwick.ac.uk (Rob McMahon)
- Newsgroups: comp.unix.shell
- Subject: Action of `echo */'
- Date: 19 Nov 1992 12:08:51 -0000
- Organization: Computing Services, University of Warwick, UK
- Lines: 41
- Distribution: world
- Message-ID: <1eg04jINN9go@sprocket.csv.warwick.ac.uk>
- NNTP-Posting-Host: sprocket.csv.warwick.ac.uk
-
- 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.
-
- Rob
- --
- UUCP: ...!mcsun!uknet!warwick!cudcv PHONE: +44 203 523037
- JANET: cudcv@uk.ac.warwick INET: cudcv@warwick.ac.uk
- Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
-