home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / shell / 4787 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.8 KB  |  85 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
  3. From: etxmesa@eos.ericsson.se (Michael Salmon)
  4. Subject: Re: Action of `echo */'
  5. Message-ID: <1992Nov19.125814.9086@ericsson.se>
  6. Sender: news@ericsson.se
  7. Nntp-Posting-Host: eos6c02.ericsson.se
  8. Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
  9. Organization: Ericsson Telecom AB
  10. References:  <1eg04jINN9go@sprocket.csv.warwick.ac.uk>
  11. Date: Thu, 19 Nov 1992 12:58:14 GMT
  12. Lines: 71
  13.  
  14. In article <1eg04jINN9go@sprocket.csv.warwick.ac.uk>
  15. cudcv@csv.warwick.ac.uk (Rob McMahon) writes:
  16. |> SunOS 4.1.3, tcsh 6.02.00, bash 1.12.1.
  17. |> 
  18. |> I was asked how to list just the subdirectories using ls, and said "easy, just
  19. |> do `ls -d */'".  He was using tcsh, and it didn't work:
  20. |> 
  21. |> cudcv (2525) > \ls -F
  22. |> xx/  yy*  zz/
  23. |> cudcv (2526) > \ls -d */
  24. |> xx/  yy/  zz/
  25. |> cudcv (2527) > 
  26. |> 
  27. |> "Eek!" thought I, a bug in tcsh!, so just to check I tried csh:
  28. |> 
  29. |> cudcv (2527) > csh -c 'ls -d */'
  30. |> xx/  zz/
  31. |> cudcv (2528) > 
  32. |> 
  33. |> Fine.  "Hmm," I continued muttering to myself, "I wonder if bash has this
  34. |> problem ?":
  35. |> 
  36. |> cudcv (2529) > bash -c 'ls -d */'
  37. |> xx/  yy/  zz/
  38. |> cudcv (2530) > 
  39. |> 
  40. |> Yes, it does.  sh ?
  41. |> 
  42. |> cudcv (2530) > sh -c 'ls -d */'
  43. |> ls: */: No such file or directory
  44. |> Exit 1
  45. |> cudcv (2531) > 
  46. |> 
  47. |> Aagh!  Say what ?  I'm sure this used to work, in sh, csh, and tcsh.
  48. |> Somewhere along the line it's all gone horribly wrong.  What's this crud from
  49. |> tcsh and bash, and ls for that matter (/bin/ls and GNU ls behave the same).
  50. |> Why won't /bin/sh expand `*/'.  `*/.' works in all cases of course.
  51.  
  52. SunOS 4.1.1, tcsh 6.02
  53.  
  54.  eos6 ~ 115 > /bin/ls -d */
  55. C/          Wingz/      c/          ibm/        misc/       shql/
  56. Calendar/   X11/        doc/        images/     motif/      sun/
  57. MH/         apstools/   eXclaim/    include/    perl/       tmp/
  58. Mail/       asa/        emacs/      incoming/   ps/         verilog/
  59. News/       awk/        fig/        ipu21220/   rfc/        x/
  60. SGML_docs/  b/          frame/      lib/        sc/         xview/
  61. VILEARN/    bin/        hdl/        man/        shell/
  62.  eos6 ~ 116 > ls-F -d */
  63. C//          Wingz//      c//          ibm//        misc//       shql//
  64. Calendar//   X11//        doc//        images//     motif//      sun//
  65. MH//         apstools//   eXclaim//    include//    perl//       tmp//
  66. Mail//       asa//        emacs//      incoming//   ps//         verilog//
  67. News//       awk//        fig//        ipu21220//   rfc//        x//
  68. SGML_docs//  b//          frame//      lib//        sc//         xview//
  69. VILEARN//    bin//        hdl//        man//        shell//
  70.  eos6 ~ 117 > ls -l lstest 
  71. -rw-r--r--  1 etxmesa  z               0 Nov 19 13:53 lstest
  72.  
  73. bash and sh both refuse to expand */.
  74.  
  75. -- 
  76.  
  77. Michael Salmon
  78.  
  79. #include    <standard.disclaimer>
  80. #include    <witty.saying>
  81. #include    <fancy.pseudo.graphics>
  82.  
  83. Ericsson Telecom AB
  84. Stockholm
  85.