From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25888 invoked by alias); 4 Mar 2012 14:37:41 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16826 Received: (qmail 3434 invoked from network); 4 Mar 2012 14:37:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.171 as permitted sender) Received-SPF: pass (google.com: domain of mikachu@gmail.com designates 10.182.174.101 as permitted sender) client-ip=10.182.174.101; Authentication-Results: mr.google.com; spf=pass (google.com: domain of mikachu@gmail.com designates 10.182.174.101 as permitted sender) smtp.mail=mikachu@gmail.com; dkim=pass header.i=mikachu@gmail.com 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== MIME-Version: 1.0 In-Reply-To: <20120304143102.GE18164@solfire> References: <20120304143102.GE18164@solfire> Date: Sun, 4 Mar 2012 15:37:32 +0100 Message-ID: Subject: Re: if the file is not found the files is not found is the file not found From: Mikael Magnusson To: meino.cramer@gmx.de Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On 4 March 2012 15:31, 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