xshell入门学习

 

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

 

posted on 2018-09-08 23:16  _故乡的原风景  阅读(175)  评论(0编辑  收藏  举报