Shell
Résolu
dino
-
dino -
dino -
Bonjour a tous,
Je commence en shell et je voudrais ecrire un script qui calcule le nbre de repertoir dans le chemin de lancement :
#!/bin/ksh
if [ `ls -ltr|grep '^d'` -ne 0 ];
then echo " il existe `ls -ltr|grep '^d'|wc -l` repertoir "
echo "toto"
fi
Mais a l'execution :
./test1[7]: [: 2: unexpected operator/operand
J'ai beau modifier tjr rien.
Merci pour votre aide.
Je commence en shell et je voudrais ecrire un script qui calcule le nbre de repertoir dans le chemin de lancement :
#!/bin/ksh
if [ `ls -ltr|grep '^d'` -ne 0 ];
then echo " il existe `ls -ltr|grep '^d'|wc -l` repertoir "
echo "toto"
fi
Mais a l'execution :
./test1[7]: [: 2: unexpected operator/operand
J'ai beau modifier tjr rien.
Merci pour votre aide.
A voir également:
- Shell
- Classic shell - Télécharger - Personnalisation
- Secure shell - Télécharger - Divers Web & Internet
- Shell infrastructure host c'est quoi - Guide
- Shell startup windows 10 - Guide
- Shell do while ✓ - Forum Shell
a+