> Yes, I know, I'd ever done alias for `read`: > > IFS="" > shopt -s expand_aliases > alias read='IFS=" " read' Why do you obfuscate your code with aliases? These just make debugging issues with your code harder. Remembering to quote variables and use a localized IFS for read is easier, than introducing an incompatible behaviour that will just help to make the confusion of shell scripting bigger.
When giving support, it's easier to tell people: «Just double quote every parameter expansion when you're in doubt», than to list all the possible cases where they should and shouldn't. With your proposal, you're just adding a new variable to the mess... > But nevertheless, I still find my proposal usable (since word > splitting for vars is unlikely to be usable in scripts). Word splitting *IS* being used actively in lots of shell scripts that aim for POSIX compatibility (because it's the only way of pseudo-emulating arrays), and even it's used (wrongly) in bash scripts that do not aim to be compatible with the POSIX shell. So, if the user puts your shopt in ~/.bashrc and happens to run a script that relies on that... breakage. Also, lazyness is not a justification. Shell scripts are written once, but read and executed many times, so invest a little time into quoting properly, instead of relying on a modified IFS and set -f. Or use a language that doesn't have to be compatible with POSIX sh. Quoting isn't that hard once you get used to it ;) -- Eduardo Alan Bustamante López