From 65e75e62722269915239ca1497df5b0b9bb42d46 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 17 Mar 2014 02:20:08 +0100 Subject: Added support for relative path. --- bin/play | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/play b/bin/play index 6893d53..29c2af5 100755 --- a/bin/play +++ b/bin/play @@ -123,16 +123,18 @@ echo " Start!" cd "$tmp" -$player "$@" +file=${@##*/} + +$player "$file" if [ $? -eq 0 ]; then if [ -d $ARCHIV ] && [ -w $ARCHIV ]; then - echo "Finished $@ succesfull." + echo "Finished $file succesfull." if [ ! $verify ]; then read -p "Should we move everything to the archiv? ($ARCHIV) [Y/n/rm/other] " verify fi if [ ! $verify ] || [ $verify = "ja" ] || [ $verify = "yes" ] || [ $verify = "j" ] || [ $verify = "y" ] || [ $verify = "Y" ]; then echo "Moving the stuff to $ARCHIV." - mv -v "$@" "$ARCHIV" + mv -v "$file" "$ARCHIV" if [ $? -eq 0 ]; then cd "$pwd" rm -v "$@" @@ -141,7 +143,7 @@ if [ $? -eq 0 ]; then read -p "Please tell us the absolute path: " path if [ -d $path ] && [ -w $path ]; then echo "Moving to $path." - mv -v "$@" "$path" + mv -v "$file" "$path" if [ $? -eq 0 ]; then cd "$pwd" rm -v "$@" @@ -152,7 +154,7 @@ if [ $? -eq 0 ]; then fi elif [ $verify = "r" ] || [ $verify = "rm" ] || [ $verify = "remove" ] || [ $verify = "RM" ] || [ $verify = "R" ]; then echo "Cleaning the mess up. Only removing files from $tmp." - rm -v "$@" + rm -v "$file" else echo "Okay, don't touching the files." fi -- cgit v1.2.3