diff options
author | Denis Vlasenko | 2009-03-31 19:18:17 +0000 |
---|---|---|
committer | Denis Vlasenko | 2009-03-31 19:18:17 +0000 |
commit | 46aeab9a349d097307a87d7dfde3057f9e4e6722 (patch) | |
tree | d348fadeb6bc0766c21bfc850a174a059fe4c732 /shell/ash_test/ash-read/read_ifs.tests | |
parent | 7566bae19715a493f40fd3fae4d69d10089af411 (diff) | |
download | busybox-46aeab9a349d097307a87d7dfde3057f9e4e6722.zip busybox-46aeab9a349d097307a87d7dfde3057f9e4e6722.tar.gz |
ash: fix $IFS handling in read. closes bug 235
Diffstat (limited to 'shell/ash_test/ash-read/read_ifs.tests')
-rwxr-xr-x | shell/ash_test/ash-read/read_ifs.tests | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/ash_test/ash-read/read_ifs.tests b/shell/ash_test/ash-read/read_ifs.tests new file mode 100755 index 0000000..cf7cd93 --- /dev/null +++ b/shell/ash_test/ash-read/read_ifs.tests @@ -0,0 +1,7 @@ +printf 'a\t\tb\tc\n' | ( IFS=$(printf "\t") read a b c; echo ".$a. .$b. .$c." ) +printf 'a\t\tb\tc\n' | ( IFS=$(printf " \t") read a b c; echo ".$a. .$b. .$c." ) +printf 'a,,b,c\n' | ( IFS="," read a b c; echo ".$a. .$b. .$c." ) +printf 'a,,b,c\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." ) +printf 'a ,, c\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." ) +printf 'a ,, c d\n' | ( IFS=" ," read a b c d; echo ".$a. .$b. .$c. .$d." ) +printf ' a,,b,c,d , ,\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." ) |