Ajouter un commentaire

fredericmazue

La façon classique de faire en Shell c'est de tester si un répertoire ou un fichier du nom de toto existre avant de lancer la commande;

comme ceci:

#! /bin/bash

if [ -d "toto" ] || [ -f "toto" ]
then
	echo "toto existe deja"
else
	echo "creation toto"
	mkdir toto
fi

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
 H  H  N   N  U   U   GGG   ZZZZZ 
H H NN N U U G Z
HHHH N N N U U G GG Z
H H N NN U U G G Z
H H N N UUU GGG ZZZZZ