Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Glob'ing for a pattern that DOESN'T match...
- X-seq: zsh-users 1392
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: "Eddy J. Gurney" <eddy@xxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Glob'ing for a pattern that DOESN'T match...
- Date: Mon, 16 Mar 1998 17:43:52 -0800
- In-reply-to: <980316161137.ZM28181@xxxxxxxxxxxxxxxx>
- References: <980316161137.ZM28181@xxxxxxxxxxxxxxxx>
On Mar 16, 4:11pm, Eddy J. Gurney wrote:
} Subject: Glob'ing for a pattern that DOESN'T match...
}
} One of the biggest problems is that ZSHEXPN man page says that:
}
} ^x matches anything except the pattern x.
}
} Any ideas on what I might be doing wrong?
Have you tried `setopt extendedglob` ?
} I'm trying to write a `compctl' for `rm' so that `rm' will never complete
} on various source files (.c, .h, .cc, .c++, etc.) and am having no luck
} in getting it to work.
This should get you started:
setopt extendedglob
compctl -g '^*.(c|h|cc|c++)' rm
You might think that ^*.{c,h,cc,c++} should work, but brace expansion is
not part of globbing (something I find extremely counter-intuitive); so
that's actually shorthand for the four patterns ^*.c ^*.h ^*.cc ^*.c++,
each of which includes everything excluded by the others (and you end up
right back where you started).
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author