前言
bash if condition
範例
這邊以外部傳入參數 $1,作為我們 If 要判斷的內容
#!/bin/bash
if [[ $1 == "123" ]]; then
echo "hello"
elif [[ $1 == "456" ]]; then
echo "world"
else
echo "not found"
fi
bash if condition
這邊以外部傳入參數 $1,作為我們 If 要判斷的內容
#!/bin/bash
if [[ $1 == "123" ]]; then
echo "hello"
elif [[ $1 == "456" ]]; then
echo "world"
else
echo "not found"
fi