home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / bash / bug / 754 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  849 b 

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!corp.SUn.COM!dtm
  2. From: dtm@corp.SUn.COM (Duane T. Mun)
  3. Newsgroups: gnu.bash.bug
  4. Subject: Why can't bash do this...
  5. Date: 25 Jan 1993 20:14:14 -0500
  6. Organization: Sun Microsystems, Inc.
  7. Lines: 23
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-bash@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <DTM.93Jan23121322@booyaa.corp.sun.com>
  12.  
  13. I'm having a problem...why does bash choke on this:
  14.  
  15.     cmdname=`_=\`/bin/basename $0\`; /bin/expr $_ : '\(.*\),v' \| $_`
  16.  
  17. Here's some debug info from bash:
  18.  
  19.     +++ /bin/basename ./tst
  20.     ++ _=tst
  21.     ++ /bin/expr : \(.*\),v |
  22.     expr: syntax error
  23.  
  24. $_ isn't being assign anything from /bin/basename.
  25.  
  26. This works fine with /bin/sh:
  27.  
  28.     + cmdname=
  29.     + /bin/basename ./tst 
  30.     _=tst
  31.     + /bin/expr tst : \(.*\),v | tst 
  32.     cmdname=tst
  33.  
  34. Thanks.
  35.  
  36.