PDA

View Full Version : Shell Script Executable Question



JPMaximilian
June 26th, 2006, 03:30 AM
How do I make Script executable without using ./my_script? In other words so that I only need type my_script from any folder to run scripts that are in my home folder? I did:

sudo gedit .bash_profile

in my home folder and added:

export PATH=$PATH:~

But when I run echo $PATH, my home folder is still not listed. Thanks for any help ya'll might provide.

scxtt
June 26th, 2006, 03:36 AM
put it in .bashrc ...


PATH=$PATH:~was all i needed ... .bashrc is loaded anytime bash is invoked ...

putting:


# set PATH so it includes user's ~ (if it exists)
if [ -d ~/ ] ; then
PATH="${PATH}":~
fiin .bash_profile also works ...

JPMaximilian
June 26th, 2006, 04:33 AM
Cool, that worked. Thanks.