ash: fix $IFS handling in read. closes bug 235
This commit is contained in:
7
shell/ash_test/ash-read/read_ifs.right
Normal file
7
shell/ash_test/ash-read/read_ifs.right
Normal file
@@ -0,0 +1,7 @@
|
||||
.a. .b. .c.
|
||||
.a. .b. .c.
|
||||
.a. .. .b,c.
|
||||
.a. .. .b,c.
|
||||
.a. .. .c.
|
||||
.a. .. .c. .d.
|
||||
.a. .. .b,c,d , ,.
|
7
shell/ash_test/ash-read/read_ifs.tests
Executable file
7
shell/ash_test/ash-read/read_ifs.tests
Executable file
@@ -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." )
|
Reference in New Issue
Block a user