Script directory in path
I add my script directory to my path, but still get this when I run a script from any other directory.
Quote:
Quote:
|
Andy:
Did you source the file you used to alter the path? Your shell won't know about the edit until you do. https://www.linuxquestions.org/quest...#faq_lqwelcome Code:
source /path/to/file Code:
bash -x /path/to/script.sh |
I do not understand "source the file." ?
In my .bashrc export PATH=$PATH:/root/Scripts/ The purpose of adding a dir to the path is to be able to runs scripts from any directory WITHOUT using the full path to it. I guess Linux does it differently than Windows. |
Quote:
Code:
source ~/.bashrc I know what the purpose of the path is on every OS. ;) but since "No such file or directory" doesn't say jack-all about what generated the message...I asked you to test the full path to the script. Is bash spewing "No such file or directory" or is the script? Seems export PATH=$PATH:/root/Scripts/ should be enough. |
Full path to script
Quote:
|
does /root/Scripts/./Findit.sh take parameters?
|
Yes.
Quote:
|
export PATH=/root/Scripts/:$PATH
|
I have that in .bashrc but still get
Quote:
|
don't use the .
Code:
Findit.sh |
Couple of possible issues here, and I think this probably should be in the Linux Software, Linux General, or Programming forums instead of Non-Nix General.
You've place a script in /root/Scripts. Who owns that directory and what permissions does it allow? Findit.sh should be executable permissions, but also should be executable permissions for the user which is attempting to run the script. The two or three things which need to be satisfied are: (EDIT: OK 5 or 6! :))
|
Habitual has it right -the OP is using the relative dir './' to call the program. Leave off the './' before the program name so that the shell searches for the object in the PATH.
|
Quote:
Do not need ./ and less typing too. Rtmistler, All flavors of Puppy run as root. This makes some Linux users cringe, but it's ok if you are safe and cautious. |
woot.
|
Code:
PATH=$PATH:/path/to/dir1; export PATH |
All times are GMT -5. The time now is 06:32 AM. |