zsh-users
 help / color / mirror / code / Atom feed
From: Akihiko Hohji <akhst7@me.com>
To: Bart Schaefer <schaefer@brasslantern.com>,
	Gabor Maghera <gmaghera@gmail.com>
Cc: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: newbie rm --^file question
Date: Sun, 25 Dec 2016 16:49:44 -0500	[thread overview]
Message-ID: <8789C49A-57C0-49FA-BC1A-52DCBFBF88FB@me.com> (raw)
In-Reply-To: <161225131004.ZM26673@torch.brasslantern.com>

Sorry.  Actually extended glob was due to auto-correction by Apple Mail.  I really typed in setopt extendedglob.

Either rm -rf with double “-“ ^file.ext.* or a single “-“ does not work.  I get the same “no matches found” message.  And there is no space in between “-“.  I’ve gotten this approach with the double “-“ from a post in Stackoverflow.  If I don’t add “*” at the end or begging of file name, it works fine.  

To just give you more details, the following is the list of files in  /System/Library/Caches;

drwxr-xr-x  16 root  wheel   544B Dec 16 21:53 .
drwxr-xr-x  92 root  wheel   3.1K Dec 16 09:31 ..
drwxr-xr-x   6 root  wheel   204B Dec 15 21:47 com.apple.CVMS
-rw-r--r--   1 root  wheel    42K Oct  4 21:52 com.apple.Components2.SystemCache.Components
-rw-r--r--   1 root  wheel    57K Sep 13 20:49 com.apple.Components2.SystemCache.QuickTimeComponents
-rw-r--r--   1 root  wheel   8.6K Dec 16 09:31 com.apple.IntlDataCache.le
-rw-r--r--   1 root  wheel    78K Dec 16 09:31 com.apple.IntlDataCache.le.kbdx
-rw-r--r--   1 root  wheel    21K Dec 16 09:35 com.apple.app-sandbox-cache.plist
-rw-r--r--   1 root  wheel    41B Dec 16 09:32 com.apple.bootefisignature
drwxr-xr-x   3 root  wheel   102B Dec 15 21:36 com.apple.bootstamps
drwxr-xr-x   2 root  wheel    68B Dec 15 21:36 com.apple.corestorage
drwx------   3 root  wheel   102B Dec 17 22:30 com.apple.coresymbolicationd
drwxr-xr-x   4 root  wheel   136B Dec 15 21:36 com.apple.kext.caches
-rw-r--r--@  1 root  wheel    23K Dec 16 21:53 com.apple.preferencepanes.systemcache
-rw-r--r--   1 root  wheel    11K Dec 16 09:35 com.apple.xpc.extensions.cache
-rw-r--r--   1 root  wheel   203K Dec 16 09:35 com.apple.xpchelper.cache

I’d like to get rid of directories and files except com.apple.IntlDataCche.le and com.apple.IntlDataCche.le.kbdx.  

And I did;

setopt extendedglob
rm -rf -^com.apple.IntlDataCache.*

Then I get zsh: no matches found: -^com.apple.IntlDataCache.le.*

Again my system is 

sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.2
BuildVersion:	16C67 

Thanks.  

AH

> On Dec 25, 2016, at 4:10 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> On Dec 25,  7:22pm, Hoji, Akihiko wrote:
> }
> } setopt extended glob
> 
> If you literally did that, you should have gotten an error message; there
> is no option named "extended" although there is one named "glob".
> 
> You can use underscores or hyphens between words (actually, between any
> two letters) in option names, but not spaces.
> 
> setopt extendedglob
> setopt extended_glob
> setopt extended-glob
> setopt EX_tend-ed_GLOB
> 
> } rm -rf -^file.ext.*
> 
> Is there a space missing there between the second "-" and the "^" ?  Or
> do the files you want to remove really have names beginning with "-" ?
> 
> } I would appreciate a poster as to what I am doing wrong. 
> 
> Other than misplaced spacing, you seem to have it; see Gabor's example.


  reply	other threads:[~2016-12-25 22:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-25 19:22 Hoji, Akihiko
2016-12-25 20:45 ` Gabor Maghera
2016-12-25 20:49   ` Hoji, Akihiko
2016-12-25 20:51     ` Gabor Maghera
2016-12-25 21:10 ` Bart Schaefer
2016-12-25 21:49   ` Akihiko Hohji [this message]
2016-12-25 22:47     ` Gabor Maghera
2016-12-25 23:02       ` Akihiko Hohji
2016-12-27 20:23         ` Roman Neuhauser

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=8789C49A-57C0-49FA-BC1A-52DCBFBF88FB@me.com \
    --to=akhst7@me.com \
    --cc=gmaghera@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).