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*

3
  • The fact that there are several functions involved makes it even more complicated and prone to failure. You now have to find all such dependencies (and all their dependencies too, if any...to however many levels deep) including any other functions that the menu function might call and declare them too. Commented Mar 11, 2016 at 6:06
  • Agreed, and I may have to just bite the bullet and break it up (and do my best to accurately determine the path it was run from, plus hope the end user keeps the files together) if there are no better alternatives. Commented Mar 11, 2016 at 6:33
  • While calling a shell function looks syntactically the same as executing an external command (process), it makes a big difference for sudo: sudo can't execute a shell function (other than sudo sh -c "shell_function" when sh knows shell_function by some means). Commented Feb 3, 2022 at 23:00