mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 02:22:37 +08:00
1410f938aa
Do this only when splitting on IFS characters which usually contains whitespace characters --- read --delimiter is unchanged; it still consumes no more than one delimiter per variable. This seems better, because it allows arbitrary delimiters in the last field. Fixes #6406
23 lines
341 B
Fish
23 lines
341 B
Fish
# RUN: %fish %s
|
|
echo 'a | b' | read -lt a b c
|
|
|
|
set -l
|
|
# CHECK: a a
|
|
# CHECK: b '|'
|
|
# CHECK: c b
|
|
|
|
echo 'a"foo bar"b' | read -lt a b c
|
|
|
|
set -l
|
|
# CHECK: a 'afoo barb'
|
|
# CHECK: b
|
|
# CHECK: c
|
|
|
|
echo "a b b" | read a b; string escape $a $b
|
|
# CHECK: a
|
|
# CHECK: 'b b'
|
|
|
|
echo 'a<><>b<>b' | read -d '<>' a b; printf %s\n $a $b
|
|
# CHECK: a
|
|
# CHECK: <>b<>b
|