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


Hi Robert,

On Thu, Feb 6, 2014 at 10:01 AM, Robert Klemme  wrote:
> Hi,
>
> in cygwin64 on Win 7 64 bit I find "." in $PATH:
>
> $ echo "$PATH" | tr : \\n | egrep '^\.$'
> .
>
> However, I was not able to detect where this came from.  It's neither
> in the Windows system environment variables nor in the user
> environment variables - as you can also see on a cmd prompt:

Windows always looks into the current directory when searching for
programs, so '.' is usually not in the Winows version of PATH (which
Cygwin imports).

Almost certainly, the dot was put into the PATH by one of the Bash
initialization files. Here are some off the top of my head (`info
bash` , 6.2 Bash startup files, has the complete list).

/etc/profile
/etc/bash.bashrc
~/.bash_profile
~/.profile
~/.bashrc


You can try running

bash -x --login

This will spew the shell commands being executed while interpreting
the startup scripts (make sure you have a large scroll-back buffer :)
Alternatively

bash -x --login > bash_init.txt 2>&1

then type 'exit' blindly into the terminal (maybe 'tee' would work
better but I don't have access to Cygwin right now).

If you saved to a file, you can grep for PATH and try to identify
which initialization file put the dot in.

HTH,
Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
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]