best way to ensure './' is at beginning of sys.path?

Jussi Piitulainen jussi.piitulainen at helsinki.fi
Sat Feb 4 04:27:01 EST 2017


Wildman writes:

[snip]

> If anyone is interested the correct way is to add this to
> /etc/profile (at the bottom):
>
> PATH=$PATH:./
> export PATH

Out of interest, can you think of a corresponding way that a mere user
can remove the dot from their $PATH after some presumably well-meaning
system administrator has put it there?

Is there any simple shell command for it? One that works whether the dot
is at the start, in the middle, or at the end, and with or without the
slash, and whether it's there more than once or not at all.

And I'd like it to be as short and simple as PATH="$PATH:.", please.



More information about the Python-list mailing list