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*

6
  • Ooh, I like that. Commented Jan 7, 2016 at 14:45
  • This is usually my preferred method as well, but bear in mind that Bash only supports $1 through $9 using this syntax. For 10th and later arguments, the ${10} form must be used. Commented Jan 7, 2016 at 17:55
  • 1
    Doesn't work when $f contains wildcards. And you need to restore IFS afterwards (or do this in a command substitution, to get the value of a field, and that strips off trailing newlines). Commented Jan 7, 2016 at 23:34
  • The example works in isolation (inside Git bash on Windows), but when I pipe from the find command I get this error: echo: write error: Bad address. Commented Jan 25, 2016 at 17:54
  • Okay, looks like I have to unset IFS every time. Commented Jan 25, 2016 at 17:57