1. 定义变量
a):
[root@station mnt]# a=66
[root@station mnt]# echo $a
66
[root@station mnt]# a=33-$a
[root@station mnt]# echo $a
33-66
b):
[root@station mnt]# b='66'
[root@station mnt]# echo $b
66
[root@station mnt]# b='33-$b'
[root@station mnt]# echo $b
33-$b
c):
[root@station mnt]# c="66"
[root@station mnt]# echo $c
66
[root@station mnt]# c="33-$c"
[root@station mnt]# echo $c
33-66
区别:’ '默认不解析其中的内容," "可以定义多个变量,没有特别要求时,字符串都加双引号,需要原样输出加单引号
###定义多个变量时,需要使用" "
[root@station mnt]# a=3 6
bash: 6: command not found...
[root@station mnt]# a=" 3 6"
[root@station mnt]# echo $a
3 6
2. 特殊变量
$0: ###获取脚本文件