fish-shell/tests/checks/read.fish
Johannes Altmanninger 1410f938aa read: discard IFS delimiters before the last token
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
2019-12-19 23:44:58 +01:00

22 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