1820271 Members
3426 Online
109622 Solutions
New Discussion

Re: Script help needed

 
sanwin
Frequent Advisor

Script help needed

Hi,
I need to write a script which will login to all servers(hpunix, linux, solaris) and get the login message and shell prompt and also the output for the commands like uptime etc.

Can anyone help me regarding this.


I tried like this:

for i in $SERVER
do
ssh -t $i >>/tmp/logfile <<-ENDTAG
hostname
uptime
exit
ENDTAG
done



But this gives only the login message and not the prompt for the hpux and for linux, itis just throwing the output.

And it is having some unknown characters like ^E ^B etc i mean it is related pseudo terminal i think.

Please help me out.

thanks!!


regards,
sanwin.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: Script help needed

It would be better to continue your questions in your other thread, rather than start a new thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1287664

>not the prompt for the hp-ux and for linux, it is just throwing the output.

What's wrong with that? The output is all you need if you aren't logging in interactively.