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  Y   Y  V     V  EEEE  U   U 
H H Y Y V V E U U
HHHH Y V V EEE U U
H H Y V V E U U
H H Y V EEEE UUU