'alias' + sudo

Mel Flynn mel.flynn+fbsd.questions at mailing.thruhere.net
Thu Sep 3 23:34:09 UTC 2009


On Wednesday 02 September 2009 13:26:59 Jerry wrote:
> I have set up several 'alias' definitions in my .bashrc file. They are
> honored when run as either a regular user or as root. However, when I
> prefix a command with 'sudo', the alias is no longer honored. In other
> words, the actual command is run;however, any flags that I was passing
> to it via 'alias' are lost. How can I circumvent this annoyance.
>
> Example, I often use 'pico' from within 'xterm'. I set up an alias that
> causes pico to use the mouse; i.e., pico -m which works fine as long as
> I do not prefix the command with 'sudo'

alias spico='/usr/local/bin/sudo pico -m' and be done with it.
-- 
Mel


More information about the freebsd-questions mailing list