Re: Incomplete environ when running MinGW apps?

2008-07-15 Thread Pedro Izecksohn
Reference: http://sourceware.org/ml/cygwin/2008-02/msg00181.html Are you sure SHELL was exported to the environment, and not just in the bash shell variable namespace? It is a documentation problem, from man bash: SHELL The full pathname to the shell is kept in this environment variable. It

Re: Incomplete environ when running MinGW apps?

2008-07-15 Thread Christopher Faylor
On Tue, Jul 15, 2008 at 01:27:18AM -0700, Pedro Izecksohn wrote: Reference: http://sourceware.org/ml/cygwin/2008-02/msg00181.html Are you sure SHELL was exported to the environment, and not just in the bash shell variable namespace? It is a documentation problem, from man bash: SHELL The full

Re: Incomplete environ when running MinGW apps?

2008-07-15 Thread Pedro Izecksohn
From: Christopher Faylor I wrote: Reference: http://sourceware.org/ml/cygwin/2008-02/msg00181.html ... SHELL The full pathname to the shell is kept in this environment variable. It may also be read from: http://www.gnu.org/software/bash/manual/bashref.html Why are you responding to

Re: Incomplete environ when running MinGW apps?

2008-07-15 Thread Markus Hoenicka
Quoting Christopher Faylor [EMAIL PROTECTED]: Why are you responding to this email 5+ months after it was sent? Distraction by incoming mails has been recognized as the main reason for low output by programmers. The cure is to switch to batch mode in email processing, like once in 5

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Paul Leder on 2/7/2008 7:19 AM: | Hi - | | I'm having a problem reading bash environment variables when running a | MinGW app on Cygwin's bash. I'm trying this on the MinGW list as well, | but no luck so far. The basic problem is that

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Paul Leder
Hmm. I think you're right; I need to give up looking for a robust way to do this. I think I'll: if( (system(uname) looks sane) (system(cygpath -m /bin/sh) returns success)) use CreateProcess with /bin/sh path returned by cygpath; else use CreateProcess with cmd.exe /c And

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Paul Leder
Dave Korn wrote: Out of curiosity, what's the problem with just using system(...) always? I can't, because I need to redirect child I/O onto a socket, which requires CreateProcess. The Unix code is (relatively) easy, but it's a complete nightmare in Windoze. You have to use pipes as well

RE: Incomplete environ when running MinGW apps?

2008-02-07 Thread Dave Korn
On 07 February 2008 18:25, Paul Leder wrote: Dave Korn wrote: Out of curiosity, what's the problem with just using system(...) always? I can't, because I need to redirect child I/O onto a socket, which requires CreateProcess. The Unix code is (relatively) easy, but it's a complete

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Greg Chicares
On 2008-02-07 16:28Z, Paul Leder wrote: [...] I've written an app which runs on Linux and Windows. Most of the time on Windows, it's probably going to be running on Cygwin/bash. However, there's always going to be someone who runs it in a DOS box. So, my problem is, how do I find out

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Paul Leder
Phil Betts wrote: Just export the variables you want. That's the whole point of the export command. They're not my variables. I've written an app which runs on Linux and Windows. Most of the time on Windows, it's probably going to be running on Cygwin/bash. However, there's always going to

RE: Incomplete environ when running MinGW apps?

2008-02-07 Thread Phil Betts
Paul Leder wrote on Thursday, February 07, 2008 3:31 PM:: Eric Blake wrote: Bash has two variable namespaces - shell variables, and environment variables. Are you sure SHELL was exported to the environment, and not just in the bash shell variable namespace? thanks - I had no idea there

RE: Incomplete environ when running MinGW apps?

2008-02-07 Thread Dave Korn
On 07 February 2008 17:51, Paul Leder wrote: Hmm. I think you're right; I need to give up looking for a robust way to do this. I think I'll: if( (system(uname) looks sane) (system(cygpath -m /bin/sh) returns success)) use CreateProcess with /bin/sh path returned by cygpath;

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Paul Leder
Dave Korn wrote: Out of curiosity, what's the problem with just using popen(...) always? I get the feeling you're working up to telling me something I don't want to hear, but I shall carry on regardless... :) [_]popen is fine if you want to execute a process and either just get its

Incomplete environ when running MinGW apps?

2008-02-07 Thread Paul Leder
Hi - I'm having a problem reading bash environment variables when running a MinGW app on Cygwin's bash. I'm trying this on the MinGW list as well, but no luck so far. The basic problem is that SHELL is not visible in environ (or from getenv) on the app, even thought the program was launched

Re: Incomplete environ when running MinGW apps?

2008-02-07 Thread Paul Leder
Eric Blake wrote: Bash has two variable namespaces - shell variables, and environment variables. Are you sure SHELL was exported to the environment, and not just in the bash shell variable namespace? thanks - I had no idea there were 2 variable namespaces. It looks like everything I can see