Problem: Write the script execution when an error occurs, as follows
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/87/08/wKioL1fSHw_BhTzfAAAyENpN0rw591.png "title=" Sogou 20160909103121.png "alt=" Wkiol1fshw_bhtzfaaayenpn0rw591.png "/>
Analysis:
(1) Where the script appears if [$result-eq 0];then
(2) Error unary operator expected the Chinese means that a unary operator should be used, that is, this $result if
is empty then it becomes if [-eq 0], the system will be considered to be one less parameter, only one-eq 0, no left argument,
Therefore, the above error will occur
Workaround: You can change the script to if [[$result-eq 0]];then, add a pair of [] numbers. As for why, I am also Baidu's
This article is from the "Court of the Odd Tree" blog, please be sure to keep this source http://zhangdl.blog.51cto.com/11050780/1850986
Unary operator expected