zsh에서 단일 대괄호로 묶인 다중 if 조건

zsh에서 단일 대괄호로 묶인 다중 if 조건

다음 명령은 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;' \;

그러나 zsh의 동일한 명령은 추가 if 조건을 이스케이프합니다."!($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-*에는 api-edb-* 및 api-pnp-*가 포함되어 있지만 제외하고 싶습니다.

zsh에서 여러 if 조건을 함께 넣는 방법.

관련 정보