Linux doesn't automatically add current directory to path
If you use the Windows command prompt, it would automatically find applications and libraries in the current working directory. In Linux, this is annoying, you need to type "./[appname]" and "export LD_LIBRARY_PATH=." every time you change to a different directory.
Re: Linux doesn't automatically add current directory to pat
Quote:
Originally Posted by user222
If you use the Windows command prompt, it would automatically find applications and libraries in the current working directory. In Linux, this is annoying, you need to type "./[appname]" and "export LD_LIBRARY_PATH=." every time you change to a different directory.
And I guarantee that if you copy that info from the Winblows command line and try to run it, it will not, nor is it giving you all of the info you think you are getting.
Keep trying, mabe you will learn something yet. :shock:
Re: Linux doesn't automatically add current directory to pat
Quote:
Originally Posted by zeeone
Quote:
Originally Posted by user222
If you use the Windows command prompt, it would automatically find applications and libraries in the current working directory. In Linux, this is annoying, you need to type "./[appname]" and "export LD_LIBRARY_PATH=." every time you change to a different directory.
And I guarantee that if you copy that info from the Winblows command line and try to run it, it will not, nor is it giving you all of the info you think you are getting.
Keep trying, mabe you will learn something yet. :shock:
If you're using the "bash" shell, put "export PATH=[some paths]:." and "export LD_LIBRARY_PATH=." in your ".bashrc" or ".bash_profile" file.
Re: Linux doesn't automatically add current directory to pat
Quote:
Originally Posted by user222
If you use the Windows command prompt, it would automatically find applications and libraries in the current working directory. In Linux, this is annoying, you need to type "./[appname]" and "export LD_LIBRARY_PATH=." every time you change to a different directory.
No, it is not made to be "annoying". It is for security good practice.
Imaging you write a script and call it "ls" then save it in a folder where you have access, let's say /tmp. Now if you get your admin to run "ls" in /tmp as root and have "." in the PATH, that will run your script instead of running the real "ls". This way you can do some nasty trick. This is why "." is not in your PATH.
Now if you don't need this kind of security, then modify your PATH.
Re: Linux doesn't automatically add current directory to pat
Quote:
Originally Posted by user222
If you use the Windows command prompt, it would automatically find applications and libraries in the current working directory. In Linux, this is annoying, you need to type "./[appname]" and "export LD_LIBRARY_PATH=." every time you change to a different directory.
For the "export LD_LIBRARY_PATH=.", you don't need to type it every time you change to a different directory. You only need to type it once for the current shell. If you start a new shell, you'll need to type it again, unless it's automatically executed when the shell starts.
Re: Linux doesn't automatically add current directory to pat
Quote:
Originally Posted by jeickal
No, it is not made to be "annoying". It is for security good practice.
Imaging you write a script and call it "ls" then save it in a folder where you have access, let's say /tmp. Now if you get your admin to run "ls" in /tmp as root and have "." in the PATH, that will run your script instead of running the real "ls". This way you can do some nasty trick. This is why "." is not in your PATH.
Now if you don't need this kind of security, then modify your PATH.
I agree it's actually a good thing, since there's no way to disable it in DOS and Windows.
Re: Linux doesn't automatically add current directory to pat
Quote:
Originally Posted by user222
I agree it's actually a good thing, since there's no way to disable it in DOS and Windows.
Unless you exploit a bug/security hole, there is no way to do anything Microsoft don't want you to do with Dos & Windows :evil:
Isn't it one of the reasons we're using Linux? :wink:
Nothing's better than true freedom :D