home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / shell / 4786 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  1.5 KB

  1. Path: sparky!uunet!pipex!warwick!warwick!not-for-mail
  2. From: cudcv@csv.warwick.ac.uk (Rob McMahon)
  3. Newsgroups: comp.unix.shell
  4. Subject: Action of `echo */'
  5. Date: 19 Nov 1992 12:08:51 -0000
  6. Organization: Computing Services, University of Warwick, UK
  7. Lines: 41
  8. Distribution: world
  9. Message-ID: <1eg04jINN9go@sprocket.csv.warwick.ac.uk>
  10. NNTP-Posting-Host: sprocket.csv.warwick.ac.uk
  11.  
  12. SunOS 4.1.3, tcsh 6.02.00, bash 1.12.1.
  13.  
  14. I was asked how to list just the subdirectories using ls, and said "easy, just
  15. do `ls -d */'".  He was using tcsh, and it didn't work:
  16.  
  17. cudcv (2525) > \ls -F
  18. xx/  yy*  zz/
  19. cudcv (2526) > \ls -d */
  20. xx/  yy/  zz/
  21. cudcv (2527) > 
  22.  
  23. "Eek!" thought I, a bug in tcsh!, so just to check I tried csh:
  24.  
  25. cudcv (2527) > csh -c 'ls -d */'
  26. xx/  zz/
  27. cudcv (2528) > 
  28.  
  29. Fine.  "Hmm," I continued muttering to myself, "I wonder if bash has this
  30. problem ?":
  31.  
  32. cudcv (2529) > bash -c 'ls -d */'
  33. xx/  yy/  zz/
  34. cudcv (2530) > 
  35.  
  36. Yes, it does.  sh ?
  37.  
  38. cudcv (2530) > sh -c 'ls -d */'
  39. ls: */: No such file or directory
  40. Exit 1
  41. cudcv (2531) > 
  42.  
  43. Aagh!  Say what ?  I'm sure this used to work, in sh, csh, and tcsh.
  44. Somewhere along the line it's all gone horribly wrong.  What's this crud from
  45. tcsh and bash, and ls for that matter (/bin/ls and GNU ls behave the same).
  46. Why won't /bin/sh expand `*/'.  `*/.' works in all cases of course.
  47.  
  48. Rob
  49. -- 
  50. UUCP:   ...!mcsun!uknet!warwick!cudcv    PHONE:  +44 203 523037
  51. JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
  52. Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
  53.