a test expression
Complex format, simple logic
Variable tests are used when variables are optimized
Two actual combat
[root@localhost ~]# unset y
[root@localhost ~]# x=${y-2}
[root@localhost ~]# echo $x
2
[root@localhost ~]# y=""
[root@localhost ~]# x=${y-2}
[root@localhost ~]# echo $x
[root@localhost ~]# y=1
[root@localhost ~]# x=${y-2}
[root@localhost ~]# echo $x
1