-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2033
koalaman edited this page Feb 26, 2014
·
8 revisions
foo() { rm /run/foo; bar --baz; };
sudo foo
sudo sh -c 'rm /run/foo; bar --baz;'
Shell functions are only known to the shell. External commands like xargs
, su
and sudo
do not recognize shell functions.
Instead, the function contents can be executed in a shell, either through sh -c
or by creating a separate shell script as an executable file.
None.