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$
( IFS=' ' && echo "<one${IFS}two$IFS--$IFS>"; )IFS=' ';echo$IFS"'or${IFS}true$IFS--$IFS". pardon. If i replace something else with IFS=' ' . I mean I want to replace something else with whitespace in IFS=' '. What should I do/( IFS=':'; echo "<one${IFS}two$IFS--$IFS>"; ) also works fine.IFS=' ' instead of whitespace?
IFS, notISF. Also, you don't have the completing single quote.