On 7/21/18 12:44 AM, Bob Proulx wrote: > Denys Vlasenko wrote: >> $ f() { for i; do echo "|$i|"; done; } >> $ x=x >> $ e= >> $ f ${x:+ ""} >> ^^^^^^^^^^^ prints nothing, bug? >> >> $ ${x:+"" } >> ^^^^^^^^^^^ prints nothing, bug? > > Insufficient quoting. That argument should be quoted to avoid the > whitespace getting stripped. (Is that during word splitting phase > using the IFS? I think so.)
Even if the whitespace gets stripped out, the quoted null string should result in an empty argument. Different shells are inconsistent about this, but I believe that if word splitting occurs, the empty string (or "$e", anything that expands to an empty string) should result in a null word. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/