Try doing this :
mpc (...) |
sed -nr '/^\[playing/s@.* ([0-9]+:[0-9]+)/.*@\1@p'
質問
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%'