commit 85fac33ffba9a6b0a6d0704e7283876a7f7576a1 parent e7fa749b0e5eae492e8548ccc42da097aa968e93 Author: Christoph Lohmann <20h@r-36.net> Date: Sat, 13 Oct 2012 09:19:31 +0200 Some changed to rppodplay. Diffstat:
bin/rppodplay | | | 24 | +++++++++++++----------- |
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/bin/rppodplay b/bin/rppodplay @@ -1,25 +1,27 @@ #!/bin/sh usage() { - echo "usage: `basename $1` [-d] msgid" + printf "usage: %s [-d] msgid\n" "$(basename $1)" >&2 exit 1 } dodownload=0 +folder="" -while getopts "dh" opt; +while getopts "dh:" opt; do case $opt in - d) - dodownload=1 - ;; - *) - usage $0 - exit 1 - ;; + d) + dodownload=1 + ;; + + *) + usage $0 + exit 1 + ;; esac done -shift `expr $OPTIND - 1` +shift $(($OPTIND - 1)) if [ $dodownload -gt 0 ]; then @@ -46,7 +48,7 @@ fi msgid="$*" -url=`rpview -- $msgid | awk '/Enclosure:/ {print $2}' | tr -d '\r'` +url=$(rpview -- $msgid | awk '/Enclosure:/ {print $2}' | tr -d '\r') for i in $url do echo $i