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

Re: expand-and-quote-alias

Hallo Peter,

Peter Stephenson <pws@xxxxxxx> wrote:
> You can safely set the whole alias to something along these lines,
>   alias ls='\ls --color -lA'
> say (a single "\" is enough to inhibit alias expansion).
> With a little more work you can make _expand_alias do that.  You probably
> want to base it on the latest version from the archive since there was a
> bug that it used to remove quoting (although that doesn't quite impinge on
> the problem in question).  Care is needed since if the alias expansion
> starts with a special character you definitely don't want to add a
> backslash.
> With even more effort you can split it into words, see if the first word
> is the same as the original first word, and only add the backslash in that
> case.  This is non-invasive enough to be worth applying to the archive.
> Here's the complete result.  It's not perfect but it handles normal
> cases like the present one.

Thanks, it works like a charm. Really cool.

bye, Jörg.
“UNIX was not designed to stop people from doing stupid things, because
 that would also stop them from doing clever things.”
            (Doug Gwyn)

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