Suppose the default shell for root is sh, my default shell is zsh, but I want to run a command in csh with sudo. How?
According to man sudo
, -l
will give zsh (my shell).
-i
can give me csh, but only if a user exists that has csh for a default shell and I specify that user with -u
. Unfortunately, it also gives the command that user's login environment, which may not be wanted.