LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 02-28-2005, 06:43 AM   #1
blackbox
LQ Newbie
 
Registered: Feb 2005
Posts: 1

Rep: Reputation: 0
BASH text executable


Hi

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.


E.g:


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, 06:49 AM   #2
hw-tph
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:
Code:
if [ -e ~/.bashrc ]
then
    source ~/.bashrc
fi
Håkan

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 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