Friday, February 3, 2012

Multiple Comparison in Bash

Checking multiple conditions in Bash can be tricky.

Following require STRING1 and STRING2 to be not empty and COUNTER < MAX.
if [[ -n "$STRING1" && -n "$STRING2" && $COUNTER -lt $MAX ]];
then
...
fi


This post is a nice concise resource.

No comments:

Post a Comment