Bonjour, je suis nouveau dans le monde de Bash,
je rencontre un petit probleme

dans mon premier script, la casse est resperté, a savoir, il ne copie que les fichiers avec une extension .JPG

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
 
hdd=/run/media/billy/alain/pictures/raw/
from=/home/billy/Pictures/workace-jpg/
 
if [ -d $hdd ]
then echo "monté"
else echo "hdd non monté"
exit
fi
cd $from
 
cp *.JPG $hdd
 
rsync -a *.ORF $hdd
exit
mais dans le deuxieme il copie toues les images JPG et jpg. (la derniere partie)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
 
 
#
#fast transform from raw to jpg
#
#script made by @rom@
#
#
#
 
#folders
SYNC=/run/media/billy/3135-6161/DCIM/101OLYMP/
FOLDERTOGO=/home/billy/Pictures/workace-jpg/
hdd=/run/media/billy/alain/pictures/raw/
 
#variables
out=".jpg"
in=".ORF"
last=".JPG"
n=0       #picture already done
z=1       #picture to work on
 
#check if the card sd is mounted and sync if so
if [ -d $SYNC ]
	then rsync -av $SYNC $FOLDERTOGO 
	else echo 'SD card unmounted'
fi
 
 
#go to the workplace to work & compte files
cd $FOLDERTOGO
Torf=`ls -l *$in | wc -l`       #compt how many ORF are in the folder
 
 
#transform ORF to JPG with a quality of 90%
for i in *.ORF; do
  if [  -f "${i%$in}$out" ]
	then (( n ++ ))			   #compt existing files
	else echo "$z/""$(( Torf - n ))"   #show how many to go 
	 rawtherapee -j'90' -c  "$i"       #transform orf to jpg
	 (( z ++ ))			   #compt what's done
  fi
done
#backup pictures on hdd
if [ -d $hdd ]
then echo "monté"
#rsync -av *.ORF $hdd
echo rsync ok
cp *.JPG $hdd
else echo "hdd non monté    pas de back up"
exit
fi
 
exit 0
où est le probleme ???/pourquoi ???


si voux voyez un trucs ou deux a changer, je suis preneur