开发者

zsh make **/*.cpp **/*.cxx **/*.hpp not result in error

开发者 https://www.devze.com 2022-12-22 20:30 出处:网络
I have \"v\" aliased to \"vim **/*.cpp **/*.hpp **/*.cxx\" Problem is, if I\'m in a directory without any *.cxx files, zsh treats this as an error. Is there anyway 开发者_开发问答to tell zsh to creat

I have "v" aliased to "vim **/*.cpp **/*.hpp **/*.cxx"

Problem is, if I'm in a directory without any *.cxx files, zsh treats this as an error. Is there anyway 开发者_开发问答to tell zsh to create the absence of **/*.cxx files as "" instead of an error?


It sounds like you want:

set -o NULL_GLOB

Another variation that may be of interest is:

set -o CSH_NULL_GLOB

They work slightly different when all the patterns fail to expand. When at least one pattern successfully expands, the two are the same. But if none of the patterns expand, NULL_GLOB will still run the command while CSH_NULL_GLOB will return an error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号