In bash how can I issue a command to a running process I just started?
For example;
# Start Bluez gatttool then Connect to bluetooth device 
gatttool -b $MAC -I
connect # send 'connect' to the gatttool process?
Currently my shell script doesn't get to the connect line because the gatttool process is running.



echo "connect" | gatttool -b $MAC -Igatttool. Would that still work? Could I send one long string with many different commands?expectgatttoolin non-interactive mode as well, that would be simpler than writing anexpectscript. Check here for example : humbug.in/2014/…/expecttag to your question. click on it to search for other questions with that tag.