bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

splitting/whitespace in expansions of ${*} vs ${*/}


From: Grisha Levit
Subject: splitting/whitespace in expansions of ${*} vs ${*/}
Date: Sat, 25 Mar 2017 07:26:07 -0400

It looks like using ${var/pattern} causes some changes in field-
splitting and whitespace-trimming behavior, even in the (presumably)
no-op case of ${*/}:

$ set -- ' 1 ' ' 2 '

$ IFS=; printf '<%s>' ${*} ${*/}
< 1 >< 2 >< 1  2 >

$ IFS=; printf '<%s>' address@hidden ${@/}
< 1 >< 2 >< 1  2 >

$ unset IFS; a=${*} b=${*/}; printf '<%s>' "$a" "$b"
<1 2>< 1   2 >

$ unset IFS; address@hidden b=${@/}; printf '<%s>' "$a" "$b"
< 1   2 ><1 2>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]