So I am running the following commands in interactive shell;
$ IFS=":"
$ for i in "foo:bar:apple"; do echo $i; done
foo:bar:apple
After changing the IFS
my expectation was, it will split at :
but it didn’t. I thought it’s not working because, the changed IFS
is not passed to the new subshell, so I tried with export
and still the same answer:
❯ export IFS=":"
❯ for i in "foo:bar:apple"; do echo $i; done
foo:bar:apple
How can I make it work for interactive shell? (I am on macos, using zsh)
1