On Thu, Sep 27, 2001 at 12:09:00PM +0100, Aherne Peter-pahern02 wrote:
> Actually what I need is
>> if (`userchoice` == "server1")
>> rsh hostname command1 #Then god damn stay in the host
> else
>> rsh hostname command2 #Then god damn stay in the host
OK - here's an answer which nearly works. Create a shell script called
command1 (or whatever) which simply has
#!/bin/sh
real_command1
exec bash -i
I say this nearly works for two reasons:
I tested it on Linux using bash, the default Linux shell. As you say ssh is
not an option, I've a sneaking suspicion you're perhaps using the group for
free help with some other *ix :-) in which case you may not have bash and
you may have to invoke the shell differently.
The remote environment is not set up correctly. The terminal type was not
picked up in my tests, and even when I set the terminal type manually the
arrow keys still did not work. Fixing these trivia is either a) unimportant
or b) left as an exercise for the reader. (BTW bash --login didn't work for
me in case that occured to anyone. bash --login -i did work but was just the
same)
That should put you on the path to righteousness. If you'd like a complete
solution with bells and whistles, please feel free to contact me privately
to arrange some consultancy :-)
Niall
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!