Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "\rm -f" stops after the 1st glob not found
- X-seq: zsh-users 17923
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: "\rm -f" stops after the 1st glob not found
- Date: Wed, 14 Aug 2013 10:53:04 +0100
- In-reply-to: <CAMXWGTxJiYpsksFKfEi0=p+nj=O06YQorg3n5MOD8MpNxdQsjQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAMXWGTxJiYpsksFKfEi0=p+nj=O06YQorg3n5MOD8MpNxdQsjQ@mail.gmail.com>
On Wed, 14 Aug 2013 06:25:27 -0300
Leonardo Barbosa <barbosa.leonardo@xxxxxxxxx> wrote:
> I'm sure that's a simple questions, but the keywords are so common
> that i couldn't find the answer by googling them.
>
> My problem is this, when i type:
>
> \rm -f *.aux *.blg *.out *.ps *.log *.toc *.tcp *.idx *.bak *.tps
> *.ilg *.ind *.sty *.bst *.bbl
>
> zsh stops in the first glob it doesn't find. How could i fix this?
You need to change the options (using "setopt" in ~/.zshrc). There are
various things you can do.
setopt NULL_GLOB
simply removes completely all command line entries where the pattern
didn't expand to anything.
setopt CSH_NULL_GLOB
does the same, but if all patterns failed to expand it's an error (a bit
safer).
setopt NO_NOMATCH
leaves the argument unmodified --- this is what some other shells do, so
it might be your best bet. That means rm -f will try to remove files
called e.g. "*.bak", but the -f means that's OK.
There's a summary of all (well, some of) this in "From Bash to Z Shell"
chapter 9, page 211 (see www.bash2zsh.com for information about the
book).
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author