Merge pull request #79 from steelywing/master

Add "$*" and "$@" equivalent
This commit is contained in:
Peter Bieringer 2019-07-21 06:59:04 +02:00 committed by GitHub
commit b63b4ed8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -8618,7 +8618,10 @@ echo "Your favorite song is $song."</programlisting>
<secondary>positional</secondary> <secondary>positional</secondary>
<tertiary>all</tertiary> <tertiary>all</tertiary>
</indexterm> </indexterm>
<para>All of the positional parameters, seen as a single word</para> <para>All of the positional parameters, seen as a single
word, <command>"$*"</command> is equivalent to
<command>"$1${IFS:0:1}$2${IFS:0:1}$3..."</command>
</para>
<note><para><quote><varname>$*</varname></quote> must be <note><para><quote><varname>$*</varname></quote> must be
quoted.</para></note> quoted.</para></note>
</listitem> </listitem>
@ -8643,7 +8646,9 @@ echo "Your favorite song is $song."</programlisting>
quoted string, that is, the parameters are passed on quoted string, that is, the parameters are passed on
intact, without interpretation or expansion. This means, intact, without interpretation or expansion. This means,
among other things, that each parameter in the argument among other things, that each parameter in the argument
list is seen as a separate word.</para> list is seen as a separate word, <command>"$@"</command>
is equivalent to <command>"$1" "$2" ...</command>
</para>
<note><para>Of course, <quote><varname>$@</varname></quote> <note><para>Of course, <quote><varname>$@</varname></quote>
should be quoted.</para></note> should be quoted.</para></note>