![zsh에서 단일 대괄호로 묶인 다중 if 조건](https://linux55.com/image/182757/zsh%EC%97%90%EC%84%9C%20%EB%8B%A8%EC%9D%BC%20%EB%8C%80%EA%B4%84%ED%98%B8%EB%A1%9C%20%EB%AC%B6%EC%9D%B8%20%EB%8B%A4%EC%A4%91%20if%20%EC%A1%B0%EA%B1%B4.png)
다음 명령은 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 조건을 함께 넣는 방법.