So I am trying to run a script that will capture the output of the command:
echo 'password' | sudo -S strace -p14750 -s9999 -e write
for about 5 seconds and then store the output into a variable. How can I do this?
Full script:
appium_pid_output=$(echo 'password' | sudo -S strace -p$appium_device_pid -s9999 -e write)
echo 'captured output of node '$appium_pid_output
if [[ $appium_pid_output == *POST* ]]; then
echo "device [ " + $device + " ] is currently in use"
return 1
fi