What's wrong with having '.' in your $PATH?
faqs.org
faqs.org
For example, on my mac, there are > 2000 binaries available in my PATH. I cannot possibly know all of them, and if one binary uses another underlying binary I don't know about, it can be quite surprising. I don't think it worths it (using ./ + tab for completion is faster than typing the name of the binary anyway)
Also, note that for often-used self compiled binaries, $HOME/bin is a good place. On some systems, $HOME/bin is already added to the user's PATH by default, so you just have to create that directory and put your favorite binaries or shell scripts into that.
The root account is still useful to prevent ssp from accidentally screwing things up, but as a security measure it's pointless in many cases.
If you've had . in your PATH for a long time and never had a problem with it, it's either because there isn't anything else open that makes this an issue (fairly likely), or that no one's really bothered to exploit your system (also fairly likely)
When I see someone coding with a non-us layout I smell the humble inexperience and nod with compassion. The difference between layouts can be astonishing if you only bang a lots of []{}|/\?-=+_-*()@#$'s. For some reason, computer languages are full of those.
I use the us layout all the time except when I have to write something in my native language and need the umlauts more easily. I remember the killing pain of trying to write code in it until I realized I can just turn on the US keyboard. Luckily, that was before my career...
For the same reason I don't use a custom .vimrc file; it's great when on a configured system but causes problems elsewhere.
Having to worry about there being an "ls" in the current dir is about the same as worrying whether or not there are multiple versions of _any_ binary elsewhere in $PATH.
This is a non-issue.
wget http://some.dudes.site/cool_stuff.tar
untar cool_stuff.tar
cd cool_stuff
ls
Oh but whoopsy-doodle, cool_stuff comes with this extra-cool script: cat ./ls
#!/usr/bin/my-favorite-scripting-language
do_sneaky_things :with => AllOfYourStuff && `rm -rf /` ls cool_stuff
before changing directories, it's less of an issue. And `rm -fr /' is less likely than `rm -fr ~', since most people don't need root access to call `ls'.But still, I don't add '.' to my path because the only time I directly reference files in my current directory, it's because of a Zsh suffix alias.
This will usually happen when a login script puts the value of a variable in your $PATH without actually checking whether that variable has any contents.
If you're a clumsy typist, even if you don't have '.' in your $PATH, you might still type ./sl (instead of your intended ./ls) and get the "rogue" program to run.
I've had . in my $PATH for the last couple of decades. It's fine.
3) (not directly related to your post) explicitly using ./ allows for more accurate completions, almost always making up for the two extra characters typed (particularly since ./ is so easy to type with a single motion).
Or at least I wouldn't. I just grepped through (several years of) my bash logs and I have never once in my life typed "./ls", accidentally or otherwise. I consider this strong evidence.
The problem isn't really about having . in your path, but the old mistake of having it AS THE FIRST THING in your path, before your shell has a chance to reach its usual important locations (/bin, /sbin, /usr/bin, /usr/local/bin and so forth). Put it as the last thing in your path variable and you won't be having any problems worth mentioning (hey, even the OpenBSD guys finally went with this solution after having banished . entirely for years).