samedi 24 juin 2017

zsh condition on number results in bad pattern

I have a function that I minified to debug but I cannot see the problem. Here is the minimal code to reproduce the issue:

#!/bin/zsh

ahead=1
if [[ "$ahead" -ne 0 ]]; then
    echo "test"
else
    echo "testelse"
fi

I get from executing this script:

./test:5: bad pattern :[[ 1

I cannot understand where the problem is. If I test it with tio.run, it works!

Aucun commentaire:

Enregistrer un commentaire