Changing IFS in bash function

I have a function in bash that takes arguments. does IFS work in a function or does it apply only to the main script?

IFS works everywhere. IFS is a global, so if you change it inside a function, be sure to change it back before the function returns, or it'll stay changed.

1 Like