Example: string comparison #!/bin/bash Read data Test "$data" = = "Hello" //note there are spaces on either side of the equal sign or [$data = = "Hello"] echo $? //Run result of previous command, success is 0, failure is 1
650) this.width=650; "title=" QQ picture 20160810202257.png "Src=" http://s4.51cto.com/wyfs02/M00/85/A7/ Wkiol1erhr-x9mkjaaarfnpmpza433.png "alt=" Wkiol1erhr-x9mkjaaarfnpmpza433.png "/>
Example: two number comparison size #!/bin/bash data=200 [$data-eq 100] echo $? [$data-LT 100] echo $? [$data-le 100] echo $? [$data-GT 100] echo $? [$data-ge 100] echo $?
650) this.width=650; "title=" QQ picture 20160810204114.png "Src=" http://s4.51cto.com/wyfs02/M02/85/A7/ Wkiol1eriodxbmfqaaaizovh3ks109.png "alt=" Wkiol1eriodxbmfqaaaizovh3ks109.png "/>
650) this.width=650; "width=" 384 "height=" "title=" QQ picture 20160810205512.png "style=" width:351px;height:220px; "src= "Http://s5.51cto.com/wyfs02/M02/85/A7/wKioL1erI5LBwmBYAADtOBsIJ0w427.png" alt= " Wkiol1eri5lbwmbyaadtobsij0w427.png "/>
650) this.width=650; "Width=" 609 "height=" 146 "title=" QQ picture 20160810205711.png "style=" WIDTH:530PX;HEIGHT:147PX; "src= "Http://s2.51cto.com/wyfs02/M02/85/A8/wKiom1erJHrg86p2AADIymt-B98039.png" alt= " Wkiom1erjhrg86p2aadiymt-b98039.png "/> For example: Test and, non-logical operations
650) this.width=650; "Width=" 522 "height=" "title=" QQ picture 20160810211610.png "style=" width:518px;height:330px; "src= "Http://s3.51cto.com/wyfs02/M00/85/A8/wKiom1erKMzTXNOMAADCx0Y4Cxc703.png" alt= " Wkiom1erkmztxnomaadcx0y4cxc703.png "/>
|