IF AND ELSE IN LINUX SHELL
#!/bin/bash
read -p "text your number :" ab
b="1"
if [ "${ab}" == "1" ]; then
echo "your input is 1"
else
echo "your input is wrong"
fi
read -p "text your number :" ab
b="1"
if [ "${ab}" == "1" ]; then
echo "your input is 1"
else
echo "your input is wrong"
fi
if you text 1 it will text your input is 1, if you text wrong text it will say your input is wrong
留言
張貼留言