LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2003, 06:43 PM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
Shortcut file


there is a file that you can put shortcuts in, so if i go to RUN, and type a command it executes a file... for example, i installed eclipse, and i want to be able to type eclips in the console and it will execute eclipse.... does anyone know that file??
 
Old 10-23-2003, 07:02 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
You can add aliases to ~/.bash_profile, ~/.bashrc, and so on. You can create a ~/bin that contains shell scripts and put it on your path. Things like that. But typing 'eclipse' in the console should laucnh 'eclipse' if it's on your path. If it's stuck in an eclipse subdirectory, you might make a symlink that *is* on your path which points to it.
 
Old 10-24-2003, 03:05 AM   #3
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Original Poster
Rep: Reputation: 30
ok, im new to linux.... so lets say my eclipse sun script is /home/atlantis/Documents/eclipse/.eclipse .... how would i make it so if i typed eclipse in the console, it will run eclipse?
 
Old 10-24-2003, 04:44 AM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Well, see I don't what eclipse is, so this could be difficult. It's a programmer's IDE? And /home/atlantis/Documents/eclipse/.eclipse is the shell script that launches it? Or is that a script/program you wrote with it that you want to run? Well, what I did for similar stuff is be in my home directory, do 'mkdir bin', edit .bash_profile (which is symlinked to .bashrc, since I don't care whether I have a login shell or not) to include

PATH="$PATH:~/bin";export PATH

and then make a symlink in ~/bin to all those out of the way files I need to execute, as well as dumping any shell scripts and my little 'hello worlds' in C and awk in there. So if it's a directory you keep programs in that you're writing, you could just add that to the path. Or, most directly, you could cd to the directory and do './.eclipse' or write a shell scriptlet that performs those two actions if you get tired of typing both.

But if I'm misundertanding what you're trying to do, that may not be helpful. And, as I say, TMTOWTDI.

Last edited by slakmagik; 10-24-2003 at 04:46 AM.
 
Old 10-24-2003, 01:50 PM   #5
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Original Poster
Rep: Reputation: 30
./eclipse is the file that came with eclipse to run it
 
Old 10-24-2003, 09:00 PM   #6
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Well, that's what I was thinking, but it being in Documents threw me. So, yeah:

PATH="$PATH:~/Documents/eclipse";export PATH

in .bashstartupfile would do it, or

alias eclipse='~/Documents/eclipse/.eclipse'

(also in your bash startup) or do

ln -s ~/Documents/eclipse/.eclipse /usr/local/bin/eclipse

And so on - just depends on whether a longer path, stray symlinks, or an aversion to aliases is more of an issue, I guess. Don't know what else I can say. If you're looking for a file for shortcuts, it sounds like an alias would be what you'd want.

Now, since you're talking about a Run box, I guess you're using KDE or Gnome or something. Why an actual shortcut in the sense of a desktop icon or menu item wouldn't suit you, I don't know but, as far as I know, the run box is just a one shot interface to your shell - I don't think there's any special Gnome or KDE file for that. Maybe somebody who uses one of those could say.
 
Old 10-24-2003, 09:39 PM   #7
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Original Poster
Rep: Reputation: 30
i tried doing the ln -s and it said that eclipse couldnt find a file that was supposed to be in the directory that it was installed in...
 
Old 10-24-2003, 10:07 PM   #8
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
How about
ln -s /home/atlantis/Documents/eclipse/.eclipse /usr/local/bin/eclipse

You have to be root to do this (use the command su to become root)
 
Old 10-24-2003, 10:33 PM   #9
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Oops. Sorry about that. Thanks, quatsch.

Like I say, if you do have a ~/bin, you can do it as user and link in ~/bin - the 'ln' command's not restricted - just write permission to /usr/local/bin is restricted. You have write permission in /home.
 
  


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
where is gnome keyboard shortcut file? susje Linux - General 5 12-25-2009 08:03 PM
how to make a shortcut file in WINE DhenZidane Linux - Newbie 4 10-04-2005 08:00 PM
KDE: Making a Shortcut to a File? Kamex Linux - Software 3 03-30-2005 10:49 PM
KDE key shortcut file atheist Linux - Software 1 05-23-2004 01:14 PM
Shortcut-key problem on KDE (file permissions related) MisterAvan Linux - Newbie 0 07-06-2003 10:27 AM


All times are GMT -5. The time now is 01:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration