Re: 'which' command does not expand '~' in path (base-files update needed)

2004-09-29 Thread John Morrison
> cgf wrote: >> Dropping the quotes from the original example will just cause >> everything to work correctly everywhere. >> >> John Morrison, would you mind doing this, please? > > Hi cgf, > > As I said, I wasn't following this thread for a while, so here are the > changes I'll do (I'm also trying

RE: "which" command does not expand "~" in path (base-files update needed)

2004-09-29 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Corinna Vinschen > Sent: 29 September 2004 12:30 > On Sep 29 12:19, Dave Korn wrote: > > > QUOTING > > > [...] > > > Enclosing characters in double quotes preserves the lit- > > > eral value of all characters with

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-29 Thread Corinna Vinschen
On Sep 29 12:19, Dave Korn wrote: > > QUOTING > > [...] > > Enclosing characters in double quotes preserves the lit- > > eral value of all characters within the quotes, with the > > exception of $, `, and \. > > Well, yeh, but, like, y'know, the tilde was _outside

RE: "which" command does not expand "~" in path (base-files update needed)

2004-09-29 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Corinna Vinschen > Sent: 29 September 2004 09:55 > On Sep 28 15:40, Christopher Faylor wrote: > > On Tue, Sep 28, 2004 at 06:49:44PM +0100, Dave Korn wrote: > > > Wonder if this is a real bug then, or if I've misread > the shell pars

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-29 Thread Corinna Vinschen
On Sep 28 15:40, Christopher Faylor wrote: > On Tue, Sep 28, 2004 at 06:49:44PM +0100, Dave Korn wrote: > > Wonder if this is a real bug then, or if I've misread the shell parsing rules? > >They are a bit ridiculously complicated and full of exceptions and special > >cases. > > It seems like

Re: 'which' command does not expand '~' in path (base-files update needed)

2004-09-29 Thread John Morrison
cgf wrote: > Dropping the quotes from the original example will just cause > everything to work correctly everywhere. > > John Morrison, would you mind doing this, please? Hi cgf, As I said, I wasn't following this thread for a while, so here are the changes I'll do (I'm also trying to clean the

Re: 'which' command does not expand '~' in path (base-files update needed)

2004-09-28 Thread Errol Smith
At 06:40 AM 29/09/2004, John Morrison wrote: Just my two penny worth; I've just pulled, ./configure[d] and make[d] the GNU which application (it built OOTB). It correctly checks ~/bin. See my original post (http://www.cygwin.com/ml/cygwin/2004-09/msg01383.html) Would it be worth considering using

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Errol Smith
At 05:43 AM 29/09/2004, Brian Ford wrote: > export PATH=~/bin:$PATH How 'bout using a temp, or just plain $HOME as suggested before? Good question, I'd like to know what was wrong with my (first ever cygwin) patch! ;-) Seriously though, is there any advantage to using ~ over $HOME? the bash man

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Errol Smith
At 03:27 AM 29/09/2004, Igor wrote: > Agreed, but aren't we talking about .bash_profile here ;-)? Ugh. Yes. FWIW, /etc/profile does use '~' (in lines 191-195), so the above point is valid anyway (though by chance, rather than by intention)... I notice that it's also full of carriage returns! :-)

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Errol Smith
At 01:31 AM 29/09/2004, Christopher Faylor wrote: > # Set MANPATH so it includes users' private man if it exists > # if [ -d ~/man ]; then >-# MANPATH="~/man:${MANPATH}" >+# MANPATH="${HOME}/man:${MANPATH}" > # fi > > # Set INFOPATH so it includes users' private info if it exists > # if [ -d ~/

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Igor Pechtchanski
On Tue, 28 Sep 2004, Christopher Faylor wrote: > On Tue, Sep 28, 2004 at 03:48:12PM -0400, Igor Pechtchanski wrote: > >On Tue, 28 Sep 2004, Christopher Faylor wrote: > > > >> On Tue, Sep 28, 2004 at 02:43:38PM -0500, Brian Ford wrote: > >> >On Tue, 28 Sep 2004, Christopher Faylor wrote: > >> > > >

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Christopher Faylor
On Tue, Sep 28, 2004 at 03:48:12PM -0400, Igor Pechtchanski wrote: >On Tue, 28 Sep 2004, Christopher Faylor wrote: > >> On Tue, Sep 28, 2004 at 02:43:38PM -0500, Brian Ford wrote: >> >On Tue, 28 Sep 2004, Christopher Faylor wrote: >> > >> >> Of course there is a simple solution: lose the quotes. A

RE: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Hannu E K Nevalainen
you wrote: > On Tue, 28 Sep 2004, Christopher Faylor wrote: > >> On Tue, Sep 28, 2004 at 02:43:38PM -0500, Brian Ford wrote: >>> On Tue, 28 Sep 2004, Christopher Faylor wrote: Of course there is a simple solution: lose the quotes. AFAICT, they aren't needed. >>> >>> IMHO, they are. W

Re: 'which' command does not expand '~' in path (base-files update needed)

2004-09-28 Thread John Morrison
Sorry, I've not been following this thread (until the brackets appeared in the subject!). Just my two penny worth; I've just pulled, ./configure[d] and make[d] the GNU which application (it built OOTB). It correctly checks ~/bin. Would it be worth considering using this version of which? What a

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Brian Ford
On Tue, 28 Sep 2004, Christopher Faylor wrote: > On Tue, Sep 28, 2004 at 02:43:38PM -0500, Brian Ford wrote: > >On Tue, 28 Sep 2004, Christopher Faylor wrote: > >> Of course there is a simple solution: lose the quotes. AFAICT, they > >> aren't needed. > > > >IMHO, they are. Windows programs ofte

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Igor Pechtchanski
On Tue, 28 Sep 2004, Christopher Faylor wrote: > On Tue, Sep 28, 2004 at 02:43:38PM -0500, Brian Ford wrote: > >On Tue, 28 Sep 2004, Christopher Faylor wrote: > > > >> Of course there is a simple solution: lose the quotes. AFAICT, they > >> aren't needed. > > > >IMHO, they are. Windows programs

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Christopher Faylor
On Tue, Sep 28, 2004 at 02:43:38PM -0500, Brian Ford wrote: >On Tue, 28 Sep 2004, Christopher Faylor wrote: > >> Of course there is a simple solution: lose the quotes. AFAICT, they >> aren't needed. > >IMHO, they are. Windows programs often put directories containing spaces >in the system path.

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Brian Ford
On Tue, 28 Sep 2004, Christopher Faylor wrote: > Of course there is a simple solution: lose the quotes. AFAICT, they > aren't needed. IMHO, they are. Windows programs often put directories containing spaces in the system path. ex: /cygdrive/c/Program Files/ATI Technologies/ATI Control Panel

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Christopher Faylor
On Tue, Sep 28, 2004 at 06:49:44PM +0100, Dave Korn wrote: > Wonder if this is a real bug then, or if I've misread the shell parsing rules? >They are a bit ridiculously complicated and full of exceptions and special >cases. It seems like it's a bug. Of course there is a simple solution: lose

RE: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Dave Korn > Sent: 28 September 2004 18:35 > Why isn't it expanded by bash's tilde substitution at the > time the 'export' > command line is parsed then? That's sooo wrong. Oh wow. > Guess what: it depends > whether the *other* p

RE: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Dave Korn
> -Original Message- > From: cygwin-owner On Behalf Of Igor Pechtchanski > Sent: 28 September 2004 18:15 > > You can use ~ here. Just don't quote it. It shouldn't be quoted. > > > > export PATH=~/bin:"${PATH}" > > I'm sorry, but this isn't true, even for bash. It still > leaves the "

RE: "which" command does not expand "~" in path

2004-09-28 Thread Brian Ford
On Tue, 28 Sep 2004, Igor Pechtchanski wrote: > On Tue, 28 Sep 2004, Brian Ford wrote: > > On Wed, 29 Sep 2004, Errol Smith wrote: > > > This is all fine & good, but it doesn't change the fact that the > > > cygwin-supplied "which" does NOT work with the cygwin-supplied > > > ".bash_profile" (when

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Igor Pechtchanski
On Tue, 28 Sep 2004, Brian Ford wrote: > On Tue, 28 Sep 2004, Igor Pechtchanski wrote: > > > Oh, and your suggestion definitely won't work for sh, which also uses > > /etc/profile. IMO, any shell-specific code in /etc/profile should go > > into the shell-specific section of /etc/profile, and the

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Brian Ford
On Tue, 28 Sep 2004, Igor Pechtchanski wrote: > Oh, and your suggestion definitely won't work for sh, which also uses > /etc/profile. IMO, any shell-specific code in /etc/profile should go > into the shell-specific section of /etc/profile, and the rest of it > should be Bourne shell compatible.

RE: "which" command does not expand "~" in path

2004-09-28 Thread Igor Pechtchanski
On Tue, 28 Sep 2004, Brian Ford wrote: > On Wed, 29 Sep 2004, Errol Smith wrote: > > > This is all fine & good, but it doesn't change the fact that the > > cygwin-supplied "which" does NOT work with the cygwin-supplied > > ".bash_profile" (when you use a personal ~/bin directory.). > > I'm just cu

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Igor Pechtchanski
On Tue, 28 Sep 2004, Christopher Faylor wrote: > On Wed, Sep 29, 2004 at 01:08:42AM +1000, Errol Smith wrote: > >At 09:23 PM 26/09/2004, "Hannu E K Nevalainen" wrote: > >>FWIW; 'man bash' has a section on Tilde Expansion - I take it as; bash does > >>this expansion for you, not which.exe -> use $H

RE: "which" command does not expand "~" in path

2004-09-28 Thread Brian Ford
On Wed, 29 Sep 2004, Errol Smith wrote: > This is all fine & good, but it doesn't change the fact that the > cygwin-supplied "which" does NOT work with the cygwin-supplied > ".bash_profile" (when you use a personal ~/bin directory.). I'm just curious. This is from the Solaris 8 man page for whic

Re: "which" command does not expand "~" in path (base-files update needed)

2004-09-28 Thread Christopher Faylor
On Wed, Sep 29, 2004 at 01:08:42AM +1000, Errol Smith wrote: >At 09:23 PM 26/09/2004, "Hannu E K Nevalainen" wrote: >>FWIW; 'man bash' has a section on Tilde Expansion - I take it as; bash does >>this expansion for you, not which.exe -> use $HOME when not typing at the >>prompt. > > This is all fin

RE: "which" command does not expand "~" in path

2004-09-28 Thread Errol Smith
At 09:23 PM 26/09/2004, "Hannu E K Nevalainen" wrote: FWIW; 'man bash' has a section on Tilde Expansion - I take it as; bash does this expansion for you, not which.exe -> use $HOME when not typing at the prompt. This is all fine & good, but it doesn't change the fact that the cygwin-supplied "whi

RE: "which" command does not expand "~" in path

2004-09-27 Thread Hannu E K Nevalainen
you wrote: script). Igor -- >>> >>> $ u="Hannu";sed -nre "s/^$u.*:(.*):.*$/\1/p" > This works only because "/" is not a valid variable name. :-p Ehm.. ;-P - could that be called a lucky shot? /Hannu E K Nevalainen, B.Sc. EE Microcomputer systems--72--> ** mailing list pre

Re: "which" command does not expand "~" in path

2004-09-26 Thread Sven Köhler
Instead, the shell usually substitutes ~ or ~user. Look at this the output of these commands: echo ~ echo "~" This is probably common knowledge, but I learned last night that sh never expands ~. Under sh, the two lines above yield the same output, simply ~. I can confirm that for cygwin.

RE: "which" command does not expand "~" in path

2004-09-26 Thread Hannu E K Nevalainen
you ([EMAIL PROTECTED]) wrote on : > On Sun, Sep 26, 2004 at 11:25:04AM +1000, Errol Smith wrote: >> I do not know if stat() is expected to interpret ~ as $HOME. > > No, it is not. > > cgf FWIW; 'man bash' has a section on Tilde Expansion - I take it as; bash does this expansion for you, not whi

Re: "which" command does not expand "~" in path

2004-09-25 Thread Christopher Faylor
On Sun, Sep 26, 2004 at 11:25:04AM +1000, Errol Smith wrote: >I do not know if stat() is expected to interpret ~ as $HOME. No, it is not. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cy

Re: "which" command does not expand "~" in path

2004-09-25 Thread Errol Smith
From: Sven Köhler Subject: Re: "which" command does not expand "~" in path Date: Sat, 25 Sep 2004 20:32:31 +0200 Message-ID: <[EMAIL PROTECTED]> Set PATH so it includes user's private bin if it exists if [ -d ~/bin ] ; then PATH="~/bin:${PATH}" fi Hm

Re: "which" command does not expand "~" in path

2004-09-25 Thread Robert Schmidt
Sven Köhler wrote: Set PATH so it includes user's private bin if it exists if [ -d ~/bin ] ; then PATH="~/bin:${PATH}" fi Hmm, i'm not 100% percent sure, but is this supposed to work in general? I don't think that all programs that use the PATH varible are supposed to interpret ~ correctly. I

Re: "which" command does not expand "~" in path

2004-09-25 Thread Sven Köhler
Set PATH so it includes user's private bin if it exists if [ -d ~/bin ] ; then PATH="~/bin:${PATH}" fi Hmm, i'm not 100% percent sure, but is this supposed to work in general? I don't think that all programs that use the PATH varible are supposed to interpret ~ correctly. Instead, the shell us

"which" command does not expand "~" in path

2004-09-25 Thread Errol Smith
If your PATH contains the tilde character (eg. "~/bin:...") the cygwin version of "which" seems to fail to expand the "~" and will then not locate any commands in ~/bin (or any other directory on the path containing "~" presumably). I'm 99% sure it's cygwin's version of "which" causing th