Barry='Life is beautiful' echo $Barry
A=(I Love Life) #shell数组下标从1开始 echo ${A[1]} ${A[2]} ${A[3]} #打印数组 echo A
shift.shell文件
echo $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 shift echo $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} shift echo $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10}
set 1 2 3 #把数字1赋给$1,数字2赋给$2,数字3赋给$3
set.shell文件
set 1 20 30 echo $0 $1 $2 $3
执行set脚本
bash set # set 1 20 30