echo "helloworld"
mytest="hello"
num=100
echo $mytest
echo $num
a=3
b=5
var=`expr $a + $b`
echo $var
if [ $a == $b ]
then
echo "is equal"
fi
if [ $a != $b ]
then
echo "not equal"
fi
if [ $a -eq $b ]
then
echo true
fi
if [ $a -ne $b ]
then
echo false
fi
string1="hello"
string2="world"
string3=${string1}${string2}
echo ${#string3}
echo ${string3:1:4}
array1=(1 2 3 4 5)
array2=(aa bb cc)
echo ${array2[2]}
for data in ${array1[@]}
do
echo ${data}
done
printf "hello world\n"
if [ $a == $b ]
then
echo "="
else
echo "!="
fi
if [ $a == $b ]
then
echo "=="
elif [ $a -gt $b ]
then
echo "-gt"
elif [ $a -lt $b ]
then
echo "-lt"
else
echo "NULL"
fi
原文地址:https://www.cnblogs.com/hy87/p/9611019.html
时间: 2024-10-08 04:33:32