denysdovhan/bash-handbook

IFS is confusing...

sumbach opened this issue · 2 comments

I've always struggled with understanding the particulars of IFS and word splitting, so I'd like to try to give beginners as much help with this as possible.

  1. I think the default value of IFS is space, tab, and newline.
  2. It might be helpful to link to Word splitting in the Bash manual in case readers need the details.

Do you still find it confusing?

@bucaran Yes, definitely 😖

The idea of IFS and word-splitting isn't too complicated or difficult to understand, but the particulars are very tricky.

I opened this issue to try to prompt a conversation about how IFS to explain/teach IFS. My personal inclination would be to recommend IFS="" then point people to particular solutions for common problems: