no save
Assistance
Achat
News

Forum | Linux/Unix
[Unix] déplacer fichier selon chaine contenu
jon_chninkel, le ven. 08 sept. 2006 à 11:10:39
C'est bon !

#!/bin/sh
# arg1 = chaine
# arg2 = rep source
# arg3 = rep cible
REP=`ls $2`
echo "Début Recherche - Déplacement"

for FICHIER in $REP
do
if [ ! -d $2/$FICHIER ] ; then
if [ "`head -1 $2/$FICHIER | grep $1'`" ] ; then
echo "$FICHIER déplacé"
mv $2/$FICHIER $3/$FICHIER;
fi
fi
done

echo "."


Chouette. Maintenant je dois l'éprouver.

bye bye
Précédentjon_chninkel
sept. 06
lami20j
sept. 06
Suivant
REPONSES
tafiscobar
sept. 06
jipicy
sept. 06
jipicy
sept. 06
jon_chninkel
sept. 06
jon_chninkel
sept. 06
jon_chninkel
sept. 06
lami20j
sept. 06
jipicy
sept. 06
lami20j
sept. 06
jipicy
sept. 06
Version Web
Réalisé par RedShift
no save