From 6f2f2a0a36366705104488b17912a0eb2f3b56de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 5 Dec 2020 20:22:20 +0100 Subject: pl: Add -a (all) option, add optional interactive selection --- pc | 2 +- pl | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pc b/pc index 9d0c4dd..4cc57a3 100755 --- a/pc +++ b/pc @@ -4,7 +4,7 @@ curl -Ls "$@" | sed -n '//,$p' | -sed -e '/^$/d' -e 's/^[ ]*//' | +sed '/^$/d; s/^[ ]*//' | awk -vFS='[<>]' -vOFS=' ' ' // { date = $3 } // { duration = $3 } diff --git a/pl b/pl index 6ba59d7..8b83551 100755 --- a/pl +++ b/pl @@ -12,4 +12,15 @@ storm=https://rss.acast.com/stormensutveckling ts=https://rss.art19.com/thinkspot-presents unb=https://unbelievable.podbean.com/feed.xml -eval echo \$$1 +# Write all +if test "$1" = -a +then eval echo $(grep '^[a-z]*=' "$0" | sed 's/=.*//; s/^/$/') | tr ' ' ' +'; exit +fi + +# Optional interactive selection +if test -z "$1" +then eval echo $(grep '^[a-z]*=' "$0" | ep | sed 's/=.*//; s/^/$/') | tr ' ' ' +' +else eval echo \$$1 +fi -- cgit v1.2.3