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 Neary dave.neary at palamon.ie
Thu Sep 27 14:28:44 IST 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.

How about the following idea (and this is a rough, off the top of my
head type solution - there's probably heavy lifting left to do here) -
set the script as the .cshrc, and then do this in the .cshrc:

if(We're not on the right server)
    serverSelect()
else
    doStuff()


serverSelect()
{
#   do the menu stuff, get your answer, and then...
    rcp .cshrc username at servername:~/.cshrc
    rlogin -l username servername

#   Maybe it's cheating a bit...
}

Dave.

-- 
David Neary,               E-Mail dave.neary at palamon.ie
Palamon Technologies Ltd.  Phone +353-1-634-5059




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