On Fri, Aug 16, 2024, 23:29 freek--- via Bug reports for the GNU Bourne
Again SHell wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
> -fstack-protec
On Sat, Aug 17, 2024, at 6:41 AM, Freek de Kruijf wrote:
> Apparently I have a problem with the concept of $@
Greg has already tried explaining it, so I'll just focus on a few details:
> I see it as list of zero or more non-whitespaced elements
When used in a context where splitting is performe
On Sat, Aug 17, 2024 at 12:41:45 +0200, Freek de Kruijf wrote:
> Apparently I have a problem with the concept of $@, I see it as list of zero
> or more non-whitespaced elements, and quotes around it makes it into a single
> element. Like a parameter p with a content of zero or more non-whitespace
On Sat, Aug 17, 2024, 12:42 Freek de Kruijf
wrote:
> Op zaterdag 17 augustus 2024 00:29:23 CEST schreef u:
> > On Fri, Aug 16, 2024, at 12:59 PM, freek--- via Bug reports for the GNU
> >
> There is no problem with "$@" or functions here. The "problem" is
> > that "$@" expands to multiple fields
Op zaterdag 17 augustus 2024 00:29:23 CEST schreef u:
> On Fri, Aug 16, 2024, at 12:59 PM, freek--- via Bug reports for the GNU >
There is no problem with "$@" or functions here. The "problem" is
> that "$@" expands to multiple fields when there are two or more
> positional parameters, so (as the
On Fri, Aug 16, 2024 at 18:59:15 +0200, freek--- via Bug reports for the GNU
Bourne Again SHell wrote:
> #!/bin/bash
> init() {
> [ -n "$@" ] && echo $@
> }
> init $@
You have multiple errors in this script.
The first error is that you used $@ without quotes, twice. If you want
to preserve the
On Fri, Aug 16, 2024, at 6:29 PM, Lawrence Velázquez wrote:
> There is no problem with "$@" or functions here. The "problem" is
> that "$@" expands to multiple fields when there are two or more
> positional parameters, so (as the error message says) you end up
> running test(1) with too many argum
On Fri, Aug 16, 2024, at 12:59 PM, freek--- via Bug reports for the GNU Bourne
Again SHell wrote:
> Description:
>
> Using the following script with a function
>
> #!/bin/bash
> init() {
> [ -n "$@" ] && echo $@
> }
> init $@
>
> and calling the script as follows:
>
> :~> LC_ALL=C . ./test.sh a b