Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-23-2010, 02:24 AM   #1
Registered: Jun 2007
Posts: 54

Rep: Reputation: 15
command execution

hi all,

I have a shell script which is executable in a folder named build. What i currently do is cd into the build directory from my home folder and do a ./ ... Is there any way i can run this executable from my home directory itself??

Something like ./vaalu/ADK/build/

the path to the make shell script is


Any help would be appreciated.
Thanking you in anticipation


Vishnu Prasad H
Old 08-23-2010, 02:29 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Sure. You can type:

<= You don't need the "."

If you need to do this often enough, you can do any of:

a) edit your .bashrc file and include value/ADK/build in your $PATH
<= that way, you can just type ""


b) Create an alias for "" (for example, "mk")

and, of course,

c) You can always create a desktop shortcut (if you use a GUI)

If you do any of this, you should definitely modify "" to "cd" into the correct directory before it tries to build anything.
Old 08-23-2010, 02:35 AM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
The script may assume you are in the current directory. You could use "pushd ./vaalu/ADK/build" first and the "popd" afterwards. If its something you often, you can use "CTRL-R pushd" to recall it from the bash history, or enter parts of the path, and press TAB for autocompletion.

A script such as
. ./

in your ~/bin/ directory may automate the process for you.

Last edited by jschiwal; 08-23-2010 at 02:37 AM.
Old 08-23-2010, 04:21 AM   #4
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,958

Rep: Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173
As Paul highlighted, be very careful what commands are in your script as if they are using relative paths from where you launch the script it could
get very messy
Old 08-23-2010, 10:06 AM   #5
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198Reputation: 1198
What jschiwal and grail wrote. In this case, where the script is called, suggesting a software build utility, it is not just possible that the utility assumes the correct working directory -- it is very probable because it is such a common build programming technique.


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
command execution time minil Programming 10 08-20-2010 05:59 PM
Only execute 2nd command on successufl execution of 1st command kregec05 Linux - Newbie 3 08-19-2009 11:29 AM
command execution gr8linux Linux - Newbie 14 05-28-2009 03:28 AM
can I check the execution of this command? kushalkoolwal Programming 1 10-21-2005 09:44 PM
command execution leonidas Linux - General 1 09-22-2004 01:29 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 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
Open Source Consulting | Domain Registration