1303 files changed, 32187 insertions, 57138 deletions
diff --git a/shell/ash_test/ash-vars/var_wordsplit_ifs1.tests b/shell/ash_test/ash-vars/var_wordsplit_ifs1.tests new file mode 100755 index 0000000..a62afc6 --- a/dev/null +++ b/shell/ash_test/ash-vars/var_wordsplit_ifs1.tests @@ -0,0 +1,42 @@ +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 |