Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Globbing confusion
- X-seq: zsh-users 10761
- From: Jean-Rene David <jrdavid@xxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Globbing confusion
- Date: Tue, 26 Sep 2006 00:24:23 -0400
- In-reply-to: <20060926.050007.74745714.Meino.Cramer@xxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060926.050007.74745714.Meino.Cramer@xxxxxx>
* 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author