Ho uno script per accedere al server remoto, ma ho provato ad eseguire lo script si è verificato un errore.
logs:
La mia sceneggiatura:
#!/bin/bash
S1=$(ssh -t selvam-odc-shell1 "users | wc -w ")
S2=$(ssh -t selvam-odc-shell2 "users | wc -w ")
S3=$(ssh -t selvam-odc-shell3 "users | wc -w ")
if [ "$S1" -le 100 ];
then
ssh -t selvam-odc-shell1 " bash"
if [ "$S2" -le 100 ];
then
ssh -t selvam-odc-shell2 "bash"
elif [ "$S3" -le 100 ];
then
ssh -t selvam-odc-shell3 "bash"
else
echo " Shell has been more than 100 users.Please try again later
fi
Ma o / p
[user@selvam-odc-sunray2: ~]#./shell.sh
Connection to selvam-odc-shell1 closed.
Connection to selvam-odc-shell2 closed.
Connection to selvam-odc-shell3 closed.
: integer expression expected60
: integer expression expected 29
Aiutatemi a risolvere questo problema.
Grazie MM SELVAM