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

Re: Dynamic colored command in zsh



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