44257ad5d0
$ echo "X:Y:" | (IFS=": " read x y; echo "|$x|$y|") |X|Y| $ echo "X:Y : " | (IFS=": " read x y; echo "|$x|$y|") |X|Y| function old new delta shell_builtin_read 1320 1426 +106 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
10 lines
456 B
Plaintext
Executable File
10 lines
456 B
Plaintext
Executable File
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|")
|