LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Running command after login.

[ILUG] Running command after login.

Dave Airlie airlied at csn.ul.ie
Thu Sep 27 13:40:59 IST 2001


the problem with rsh is it doesn't do tty assigning for remote
commands... only for remote logins if I remember correctly...

my own take is to find an ENV variable that rsh transfers to the other
side and then feck with the /etc/csh.login /etc/profile to check is the
ENV set and if it is execute the script.. you might be using an
environment variable that isn't supposed to do this like DISPLAY or someat
but a bit of overloading doesn't affect much :-)

Dave.


On Thu, 27 Sep 2001, Aherne Peter-pahern02 wrote:

> Ok, try to reply to both Niall and Dave in this one.
>
> Dave first.
>
> Exactely what I want to do:
>
> Write a script, first thing the script does is check what machine they are on, if they are on the right one do something, if not ask them to choose from a list of servers, they choose, they get logged onto that machine, now I want to run the same script again automagically, this time they will be on the right machine so it will pass the server choice thing and work away.
>
> So thats what I want to do in case that gives people any more ideas.
>
> As for Niall.
>
> This could do the job for me, but since the machines are down at the mo I'll have to wait to test it out.
>
> >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
>
> </Grins Sheepishly> Lets just pretend I'm using a Linux box with no ssh then the problem is kinda platform independant. And your right, I dont have bash either - really I have a very minimal Linux installation :-)
>
> Thanks for all the help guys, gives me more options to play with.
> Peter.
>
> --
> Peter Aherne, Software Engineer, Motorola Ireland Ltd.
> http://www.skynet.ie/~peter - peter at linux.ie
> Ph: +353 21 4511234 Mobile: +353 87 2246834
>
>
> -----Original Message-----
> From: Niall O Broin [mailto:niall at linux.ie]
> Sent: 27 September 2001 12:49
> To: 'ilug at linux.ie'
> Subject: Re: [ILUG] Running command after login.
>
>
> 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
>
>

-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / airlied at skynet.ie
pam_smb / Linux DecStation / Linux VAX / ILUG person






More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell