Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-12-2005, 09:54 AM   #1
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Rep: Reputation: 30
Quick Challange for shell scripters!

Hi all

I've a quick challenge for all the shell scripters out there. I'm no good with shell scripting, and I'm sure you guys should be able to produce a quick and elegant solution to my problem...

My boss uses ssh sometimes to access a few servers from his mac. Not a very experienced terminal user, he gets a little lost with ssh on the terminal because of all the options.

Most of the time, he's accessing one of our servers, and just needs to pass the username, ip, and password to ssh.

We could do with a little script so that whenever we type #myssh we get two prompts:
Control can then pass to ssh for entering the password and all other commands.

How elegant can you make it?
Old 09-12-2005, 10:02 AM   #2
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,144

Rep: Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886
this should do it:


echo ip:
read ip
#echo ip = $ip

echo user:
read user
#echo user = $user

ssh -l $user $ip
Old 09-12-2005, 10:13 AM   #3
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Original Poster
Rep: Reputation: 30
great! gotta love *nix.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Challange to all webwolf70 General 0 09-29-2005 07:36 PM
Quick way to send mail from shell? tobycatlin Linux - General 2 04-27-2005 06:27 AM
Quick Shell Question youssefe2k Linux - Software 2 04-10-2005 09:47 PM
Brain challange : Shell Variable xanthium Programming 5 02-07-2004 11:00 AM
I need a quick shell script. 360 Programming 3 03-22-2002 04:44 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration