0aaaa50b45
Upstream commit: Date: Thu, 1 Jan 2015 07:53:10 +1100 expand: Fixed "$@" expansion when EXP_FULL is false The commit 3c06acdac0b1ba0e0acdda513a57ee6e31385dce ([EXPAND] Split unquoted $@/$* correctly when IFS is set but empty) broke the case where $@ is in quotes and EXP_FULL is false. In that case we should still emit IFS as field splitting is not performed. Reported-by: Juergen Daubert <jue@jue.li> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
43 lines
1.1 KiB
Plaintext
Executable File
43 lines
1.1 KiB
Plaintext
Executable File
set -- abc "d e"
|
|
|
|
echo 'Testing: !IFS $*'
|
|
unset IFS; for a in $*; do echo ".$a."; done
|
|
echo 'Testing: !IFS $@'
|
|
unset IFS; for a in $@; do echo ".$a."; done
|
|
echo 'Testing: !IFS "$*"'
|
|
unset IFS; for a in "$*"; do echo ".$a."; done
|
|
echo 'Testing: !IFS "$@"'
|
|
unset IFS; for a in "$@"; do echo ".$a."; done
|
|
|
|
echo 'Testing: IFS="" $*'
|
|
IFS=""; for a in $*; do echo ".$a."; done
|
|
echo 'Testing: IFS="" $@'
|
|
IFS=""; for a in $@; do echo ".$a."; done
|
|
echo 'Testing: IFS="" "$*"'
|
|
IFS=""; for a in "$*"; do echo ".$a."; done
|
|
echo 'Testing: IFS="" "$@"'
|
|
IFS=""; for a in "$@"; do echo ".$a."; done
|
|
|
|
echo 'Testing: !IFS v=$*'
|
|
unset IFS; v=$*; echo "v='$v'"
|
|
echo 'Testing: !IFS v=$@'
|
|
unset IFS; v=$@; echo "v='$v'"
|
|
echo 'Testing: !IFS v="$*"'
|
|
unset IFS; v="$*"; echo "v='$v'"
|
|
echo 'Testing: !IFS v="$@"'
|
|
unset IFS; v="$@"; echo "v='$v'"
|
|
|
|
echo 'Testing: IFS="" v=$*'
|
|
IFS=""; v=$*; echo "v='$v'"
|
|
echo 'Testing: IFS="" v=$@'
|
|
IFS=""; v=$@; echo "v='$v'"
|
|
echo 'Testing: IFS="" v="$*"'
|
|
IFS=""; v="$*"; echo "v='$v'"
|
|
echo 'Testing: IFS="" v="$@"'
|
|
IFS=""; v="$@"; echo "v='$v'"
|
|
|
|
# Note: in IFS="" v=$@ and IFS="" v="$@" cases, bash produces "abc d e"
|
|
# We produce "abcd e"
|
|
|
|
echo Finished
|