Rechercher : dans
Par :

Aide scripts

Dernière réponse le 14 jan 2009 à 12:28:25 mourad.ounough, le 13 jan 2009 à 15:04:40 
 Signaler ce message aux modérateurs

Bonjour,

je cherche à resoudre un pb qui ma paru quand je lance mon scripts :
#!/bin/sh

list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 blp203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201
bll301 bll401 bll501 blf101 blf201 blf301 blf401 blf501"

while true
do
clear
echo "veuilez choisir votre choix :
1) vM-irifier last restart server & cpu status
2) vM-irifier la defense
3) vM-irifier recovery
4) vM-irifier snap delay
5) vM-irifier check archilaog
6) vM-irifier semaphore
7) vM-irifier cross-config
8) vM-irifier last restart of SEP
9) vM-irifier
10) sortir"

echo "Votre choix : c"
read choice
case "$choice" in
1 ) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '{print "============>>"$3" " " "$4}'` && echo "$firstcol $sec
ondcol"
done
sleep 2
continue
;;
2 )
for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| awk '{print"=====================>>"$1 " "$2}'
done

sleep 2
continue
;;
3) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $host ls /in/local/var/recovery | wc -l
done
sleep 2
continue
;;
4) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|snap|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7
}'
done
sleep 2
continue
;;
5) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $ ls -ltr /in/smp/smf/platform/archdb
done
sleep 2
continue
;;

6) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $ipcs -sam | grep 0x5000

done
sleep 2
continue
;;

7) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|pfmddup
done
sleep 2
continue
;;

8) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $$HOME/.profile > /dev/null 2>&1;/in/local/bin/sepman -l | grep -v "I.N" | grep "nov27" | awk -F"|" '{print $3" "" "" "" "" "$
8}'
done
continue
;;
9) echo "Mauvais choix."
continue
;;
10) echo "bye, bye..."

esac
done



jai le message :

bls101 linus> ./test.sh
./test.sh: syntax error at line 119: `end of file' unexpected




merci en avance à vous

Configuration: Windows XP
Internet Explorer 7.0

Meilleures réponses pour « aide scripts » dans :
Attaques Cross-Site Scripting Voir Injection de code malicieux Les attaques de type Cross-Site Scripting (notée parfois XSS ou CSS) sont des attaques visant les sites web affichant dynamiquement du contenu utilisateur sans effectuer de contrôle et d'encodage des informations...
Objets WSH (Windows Scripting Host) Voir WSH Windows Scripting Host (WSH) est un hôte de scripts pour les systèmes Microsoft Windows permettant d'interprêter des scripts afin d'automatiser l'administration du système. WSH permet d'interprêter nativement les scripts écrits en JScript ou...
Java Server Pages - Les scriptlets Voir Présentation des scriptlets JSP Une scriptlet JSP est un bloc de code Java compris entre les balises suivantes : Le code Java (qui doit naturellement être valide) présent entre les balises devient le corps de la...
[IE] Erreur de script / Effectuer un débogage VoirDe temps en temps, lorsque vous naviguez sur le Net et que vous chargez une page Web, un message d'erreur de script survient : Une erreur est survenue. Une erreur est survenue sur le script de cette page. Souhaitez-vous effectuer un...
Exécuter un script shell VoirExécution d'un script Pour pouvoir exécuter un script ou un programme en ligne de commande il y a plusieurs possibilités : 1. Le chemin absolu 2. Le chemin relatif 3. Modifier la variable PATH Note: Le Sha...
Créer un script d'ouverture de session VoirWindows permet de définir des scripts d'ouverture de session, c'est-à-dire des scripts contenant des commandes exécutés dès qu'un utilisateur ouvre une nouvelle session. Les scripts d'ouverture de session permettant de lancer des tâches qui seront...

1

jipicy, le 13 jan 2009 à 15:12:50

Salut,

Il semblerait qu'il manque un ";;" dans le dernier "case" :

9) echo "Mauvais choix."
continue
;;
10) echo "bye, bye..."
;; <<<<==== 
esac
done 
;-))
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

2

mourad.ounough, le 13 jan 2009 à 15:18:49

Bonjour

merci à toi ,mais jai réctifier jai une autre erreur :

./test.sh
./test.sh: syntax error at line 119: `end of file' unexpected



merci en avance

Répondre à mourad.ounough

3

jipicy, le 13 jan 2009 à 15:24:27

Ton script il s'exécute sur une machine Windows ou Linux ?
Il a été créé sur quel système ?
Affiche la sortie de la commande :

cat -A test.sh
;-))
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

4

mourad.ounough, le 13 jan 2009 à 15:27:40

Bonjour

usage: cat [-benrstuv] [-|file] ...

je suis sous linux (serveur hp)

merci

Répondre à mourad.ounough

5

jipicy, le 13 jan 2009 à 15:33:14

Alors affiche (c'est un ELLE minuscule) :

sed -n l test.sh
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

6

mourad.ounough, le 13 jan 2009 à 15:36:22

Bonjour

jai le messahe :

sed -n l test.sh
#!/bin/sh \
\
$
\
\
$
list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 bl\
p203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201 bll301 bll\
401 bll501 blf101 blf201 blf301 blf401 blf501" $
\
\
$
while true \
\
$
do \
\
$
clear \
\
$
echo "veuilez choisir votre choix : \
\
$
1) vM-irifier last restart server & cpu status \
\
$
2) vM-irifier la defense \
\
$
3) vM-irifier recovery \
\
$
4) last restart sep \
\
$
5) sortir" \
\
$
\
\
$
echo "Votre choix : \\c" \
\
$
read choice \
\
$
case "$choice" in \
\
$
1 ) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '\
{print "============>>"$3" " " "$4}'` && echo "$firstcol $secondcol" \
$
done \
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
2 ) \
\
$
for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| aw\
k '{print"=====================>>"$1 " "$2}' \
$
done \
\
$
\
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
3) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $host ls /in/local/var/recovery | wc -l \
\
$
done \
\
$
\
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
4) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|sn\
ap|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7}' \
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
5) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $ ls -ltr /in/smp/smf/platform/archdb \
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
\
\
$
6) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $ipcs -sam | grep 0x5000 \
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
\
\
$
7) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|\
pfmddup \
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
\
\
$
8) \
\
$
9) ) echo "Mauvais choix." \
\
$
10) echo "bye, bye..." \
\
$
break \
\
$
;; \
\
$
esac \
\
$
done \
\
$
bls101 linus>

Répondre à mourad.ounough

7

jipicy, le 13 jan 2009 à 15:50:05

Je ne sais pas pourquoi, mais j'ai l'impression que ton fichier est rempli de caractères (non imprimables) bizarres ;-(

Il faudrait que tu fasses un copier/coller du code de ton 1er post et que tu crées un nouveau script exécutable à partir de ça...

Peux-tu mettre ton fichier original (sans passer par Windows) quelque part (cjoint par exemple) qu'on puisse le récupérer et voir ce qui cloche ?
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

8

mourad.ounough, le 13 jan 2009 à 16:13:08

Bonjour

le fichier est sur le lien :http://cjoint.com/?bnq7KxdtBt

merci boucoup en avance

Répondre à mourad.ounough

9

jipicy, le 13 jan 2009 à 16:22:10

Voilà à quoi ressemble ton fichier avec "cat -A" :

#!/bin/sh ^M$
^M$
list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 blp203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201 ^M$
bll301 bll401 bll501 blf101 blf201 blf301 blf401 blf501" ^M$
^M$
while true ^M$
do ^M$
clear ^M$
echo "veuilez choisir votre choix : ^M$
1) vM-irifier last restart server & cpu status ^M$
2) vM-irifier la defense ^M$
3) vM-irifier recovery ^M$
4) vM-irifier snap delay ^M$
5) vM-irifier check archilaog ^M$
6) vM-irifier semaphore ^M$
7) vM-irifier cross-config ^M$
8) vM-irifier last restart of SEP ^M$
9) vM-irifier ^M$
10) sortir" ^M$
^M$
echo "Votre choix : c" ^M$
read choice ^M$
case "$choice" in ^M$
1 ) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '{print "============>>"$3" " " "$4}'` && echo "$firstcol $sec ^M$
ondcol" ^M$
done ^M$
sleep 2 ^M$
continue ^M$
;; ^M$
2 ) ^M$
for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| awk '{print"=====================>>"$1 " "$2}' ^M$
done ^M$
^M$
sleep 2 ^M$
continue ^M$
;; ^M$
3) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $host ls /in/local/var/recovery | wc -l ^M$
done ^M$
sleep 2 ^M$
continue ^M$
;; ^M$
4) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|snap|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7 ^M$
}' ^M$
done ^M$
sleep 2 ^M$
continue ^M$
;; ^M$
5) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $ ls -ltr /in/smp/smf/platform/archdb ^M$
done ^M$
sleep 2 ^M$
continue ^M$
;; ^M$
^M$
6) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $ipcs -sam | grep 0x5000 ^M$
^M$
done ^M$
sleep 2 ^M$
continue ^M$
;; ^M$
^M$
7) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|pfmddup ^M$
done ^M$
sleep 2 ^M$
continue ^M$
;; ^M$
^M$
8) for host in $list ^M$
do ^M$
echo "33[1m" ^M$
echo $host" :" ^M$
echo "33[0m" ^M$
rsh $$HOME/.profile > /dev/null 2>&1;/in/local/bin/sepman -l | grep -v "I.N" | grep "nov27" | awk -F"|" '{print $3" "" "" "" "" "$ ^M$
8}' ^M$
done ^M$
continue ^M$
;; ^M$
9) echo "Mauvais choix." ^M$
continue ^M$
;; ^M$
10) echo "bye, bye..." ^M$
  ;;^M$
esac ^M$
done
En fait tous les caractères "^M" sont le signe d'un retour chariot à la sauce Micro$oft ;-((

Il faudrait que tu convertisse ton fichier au format Unix avec la commande dos2unix si elle est présente sur ton système, sinon à la main avec sed : Sed - Conversion retours chariots DOS (CRLF) / UNIX (LF)
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

10

mourad.ounough, le 13 jan 2009 à 16:24:11

Bonjour

tu peut maider à le transformer en format unix step by step

merci à toi mon ami :)

Répondre à mourad.ounough

11

jipicy, le 13 jan 2009 à 16:33:33

Si ton système possède la commande dos2unix :

dos2unix fichier

Sinon, voir le lien pour sed.
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

12

mourad.ounough, le 13 jan 2009 à 16:36:55

Jai le message :

dos2unix test.sh
ksh: dos2unix: not found

avec sed :

sed 's/\x0D$//' test.sh
#!/bin/sh

list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 blp203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201 bll301 bll401 bll501 blf101 blf201 blf301 blf401 blf501"

while true
do
clear
echo "veuilez choisir votre choix :
1) vM-irifier last restart server & cpu status
2) vM-irifier la defense
3) vM-irifier recovery
4) last restart sep
5) sortir"

echo "Votre choix : \c"
read choice
case "$choice" in
1 ) for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '{print "============>>"$3" " " "$4}'` && echo "$firstcol $secondcol"
done
sleep 2
continue
;;
2 )
for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| awk '{print"=====================>>"$1 " "$2}'
done

sleep 2
continue
;;
3) for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $host ls /in/local/var/recovery | wc -l
done

sleep 2
continue
;;
4) for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|snap|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7}'
sleep 2
continue

5) for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $ ls -ltr /in/smp/smf/platform/archdb
sleep 2
continue
;;

6) for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $ipcs -sam | grep 0x5000
sleep 2
continue
;;

7) for host in $list
do
echo "\033[1m"
echo $host" :"
echo "\033[0m"
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|pfmddup
sleep 2
continue
;;

8)
9) ) echo "Mauvais choix."
10) echo "bye, bye..."
break
;;
esac
done

Répondre à mourad.ounough

13

jipicy, le 13 jan 2009 à 16:54:11

Affiche plutôt :

sed 's/\x0D$//' test.sh  | sed -n l
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

14

mourad.ounough, le 13 jan 2009 à 17:39:10

Bonjour

jai ca :
sed 's/\x0D$//' test.sh | sed -n l
#!/bin/sh \
\
$
\
\
$
list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 bl\
p203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201 bll301 bll\
401 bll501 blf101 blf201 blf301 blf401 blf501" $
\
\
$
while true \
\
$
do \
\
$
clear \
\
$
echo "veuilez choisir votre choix : \
\
$
1) vM-irifier last restart server & cpu status \
\
$
2) vM-irifier la defense \
\
$
3) vM-irifier recovery \
\
$
4) last restart sep \
\
$
5) sortir" \
\
$
\
\
$
echo "Votre choix : \\c" \
\
$
read choice \
\
$
case "$choice" in \
\
$
1 ) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '\
{print "============>>"$3" " " "$4}'` && echo "$firstcol $secondcol" \
$
done \
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
2 ) \
\
$
for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| aw\
k '{print"=====================>>"$1 " "$2}' \
$
done \
\
$
\
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
3) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $host ls /in/local/var/recovery | wc -l \
\
$
done \
\
$
\
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
4) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|sn\
ap|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7}' \
$
sleep 2 \
\
$
continue \
\
$
\
\
$
5) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $ ls -ltr /in/smp/smf/platform/archdb \
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
\
\
$
6) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $ipcs -sam | grep 0x5000 \
\
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
\
\
$
7) for host in $list \
\
$
do \
\
$
echo "\\033[1m" \
\
$
echo $host" :" \
\
$
echo "\\033[0m" \
\
$
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|\
pfmddup \
$
sleep 2 \
\
$
continue \
\
$
;; \
\
$
\
\
$
8) \
\
$
9) ) echo "Mauvais choix." \
\
$
10) echo "bye, bye..." \
\
$
break \
\
$
;; \
\
$
esac \
\
$
done $

queque je doit faire

merci à toi

Répondre à mourad.ounough

15

jipicy, le 13 jan 2009 à 17:49:18

Tiens je l'ai converti chez moi et mis sur cjoint, récupères-le et essaie de lancer le script...

Par contre y'a un truc qui me chiffonne, ta variable "liste" c'est normal que les valeurs soient sur 2 lignes ? Il y a un retour à la ligne après la valeur "bll201" ;-\
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

16

mourad.ounough, le 13 jan 2009 à 18:02:14

Bonjour

cat >test.sh
#!/bin/sh

list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 blp203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201
bll301 bll401 bll501 blf101 blf201 blf301 blf401 blf501"

while true
do
clear
echo "veuilez choisir votre choix :
1) vM-irifier last restart server & cpu status
2) vM-irifier la defense
3) vM-irifier recovery
4) vM-irifier snap delay
5) vM-irifier check archilaog
6) vM-irifier semaphore
7) vM-irifier cross-config
8) vM-irifier last restart of SEP
9) vM-irifier
10) sortir"

echo "Votre choix : c"
read choice
case "$choice" in
1 ) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '{print "============>>"$3" " " "$4}'` && echo "$firstcol $sec
ondcol"
done
sleep 2
continue
;;
2 )
for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| awk '{print"=====================>>"$1 " "$2}'
done

sleep 2
continue
;;
3) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $host ls /in/local/var/recovery | wc -l
done
sleep 2
continue
;;
4) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|snap|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7
}'
done
sleep 2
continue
;;
5) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $ ls -ltr /in/smp/smf/platform/archdb
done
sleep 2
continue
;;

6) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $ipcs -sam | grep 0x5000

done
sleep 2
continue
;;

7) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|pfmddup
done
sleep 2
continue
;;

8) for host in $list
do
echo "33[1m"
echo $host" :"
echo "33[0m"
rsh $$HOME/.profile > /dev/null 2>&1;/in/local/bin/sepman -l | grep -v "I.N" | grep "nov27" | awk -F"|" '{print $3" "" "" "" "" "$
8}'
done
continue
;;
9) echo "Mauvais choix."
continue
;;
10) echo "bye, bye..."
;;
esac
done
bls101 linus> ./test.sh
./test.sh: syntax error at line 119: `end of file' unexpected
bls101 linus> chmod +x test.sh
bls101 linus> ./test.sh
./test.sh: syntax error at line 119: `end of file' unexpected


voila ce que jai , ????

Répondre à mourad.ounough

17

jipicy, le 13 jan 2009 à 18:09:20

Essaie de rajouter un saut de ligne (<Entrée>) après le dernier "done" (à la ligne 118) sans grand espoir ;-(
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

18

jipicy, le 13 jan 2009 à 18:32:10

Ah j'oubliais, repasse un coup de "sed -n l test.sh" qu'on soit sur que les caractères bizarres ne sont plus là ;-\
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

19

mourad.ounough, le 14 jan 2009 à 09:18:13

Bonjour

voila :
sed -n l test.sh
#!/bin/sh $
$
list="bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 bl\
p203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201 $
bll301 bll401 bll501 blf101 blf201 blf301 blf401 blf501" $
$
while true $
do $
clear $
echo "veuilez choisir votre choix : $
1) vM-irifier last restart server & cpu status $
2) vM-irifier la defense $
3) vM-irifier recovery $
4) vM-irifier snap delay $
5) vM-irifier check archilaog $
6) vM-irifier semaphore $
7) vM-irifier cross-config $
8) vM-irifier last restart of SEP $
9) vM-irifier $
10) sortir" $
$
echo "Votre choix : c" $
read choice $
case "$choice" in $
1 ) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '{print "=\
===========>>"$3" " " "$4}'` && echo "$firstcol $sec $
ondcol" $
done $
sleep 2 $
continue $
;; $
2 ) $
for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $HOME/.profile; /in/local/bin/sepman -l | grep Defence| awk '{print\
"=====================>>"$1 " "$2}' $
done $
$
sleep 2 $
continue $
;; $
3) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $host ls /in/local/var/recovery | wc -l $
done $
sleep 2 $
continue $
;; $
4) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $HOME/.profile > /dev/null 2>&1;get_snap | grep -vE "Active|the|sna\
p|Delay" | awk '{if ($4>=25) print " "" "" "" "$4" "" "" "$7 $
}' $
done $
sleep 2 $
continue $
;; $
5) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $ ls -ltr /in/smp/smf/platform/archdb $
done $
sleep 2 $
continue $
;; $
$
6) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $ipcs -sam | grep 0x5000 $
$
done $
sleep 2 $
continue $
;; $
$
7) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $HOME/.profile; /in/local/bin/sepman -l | grep -E "dzasdpa|dzaota|p\
fmddup $
done $
sleep 2 $
continue $
;; $
$
8) for host in $list $
do $
echo "33[1m" $
echo $host" :" $
echo "33[0m" $
rsh $$HOME/.profile > /dev/null 2>&1;/in/local/bin/sepman -l | grep -v \
"I.N" | grep "nov27" | awk -F"|" '{print $3" "" "" "" "" "$ $
8}' $
done $
continue $
;; $
9) echo "Mauvais choix." $
continue $
;; $
10) echo "bye, bye..." $
;;$
esac $
done$



merci à toi

Répondre à mourad.ounough

20

jipicy, le 14 jan 2009 à 09:34:40

Tiens récupère ce nouveau script, j'ai rectifié 2/3 choses, notamment un guillemet manquant juste avant un done (c'est d'ailleurs peut être ça qui mettait le boxon) et enlevé quelques sauts de ligne qui n'avaient rien à faire...

Teste ça et dis-moi ,-))
$ man woman
Il n'y a pas de page de manuel pour woman.

Répondre à jipicy

21

 mourad.ounough, le 14 jan 2009 à 12:28:25

Bonjour

voila jai tester voila mon scripts maintenant : http://cjoint.com/?bondh5tKTi

sava pour les autre mais jai un pépin pour 1) jai le message :



Name does not resolve to supplied parameters; neither nodename nor servname were passed. bll401 :
Name does not resolve to supplied parameters; neither nodename nor servname were passed. bll501 :
Name does not resolve to supplied parameters; neither nodename nor servname were passed. blf101 :


normalement jai ca :

cbe
uid=10000(linus) gid=31(in) groups=0(system),26(dba)
Comando to: bls101 bls201 bls102 bls202 blp101 blp201 blp102 blp202 blp103 blp203 blp104 blp204 blp105 blp205 blp106 blp206 bll101 bll201 bll301 bll401 bll501 blf101 blf201 blf301 blf401 blf501
cbe> firstcol=`/usr/sbin/psrinfo` && secondcol=`uptime | awk '{print "============>>"$3" " " "$4}'` && echo "$firstcol $secondcol"
***** BEGIN OF REPORT PF2 date: Wed Jan 14 12:27:35 CET 2009 *****
bls101
--------
0 on-line since 11/25/2007 10:27:58
1 on-line since 08/05/2008 11:56:35
2 on-line since 08/05/2008 11:56:52
3 on-line since 08/05/2008 11:57:01 ============>>416 days,



merci à toi pour votre support mon ami

Répondre à mourad.ounough