Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
bashtestzero [2018/01/15 11:57]
yassine chaouche
bashtestzero [2018/01/15 11:58] (current)
yassine chaouche
Line 4: Line 4:
  
 To test for emptiness, Just use square braquets around the variable like this :  To test for emptiness, Just use square braquets around the variable like this : 
 +
 <​code>​ <​code>​
 if [ $var ] if [ $var ]
Line 13: Line 14:
 </​code>​ </​code>​
  
-To test for zeroness, use double parens (w/o the dollar) like this :  +To test for zero, use double parens (w/o the dollar) like this :  
-<​code>​+
 <​code>​ <​code>​
 if (( $var )) if (( $var ))
Line 22: Line 23:
   echo $var is zero   echo $var is zero
 fi fi
-</​code>​ 
 </​code>​ </​code>​
 ---- ----

QR Code
QR Code bashtestzero (generated for current page)