Pages

Monday, January 3, 2011

How to check NULL in a string in Shell Script ?

The following code snippet will tell whether
a string is null or not .

VALUE=
if [ ! -n "$VALUE" ];    
  then echo "null";  
else
 echo "String is not null"
fi

No comments:

Post a Comment