The grep utility processes lines. Lines end with a <newline> character. Your file has 8 lines in the 1st 470 bytes of your 5,025 byte file and one long and, presumably, growing incomplete line with a bunch of <carriage-return>s, but no <newline>s.
To get the last status update, maybe you want something more like:
or:
Last edited by Don Cragun; 05-31-2015 at 09:09 PM..
Reason: Add awk RS alternative.
This User Gave Thanks to Don Cragun For This Post:
I think the issue somehow is based upon the fact that ffmpeg (ffplay here) prints some basic info of the file, and then prints an updated status line, of where it currently is, the current bitrate, etc, and lcoses the line with a \r.
Though the tempfile ($TMP.playstatus) gets prints a new line.
I tried sed s,\r,,g with no change
However, Just played a 2:28 file and a 1:30 minute file, and at the end it looked:
However, this did NOT apply to the file playing 1:30....
Another weird thing of the above example, max is 148 secs = 2:28, but the cur only reach 93.21 secs when it was done playing
---------- Post updated at 02:12 ---------- Previous update was at 02:08 ----------
---------- Post updated at 02:16 ---------- Previous update was at 02:12 ----------
Nevermind, i prefix tr with cat, and its now working.
Though not what i wanted, but it works.
Given your status file's structure is fixed, i.e. line length is constant, as is field length, this
would yield the first field of the last line, eliminating tr and awk. Although there's a small chance that another line is written between stat's byte count read and dd's copy action. Worth a shot?
Given your status file's structure is fixed, i.e. line length is constant, as is field length, this
would yield the first field of the last line, eliminating tr and awk. Although there's a small chance that another line is written between stat's byte count read and dd's copy action. Worth a shot?
Structure is fixed, so the given 7 first bytes per line would match.
Wouldnt that apply to the current (or just any filebased) method either?
I'm not quite sure if the replacing of 3 string/stream modifiers/tools by 2 file modifiers would improve anything (speed, hw i/o rate, cpu/hdd temp) or the contrairy...
Sure thing is an interesting new approach, i would not have thought of dd to read and print a file its content.
IMHO, without having one, i'd say its best use (to stream a directories content of audiofiles to your network) on a Raspery PI or something alike.
If you should have it already installed, be sure to update TUI too.
---------- Post updated at 13:18 ---------- Previous update was at 12:46 ----------
I'll stay with the current method.
It tends to be 0.01 s faster than the dd method on the average.
Just installed the latest version on my hp stream, was tired of windows. Of the few times I've used Linux, this is the first time it won't update. Im connected to the net the updater recognizes that the OS needs 21 updates. But it won't download/install the updates. It also won't load the... (1 Reply)
I have an app in FP26 with 400 prgs currently en UW7.1.1 thats work perfectly.
I have a new server and install UW7.1.4 and FP26. Then I had copy my App to new server. But the next command doesn't work:
use database
@10,10 get name
read
I can't write in the get.
... (5 Replies)
Hello Expert,
is there any command through which i can update/replace the folder after every two months.
lets say i have folder
/usr/local/x_folder
created on 01/01/2011
I need to update it on 31/03/2011
Please help me to get the logic :confused:
Thanks (3 Replies)
Hello
I have a server whose os level reads 5300-01-00-0000. It has to be upgraded to the latest level which is 5300-12-04-1119. What would I need to do go get the server to this point? Would I need to go through each patch level until I get it to current? If so, would anyone happen to know... (1 Reply)
hi,
I'm trying to add a # to the beginning of the line where the a word is included.
and the i want to run the whole original script.
and if possible I would prefer that line would stay in the same order in the text file, the line which includes the word.
Thanks, (10 Replies)
I have an extremely large csv file that I need to search the second field, and upon matches update the last field...
I can pull the line with awk.. but apparently you cant use awk to directly update the file? So im curious if I can use sed to do this... The good news is the field I want to... (5 Replies)
Hello,
I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^
Here is what I'm trying to achieve :
file1:
test filea 3495;
test fileb 4578;
test filec 7689;
test filey 9978;
test filez 12300;
file2:
test filea... (11 Replies)