🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Andy Bliven Tue, 12 Dec 1989 19:36
bash: "$@" incorrect in functions
#589
Author: 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
Re: bash: "$@" incorrect in functions
#1669
Author: Chet Ramey
Date: Wed, 13 Dec 1989 19:56
13 lines
936 bytes
In article <15261@athertn.Atherton.COM> bliven@Atherton.COM (Andy Bliven) writes:
>There is a difference in the way bash and sh handle "$@" in a
>function.  Here is an example in sh:

There is a bug in how bash 1.04 handles "$@" in general.  I have sent fixes
for this to Brian, my bash does it correctly.

Chet Ramey
-- 
Chet Ramey
Network Services Group				"Where's my froggie?"
Case Western Reserve University
chet@ins.CWRU.Edu			
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads