The command bellow works well in bash:
find . -depth -name Chart.yaml -exec sh -c 'f="{}"; if [[ ($f =~ ./api-*) && !($f =~ ./api-pnp-*) && !($f =~ ./api-edb-*) ]]; then tmpifs=`echo $IFS`; verstr=`grep version $f`; IFS=" "; read -r -a strarr5 <<< $verstr; if [[ $strarr5[2] =~ ([0-9]+).([0-9]+)* ]]; then IFS=“.” read -r -A verno <<< $strarr5[2]; Minornew=`echo $verno[2]+1 |bc`; Minorold=`echo $verno[2]`; sed -i '.bakrohit' "s/$Minorold/$Minornew/g" $f; echo $f $Minorold $Minornew; fi; fi;' \;
But the same command in zsh, escape the extra if conditions "!($f =~ ./api-pnp-*) && !($f =~ ./api-edb-*)"
find . -depth -name Chart.yaml -exec zsh -c 'f="{}"; if [[ ($f =~ ./api-*) && !($f =~ ./api-pnp-*) && !($f =~ ./api-edb-*) ]]; then tmpifs=`echo $IFS`; verstr=`grep version $f`; IFS=" "; read -r -A strarr5 <<< $verstr; if [[ $strarr5[2] =~ ([0-9]+).([0-9]+)* ]]; then IFS=“.” read -r -A verno <<< $strarr5[2]; Minornew=`echo $verno[2]+1 |bc`; Minorold=`echo $verno[2]`; sed -i '.bakrohit' "s/$Minorold/$Minornew/g" $f; echo $f $Minorold $Minornew; fi; fi;' \;
api-* includes api-edb-* and api-pnp-*, but i want to exclude those.
How to put multiple if condition together in zsh.