🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #589

bash: "$@" incorrect in functions

#589
From: Andy Bliven
Date: Tue, 12 Dec 1989 19:36
30 lines
1305 bytes
There is a difference in the way bash and sh handle "$@" in a
function.  Here is an example in sh:

    $ args () { for a in "$@"; do echo $a; done }
    $ args 1 2 3 4
    1
    2
    3
    4
    $

And the same example in bash:

    $ args () { for a in "$@"; do echo $a; done }
    $ args 1 2 3 4
    1 2 3 4
    $

I'm running on a Sun 3/60 with Sun UNIX 4.2 Release 3.5, and the ident
string in my bash is /bin/bash:

          $Id: gtest.c,v 1.10 88/07/02 13:34:45 afb Exp Locker: afb $

Does anyone have a fix?  Thanks,

Andy Bliven
-------------------------------------------------------------------
Atherton Technology			mail:	bliven@atherton.com
1333 Bordeaux Drive                  	phone:	408-734-9822
Sunnyvale, California 94089     	fax:	408-744-1607
Technical Details
Message-ID: <15261@athertn.Atherton.COM>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!voder!pyramid!athertn!Atherton.COM!bliven

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!voder!pyramid!athertn!Atherton.COM!bliven
From: bliven@Atherton.COM (Andy Bliven)
Newsgroups: gnu.utils.bug
Subject: bash: "$@" incorrect in functions
Keywords: bash
Message-ID: <15261@athertn.Atherton.COM>
Date: 12 Dec 89 19:36:36 GMT
Sender: news@athertn.Atherton.COM
Reply-To: bliven@Atherton.COM (Andy Bliven)
Organization: Atherton Technology -- Sunnyvale, CA
Lines: 30