Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: using command aliases with sudo
- X-seq: zsh-users 6143
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Eric Mangold <teratorn@xxxxxxxxxxxxx>
- Subject: Re: using command aliases with sudo
- Date: Sun, 1 Jun 2003 23:36:50 -0700
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <200305280204.44215.teratorn@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200305280204.44215.teratorn@xxxxxxxxxxxxx>
On Wed, May 28, 2003 at 02:04:44AM -0500, Eric Mangold wrote:
> I'm thinking of writing an extension to zsh that makes aliases work with sudo.
You just need an alias with a trailing space, like this:
alias sudo='command sudo '
That will cause zsh to expand your command aliases after a "sudo"
command. Unfortunately, it's not perfect because it does not handle
sudo options properly. I.e., this won't work (where "agi" is your
aliased command):
sudo -u bin agi
but this will work:
sudo agi
You can work around the problem for often-used users like this:
alias sudobin='command sudo -u bin '
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author