Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: if the file is not found the files is not found is the file not found
- X-seq: zsh-users 16826
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: meino.cramer@xxxxxx
- Subject: Re: if the file is not found the files is not found is the file not found
- Date: Sun, 4 Mar 2012 15:37:32 +0100
- Authentication-results: mr.google.com; spf=pass (google.com: domain of mikachu@xxxxxxxxx designates 10.182.174.101 as permitted sender) smtp.mail=mikachu@xxxxxxxxx; dkim=pass header.i=mikachu@xxxxxxxxx
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JQR4+CnxLH6CxO/ZzKAhQyAjxWZyBV8E4inEUbnunmg=; b=XXCquQNq0na2QkAK37jSOEZ8NquCwnjOrsgxGlXAApw2Gs3jCobExbIbhijEGMnGgz tCx9U+MItXv04gAl3ypfwaNP07RU6SA9Q8B6NUy5zUgoqZoTLt07hZ4IbwamGJ5D3EJm k5UR6eRvlzIDSW1rmXoFOtMMyypFbJE3kHj9ODn6mCsNPUUkbECLSxDnKV8DM4m4ek1+ pK6Z0rQbO209WLrGzB4jK9V3vE2thGz+W8IlA87u8td6aXRtoS8AtiVRExz++9FDhSWs zIcDFqc8beWf9+mQM4He9lsMeAsYI1wOmWMeWBvVG8Liq42pvMsOfZ7KG8w3zowMG6Do fiLA==
- In-reply-to: <20120304143102.GE18164@solfire>
- 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
- References: <20120304143102.GE18164@solfire>
On 4 March 2012 15:31, <meino.cramer@xxxxxx> wrote:
> Hi,
>
> ... the cat has bitten into its own tail... somehow...
>
>
> I wrote a script which handles dvbt streamed files. The process
> creates some temporary files, which I want to remove afterwards,
> because they normally big ones.
>
> First I wrote
>
> rm -f ${f}-[0-9]*.mp2
>
> which breaks which an error, if the certain has not created files
> of that pattern ... despite the "-f" of the "rm" command.
>
> Then I treid to check for the existence of such files in beforehand
> this way:
>
> [ -f ${f}-[0-9]*.mp2 ]] && rm -f ${f}-[0-9]*.mp2
>
> . Which fails for the same reason.
>
> Did I get lost here? ;)
>
> How many cats do I need to get one, which does not bit into
> the tail of the next cat I enter into the script ?
>
> Who knows of the according dog to chase the cats away and make
> my script work? ;) :))
>
> Thanks a lot for any help in advance!
If you setopt extendedglob you can append (#qN) to the pattern to
suppress the error for that specific pattern, or setopt nullglob to
always do it. ie, it would be ${f}-[0-9]*.mp2(#qN)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author