Re: [PATCHES] psql \! WIN32 cleanup

Lists: pgsql-hackers-win32pgsql-patches
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: psql \! WIN32 cleanup
Date: 2004-11-06 04:29:44
Message-ID: 200411060429.iA64Ti412489@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

The attached applied patch tests for COMSPEC in the right place and
supplies a reasonable shell default on Win32.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 1.1 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: psql \! WIN32 cleanup
Date: 2004-11-06 05:30:55
Message-ID: 26227.1099719055@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> The attached applied patch tests for COMSPEC in the right place and
> supplies a reasonable shell default on Win32.

> + #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"

Is it really a good idea to assume that the Windows installation is on
drive C: ?

(This is an honest question, not a rhetorical one. I dunno whether
inserting the C: is better than leaving it off. I can think of cases
where either way will break, but I'm unsure what's most likely in
practice.)

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [PATCHES] psql \! WIN32 cleanup
Date: 2004-11-06 05:49:56
Message-ID: 200411060549.iA65nuo29918@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > The attached applied patch tests for COMSPEC in the right place and
> > supplies a reasonable shell default on Win32.
>
> > + #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"
>
> Is it really a good idea to assume that the Windows installation is on
> drive C: ?
>
> (This is an honest question, not a rhetorical one. I dunno whether
> inserting the C: is better than leaving it off. I can think of cases
> where either way will break, but I'm unsure what's most likely in
> practice.)

Not sure. Should we just do "/windows/system32/cmd.exe" and leave off
the C:? The previous default was "/bin/sh" and that certainly will not
work on Win32.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: John A Meinel <john(at)johnmeinel(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [PATCHES] psql \! WIN32 cleanup
Date: 2004-11-06 06:10:49
Message-ID: 418C6AE9.5060300@johnmeinel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
>
>>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>
>>>The attached applied patch tests for COMSPEC in the right place and
>>>supplies a reasonable shell default on Win32.
>>
>>>+ #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"
>>
>>Is it really a good idea to assume that the Windows installation is on
>>drive C: ?
>>
>>(This is an honest question, not a rhetorical one. I dunno whether
>>inserting the C: is better than leaving it off. I can think of cases
>>where either way will break, but I'm unsure what's most likely in
>>practice.)
>
>
> Not sure. Should we just do "/windows/system32/cmd.exe" and leave off
> the C:? The previous default was "/bin/sh" and that certainly will not
> work on Win32.
>

Do you need to supply the full path to the executable? Because if it is
in the system PATH, then it should be found, and you can just do:

#define DEFAULT_SHELL "cmd.exe"

Or, if you allow environment variables, then something like:

#define DEFAULT_SHELL "$WINDIR/system32/cmd.exe"

is probably the way to go.

John
=:->


From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: psql \! WIN32 cleanup
Date: 2004-11-06 09:01:46
Message-ID: 418C92FA.4000908@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers-win32 pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
>
>>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>
>>>The attached applied patch tests for COMSPEC in the right place and
>>>supplies a reasonable shell default on Win32.
>>
>>>+ #define DEFAULT_SHELL "c:/windows/system32/cmd.exe"
>>
>>Is it really a good idea to assume that the Windows installation is on
>>drive C: ?
>>
>>(This is an honest question, not a rhetorical one. I dunno whether
>>inserting the C: is better than leaving it off. I can think of cases
>>where either way will break, but I'm unsure what's most likely in
>>practice.)
>
>
> Not sure. Should we just do "/windows/system32/cmd.exe" and leave off
> the C:? The previous default was "/bin/sh" and that certainly will not
> work on Win32.

I think another path to try if COMSPEC is not defined is:

%SystemRoot%/system32/cmd.exe

Regards
Gaetano Mendola