🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #705

Re: Bug report: quoted strings passed to functions

#705
From: David Elliott
Date: Mon, 13 Nov 1989 16:24
24 lines
1254 bytes
In article <1989Nov13.054213.24296@rpi.edu> night@pawl11.pawl.rpi.edu (Trip Martin) writes:
>Configuration: bash 1.04.1, SysVR3.1, ATT 3B2/300
>
>bash$ grep() { egrep $* ; }
>bash$ grep 'foo bar' testfile
>egrep: bar does not exist

The bug is in the use of $*, not bash.  This is a common problem, caused
by a flaw in the design of the original sh.

Change that to

	grep() { egrep "$@" ; }

and it will work as expected.

Hey, Brian, maybe you could add a special mode to bash that would
print out warnings for all uses of $* and unquoted variable
references, or maybe someone could write "shlint". ;-)
-- 
David Elliott
dce@sony.com | ...!{uunet,mips}!sonyusa!dce
(408)944-4073
"You can lead a robot to water, but you can not make him compute."
Technical Details
Message-ID: <1989Nov13.162429.12744@sony.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!mips!sony.com!dce
References: <1989Nov13.054213.24296@rpi.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!mips!sony.com!dce
From: dce@sony.com (David Elliott)
Newsgroups: gnu.bash.bug
Subject: Re: Bug report: quoted strings passed to functions
Message-ID: <1989Nov13.162429.12744@sony.com>
Date: 13 Nov 89 16:24:29 GMT
References: <1989Nov13.054213.24296@rpi.edu>
Reply-To: dce@icky.Sony.COM (David Elliott)
Distribution: na
Organization: Sony Microsystems Corp.
Lines: 24