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
  • 3
    Any way to pass arguments to this shell? As in $1, and $2? Commented May 22, 2011 at 0:34
  • 2
    @segfault: The subshell has complete access to the surrounding scope. Commented May 23, 2011 at 8:26
  • 2
    You can pass all arguments by doing $*, $@ or "$@" (if you want arguments to respect double quotes) Commented Nov 29, 2016 at 1:38
  • 1
    WIll it work if I add this line to /etc/rc.d/rc.local ? Commented May 15, 2018 at 8:12
  • 3
    the entire () construct will have the exitcode of the last command inside. You can check that either directly through chaining or by inspecting $?. Commented May 7, 2020 at 15:53