Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Finding null column value using array

$
0
0
hi,
Am trying to find a solution for finding a null column value inside a loop using array.


Code:

for eg:

two
three

five

From the above array myarray[0],myarray[3] and myarray[5] having null values. But when am trying to check that space using some condition its not working.
for (( i=0; i<"${#myarray[@]}"; i++ ))
do
space=""
if [[ "${myarray[$i]}" == "$space" ]]   
then
echo "space is there"
else
echo "no space"
fi
done


Viewing all articles
Browse latest Browse all 16232

Trending Articles