Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Unless I'm missing something, there appears to be no simple way in *NIX to read from a serial port directly into a file

I had imagined something as simple as cat /dev/ttyX > file but apparently not

Does anyone know a trick that I'm missing?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If you're just trying to capture data from a serial port, Minicom might work. I believe it supports logging to a file.

I thought doing a cat /dev/ttySx would work as well...are you sure it's mapped to the proper serial port? Is something else not allowing the device file to be opened? What happens if you just cat the file instead of redirecting it?

share|improve this answer
    
Maybe it is something to do with line-buffering? –  RedGrittyBrick Dec 21 '10 at 13:10
    
Strangly, This got sorted by playing with minicom... After HUP and quitting minicom, cat > file works :S Sorry for the time wasted. –  Andrew Bolster Dec 21 '10 at 13:47
    
It could be that the port needed settings reset to defaults or was set in a funny mode. –  Bart Silverstrim Dec 21 '10 at 13:53

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.