🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #992

Why can't bash do this...

#992
From: Duane T. Mun
Date: Tue, 26 Jan 1993 01:14
22 lines
882 bytes
I'm having a problem...why does bash choke on this:

	cmdname=`_=\`/bin/basename $0\`; /bin/expr $_ : '\(.*\),v' \| $_`

Here's some debug info from bash:

	+++ /bin/basename ./tst
	++ _=tst
	++ /bin/expr : \(.*\),v |
	expr: syntax error

$_ isn't being assign anything from /bin/basename.

This works fine with /bin/sh:

	+ cmdname=
	+ /bin/basename ./tst 
	_=tst
	+ /bin/expr tst : \(.*\),v | tst 
	cmdname=tst

Thanks.
Technical Details
Message-ID: <DTM.93Jan23121322@booyaa.corp.sun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!corp.SUn.COM!dtm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!corp.SUn.COM!dtm
From: dtm@corp.SUn.COM (Duane T. Mun)
Newsgroups: gnu.bash.bug
Subject: Why can't bash do this...
Date: 25 Jan 1993 20:14:14 -0500
Organization: Sun Microsystems, Inc.
Lines: 23
Sender: daemon@cis.ohio-state.edu
Approved: bug-bash@prep.ai.mit.edu
Distribution: gnu
Message-ID: <DTM.93Jan23121322@booyaa.corp.sun.com>