LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-14-2005, 02:42 PM   #1
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Rep: Reputation: 32
Question bash applet


Is it possible to make an applet (shortcut you just have to click) that starts bash and "types" ssh user@server.com, so I don't have to type the whole thing over and over again? How do you create it?

Thanks
 
Old 09-14-2005, 02:57 PM   #2
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Posts: 264

Rep: Reputation: 30
What about a bash-script either sat on your desktop or on your panel? That's all it has to be...
 
Old 09-15-2005, 02:13 PM   #3
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
That would be fine with me, either of them... but I don't know how to write a shell script that starts bash with that line "ssh user @ server. com"...
 
Old 09-16-2005, 08:58 AM   #4
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Posts: 264

Rep: Reputation: 30
I'll look into this evening and write it if you still need the help
 
Old 09-16-2005, 09:38 AM   #5
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
thx, that'd be great
 
Old 09-17-2005, 02:32 PM   #6
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Posts: 264

Rep: Reputation: 30
Sorry about the delay, I had things to do last night, but this is really easy as I've just tested it out.

First of all, in your home directory, create a directory called /bin or /scripts to keep all of your custom bash scripts in. This makes everything much easier in the future as you expand your knowledge of bash.

Open gedit or any other text editor, and write the following:

Code:
#!/bin/bash

# ssh shortcut to custom server

ssh user@www.server.com

#EOF
Obviously replace the user@www.server.com with your info.

My apologies if I'm teaching you to suck eggs here, but i'll briefly explain this.

The first line denotes that this is a bash script, and this a rough standard for most scripting languages.

The second line is simply a brief description of the script - pointless here but useful on longer scripts. Anything on the same line and after a # is a comment and is not part of the code.

The 3rd line is the one you want - this is simply the command exactly how you would type it on the command line.

The fourth line is a further comment which just denotes End Of File. Strictly speaking only the first and 3rd lines are required.


OK, now save it as say "connection.sh" where connection is whatever you want to call it. The .sh denotes that it's a script.

In GNOME right click on the file, goto Properties > Permissions and change the permissions so the owner can read write and execute. At the command line you would do this with: chmod 770 filename

Now that you can execute it, we need to create a custom launcher.

Right click on a GNOME panel and choose "Add to Panel..." then "Custom Application Launcher"

Choose a name for it, give a description in the comments field if you like, but in the command simply type "/home/user/scripts/connection.sh" or whatever the path is to your file. Click "Run in Terminal" and choose an icon, click OK, and that's it!

Now you should have a new icon, and when clicked (or double clicked) it should open up a terminal to your desired ssh connection.

Hope that helped.


(btw, the signature just below this is a bash script to check my fridge for beer and order some if it's empty... )

Last edited by morrolan; 09-17-2005 at 02:36 PM.
 
Old 09-18-2005, 07:05 AM   #7
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
thanks that REALLY was helpful!!!
 
Old 09-19-2005, 04:02 AM   #8
morrolan
Member
 
Registered: Sep 2003
Location: Manchester UK
Posts: 264

Rep: Reputation: 30
I'm glad I could help!
 
  


Reply


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
need some help with a java applet gulo General 1 07-14-2005 02:52 PM
Java applet error: "Applet Failed" nro Programming 1 08-28-2004 05:52 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
RHN Applet opafire Fedora 6 12-01-2003 05:32 AM
Applet <name> Notinited kaine Linux - Software 6 08-15-2003 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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