commit 5b9a5c431f092e9b6a0541822689726894a61472 parent e37b604751c7a5c8e9215c91caae72be9e74f36e Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Fri, 25 Sep 2020 18:41:50 +0200 add script mpc-delete-pattern to selectively delete from current playlist Diffstat:
A | .local/bin/mpc-delete-pattern | | | 8 | ++++++++ |
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/.local/bin/mpc-delete-pattern b/.local/bin/mpc-delete-pattern @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +if [ -z "$HOST" ]; then HOST=mini; fi + +mpc --host="$HOST" playlist | \ +awk -v pattern="$1" '{if (match($0, pattern)) {print NR}}' | \ +mpc --host="$HOST" del