[ale] Remote Shell Question
Michael B. Trausch
fd0man at gmail.com
Wed Jan 3 12:53:12 EST 2007
On Tue, 2007-01-02 at 23:34 -0500, Vikram Nanda wrote:
> Hi,
>
> I have a shell script on Unix box A. I want to execute it on another
> Unix box B from the box A. The restriction is that the script file
> cannot physically land (or copied) on B. Is there any way this could
> be accomplished through rsh/rexec ?
This sounds like a silly restriction that I had when I was working with
boxes at AT&T... I wanted to write scripts to automate silly trivial
tasks that I had to do on a daily basis, but they wouldn't permit those
scripts from so much as residing in my networked $HOME because they
would be "modifications to the platform...".
I got around it by writing the script and saving it on my own
workstation, and when I needed to use it, using a generic script that
used telnet to pipe the script into the shell on the other end, and then
display the results on my tty locally, or redirect to a file using
regular shell redirection and the like.
I don't have the script that I used anymore, but I remember that I had
to use () to run things in a subshell and then pipe them into telnet,
with a series of commands to do the login, and then move the script over
to run before disconnecting. It would be something along the lines of:
(
sleep 1
echo $USER
sleep 1
echo $PWD
sleep 1
IFS='
'
for line in $SHELL_SCRIPT; do echo "$line"; sleep 1; done
echo "exit"
) | telnet $HOST
That should get you started... hope this helps.
-- Mike
--
Michael B. Trausch
fd0man at gmail.com
Phone: (404) 592-5746
Jabber IM:
fd0man at gmail.com
fd0man at livejournal.com
Demand Freedom! Use open and free protocols, standards, and software!
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the Ale
mailing list