Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dynamic colored command in zsh
- X-seq: zsh-users 15403
- From: Roy Zuo <roylzuo@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Dynamic colored command in zsh
- Date: Tue, 14 Sep 2010 07:33:33 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:x-pgp-key-id:user-agent; bh=x70GNPfyo4mbmj+fsdTWQ2I0QoMMUAmzOsPAYNSo4Qs=; b=JcwjtcNli8I689g17C5RlSU1ICPJFlGXBDYTCXUE6S6z1aLazy0Ckud3Yyr1jP/pcJ Pkn8IszgkDmj0dzVi8feDw3xWsl/OIwM/7iQuMCLVNARLev2ziAI/aXDDP92enJRH4LB l+T9blA8qA9gCLShp6/nrGE6u+ESMIpxGWKk4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :x-pgp-key-id:user-agent; b=RxKcsqrHrSKaPjpXE8w3LAHtyAbGGeAchxeKtfXQ4beJnr5+EAbGKmJiwjXpuzLaR/ UjsupPrBjjrB1NRy0E4uaX+nMM8Etku6jeYOqzL9p/dUWpFiNA6/cIZeTvIQQo+2RVVE KJTTzGUad1hftoEAln9sKZNdBMPTrFGZdTENQ=
- In-reply-to: <20100913141627.GA9720@xxxxxxxxxxxxxxx>
- 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> <20100913141627.GA9720@xxxxxxxxxxxxxxx>
Thanks Sebastin and Frank, I myself am never a decent shell programmer :).
Roy
On Mon, Sep 13, 2010 at 04:16:27PM +0200, Frank Terbeck wrote:
> 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
>
--
_________________________________________
/ Fain would I climb, yet fear I to fall. \
| |
\ -- Sir Walter Raleigh /
-----------------------------------------
\ ,__,
\ (oo)____
(__) )\
||--|| *
Messages sorted by:
Reverse Date,
Date,
Thread,
Author