Re:Is Sudo Almost Useless?
by jabirali on Tuesday June 09, 2020 @05:25PM
(#23471078)
Or make it a shell function that operates on $@ in the same way, so you can put it in your bashrc with your aliases.
[ Parent
| on HN ]
I tried this but didn't work:
~ :) gudo () { su -c "$@"; }
~ :) gudo echo foo bar
su: user foo does not existI searched it up, and apparently "$@" and expands to "foo" "bar" while "$*" expands to "foo bar", and the latter is what we want. From a quick test on my machine, that replacement in in your function definition seems to fix it :).