The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running a Script in a Remote server ZeroGPX Shell Programming and Scripting 2 03-07-2008 05:07 PM
script hangs when a remote server is down vikas027 Shell Programming and Scripting 6 11-06-2007 09:26 AM
running a script on remote server. whited05 Shell Programming and Scripting 1 10-20-2005 02:07 AM
Connect to a Remote Sybase Server Through Script. Aparna_k82 Windows & DOS: Issues & Discussions 2 06-23-2005 08:26 AM
Script to Test Application Server is running duglover UNIX for Dummies Questions & Answers 0 04-28-2004 06:47 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-26-2005
Registered User
 

Join Date: Feb 2005
Posts: 26
run a application from a remote server via script?

I have a ksh script that does a bunch of things, then runs

telnet server_b

I then manually login, manually run one command (which launches an application with display back to my workstation), then logout at which point the main script takes back over, runs something else, then ends.

Is there anyway to automate the manual parts?
Reply With Quote
Forum Sponsor
  #2  
Old 10-26-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Have you tried a here document?

Code:
telnet somenode<<EOF
username
password
special_command
exit
EOF
Reply With Quote
  #3  
Old 10-26-2005
Registered User
 

Join Date: Feb 2005
Posts: 26
Jim,

What is a here document?

Also, that solution does not work, just tosses me back out to my orig host.
Reply With Quote
  #4  
Old 10-26-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
you should really look into using "expect", but here's a 'poor-man' attempt to do it with the 'pipped' "telnet":
Code:
#!/bin/ksh

host='myHost'
user='anyUserName'
pass='aPassword'

    (
    sleep 3
    print "${user}"
    sleep 1
    print "${pass}"
    sleep 2
    print "ls ~"
    sleep 1
    print "exit"
    sleep 3
    ) | telnet "${host}"

Last edited by vgersh99; 10-26-2005 at 01:19 PM.
Reply With Quote
  #5  
Old 10-26-2005
Registered User
 

Join Date: Feb 2005
Posts: 26
Thanks vgersh99,

Looks somewhat like sendkeys (VBA command). I looked up expect. Looks like I'll need to play with it a lot before getting it to work, but undoubtedly a better approach.

Thanks for the help.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0