bug-bash
[Top][All Lists]
Advanced

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

Re: Word splitting for $@ in variable assignment


From: Nora Platiel
Subject: Re: Word splitting for $@ in variable assignment
Date: Fri, 25 Jun 2021 16:28:20 +0200

On 2021-06-25 7:36, Oğuz wrote:
> > To me, "$@" expanding to multiple words would mean that:
> >
> > $ var="$@" foo
> >
> > for $# > 0, behaves the same as:
> >
> > $ var="$1" "${@:2}" foo
> 
> But it wouldn't make any sense. `foo' would be subjected to alias
> substitution even though it isn't known for sure to be a command name. How
> would that work?

I'm not saying that `var="$@" foo' should behave the same as `var="$1" "${@:2}" 
foo', I'm just showing what I think it means to "expand to multiple words".
I know that `foo' is subjected to alias substitution in the former case but not 
in the latter (regardless of how many parameters we have).




reply via email to

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