Mikael Magnusson wrote: > On 17 October 2011 23:27, Daniel Serodio (lists) > wrote: >> Mikael Magnusson wrote: >> >> On 17 October 2011 23:09, Daniel Serodio (lists) >> 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 =~ >> >> Ooops. Error copy'n'pasting. The actual line in the script that fails is: >> >> if [[ ! "${PATH}" =~ $regex ]] ; then >> >> where "regexp" is: >> >> regex="^([^:]*:)*${rvm_bin_path}(:[^:]*)*$" > > Fails how? > Sorry. Fails with "condition expected: =~"