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

Re: precommand modifiers and alias sudo="sudo "



Sebastian Stark wrote:
> I have set up an alias sudo="sudo " that enables use of aliases with  
> sudo.
> 
> But now precommand modifiers like "nocorrect" or "env"* stopped working.
> 
> p% alias mkdir
> mkdir='nocorrect mkdir'
> % sudo mkdir foo
> sudo: nocorrect: command not found
> %
> 
> Anything I can do? Or should I forget about the idea of using aliases  
> with sudo?

I don't see anything you can do automatically, offhand, but you can
suppress alias expansion by quoting any part of mkdir (e.g. \mkdir).

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author