shell if 濡備綍鍙栭潪
鍦⊿hell鑴氭湰涓紝鍙互浣跨敤!
鎿嶄綔绗︽潵鍙栭潪銆傚叿浣撹娉曞涓嬶細
if ! condition; then
# code to be executed if the condition is false
else
# code to be executed if the condition is true
fi
鍦ㄤ笂杩颁唬鐮佷腑锛?code>!鎿嶄綔绗︾敤浜庡condition
杩涜鍙栭潪鎿嶄綔銆傚鏋?code>condition涓簍rue锛屽垯鎵цelse
鍚庨潰鐨勪唬鐮佸潡锛涘鏋?code>condition涓篺alse锛屽垯鎵цif
鍚庨潰鐨勪唬鐮佸潡銆?/p>