M
M
MegaBOOBLIK2016-03-28 12:21:58
linux
MegaBOOBLIK, 2016-03-28 12:21:58

How to withdraw CAT | SCREEN to a file?

ZDR!
There is a device connected via usb
# dmesg | grep cp210x
[ 22.880215] usbcore: registered new interface driver cp210x
[ 22.880277] usbserial: USB Serial support registered for cp210x
[ 22.880391] cp210x 2-1:1.0: cp210x converter detected
[ 23.265817] usb 2-1: cp210x converter attached to ttyx USB converter now redirected to /dev /
COM1 for convenience and not to
change
\x37' > $PORT
device should respond, BUT!
cat /dev/COM1 - silence
screen /dev/COM1 - everything is displayed fine
but I can’t write SCREEN into a variable for later parsing, or at least into a file.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
MegaBOOBLIK, 2016-03-28
@MegaBOOBLIK

RESOLVED!
1. The problem was in the port settings
Not working
speed 300 baud; rows0; columns0; line=0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werease = ^W; lnext = ^V; flush = ^O; min = 0; time = 0;
parenb -parodd cs7 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr - onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo -echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
Working
speed 300 baud; rows0; columns0; line=0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werease = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
parenb -parodd cs7 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret - ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke cat :
no process found ALL SPS!

Z
Zhbert, 2016-03-28
@Zhbert

screen /dev/COM1 > file

S
Spetros, 2016-03-28
@Spetros

This is called I/O redirection .

S
Saboteur, 2016-03-28
@saboteur_kiev

"screen / dev / COM1 - everything is fine displayed"
So redirect its output.

S
Shetani, 2016-03-28
@Shetani

Try like this

exec 4< /dev/com1
cat <&4

to close the handle later, use
exec 4<&-

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question