shell conditional testing
Writing about web page http://www.oracle.com/technology/pub/articles/dulaney_test.html
I keep on forgeting the syntax of bash shell condition syntax. So i have to write it down now.
[ condition ] :
note the space between each side the condition when using square brackets.
"[" actu
String Comparation
=, !=, -z (string is null), -n (not null)
Numbers
-eq, -ne, -gt, -lt, le,ge
e.g.:
[ "$number" -eq "10"] or [ $number -gt 30 ]
"0" means true
"1" means false
Add a comment
You are not allowed to comment on this entry as it has restricted commenting permissions.