Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Globbing confusion



From: Jean-Rene David <jrdavid@xxxxxxxx>
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,

 thanks a lot for your explanations! :)
 
 Have a nice day!
 mcc



Messages sorted by: Reverse Date, Date, Thread, Author