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*

7
  • I'd also recommend to attach shebang en.wikipedia.org/wiki/Shebang_%28Unix%29 at the beggining of EACH script. Commented Sep 10, 2015 at 10:49
  • 2
    @MateuszPacek: The OP calling sh -c inline script instead of creating a shell script. the shebang didn't help in this case. Commented Sep 10, 2015 at 10:51
  • @ccuonglm yes, that's true. But when you got script in file it's easier to exec it inline if you know what kind of shell implementation you used to use. Commented Sep 10, 2015 at 10:55
  • 2
    @c4f4t0r this works only if your sh isn't really sh but is actually bash, zsh, or ksh in poor disguise. You shouldn't really use bash features with the shell invoked as sh as one day it may break (consider Debian with sh a symlink to dash rather than bash). Commented Sep 10, 2015 at 13:05
  • 1
    @c4f4t0r, still, avoid bad practices: use the most precise interpreter for your code. Commented Sep 10, 2015 at 13:28