Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: using command aliases with sudo
- X-seq: zsh-users 6142
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: "'Danek Duvall'" <duvall@xxxxxxxxxxx>
- Subject: RE: using command aliases with sudo
- Date: Mon, 2 Jun 2003 10:35:21 +0400
- Cc: "'Eric Mangold'" <teratorn@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Importance: Normal
- In-reply-to: <20030602062454.GE16251@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
> Andrey Borzenkov wrote:
>
> > sudo() {
> > ... add sudo options parsing here that sets sudo_options and
> > sudo_command...
> > command sudo $sudo_options zsh -c "$sudo_command"
> > }
> >
> > with obvious caveat that you have to modify sudoers to account for this.
>
> What about
>
> if [[ -n $aliases[$sudo_command[1]] ]]; then
> sudo_command[1]=( $=aliases[$sudo_command[1]] )
> fi
> command sudo $sudo_options "$sudo_command"
>
excellent :)
-andrey
Messages sorted by:
Reverse Date,
Date,
Thread,
Author