Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Error with script for ssh

Shell Programming and Scripting


Tags
solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 08-13-2017   -   Original Discussion by sam_bd
sam_bd sam_bd is offline
Registered User
 
Join Date: May 2011
Last Activity: 20 November 2017, 8:10 AM EST
Posts: 72
Thanks: 20
Thanked 1 Time in 1 Post
Thank you vbe, MadeInGermany for your responses.
vbe: yes i'll keep that in mind not to use keywords.
MadeInGermany: i did
Code:
type ssh

and got
Code:
ssh is /usr/bin/ssh

. I ran the script without using the one suggested by you. What i'm seeing is 4 banners of HP UX and then the error message as i've posted above. So looks like it's logging into all the 4 servers mentioned in the
Code:
serverlist.txt

but unable to get command output. However i'll try with your suggested script. But i need to understand it. Linux

---------- Post updated at 08:08 AM ---------- Previous update was at 07:59 AM ----------

Hi MadeInGermany: just tried with your suggested script. I'm getting 4 HP-UX banners (because i've mentioned only 4 servers in the server list) but not seeing the error as mentioned above. Also not seeing the hostname and home directory in the output.
Sponsored Links
    #9  
Old Unix and Linux 08-14-2017   -   Original Discussion by sam_bd
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 21 November 2017, 3:14 AM EST
Location: Simplicity
Posts: 3,826
Thanks: 318
Thanked 1,282 Times in 1,160 Posts
The output is redirected to $OUTPUTLIST i.e. the file output.txt

Code:
cat output.txt

The Following User Says Thank You to MadeInGermany For This Useful Post:
sam_bd (08-20-2017)
Sponsored Links
    #10  
Old Unix and Linux 08-20-2017   -   Original Discussion by sam_bd
sam_bd sam_bd is offline
Registered User
 
Join Date: May 2011
Last Activity: 20 November 2017, 8:10 AM EST
Posts: 72
Thanks: 20
Thanked 1 Time in 1 Post
MadeInGermany: Thanks. I'm getting output in output.txt. I totally forgot about it. In the code i included

Code:
done < ${SERVERLIST} > ${OUTPUTLIST} 2> /dev/null

which's suppressing the HP UX banners & the error mesg.
Thanks once again.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Calling shell script within awk script throws error Sudhakar333 Shell Programming and Scripting 10 05-01-2013 01:04 PM
Re: Script Error [syntax error at line] anudeepkumar123 UNIX for Dummies Questions & Answers 3 08-15-2011 04:54 PM
How to grep sql error in shell script and exit the script? allinshell99 Shell Programming and Scripting 2 05-27-2010 10:06 PM
Error opening script file - location error starcraftbud Windows & DOS: Issues & Discussions 9 02-17-2010 05:56 PM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 12:16 PM



All times are GMT -4. The time now is 06:09 AM.