First, conditional test syntax:
The first three test syntax is basically the same.
Second, numerical test:
2.1 Common numerical test:
2.2 )) test
[root@server1 ~]# (( "2" < "3" ))[root@server1 ~]# echo $?0[root@server1 ~]# [ ,null,null,3],1 -lt 3 ][root@server1 ~]# echo $?0
Note: Double parenthesis test can't test the case of equal value. If you use double parenthesis test, it will report the following error:
[root@server1 ~]# (( "2" = "3" ))-bash: ((: 2 = 3 : attempted assignment to non-variable (error token is "= 3 ")
3, test string:
< Br>
Try the example:
[root@server1 ~]# A=str[root@server1 ~]# B=str[root@server1 ~]# [ $A = $B ][root@server1 ~]# Echo $?0[root@server1 ~]# B=Str[root@server1 ~]# [ $A = $B ][root@server1 ~]# echo $?1[root@server1 ~]# [ -n $ B ][root@server1 ~]# echo $?0[root@server1 ~]# [ -z $B ][root@server1 ~]# echo $?1
Microsoft announced the extension of the Windows Vista and Windows 7 lifecycle. The life cycle of W
One serial port control Usually we use direct serial port for video server, video recorder, switcher
under RedHat Enterprise Linux server 5.4 First, system environment operating system: RedHat Enterp
diskless boot everyone should have heard of it, and now many Internet cafes and enterprises have use
Display multi-core mode method under Linux
Method of operating a Bluetooth phone in the Linux operating system, the so-called
Linux Virtual Machine VMware vSphere Installation Tutorial
mogileFS Distributed Storage - Installation Notes
Fedora 15 installed nvidia driver
Realizing LAN Remote Access in Linux
Linux manual adjustment date time
Suse linux single-user mode to modify the root password
Login with Win8.1 administrator account
Don't know! Win8 RP version of the FAQ collection (2)
What if the win7 program does not respond?
Why can't Windows XP with SP2 install IIS
IE7.0 shortcut key full contact
Why doesn't win10 display thumbnails only to see icons?
Win8 system computer set the method to manually start the safe mode when booting
Linux server network related kernel parameters
Win 8 calls the tablet pc input panel illustration
Win7 32-bit system desktop icon can not be automatically refreshed how to do