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
  • This looks like unnecessary complexity to what should be a working example from the OP. Commented Aug 19, 2013 at 5:53
  • 2
    @jordanm, I've edited the answer to give reasons for the added complexity. Commented Aug 19, 2013 at 6:16
  • Maybe it could be better with while IFS= read -r line <&3 || [ -n "$line" ] ; do to avoid repeating the internals of the loop on non-null last line. Yes, it still will not handle a NUL character. Commented Jan 18, 2016 at 21:35