Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Brace expansion vs. TAB
- X-seq: zsh-users 24501
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Brace expansion vs. TAB
- Date: Fri, 6 Dec 2019 18:18:12 +0100
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Reply-to: dominik.vogt@xxxxxx
(Using zsh 5.3.1 on Debian.)
In a directory with c++ sources:
$ ls *
foo.cpp foo.h
Now,
$ grep ... *.{hpp,cpp}<TAB>
results in
$ grep ... foo.cpp
But
$ grep ... *.{hpp,cpp}<ENTER>
zsh: no matches found: *.hpp
--
Q1:
Well, that is probably because Tab expansion is totally different
from filename generation and the NOMATH option is enabled (by
default?). But is there a way to get rid of the error message in
this specific case only? I.e. to disable the NOMATCH option in
command using brace expansion only?
Q2:
What I really want to have is a simple way to get all c and c++
filenames in a singel pattern, like
$ grep ... *.{h,c,hpp,cpp,hxx,cxx}
$ grep ... **/*.{h,c,hpp,cpp,hxx,cxx}
In an ideal world I'd like to have something very simple that
worked with c sources, but not with c++.
$ grep ... **/*.[ch]
->
$ alias -g CH="{h,c,hpp,cpp,hxx,cxx}"
$ grep ... **/*.CH
(Yeah, I know global aliases dont't work this way.)
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author