The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Simple CSH script nimo Shell Programming and Scripting 3 09-25-2009 05:32 PM
Simple script chvs2000 UNIX for Dummies Questions & Answers 4 12-30-2008 12:39 PM
Simple Script mojoman Shell Programming and Scripting 6 05-12-2008 03:55 AM
Simple Script xplod4202 Shell Programming and Scripting 11 04-27-2008 10:20 PM
Need a simple script Relykk Shell Programming and Scripting 10 03-16-2004 10:18 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 2 Weeks Ago
ramky79 ramky79 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 56
Simple SSH script

I have several unix servers,
I need to logon to each server and find out if an id exists on that server.
I need a simple script for this, i have come up with the following script, but I cannot bring the output of a child process on the remote server.
HTML Code:
for i in `cat SERVER_LIST`
do
ssh $i <<EOF>> server_idchk4user_$sysid.log
id $1
if [ $? = 0 ];then
echo "I have a login on $i server"
else
echo "I do not have a login on $i server"
exit
EOF
done


Any help s greatly appreciated.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0