Linux变量和控制语句

数组:

# a = (a b c d e)

# echo ${a[0]}

# echo ${a[*]}

# echo ${a[@]}

b[0] = 1

 

if 语句:

a = 20

b =10

if [ $a -eq $b ]; then echo "=";fi

 

for语句:

for loop in 1 2 3 4 5

do

  echo "hello"

done

while语句:

while(condition)

do

  echo ""

done

posted @ 2022-04-05 18:44  狒狒桑  阅读(26)  评论(0)    收藏  举报