Results 1 to 10 of 10
|
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
04-03-2005 #1Linux Newbie
- Join Date
- Oct 2004
- Posts
- 139
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.
-
04-03-2005 #2Linux Enthusiast
- Join Date
- Dec 2004
- Location
- Rockin' in the USA!!!
- Posts
- 603
if you _really_ can't stand this, do the following: ugh...
Code:export PATH=.:$PATH
-
04-04-2005 #3
Re: Linux doesn't automatically add current directory to pat
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.
Originally Posted by user222
Keep trying, mabe you will learn something yet.
Research, research, research before you walk the plank.
Registered Linux User #398829
-
04-04-2005 #4Linux Newbie
- Join Date
- Oct 2004
- Posts
- 139
Re: Linux doesn't automatically add current directory to pat
If you're using the "bash" shell, put "export PATH=[some paths]:." and "export LD_LIBRARY_PATH=." in your ".bashrc" or ".bash_profile" file.
Originally Posted by zeeone
-
04-04-2005 #5
Re: Linux doesn't automatically add current directory to pat
No, it is not made to be "annoying". It is for security good practice.
Originally Posted by user222
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.
-
04-04-2005 #6Linux Newbie
- Join Date
- Oct 2004
- Posts
- 139
Re: Linux doesn't automatically add current directory to pat
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.
Originally Posted by user222
-
04-04-2005 #7Linux Newbie
- Join Date
- Oct 2004
- Posts
- 139
Re: Linux doesn't automatically add current directory to pat
I agree it's actually a good thing, since there's no way to disable it in DOS and Windows.
Originally Posted by jeickal
-
04-04-2005 #8
Re: Linux doesn't automatically add current directory to pat
Unless you exploit a bug/security hole, there is no way to do anything Microsoft don't want you to do with Dos & Windows
Originally Posted by user222
Isn't it one of the reasons we're using Linux?
Nothing's better than true freedom
-
04-05-2005 #9Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Unless you really want to over-ride a supplied command, it's safer to add the '.' directory to the end of your PATH, not the beginning:
export PATH=$PATH:.
And absolutely do not add it to root's PATH.
Steve
-
04-06-2005 #10
Good show folks, I think we have one that is learning what the word " CHOICE" is about!
Research, research, research before you walk the plank.
Registered Linux User #398829


Reply With Quote