Shell Scripting: How to read the response of adb devices and store it
<p>I am trying to make a small shell script that would pass some adb commands, reboot the device, and once the device reboots, again pass some adb commands.
I was thinking of passing adb devices at regular intervals through out the period the device is rebooting so as to know when the next adb command could be passed(not sure there are any other better methods for doing this). For this purpose I need to check the response of each adb devices command. Is there any method to read this response?
I am a novice in shell scripts. Kindly excuse it the method I am adopting to achieve this task is not correct. 
Any help or suggestions would be much appreciated.</p>