Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: using command aliases with sudo



> 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