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

Re: What's wrong with this expression?



On 17 October 2011 23:09, Daniel Serodio (lists)
<daniel.lists@xxxxxxxxxxxxx> wrote:
> I'm trying to troubleshoot a script that works with bash but fails with zsh,
> and it uses the "regex match" operator. What's wrong with this expression?
>
>    [[ "foo" ~= "x" ]] && echo true
>
> Fails with "zsh: condition expected: ~="

You wrote ~= instead of =~

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author