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.

3
  • 2
    the latter is a kshism, copied by zsh and bash. When you use read, you need the -r option and remove the white space characters from $IFS (like IFS= read -r i) unless you need the special behaviour of read if you don't Commented Feb 10, 2013 at 22:16
  • But what if the filenames contain newlines? Commented Feb 11, 2013 at 0:10
  • @ruakh: that's exactly when xargs comes in handy. Last paragraph of my answer. Commented Feb 11, 2013 at 13:26