Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-11-17 Thread Andrey Repin
Greetings, Francis Litterio!

>>> I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in
>>> registry, not in a cmd shell. I expect it needs to be seen when the
>>> first cygwin1.dll instance starts, so you would need to stop all
>>> cygwin processes and servers, just like you do when you run the cygwin
>>> setup, for this to be effective.
>>
>> Ouch, no!  Environment variables are handed down from parent to child
>> process.  On all systems, be it Windows, Cygwin, Linux or whatever.
>> There's *no* other magic involved.  It's just a bunch of strings
>> inherited from the parent process.

> Yes, but Explorer induces confusion as follows (seen on Windows 7):

> 1. Open a Command Prompt from the Start Menu (so cmd.exe is a child of 
> explorer.exe), and enter "echo %foobar%".  See output "%foobar%". 
> Environment variable foobar is not set.

> 2. Enter "setx foobar 99" to add foobar to the persistent environment 
> variables in the Registry.

> 3. Enter "echo %foobar%" again in the same Command Prompt.  Still see 
> "%foobar%".  No change in that process's environment, as expected.

> 4. Launch a new Command Prompt from the Start Menu.  Enter "echo 
> %foobar%".  See "99".  Clearly, Explorer updated it's environment from 
> the Registry and passed the change to the new child process.

> This leads people to think that environment variables stored in the 
> Registry are special, when in fact it's Explorer's doing.

It's actually OS and setx's doing. setx sends a signal on OS level, that the
environment has been updated, and programs subscribed to it (like Explorer)
update their environment accordingly.
Predictable, this behavior is not limited to Explorer. F.e. Far Manager do that.


-- 
With best regards,
Andrey Repin
Friday, November 18, 2016 02:36:52

Sorry for my terrible english...


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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-11-17 Thread Corinna Vinschen
On Nov 17 12:11, Vince Rice wrote:
> > On Nov 17, 2016, at 12:04 PM, Francis Litterio  wrote:
> > 
> > On 9/8/2016 8:07 AM, Corinna Vinschen wrote:
> >> On Sep  5 10:36, Doug Henderson wrote:
> > 
> >>> I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in
> >>> registry, not in a cmd shell. I expect it needs to be seen when the
> >>> first cygwin1.dll instance starts, so you would need to stop all
> >>> cygwin processes and servers, just like you do when you run the cygwin
> >>> setup, for this to be effective.
> >> 
> >> Ouch, no!  Environment variables are handed down from parent to child
> >> process.  On all systems, be it Windows, Cygwin, Linux or whatever.
> >> There's *no* other magic involved.  It's just a bunch of strings
> >> inherited from the parent process.
> > 
> > Yes, but Explorer induces confusion as follows (seen on Windows 7):
> > 
> > 1. Open a Command Prompt from the Start Menu (so cmd.exe is a child of 
> > explorer.exe), and enter "echo %foobar%".  See output "%foobar%". 
> > Environment variable foobar is not set.
> > 
> > 2. Enter "setx foobar 99" to add foobar to the persistent environment 
> > variables in the Registry.
> > 
> > 3. Enter "echo %foobar%" again in the same Command Prompt.  Still see 
> > "%foobar%".  No change in that process's environment, as expected.
> > 
> > 4. Launch a new Command Prompt from the Start Menu.  Enter "echo %foobar%". 
> >  See "99".  Clearly, Explorer updated it's environment from the Registry 
> > and passed the change to the new child process.
> > 
> > This leads people to think that environment variables stored in the 
> > Registry are special, when in fact it's Explorer's doing.
> 
> None of which has anything to do with needing to re-start cygwin,
> which was Corinna's point.  And, for the record, Explorer doesn't
> induce any confusion at all. A new process gets its environment when
> it starts. Pretty simple to understand.

Well, Francis raises a good point.  The question is of course this:

If Explorer is a process as any other process (and it is), then when you
change the system env, how is it that Explorer notices it and
starts child processes with the changed env?

Under normal inheritence rules this *is* puzzeling.

The solution: Windows GUI applications receive a message in the Windows
Message Queue notifing them of the fact that the system env has been
changed.  If the GUI app cares for this, and Explorer does, the app can
then re-read the system env and refresh its own env with the new data.

This explains how processes started from Explorer *after* changing the
system env immediatly see the changes.


HTH,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


signature.asc
Description: PGP signature


Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-11-17 Thread Vince Rice
> On Nov 17, 2016, at 12:04 PM, Francis Litterio  wrote:
> 
> On 9/8/2016 8:07 AM, Corinna Vinschen wrote:
>> On Sep  5 10:36, Doug Henderson wrote:
> 
>>> I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in
>>> registry, not in a cmd shell. I expect it needs to be seen when the
>>> first cygwin1.dll instance starts, so you would need to stop all
>>> cygwin processes and servers, just like you do when you run the cygwin
>>> setup, for this to be effective.
>> 
>> Ouch, no!  Environment variables are handed down from parent to child
>> process.  On all systems, be it Windows, Cygwin, Linux or whatever.
>> There's *no* other magic involved.  It's just a bunch of strings
>> inherited from the parent process.
> 
> Yes, but Explorer induces confusion as follows (seen on Windows 7):
> 
> 1. Open a Command Prompt from the Start Menu (so cmd.exe is a child of 
> explorer.exe), and enter "echo %foobar%".  See output "%foobar%". Environment 
> variable foobar is not set.
> 
> 2. Enter "setx foobar 99" to add foobar to the persistent environment 
> variables in the Registry.
> 
> 3. Enter "echo %foobar%" again in the same Command Prompt.  Still see 
> "%foobar%".  No change in that process's environment, as expected.
> 
> 4. Launch a new Command Prompt from the Start Menu.  Enter "echo %foobar%".  
> See "99".  Clearly, Explorer updated it's environment from the Registry and 
> passed the change to the new child process.
> 
> This leads people to think that environment variables stored in the Registry 
> are special, when in fact it's Explorer's doing.

None of which has anything to do with needing to re-start cygwin, which was 
Corinna's point.
And, for the record, Explorer doesn't induce any confusion at all. A new 
process gets its environment when it starts. Pretty simple to understand.


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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-11-17 Thread Francis Litterio

On 9/8/2016 8:07 AM, Corinna Vinschen wrote:

On Sep  5 10:36, Doug Henderson wrote:



I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in
registry, not in a cmd shell. I expect it needs to be seen when the
first cygwin1.dll instance starts, so you would need to stop all
cygwin processes and servers, just like you do when you run the cygwin
setup, for this to be effective.


Ouch, no!  Environment variables are handed down from parent to child
process.  On all systems, be it Windows, Cygwin, Linux or whatever.
There's *no* other magic involved.  It's just a bunch of strings
inherited from the parent process.


Yes, but Explorer induces confusion as follows (seen on Windows 7):

1. Open a Command Prompt from the Start Menu (so cmd.exe is a child of 
explorer.exe), and enter "echo %foobar%".  See output "%foobar%". 
Environment variable foobar is not set.


2. Enter "setx foobar 99" to add foobar to the persistent environment 
variables in the Registry.


3. Enter "echo %foobar%" again in the same Command Prompt.  Still see 
"%foobar%".  No change in that process's environment, as expected.


4. Launch a new Command Prompt from the Start Menu.  Enter "echo 
%foobar%".  See "99".  Clearly, Explorer updated it's environment from 
the Registry and passed the change to the new child process.


This leads people to think that environment variables stored in the 
Registry are special, when in fact it's Explorer's doing.

--
Fran



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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-09-08 Thread Corinna Vinschen
On Sep  5 10:36, Doug Henderson wrote:
> On 5 September 2016 at 10:04, Jim Reisert AD1C  wrote:
> > On Sun, Sep 4, 2016 at 10:07 PM, Doug Henderson wrote:
> >
> >> Note that CYGWIN_NOWINPATH is still undocumented, except in the email
> >> archives. See, e.g.
> >>
> >> https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com
> >>
> >> CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
> >> email archive.
> >
> > CYGWIN_NOWINPATH is not working for me.
> >
> > CYGWIN_NT-10.0-WOW AD1C 2.6.0(0.304/5/3) 2016-08-31 14:27 i686 Cygwin
> >
> > d:\>printenv | grep CYG
> > CYGWIN=nodosfilewarning
> > CYGWIN_NOWINPATH=1
> >
> > When I start bash, I still get my full Windows path as part of the
> > bash path.  Am I missing something?
> >
> > I have neither a ~/.login or ~/.profile, only a ~/.bashrc
> 
> I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in
> registry, not in a cmd shell. I expect it needs to be seen when the
> first cygwin1.dll instance starts, so you would need to stop all
> cygwin processes and servers, just like you do when you run the cygwin
> setup, for this to be effective.

Ouch, no!  Environment variables are handed down from parent to child
process.  On all systems, be it Windows, Cygwin, Linux or whatever.
There's *no* other magic involved.  It's just a bunch of strings
inherited from the parent process.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


signature.asc
Description: PGP signature


Re: /etc/profile: avoid multiple /usr/bin in PATH

2016-09-05 Thread Achim Gratz
Vince Rice writes:
>> It's documented right in /etc/profile for the moment.
>
> Well, “documented” is a little strong. “Used” is more accurate. There
> are no comments as to what it is or what it’s used for, at least in my
> /etc/profile (last updated in June).

In case it wasn't clear, I was talking about the test version.

https://sourceware.org/git/?p=cygwin-apps/base-files.git;a=blob;f=etc/defaults/etc/profile


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2016-09-05 Thread Vince Rice
>> Note that CYGWIN_NOWINPATH is still undocumented, except in the email
>> archives. See, e.g.
>> 
>>https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com
>> 
>> CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
>> email archive.
> 
> It's documented right in /etc/profile for the moment.

Well, “documented” is a little strong. “Used” is more accurate. There are no 
comments as to what it is or what it’s used for, at least in my /etc/profile 
(last updated in June).


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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2016-09-05 Thread Achim Gratz
Doug Henderson writes:
> Please make sure that this version of cygwin.bat will work correctly
> when CYGWIN_NOWINPATH=1 is set in the windows environment.

So test the test version and tell me if it still works for you?

> Note that CYGWIN_NOWINPATH is still undocumented, except in the email
> archives. See, e.g.
>
> https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com
>
> CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
> email archive.

It's documented right in /etc/profile for the moment.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-09-05 Thread Achim Gratz
Doug Henderson writes:
[…]
> BTW: I think cygwin1.dll stores the original windows path in the
> exported ORIGINAL_PATH variable. I am running Windows 7 Home Premium
> on an laptop.

No, this is purely done in /etc/profile, cygwin1.dll has nothing to do
with it.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-09-05 Thread Achim Gratz
Jim Reisert AD1C writes:
> CYGWIN_NOWINPATH is not working for me.
>
> CYGWIN_NT-10.0-WOW AD1C 2.6.0(0.304/5/3) 2016-08-31 14:27 i686 Cygwin
>
> d:\>printenv | grep CYG
> CYGWIN=nodosfilewarning
> CYGWIN_NOWINPATH=1
>
> When I start bash, I still get my full Windows path as part of the
> bash path.  Am I missing something?

Most likely.  This setting is used in /etc/profile and it seems you
start bash in a way that doesn't source it.  Your first shell should
really be a login shell.  See 'man bash', section invocation.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-09-05 Thread Jim Reisert AD1C
I now see what's wrong.  'ORIGINAL_PATH' in my shell environment was
so long, I missed the very short 'PATH'.  So it is working just fine.

-- 
Jim Reisert AD1C, , http://www.ad1c.us

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



Re: CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-09-05 Thread Doug Henderson
On 5 September 2016 at 10:04, Jim Reisert AD1C  wrote:
> On Sun, Sep 4, 2016 at 10:07 PM, Doug Henderson wrote:
>
>> Note that CYGWIN_NOWINPATH is still undocumented, except in the email
>> archives. See, e.g.
>>
>> https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com
>>
>> CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
>> email archive.
>
> CYGWIN_NOWINPATH is not working for me.
>
> CYGWIN_NT-10.0-WOW AD1C 2.6.0(0.304/5/3) 2016-08-31 14:27 i686 Cygwin
>
> d:\>printenv | grep CYG
> CYGWIN=nodosfilewarning
> CYGWIN_NOWINPATH=1
>
> When I start bash, I still get my full Windows path as part of the
> bash path.  Am I missing something?
>
> I have neither a ~/.login or ~/.profile, only a ~/.bashrc

I set CYGWIN_NOWINPATH=1 in my user environment variables, i.e. in
registry, not in a cmd shell. I expect it needs to be seen when the
first cygwin1.dll instance starts, so you would need to stop all
cygwin processes and servers, just like you do when you run the cygwin
setup, for this to be effective.

It works for me in both my x86_64 and x86 cygwin installs. I start
bash from mintty using the desktop shortcut created by setup (or a
copy of it), I have CYGWIN=error_start=d:\cygwin64\bin\dumper.exe, I
know this is the wrong dumper for my 32bit install, but I do almost
all my work in the 64 bit install, that's not a big deal for me.

BTW: I think cygwin1.dll stores the original windows path in the
exported ORIGINAL_PATH variable. I am running Windows 7 Home Premium
on an laptop.

$ uname -a
CYGWIN_NT-6.1 Rover 2.6.0(0.304/5/3) 2016-08-31 14:32 x86_64 Cygwin


HTH
Doug



-- 
Doug Henderson, Calgary, Alberta, Canada

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



CYGWIN_NOWINPATH (was Re: /etc/profile: avoid multiple /usr/bin in PATH)

2016-09-05 Thread Jim Reisert AD1C
On Sun, Sep 4, 2016 at 10:07 PM, Doug Henderson wrote:

> Note that CYGWIN_NOWINPATH is still undocumented, except in the email
> archives. See, e.g.
>
> https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com
>
> CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
> email archive.

CYGWIN_NOWINPATH is not working for me.

CYGWIN_NT-10.0-WOW AD1C 2.6.0(0.304/5/3) 2016-08-31 14:27 i686 Cygwin

d:\>printenv | grep CYG
CYGWIN=nodosfilewarning
CYGWIN_NOWINPATH=1

When I start bash, I still get my full Windows path as part of the
bash path.  Am I missing something?

I have neither a ~/.login or ~/.profile, only a ~/.bashrc

-- 
Jim Reisert AD1C, , http://www.ad1c.us


cygcheck.out
Description: Binary data
--
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

Re: /etc/profile: avoid multiple /usr/bin in PATH

2016-09-04 Thread Doug Henderson
On 4 September 2016 at 05:32, Achim Gratz wrote:
> Helmut Karlowski writes:
>> I set C:/cygwin/usr/bin in my windows-environment. Now /etc/profile
>> always adds /usr/bin to PATH resulting in /usr/bin being twice in my
>> cygwin-PATH.
>>
>> The attached patch fixes this.
>
> I've added the option to just use the already set-up PATH variable from
> Windows for this use case.  Set CYGWIN_USEWINPATH before starting up.
>

Please make sure that this version of cygwin.bat will work correctly
when CYGWIN_NOWINPATH=1 is set in the windows environment.

I use this to isolate my cygwin environment from random windows stuff.
When I need to execute windows executables, I wrap the call in a
script or alias that makes just enough of the window's path available
to let it work.

This makes it much safer when running multiple cygwins, intentionally
for 32bit and 64bit, or unintentionally as when running windows apps
that include a cygwin.dll, e.g. GitHub for Windows. Also it avoids
accidentally running non-cygwin versions of *nix programs such as can
happen when you have Gnu for Windows or MSYS in your windows path.

Note that CYGWIN_NOWINPATH is still undocumented, except in the email
archives. See, e.g.

https://www.google.ca/search?q=CYGWIN_NOWINPATH+site:cygwin.com

CYGWIN_USEWINPATH is also undocumented, except in a non-cygwin.com
email archive.

Thanks,
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2016-09-04 Thread Achim Gratz
Helmut Karlowski writes:
> I set C:/cygwin/usr/bin in my windows-environment. Now /etc/profile
> always adds /usr/bin to PATH resulting in /usr/bin being twice in my
> cygwin-PATH.
>
> The attached patch fixes this.

I've added the option to just use the already set-up PATH variable from
Windows for this use case.  Set CYGWIN_USEWINPATH before starting up.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2015-12-08 Thread Achim Gratz
Helmut Karlowski writes:
> I set C:/cygwin/usr/bin in my windows-environment. Now /etc/profile
> always adds /usr/bin to PATH resulting in /usr/bin being twice in my
> cygwin-PATH.
>
> The attached patch fixes this.

I tend to reject this patch.  The purpose of the default profile is to
put those two paths in front, while with your patch they could end up
anywhere.  If you think that's OK for you, then you can already do that,
but I don't think that's a good default.

> It also sets SHELL if not yet set and avoids a call of hostname.

Can you tell me in which circumstances this happens and why this is a
problem?  SHELL is supposed to be the user preference, so I don't think
/etc/profile should try to second-guess it.

The second fork to hostname can indeed be removed.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2015-12-08 Thread Helmut Karlowski

Am 08.12.2015, 22:21 Uhr, schrieb Achim Gratz:


Helmut Karlowski writes:

Can you tell me in which circumstances this happens and why this is a
problem?  SHELL is supposed to be the user preference, so I don't think
/etc/profile should try to second-guess it.


/etc/profile is run before ~/.profile, and if that does not set SHELL
there will be none.


Yes, but why is this a problem?  Note that bash will set it anyway if
not present.


There must have been one once, I don't remember. And I don't use bash:

881/etc$bash --version
aKSH v0.0.1, Dec  7 2015 (cygwin-1.7.35(0.287/5/3))

(selfmade).

-Helmut


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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2015-12-08 Thread Helmut Karlowski

Am 08.12.2015, 22:31 Uhr, schrieb Helmut Karlowski:


Yes, but why is this a problem?  Note that bash will set it anyway if
not present.


All shells set it only when run as login-shell.


Wrong: Only bash gives it a value - ksh and dash export SHELL with no  
value if none present. And IMHO SHELL should not be /bin/bash by default.


-Helmut

--

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2015-12-08 Thread Helmut Karlowski

Am 08.12.2015, 22:01 Uhr, schrieb Achim Gratz:


Helmut Karlowski writes:

I set C:/cygwin/usr/bin in my windows-environment. Now /etc/profile
always adds /usr/bin to PATH resulting in /usr/bin being twice in my
cygwin-PATH.

The attached patch fixes this.


I tend to reject this patch.  The purpose of the default profile is to
put those two paths in front, while with your patch they could end up
anywhere.  If you think that's OK for you, then you can already do that,


Not if they have not been present in the windows-path before. I personally  
want to keep the order I have in my windows-path, but tastes may differ.  
But the actual reason for me to change profile was that I had /usr/bin  
twice in my cygwin-path. That can be avoided with the original profile if  
the user also sets CYGWIN_NOWINPATH to something in the  
windows-environment, which I escaped me before, and then I would also have  
to set /usr/local/bin in windows. I find this overcomplicated for the user.


To force /usr/bin first in PATH would be doable of course.


but I don't think that's a good default.


It also sets SHELL if not yet set and avoids a call of hostname.


Can you tell me in which circumstances this happens and why this is a
problem?  SHELL is supposed to be the user preference, so I don't think
/etc/profile should try to second-guess it.


/etc/profile is run before ~/.profile, and if that does not set SHELL  
there will be none.


-Helmut

--

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2015-12-08 Thread Achim Gratz
Helmut Karlowski writes:
>> Can you tell me in which circumstances this happens and why this is a
>> problem?  SHELL is supposed to be the user preference, so I don't think
>> /etc/profile should try to second-guess it.
>
> /etc/profile is run before ~/.profile, and if that does not set SHELL
> there will be none.

Yes, but why is this a problem?  Note that bash will set it anyway if
not present.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

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



Re: /etc/profile: avoid multiple /usr/bin in PATH

2015-12-08 Thread Helmut Karlowski

Am 08.12.2015, 22:26 Uhr, schrieb Helmut Karlowski:


Am 08.12.2015, 22:21 Uhr, schrieb Achim Gratz:


Helmut Karlowski writes:

Can you tell me in which circumstances this happens and why this is a
problem?  SHELL is supposed to be the user preference, so I don't  
think

/etc/profile should try to second-guess it.


/etc/profile is run before ~/.profile, and if that does not set SHELL
there will be none.


Yes, but why is this a problem?  Note that bash will set it anyway if
not present.


All shells set it only when run as login-shell.

-Helmut


--

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



/etc/profile: avoid multiple /usr/bin in PATH

2015-12-06 Thread Helmut Karlowski

Hello,

I set C:/cygwin/usr/bin in my windows-environment. Now /etc/profile always  
adds /usr/bin to PATH resulting in /usr/bin being twice in my cygwin-PATH.


The attached patch fixes this.

It also sets SHELL if not yet set and avoids a call of hostname.


Maybe the maintainer takes a look.

-Helmut
--

profile.diff
Description: Binary data
--
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