Ish Montalvo
Ish Montalvo

Reputation: 181

How to store Screen Command output (x amount of seconds) into a file

I understand that in order to save a screen command you can do:

screen /dev/tty.usbserial-DA01G657 57600

and then Ctrl+a+H and it stores it.

I am looking for a way of storing the output into a file but having a time limit on the data.

for example:

I start reading from that port for 1 minute and record that data into a file. But JUST for that 1 minute.

It could be wither by time or by quantity of characters stored.

is this possible?

Upvotes: 0

Views: 475

Answers (1)

larsks
larsks

Reputation: 312370

I probably wouldn't use screen for this. If your goal is simply to record X minutes of serial port data to a file, how about:

stty -F /dev/tty.usbserial-DA01G657 speed 57600
timeout 60 cat /dev/tty.usbserial-DA01G657 > output.txt

Upvotes: 1

Related Questions