shell-scripte-code/cp_onefile.sh
2019-01-07 20:23:02 +01:00

23 lines
319 B
Bash
Executable file

#!/usr/bin/env 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
sync
echo "Fertig!!!"
#./cp_onefile.sh onefile-final.mp3 /mnt1/