Oui, mais uniquement des tabulations (\t, 0x09). Tout autre caractère, espace compris, parasite la reconnaissance de fin du "here doc".
Version imprimable
Oui, mais uniquement des tabulations (\t, 0x09). Tout autre caractère, espace compris, parasite la reconnaissance de fin du "here doc".
Testé et approuvé à l'instant sur Cygwin.
Ca fonctionne pour les tabulations et espaces.
OK mille fois merci !!!! :mouarf:
Ça marche. Satanée tabulation.
Merci pour votre aide et votre patience.
Le script qui marche enfin:
Code:
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 # !/bin/bash if [ -f "$1" ]; then echo "Le fichier "$1" existe" else echo "Le fichier "$1" n'existe pas" exit fi DAY=$(date +"%Y-%m-%d") touch --date "$DAY" /root/file while IFS=: read NOM_CLIENT PATH_LOCAL RACINE_FICHIER_LOCAL SERVEUR_DEPOT PATH_DISTANT do NOM_LAST_FICH=`find $PATH_LOCAL$RACINE_FICHIER_LOCAL* -type f -newer /root/file` # Purge ancien fichier de sauvegarde sur serveur destination sftp $NOM_CLIENT@$SERVEUR_DEPOT <<EOF cd $PATH_DISTANT rm $RACINE_FICHIER_LOCAL* # Envoi vers serveur destination put $NOM_LAST_FICH quit EOF done < $1