From a55f02fbc80421f91c1e2b87257e3c7a24d3f2fa Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 22 Aug 2017 00:12:15 +0200 Subject: [PATCH] cp_onfile.sh --- cp_onefile.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 cp_onefile.sh diff --git a/cp_onefile.sh b/cp_onefile.sh new file mode 100755 index 0000000..6b254b3 --- /dev/null +++ b/cp_onefile.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +finds=$(find -name $1) + +set -ex + +i=0 +for wort in $finds +do + echo "$wort" + + FILENAME=${wort##*/} # Dateiname ist alles ab dem letzten '/' + echo "$FILENAME" + + cp $wort ""$2""$i""-""$FILENAME"" + i=$(expr ${i} + 1) +done + +echo "Fertig!!!" + +#./cp_onefile.sh onefile-final.mp3 /mnt1/