| Author |
Linux shortcut commands
|
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Guys,
I have a couple of programs that I start using the terminal. But everytime when I open the terminal, I had to kind of cd into the directory where the shell script resides and then start it. Is there a shortcut command that I can use which would cd into the directory and start the program for me? I guess I have to write my own shell script for this or is there any Linux command that can do this for me?
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
|
Why cd at all? Just type the full path to the shell script. Or put its folder on the PATH.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Bear Bibeault wrote:Why cd at all? Just type the full path to the shell script. Or put its folder on the PATH.
That typing is what I want to avoid and make it elegant by having a couple of shell scrips that would do that for me. What I would like to know is if there is a Linux command that I can create for such shortcuts?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
|
Use the PATH, Luke
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Good idea. I however do not want those additional programs to be in my PATH. I'm going to create a couple of shell scripts to do this for me.
Thanks for your suggestions!
|
 |
Peter Rooke
Ranch Hand
Joined: Oct 21, 2004
Posts: 779
|
|
The alias command should help. You can set these up in your startup scripts. For the bash shell, edit your .bash_profile in the home directory.
To setup an alias called startadmin:
alias startadmin='nohup /bea/domains/domain_name_x/bin/startWebLogic.sh >/bea/domains/domain_name_x/servers/domain_admin/logs/domain_admin_startup.log 2>&1 &'
|
Regards Pete
|
 |
 |
|
|
subject: Linux shortcut commands
|
|
|