From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3906 invoked from network); 27 Sep 2006 02:46:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_IN_SORBS_WEB autolearn=no version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Sep 2006 02:46:40 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 15904 invoked from network); 27 Sep 2006 02:46:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Sep 2006 02:46:34 -0000 Received: (qmail 10346 invoked by alias); 27 Sep 2006 02:46:27 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10764 Received: (qmail 10336 invoked from network); 27 Sep 2006 02:46:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 Sep 2006 02:46:26 -0000 Received: (qmail 14678 invoked from network); 27 Sep 2006 02:46:26 -0000 Received: from p548541bf.dip0.t-ipconnect.de (HELO localhost) (84.133.65.191) by a.mx.sunsite.dk with SMTP; 27 Sep 2006 02:46:24 -0000 Received: from localhost ([127.0.0.1]) by localhost with esmtp (Exim 4.60) (envelope-from ) id 1GSPRG-0004sq-Px; Wed, 27 Sep 2006 04:46:23 +0200 Date: Wed, 27 Sep 2006 04:46:22 +0200 (CEST) Message-Id: <20060927.044622.79063538.Meino.Cramer@gmx.de> To: jrdavid@magma.ca Cc: zsh-users@sunsite.dk Subject: Re: Globbing confusion From: Meino Christian Cramer In-Reply-To: <20060926042423.GA31728@princo> References: <20060926.050007.74745714.Meino.Cramer@gmx.de> <20060926042423.GA31728@princo> X-Mailer: Mew version 5.1 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Jean-Rene David Subject: Re: Globbing confusion Date: Tue, 26 Sep 2006 00:24:23 -0400 > * Meino Christian Cramer [2006.09.25 23:15]: > > Besides others I want to to match all _directories_ matching the > > patterm mc-4.6.1* but dont want to remove _files_ of that pattern. > > > > And I dont want any errormessage, if a certain directory/file could > > not be found. > > rm -rf mc-4.6.1*(/) > > The "-f" option to "rm" will take care of the > warnings. > > > For that purpose I tested on the commandline the following > > > > cd /tmp > > ls -ld ertertert(N/) # ertertert does not exist under /tmp > > When NULL_GLOB is set (as it is when using the "N" glob qualifier), the shell > *deletes from the command line* any pattern which generates no match. > > Your command becomes: > > ls -ld > > which prints the entry for the current directory (".") as expected. > > > In a script I would kill . in that case if "ls -ld" is replaced by > > "rm -rf" ??? > > No you wouldn't. Your command would become: > > rm -rf > > which does nothing. > > -- > JR > Hi JR, me again... I inserted rm -rf /tmp/mc-4.6.1i*(/) into my cleanup-script for /tmp and executed it _twice_. First kills the directory, second run gives me: solfire:/home/mccramer>~/bin/cleantmp /home/mccramer/bin/cleantmp:20: no matches found: /tmp/mc-4.6.1i*(/) Can I supress the warning also (other "rm -f"'s, which carry the (N) also does not print a warning when not found.) I tried the following: I mkdir a directory mc-4.6.1A and touch mc-4.6.1B then I did a rm -rf /tmp/mc-4.6.1*(/N) from within a script. BOTH entries were removed. Only the directory should be removed. What I am confusing here so much ? Thank you very much in advance for any help ! mcc