Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Dynamic colored command in zsh



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