La commande( and not) en script shell
Résolu
sajodia
-
lunixseeker Messages postés 3 Statut Membre -
lunixseeker Messages postés 3 Statut Membre -
Bonjour,
j'aimmerais savoir comment s'ecrit la commande (and not) pour marquer l'inexistant,la négation
if [ $jour == 20 ] and [ $mois == 01 or 03 or 05 or 07 or 08 or 10 or 12 ] and not [- s /sextantapp/m1/fic/GRPARAM ] and not [ -s /sextantapp/m1/fic/GRTABLE ] and not [ -s /sextantapp/m1/fic/GRAGENT ] and not[ -s /sextantap
p/m1/fic/GRCOUTMAT ]
merci.
j'aimmerais savoir comment s'ecrit la commande (and not) pour marquer l'inexistant,la négation
if [ $jour == 20 ] and [ $mois == 01 or 03 or 05 or 07 or 08 or 10 or 12 ] and not [- s /sextantapp/m1/fic/GRPARAM ] and not [ -s /sextantapp/m1/fic/GRTABLE ] and not [ -s /sextantapp/m1/fic/GRAGENT ] and not[ -s /sextantap
p/m1/fic/GRCOUTMAT ]
merci.
Configuration: Windows XP Internet Explorer 7.0
A voir également:
- La commande( and not) en script shell
- Invite de commande - Guide
- Classic shell - Télécharger - Personnalisation
- Spybot search and destroy - Télécharger - Antivirus & Antimalwares
- Find and mount - Télécharger - Récupération de données
- Mas script - Accueil - Windows
6 réponses
Non ! Cette commande renvoie "vraie" si le fichier a une taille différente de "0" (zéro) !!!
C'est "-e" qui permet de tester si un fichier existe :-))
C'est "-e" qui permet de tester si un fichier existe :-))
la commande if va renvoyer vrai ou faux, vrai si la condition est remplie, faux si elle n'est pas rempli :
if test -e fichier
test -e fichier est la condition, si fichier existe alors if renverra vrai , sinon faux.
on peux dire à if de tester si la condition n'est pas rempli grâce au !
ainsi if ! test -e fichier renverra vrai si fichier n'existe pas.
Tu as aussi l'exemple de jipicy en dessous pour voir comment cela marche.
if test -e fichier
test -e fichier est la condition, si fichier existe alors if renverra vrai , sinon faux.
on peux dire à if de tester si la condition n'est pas rempli grâce au !
ainsi if ! test -e fichier renverra vrai si fichier n'existe pas.
Tu as aussi l'exemple de jipicy en dessous pour voir comment cela marche.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
ça ne marche pas ou bien peut etre j'ai mal compris
merci de réexpliquer svp