I am trying to write a wrapper around suto make it more like sudo, so su_wrapper foo bar baz== su -c "foo bar baz".
However, I am not sure how to approach this problem. I came up with this:
su_wrapper ()
{
su -c "$@"
}
However, in the above example, there can be only one argument; this fails with a few arguments (because it sutreats them as its own arguments).
There is another problem: since the argument is passed through the shell, I think I should explicitly specify the shell in order to avoid other problems. Perhaps what I want to do can be expressed in pseudo-w50> (!) Like su -c 'bash -c "$@"'.
So how can I make it accept multiple arguments?