![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Have you tried a here document?
Code:
telnet somenode<<EOF username password special_command exit EOF |
|
#3
|
|||
|
|||
|
Jim,
What is a here document? Also, that solution does not work, just tosses me back out to my orig host. |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |