This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: $PATH contains dot but unclear where it comes from
- From: Robert Klemme <shortcutter at googlemail dot com>
- To: David Boyce <dsb at boyski dot com>, cygwin <cygwin at cygwin dot com>
- Date: Wed, 19 Feb 2014 09:37:58 +0100
- Subject: Re: $PATH contains dot but unclear where it comes from
- Authentication-results: sourceware.org; auth=none
- References: <CAM9pMnM1=UnbcXRGefXiDVjVXJcVeNej=OGowbwwWBgHeG+MjQ at mail dot gmail dot com> <CAEhDDbCG7i9GdEE1W2UL9egRdcA786u0xmwsKJXBD5HgXh5XcA at mail dot gmail dot com> <CAM9pMnM-_hZkk5+=44aTKrscqYP-qg1Mv=R4w7Jt2gFjd_WP8w at mail dot gmail dot com> <1811171498 dot 20140206155616 at mtu-net dot ru> <CAM9pMnMBpULHt7NTx-eOr8DmLkQFTQwtTmMpDmbA8UQqLpUh7g at mail dot gmail dot com> <CAM9pMnONy0ua43WKt6yFXzaWyjB4XJmmt7XefYOXer3UYgnEEg at mail dot gmail dot com> <CACUHbYP65+7GJpka9OBAkWnJeRonwNDxbXrG7n06n8e76UhR8g at mail dot gmail dot com>
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