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*

2
  • Quick question, how the for loop is accessing values passed by xargs, also what is the need to end the command with sh ? Commented Apr 30, 2018 at 11:45
  • @krrish, that sh is stored by sh inside $0. That is, it give a name (here sh, you could use any arbitrary string, but use something relevant as it shows up in error messages output by sh) to that inline-script. xargs passes the words on its input as additional arguments to sh, and that's what for i do loops over (it loops over the positional parameters). Commented Apr 30, 2018 at 11:51