Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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