diff options
Diffstat (limited to 'shell/hush_test/hush-vars')
-rw-r--r-- | shell/hush_test/hush-vars/var_wordsplit_ifs1.right | 16 | ||||
-rwxr-xr-x | shell/hush_test/hush-vars/var_wordsplit_ifs1.tests | 21 |
2 files changed, 37 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/var_wordsplit_ifs1.right b/shell/hush_test/hush-vars/var_wordsplit_ifs1.right index efdafc70f..cf583d0aa 100644 --- a/shell/hush_test/hush-vars/var_wordsplit_ifs1.right +++ b/shell/hush_test/hush-vars/var_wordsplit_ifs1.right @@ -22,4 +22,20 @@ Testing: IFS="" "$*" Testing: IFS="" "$@" .abc. .d e. +Testing: !IFS v=$* +v='abc d e' +Testing: !IFS v=$@ +v='abc d e' +Testing: !IFS v="$*" +v='abc d e' +Testing: !IFS v="$@" +v='abc d e' +Testing: IFS="" v=$* +v='abcd e' +Testing: IFS="" v=$@ +v='abcd e' +Testing: IFS="" v="$*" +v='abcd e' +Testing: IFS="" v="$@" +v='abcd e' Finished diff --git a/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests b/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests index 532ab992e..a62afc6fd 100755 --- a/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests +++ b/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests @@ -18,4 +18,25 @@ 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 |