Aide scripts

mourad.ounough Messages postés 28 Statut Membre -  
mourad.ounough Messages postés 28 Statut Membre -
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

8 réponses

jipicy Messages postés 41342 Statut Modérateur 4 896
 
Salut,

Il semblerait qu'il manque un ";;" dans le dernier "case" :
9) echo "Mauvais choix."
continue
;;
10) echo "bye, bye..."
;; <<<<==== 
esac
done 
;-))
0
mourad.ounough Messages postés 28 Statut Membre
 
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
0
jipicy Messages postés 41342 Statut Modérateur 4 896
 
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
;-))
0
mourad.ounough Messages postés 28 Statut Membre
 
bonjour

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

je suis sous linux (serveur hp)

merci
0
jipicy Messages postés 41342 Statut Modérateur 4 896 > mourad.ounough Messages postés 28 Statut Membre
 
Alors affiche (c'est un ELLE minuscule) :
sed -n l test.sh
0
mourad.ounough Messages postés 28 Statut Membre > jipicy Messages postés 41342 Statut Modérateur
 
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>
0
jipicy Messages postés 41342 Statut Modérateur 4 896 > mourad.ounough Messages postés 28 Statut Membre
 
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 ?
0
mourad.ounough Messages postés 28 Statut Membre > jipicy Messages postés 41342 Statut Modérateur
 
bonjour

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

merci boucoup en avance
0
jipicy Messages postés 41342 Statut Modérateur 4 896
 
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)
0
mourad.ounough Messages postés 28 Statut Membre
 
bonjour

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

merci à toi mon ami :)
0
jipicy Messages postés 41342 Statut Modérateur 4 896
 
Si ton système possède la commande dos2unix :

dos2unix fichier

Sinon, voir le lien pour sed.
0
mourad.ounough Messages postés 28 Statut Membre
 
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
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
jipicy Messages postés 41342 Statut Modérateur 4 896
 
Affiche plutôt :
sed 's/\x0D$//' test.sh  | sed -n l
0
mourad.ounough Messages postés 28 Statut Membre
 
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
0
jipicy Messages postés 41342 Statut Modérateur 4 896
 
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" ;-\
0
mourad.ounough Messages postés 28 Statut Membre
 
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 , ????
0
jipicy Messages postés 41342 Statut Modérateur 4 896 > mourad.ounough Messages postés 28 Statut Membre
 
Essaie de rajouter un saut de ligne (<Entrée>) après le dernier "done" (à la ligne 118) sans grand espoir ;-(
0
jipicy Messages postés 41342 Statut Modérateur 4 896 > jipicy Messages postés 41342 Statut Modérateur
 
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à ;-\
0
mourad.ounough Messages postés 28 Statut Membre
 
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
0
jipicy Messages postés 41342 Statut Modérateur 4 896
 
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 ,-))
0
mourad.ounough Messages postés 28 Statut Membre
 
bonjour

voila jai tester voila mon scripts maintenant : https://www.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
0