I am trying to record a reoccurring test to a txt file using tail but there is an issue with the output.
The commands I am running are:
script -q /dev/stdout -c 'scp /home/user/test.img user@pc28:/tmp' | tee /home/user/scp.log
tail -3 /home/user/scp.log >> /home/user/test.txt
The issue is the text looks like--
^Mtest.img
0% 0 0.0KB/s --:-- ETA^Mtest.img
16% 82MB 81.7MB/s 00:05 ETA^Mtest.img
35% 178MB 83.2MB/s 00:03 ETA^Mtest.img
51% 256MB 82.7MB/s 00:02 ETA^Mtest.img
65% 328MB 81.6MB/s 00:02 ETA^Mtest.img
84% 421MB 82.8MB/s 00:00 ETA^Mtest.img
100% 500MB 87.0MB/s 00:05`
instead of
*test.img
100% 500MB 87.0MB/s 00:05*
which is what it looks like if i cat the file. I see the long messy output if i less or vi the file.
\r
instead of\n
. What output do you actually want? What are you expecting here?script
at all here?