This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: $PATH contains dot but unclear where it comes from


On Tue, Feb 18, 2014 at 7:32 PM, David Boyce <dsb@boyski.com> wrote:
>> On Thu, Feb 6, 2014 at 4:32 PM, Robert Klemme
>> <shortcutter@googlemail.com> wrote:
>>
>>> Can anybody make sense of that?  I can share the complete log with
>>> individuals if it helps.
>>
>> Nobody?
>
> I haven't read the whole backthread, but you do understand that a
> missing entry is translated to ".", right? E.g.
> "/usr/bin:$foo:/usr/local/bin" will include a dot if foo is undefined.
> Here's the relevant section from the man page:
>
> "A zero-length (null) directory name in the value of PATH indicates
> the current directory. A null directory name may appear as two
> adjacent colons, or as an initial or trailing colon."

I was not aware of this.  Thank you!

> I'd be surprised if this isn't at the root of the issue.

Let's see: on Windows command prompt

path >path.txt

Now let's look at the contents.  No additional leading or trailing
semi colon.  But:

$ egrep -o ';{2,}' path.txt
;;
;;

Aha!  If we look at the positions

$ egrep -o '.{15};{2,}.{15}' path.txt
OWERSHELL\V1.0\;;C:\PROGRAM FILE
ftware\syswow64;;C:\Program File

we find they do not match the position and mount of dots in the Cygwin
$PATH: it's only present at the end:

mon:/cygdrive/c/Users/rklemme/Applications/SysinternalsSuite:.

OK, now: I removed empty path entries from Windows PATH (system and
user), rebooted and they are gone.

But, the Cygwin shell's $PATH still has the dot at the same position
(i.e. at the end).

I assume there must be some internal mechanism in Cygwin which causes
this but at the moment I am out of ideas where to look further.  Does
anybody else have an idea?  Is there maybe some automatism which adds
the dot because on Windows systems the shell always also looks in the
current directory?

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]