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*

4
  • I always just use while read line What does setting IFS= do for us? I'm guessing read -r helps pickup special characters? Commented May 12 at 17:58
  • 1
    @Angelo for IFS, compare and contrast read x <<<' word '; echo ">$x<" with IFS= read x <<<' word '; echo ">$x<" Commented May 12 at 18:03
  • 1
    @Angelo and for -r, compare and contrast IFS= read x <<<'word \r \\ fun'; echo ">$x<" with IFS= read -r x <<<'word \r \\ fun'; echo ">$x<" Commented May 12 at 18:05
  • 1
    Thanks. Clearly a lack of my own creativity in possible inputs. Commented May 12 at 18:11