1

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.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
user2079266
  • 49
  • 1
  • 3

2 Answers2

2

Try doing this :

mpc (...) | 
sed -nr '/^\[playing/s@.* ([0-9]+:[0-9]+)/.*@\1@p'
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
1

try this:

sed -r '/playing/!d; s%.*([0-9]+:[0-9]+)/.*%\1%'
darque
  • 1,566
  • 1
  • 14
  • 22