zsh-users
 help / color / mirror / code / Atom feed
From: Jean-Rene David <jrdavid@magma.ca>
To: zsh-users@sunsite.dk
Subject: Re: Globbing confusion
Date: Tue, 26 Sep 2006 00:24:23 -0400	[thread overview]
Message-ID: <20060926042423.GA31728@princo> (raw)
In-Reply-To: <20060926.050007.74745714.Meino.Cramer@gmx.de>

* 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


  reply	other threads:[~2006-09-26  4:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26  3:00 Meino Christian Cramer
2006-09-26  4:24 ` Jean-Rene David [this message]
2006-09-27  2:35   ` Meino Christian Cramer
2006-09-27  2:46   ` Meino Christian Cramer
2006-09-27 14:22     ` Jean-Rene David

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060926042423.GA31728@princo \
    --to=jrdavid@magma.ca \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).