How to check for null or empty string

Hi,

I need to check for value not equal (<>) to 21 and not equal empty or null values.

Please modify this script

if [ $VALUE -ne "21" ]
then
    echo "$VALUE,$BSC_NAME,$BSC_ID" > $OUT_FILE/power_up.out
end if

TQ

can anyone help?

Please read our rules and refrain from bumping your posts.

Thanks,
ZB

Sorry. Anyway i found the solution. Thank you so much for the help.

You shuld post the solution to help other forum members having same type of problems in coming future......

Cheers,

Awadhesh
:slight_smile:

Here's the solution

if [ ! -n "$VALUE" ]
    then
   VALUE="21"
fi
if [ $VALUE -ne "21" ]
then
echo "$VALUE,$BSC_NAME,$BSC_ID" > $OUT_FILE/power_up.out
end if