I have a script like that

genhash --use-ssl -s $IP -p 443 --url $URL | grep MD5 | grep -c $MD5

I want to get stream generated by genhash in a variable. How do I redirect it into a variable $hash to compare inside a conditional?

if [ $hash -ne 0 ]
  then echo KO
  exit 0
else echo -n OK
  exit 0
fi

8 Answers
8

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *