Re: Dash problem with IFS

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

>  So if you want it to have a tab and newline you need to specify
>  them literally, or use something that does interpret escapes,
>  like

newline and tab, because in output substitution trailing '\n's
(default in any `echo`) are removed.

>  IFS=$(echo '\n\t $')

`echo` isn't a good example due to historical feature-support problems, imho.

# newline and tab
IFS=`printf '\n\t'`
# just newline
IFS=`printf '\n+'`; IFS=${IFS%+}

last example is POSIXly correct ugliness. Bashizm looks better (:


where $' ' is one, not "\t is <tab> in $IFS", guys.
sed 'sed && sh + olecom = love'  <<  ''
 #oo'L O
<___=E M
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

Powered by Linux