Re: Avoiding to type "./" before command if in same directory ?




Stephen Adams wrote:
bumpy@xxxxxxxx (Carsten Eishold) writes:

If I want to execute a command whose program is in my current working
directory I have always to type "./" before the actual command. E.g.

/etc/init.d> smb start
bash: smb: command not found
/etc/init.d> ./smb start
Starting Samba SMB daemon

Is there a way of prepending automatically the ./ to every command if
necessary?

Sure. You can add "." to your $PATH. But, my strong advice is DO NOT DO
THIS. It's a security risk.

In the above case, you could add '/etc/init.d' to your path, but you're
going to run into conflicting command names. One example:

/usr/sbin/postfix
/etc/init.d/postfix

Depending on where you put /etc/init.d in your $PATH, you would have very
different behavior, and serious potential for problems.

Just type the ./ - it's the safest way to go, from every angle. It's
what every admin I know does...


Carsten Eishold is dead - otherwise he'd reply by now - .....what a
dump! ;-)

.



Relevant Pages