質問

I need filter this mpc output:

Burzum - Budstikken
[playing] #6/7   5:03/10:10 (49%)
volume: 60%   repeat: off   random: on    single: off   consume: offere

To this:

5:03

Using sed.

役に立ちましたか?

解決

Try doing this :

mpc (...) | 
sed -nr '/^\[playing/s@.* ([0-9]+:[0-9]+)/.*@\1@p'

他のヒント

try this:

sed -r '/playing/!d; s%.*([0-9]+:[0-9]+)/.*%\1%'
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top