if [ test_command ]
then
commands
fi
if [ test_command ]
then
commands
else
commands
fi
commands
elif [ test_command ]
then
commands
...
...
else (optional)
commands
fi
commands
done
commands
done
commands
done
commands_to_execute_for_1;;
commands_to_execute_for_2;;
commands_to_execute_for_3;;
...
...
*) (可选 - any other value)
commands_to_execute_for_no_match
;;
esac