Click to See Complete Forum and Search --> : Bash scripts from anywhere


stoatontoast
05-17-2000, 05:06 AM
A nice easy one for someone...

Is there a file that can be modified so that bash scripts I've written can be executed from any directory?

Thanks

Strike
05-17-2000, 05:14 AM
What are you asking? Do you want it so that you don't have to type in the full path? Well, if you add . to your $PATH, then as long as you are in that directory you don't have to type ./ execute it. As far as making every bash script you edit executable universally, the only thing I can think of would be to make it so that every time you create a shell script that you also create a symlink to it in some place in the $PATH (like /usr/bin for example).

linuxduh
12-12-2000, 11:53 PM
hi
i dont understand by adding a path to bash.
suppose default is
PATH=$PATH
export PATH

iw ould like to add path and environtment
hwo do i do that suppose the directory fo rthe compiler is /compiler/bin . what would it look like? how abt the environment setting?

thanks

tnordloh
12-13-2000, 11:41 AM
You just have to consistently save your bash scripts in the same directory. Then add that particular directory to your path variable.

YaRness
12-13-2000, 03:57 PM
i'd do exactly that. i had a ~/bin directory that i stuck in my path

------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/
------------------

jemfinch
12-14-2000, 01:16 AM
export PATH=`find / -type d | xargs perl -e 'print join ":", @ARGV'`

That would be stupid, but it'll make you path every directory on the computer http://www.linuxnewbie.org/ubb/smile.gif

Jeremy