Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: using command aliases with sudo
- X-seq: zsh-users 6141
- From: Danek Duvall <duvall@xxxxxxxxxxx>
- To: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- Subject: Re: using command aliases with sudo
- Date: Sun, 1 Jun 2003 23:24:54 -0700
- Cc: "'Eric Mangold'" <teratorn@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- In-reply-to: <6134254DE87BD411908B00A0C99B044F05A0C92F@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxx>, Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>, 'Eric Mangold' <teratorn@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200305280204.44215.teratorn@xxxxxxxxxxxxx> <6134254DE87BD411908B00A0C99B044F05A0C92F@xxxxxxxxxxxxxxxxxxxxxxx>
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"
Danek
Messages sorted by:
Reverse Date,
Date,
Thread,
Author