Path: 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 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."