There is a quite nasty expression that want to echo using bash.
The expression is:
'one two --
Note: There is white space after --
.
So I have:
IFS=
echo 'one$IFStwoIFS--$IFS
But the result is:
one$IFStwo$IFS--$IFS
You have few issues with your approach:
one$IFStwo$IFS--$IFS
first instance of $IFS
will not be expanded since you have string two
next to $IFS
so it attempts to expand non-existent variable $IFStwo
.$IFS
is $' \t\n'
You can use:
echo "one${IFS}two$IFS--$IFS"
which will expand to (cat -A
output):
one ^I$
two ^I$
-- ^I$