I am working on a distributed Linux system.In my bash script I want to grep the output of :
ssh $ipaddress ibstat
The above command will hang if the machine is down. How do I handle the hang and come out of a the bash script with a non-zero value?