Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • thanks, if expansions take place before assignments how does the IFS=. read work? if that spec was applicable, wouldnt that mean the IFS be taking effect (on word splitting) before the IFS=. got assigned? Commented May 30, 2017 at 5:51
  • 1
    @the_velour_fog, there are no expansions in IFS=. read. An expansion means $variablename. Commented May 30, 2017 at 5:54
  • 1
    @the_velour_fog, read only uses IFS after the command line is processed, it acts like any command (though it implicitly sees even an unexported IFS). If you did something like vars="a b c"; IFS=. read $vars <<< "1.2.3"; echo $b (with the default value of IFS) you'd get 2, since $vars was word-split with the original IFS, but read used the one explicitly given to it. Commented May 30, 2017 at 6:03