If I do something like this:
IFS=,
x=hello,hi,world
echo $x
Then three arguments will be extracted (which are hello
and hi
and world
), and these three arguments will be passed to echo
.
But when I do not use a variable:
IFS=,
echo hello,hi,world bye
Then word splitting will happen using the space delimiter and not the comma delimiter, and so the two arguments generated and passed to echo
will behello,hi,world
and bye
.
Is there a way to make word splitting work with a non-space delimiter when not using a variable?
echo
something, and suspect this might be an XY problem. If you give an example of the specific use case you have in mind, we might be able to give you a better solution. – terdon♦ Dec 30 '17 at 11:41