Thread: aUDIOBOOK?
View Single Post
jldiaz's Avatar
Posts: 48 | Thanked: 40 times | Joined on Apr 2008 @ Spain
#28
Originally Posted by konus View Post
Thanks for idea.
My scripting skills are not so good... but this script works %)

Code:
...(omitted)...
It did not work for me... I'm unsure why (because I don't fully understand its purpose, for example, the variable FILESUM). I have some ogg files, and your script relies on the assumption that only mp3 files are present. Besides, it requires the previous existence of file "abook.plist".

Anyway...

Originally Posted by konus View Post
Code:
...
mplayer -ss $RESPOINT $CPLIST > $HOME/.mplayer/abook.temp
awk '/Playing/ {print $2}' $HOME/.mplayer/abook.temp > $HOME/.mplayer/abook.resume
awk 'BEGIN{RS="\r"}{if ($1=="A:") t=$2}END{print t}' $HOME/.mplayer/abook.temp >> $HOME/.mplayer/abook.resume
how from last 3 lines make only one line? :/
thanks.
What about the following? (not tested)

Code:
mplayer -ss $RESPOINT $CPLIST | awk 'BEGIN{RS="\r"}/Playing/{print $2}/^A:/{t=$2}END{print t}' > $HOME/.mplayer/abook.resume
The use of pipes in a single line avoids the existence of the temporal file, which is a good thing, because that file grows very faster (mplayer outputs status information about ten times per second!)
__________________
--ル Diaz