Executing commands in local directory without directory path
I am a little confused. Why must I include the directory path when executing bacwi?
Code:
pi@raspberrypi ~/bacnet-stack-0-8-0/bin $ pwd |
What is the output of this command?
Code:
echo $PATH jdk |
The current working directory is not normally part of the search path for comands, try
Code:
echo $PATH Code:
./bacwi |
@Keith Hedger
Great minds think alike. ;) jdk |
Quote:
|
Code:
pi@raspberrypi ~/bacnet-stack-0-8-0/bin $ echo $PATH |
Don't forget to mark the thread SOLVED
|
1 Attachment(s)
Glad to have been of service. As a service to others please mark this thread as [SOLVED]. You can use the Thread Tools menu located above your first post in this thread (see the attachment).
jdk |
:)Great minds still think alike. What did you have for breakfast?
jdk |
Quote:
|
No current directory in $PATH
There is a very good reason why there is no current directory (.) in your $PATH
It is a potential security risk - although it would, of course, be comforting for people coming from windows to see that they could f**k up their system in a way that they were used to. Back in the eighties it was common (normal?) to prepend $PATH with current directory. However this creates a security hole in that an executable file, in your home directory, with the same name as a system program could do all manner of nasty things. So we moved to putting the current directory at the end of the $PATH. Then it was realised that there could still be problems, so for the past 20 - 25 years the advice has always been not to include current (or home) directory in $PATH - but to use ./ to reinforce that you consciously wish to use a local file. Nothing wrong with having a bin directory within your home directory - in fact it's a good idea - but put it at the end of your $PATH |
All times are GMT -5. The time now is 05:55 PM. |