I have some hardware that is sending commands over /dev/ttyACM0 every once in a while and I'd like to execute them in a terminal. For example, if the ascii "ls" comes over /dev/ttyACM0, I'd like to have a terminal actually run that. Is there some command-line-fu I can use to do that?


You should be able to just run the following

sh /dev/ttyACM0

This will treat /dev/ttyACM0 as a script and run anything that comes from it.

  • Are the results of the command in the terminal sent back to the Serial port. i.e, is it one way or two way terminal communication? – Ufoguy Dec 15 '13 at 18:50
  • Bash treats it as a script. Meaning bash doesn't know that it's not a script. It see's a file that it can read commands from and so it does just that. If the /dev device supports it, you can just do a normal shell redirect to send the output into it. – Patrick Dec 15 '13 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.