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 :-)
 U   U  L     N   N  RRRR   V     V 
U U L NN N R R V V
U U L N N N RRRR V V
U U L N NN R R V V
UUU LLLL N N R RR V