2012年7月08日

Escape square brackets by default in zsh

Square brackets in zsh

Square brackets in zsh have special meanings but in MOST circumstances maybe you just have to escape them by putting \(backslash) before them.

Here is a example for generating a new octopress post

rake new_post["Escape square bracket by default in zsh"]
zsh: no matches found: new_post[Escape square bracket by default in zsh]

rake new_post\["Escape square bracket by default in zsh"\]
mkdir -p source/_posts
Creating new post: source/_posts/2012-07-08-escape-square-bracket-by-default-in-zsh.markdown

How to escape by default?

Just setup this alias in your .zshrc.

alias rake='noglob rake'
Share on Twitter Share the post
Qihuan Piao

风七

笔名兼游戏内常用名"风七",标准宅男,长居东京。喜好有常、不善言谈,但在这个博客小窝里却是尽其能的大肆抒发阴晴圆缺。喜欢一成不变的生活。

还有用英语日语写东西,有兴趣的话不妨看看:)