bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on $@ vs $@$@


From: alex xmb sw ratchev
Subject: Re: Question on $@ vs $@$@
Date: Wed, 14 Aug 2024 04:05:18 +0200

On Wed, Aug 14, 2024, 02:45 Steffen Nurpmeso <steffen@sdaoden.eu> wrote:

> Hello.
>
> I include bug-bash even though i think bash is correct, but there
> lots of people of expertise are listening, so, thus.
> Sorry for cross-posting, nonetheless.
> Given this snippet (twox() without argument it is)
>
>   one() { echo "$# 1<$1>"; }
>   two() { one "$@"; }
>   twox() { one "$@$@"; }
>   two
>   two x
>   twox
>   twox x
>
> i get
>
>   $ dash shbug.sh
>   0 1<>
>   1 1<x>
>   1 1<>
>   1 1<xx>
>
>   #?0|kent:tmp$ busybox.static sh shbug.sh
>   0 1<>
>   1 1<x>
>   1 1<>
>   1 1<xx>
>
>   #?0|kent:tmp$ bash shbug.sh
>   0 1<>
>   1 1<x>
>   0 1<>
>   1 1<xx>
>

note that "$@" of no args is >nothing<
eg a=( ) ; "${a[@]}" # none
a=( echo foo ) ; "${a[@]}" # echo ..

the if array is empty then nothing , else the specified ..

(This is busybox with my arithmetic patch, built on April 20th.)
> Unfortunately my MUA is also bogus :(
>
> --steffen
> |
> |Der Kragenbaer,                The moon bear,
> |der holt sich munter           he cheerfully and one by one
> |einen nach dem anderen runter  wa.ks himself off
> |(By Robert Gernhardt)
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]