shell-scripte-code/cp_onefile.sh

22 lines
325 B
Bash
Raw Normal View History

2017-08-22 00:12:15 +02:00
#!/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/