Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dynamic colored command in zsh
- X-seq: zsh-users 15402
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Dynamic colored command in zsh
- Date: Mon, 13 Sep 2010 16:16:27 +0200
- In-reply-to: <AANLkTikq=h-awW+-HAB8-QWdg0dWTuY+uydMu-Ezmt-0@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTinNJXay4pibEiQmKR4PSRcNiwCJ3w==Scc9rco0@xxxxxxxxxxxxxx> <20100913130345.GA9240@Lancelot> <AANLkTikq=h-awW+-HAB8-QWdg0dWTuY+uydMu-Ezmt-0@xxxxxxxxxxxxxx>
Julien Nicoulaud <julien.nicoulaud@xxxxxxxxx>:
> Wow, that would be great !
>
> Roy, can you give us the options you use ? The "=~" equalities throw errors
> for me.
>
> 2010/9/13 Roy Zuo <roylzuo@xxxxxxxxx>
[...]
> > if [ $res =~ 'reserved word' ]; then
[...]
There is no need for regex use here. You can just use
case $res in
*'reserved word'*)
# code
;;
...
esac
...or use [[ $res == *'reserved word'* ]] instead of the above test.
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author