busybox/shell/hush_test/hush-read/read_ifs2.tests

10 lines
456 B
Plaintext
Raw Normal View History

echo "X:Y:Z:" | (IFS=": " read x y; echo "|$x|$y|")
echo "X:Y:Z" | (IFS=": " read x y; echo "|$x|$y|")
echo "X:Y:" | (IFS=": " read x y; echo "|$x|$y|")
echo "X:Y" | (IFS=": " read x y; echo "|$x|$y|")
echo "X:" | (IFS=": " read x y; echo "|$x|$y|")
echo "X" | (IFS=": " read x y; echo "|$x|$y|")
echo "" | (IFS=": " read x y; echo "|$x|$y|")
echo Whitespace should be trimmed too:
echo "X:Y : " | (IFS=": " read x y; echo "|$x|$y|")