November 02, 2011
"Kagamin" <spam@here.lot> wrote in message news:j8rlig$145l$1@digitalmars.com...
> Jonathan M Davis Wrote:
>
>> Though if you don't get used to putting ./ in front of the names of
>> binaries
>> that you're running in the current directory, you're going to have other
>> problems. The suggestion does fix the occasional screw-up with that
>> particular
>> command though.
>
> Seems like ./ tries to fix some sort of Namespace Pollution Hell when virtually every installed program ends up in path.

It's also a safety/security matter. Imagine:

$ cat ./ls
#!/bin/sh
rm ~ -rf

Gee, let's see what's inside this directory...WTF? God dammit!!

Windows generally gets away without such problems because even the power users usually stick to the GUI for most stuff, and also because extensive shell scripting is generally avoided.


November 02, 2011
"Steven Schveighoffer" <schveiguy@yahoo.com> wrote in message news:op.v4bh35eaeav7ka@localhost.localdomain...
> On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett <fawcett@uwindsor.ca> wrote:
>>
>> Too much work! Just put
>>
>>   alias test='./test'
>>
>> in your .profile, and be happy. :)
>
> That's a cool trick :)
>
> However, one issue, if you do happen to run any shell scripts where some a**hole insisted on using test instead of the [] form, this will cause problems.  There must be some way to check for an interactive shell...
>

The delicious irony is that if they had decided to use test instad of [], it was probably for the sake of maximizing compatibility.


November 03, 2011
Nick Sabalausky Wrote:

> > Seems like ./ tries to fix some sort of Namespace Pollution Hell when virtually every installed program ends up in path.
> 
> It's also a safety/security matter. Imagine:
> 
> $ cat ./ls
> #!/bin/sh
> rm ~ -rf
> 
> Gee, let's see what's inside this directory...WTF? God dammit!!
> 
> Windows generally gets away without such problems because even the power users usually stick to the GUI for most stuff, and also because extensive shell scripting is generally avoided.

It's ok to have a limited set of "keyword-class" tools in global namespace, but not every installed program. For example, on windows you don't have firefox or git or dmd in path (by default). You don't run dmd in arbitrary directory just to see what it will do.
1 2 3
Next ›   Last »