Latest LQ Deal: Latest LQ Deals
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 02-28-2005, 07:43 AM   #1
LQ Newbie
Registered: Feb 2005
Posts: 1

Rep: Reputation: 0
BASH text executable


How do I make a bash text executable in the terminal in any directory?
In another words, I no longer need to execute a certain program within that directory where the program resides.


I can simply type the executable text in any directory like:

"user@ttyp2[Desktop]$ egpgrm

Instead of executing the program within the directory where the program resides:

"user@ttyp2[home]$ ./egpgrm"

Thanks in advance..
Old 02-28-2005, 07:49 AM   #2
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Type export PATH=$PATH:/home/myself/bin, where /home/myself/bin is the directory which contains the executable you want to be able to run. The environment variable $PATH is a colon-separated list of directories, and by typing the above you append your directory to the list of directories in $PATH (type echo $PATH to see what directories are there).

To always have this set, add that line to your ~/.bashrc and make sure your ~/.bash_profile sources your ~/.bashrc. Add this to your ~/.bash_profile if it's not already there:
if [ -e ~/.bashrc ]
    source ~/.bashrc

Last edited by hw-tph; 02-28-2005 at 07:51 AM.


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
bash: split text file iluvatar Programming 4 08-22-2005 09:58 AM
[bash] cutting text with sed Erhnam Programming 3 02-11-2005 05:31 AM
Colorize Text in Bash? Beppe83 Linux - Software 1 06-08-2004 04:31 AM
Dealing with text in bash scripts Skute Programming 6 03-16-2004 03:58 AM
Text input in bash? pk21 Programming 12 06-05-2003 10:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:09 AM.

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