shell-scripte-code/cp_onefile.sh

24 lines
311 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
2018-11-11 04:24:37 +01:00
echo "$wort"
2017-08-22 00:12:15 +02:00
2018-11-11 04:24:37 +01:00
FILENAME=${wort##*/} # Dateiname ist alles ab dem letzten '/'
echo "$FILENAME"
2017-08-22 00:12:15 +02:00
2018-11-11 04:24:37 +01:00
cp $wort ""$2""$i""-""$FILENAME""
i=$(expr ${i} + 1)
2017-08-22 00:12:15 +02:00
done
2017-08-21 22:38:38 +02:00
sync
2017-08-22 00:12:15 +02:00
echo "Fertig!!!"
#./cp_onefile.sh onefile-final.mp3 /mnt1/