Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Preventing "no matches found:"
- X-seq: zsh-users 9128
- From: John Reese <john.reese@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Preventing "no matches found:"
- Date: Fri, 22 Jul 2005 17:14:49 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=U77+13DwR4cSLgWL96d1GJa3ESUd3tKNSEcOJyuR5PvmY37avRCivqUgRQfli2dsaSjzDYHMxK0cGWJkDEJY9b2s1dJktd1TEa8qFnDk4eVi9NNegbq4A5SnPcVCpA/ihEJ+WlwyJEhu67ui11rbQ7kIhNdtWtNsIodYIhF0nRE=
- In-reply-to: <20050722230139.GA81842@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <EC7D91E9-B014-405A-9BC0-A4BCEFB1E24A@xxxxxxx> <20050722230139.GA81842@xxxxxxxxxxxxxxxxxxx>
- Reply-to: John Reese <john.reese@xxxxxxxxx>
2005/7/22, Jos Backus <jos@xxxxxxxxxxx>:
> On Fri, Jul 22, 2005 at 03:24:31PM -0700, Tim McNerney wrote:
> > rm ~/log/**/*.log(m+7)
> >
> > and would like to avoid the message:
> >
> > no matches found: ~/log/**/*.log(m+7)
>
> You could try this:
>
> % setopt nullglob
> % echo ~/log/**/*.log(m+7) | xargs rm
>
> --
> Jos Backus
> jos at catnook.com
>
You can turn on noglob for a single pattern by adding a (N) flag. So
you could just do:
rm ~/log/**/*.log(m+7,N)
But that doesn't really solve your problem, because if rm has no
arguments, it'll complain. Now, my personal advice would be to not
care, but if you do care, you could do this:
deadlogs=(~/log/**/*.log(m+7,N))
((#deadlogs)) && rm $deadlogs
Messages sorted by:
Reverse Date,
Date,
Thread,
Author