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

rm nonexisting*; alias with parameters?



I have a log directory where different logs appear, and an alias to
clear it up.  I try to define patterns covering all the logs to avoid
rm *, which is dangerous and asks for a confirmation.  So I define all
possible patterns like in an alias, rml:

alias rml='rm prefix1.* *.suffix2*'

But when some of the patterns match nothing, zsh prints an error about
that doesn't do anything.  How can I change that behavior to the
expected of rm -f ?

While I'm on the subject of aliases, looks like zsh aliases are as
weak as bash's, so when I have my lr:

alias lr='ls -lt | head'

which I could not use with a parameter, lr <dir>, I still cannot use a
parameter in zsh.  In bash,  made lr a function -- what the zsh
function would look like?  And is there a way to do it in an alias, or
still not?

Alexy



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