Trailing non-whitespace IFS doesn't generate an empty parameter (any more).
This commit is contained in:
parent
eae5877e02
commit
1f9b387f1d
@ -70,7 +70,9 @@ check 't=axb; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 a:b'
|
||||
check 't="a x b"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 a : b'
|
||||
check 't="a xx b"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '3 a :: b'
|
||||
check 't="a xx b"; IFS="x "; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '3 a::b'
|
||||
check 't="xax"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '3 :a:'
|
||||
# A recent 'clarification' means that a single trailing IFS non-whitespace
|
||||
# doesn't generate an empty parameter
|
||||
check 't="xax"; IFS="x"; set $t; IFS=":"; r="$*"; IFS=; echo $# $r' '2 :a'
|
||||
check 'IFS="x"; set axb; IFS=":"; r="$*"; IFS=; echo $# $r' '1 axb'
|
||||
|
||||
# Check that we apply IFS to ${#var}
|
||||
|
Loading…
Reference in New Issue
Block a user