public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: pathname with spaces causes problems for tcsh
@ 2000-03-21 13:03 Halim, Salman
  0 siblings, 0 replies; 7+ messages in thread
From: Halim, Salman @ 2000-03-21 13:03 UTC (permalink / raw)
  To: Cygwin

i wonder if the problem is resolved if quotes are used instead of
backslashes?  (i use bash so can't check this; it works either way on bash.)

-- 
   ===============================================================
   Salman Halim                 Email:  salman@bluestone.com
   ===============================================================
   If a man  says something  in a forest,  and there  are no women
   around to hear him, is he still wrong?


> -----Original Message-----
> From: Earnie Boyd [ mailto:earnie_boyd@yahoo.com ]
> Sent: Tuesday, March 21, 2000 3:52 PM
> To: Steve Kelem; Cygwin; christos@zoulas.com
> Subject: Re: pathname with spaces causes problems for tcsh
> 
> 
> Pathnames with spaces are a problem, period.  By the time 
> that pushd got the
> argument the backslashes had been removed and pushd passed to 
> setenv more than
> one argument thus the complaint.
> 
> You'll have to modify the source of tcsh to fix this problem.
> 
> Earnie.
> 
> P.S.: This problem would exist on UNIX if the directory 
> contained spaces.
> 
> --- Steve Kelem <kelem@adaptivesilicon.com> wrote:
> > I'm running tcsh 6.09.00 from the Cygwin 1.0 release on NT 4.0 SP6.
> > When I type
> > pushd /c/My\ Download\ Files/Cygnus/Xfree/
> > it responds:
> > /c/My Download Files/Cygnus/Xfree /
> > setenv: Too many arguments.
> > % which pushd
> > pushd: shell built-in command.
> > % pwd
> > /c/My Download Files/Cygnus/Xfree
> > 
> > This indicates that it works, but the complaint is odd.
> > 
> > Steve Kelem
> > > begin:vcard 
> > n:Kelem;Steve
> > tel;fax:408-399-8905
> > tel;work:408-335-2718
> > x-mozilla-html:FALSE
> > url: http://www.adaptivesilicon.com
> > org:Adaptive Silicon, Inc.
> > adr:;;985 University Ave., Suite 31;Los Gatos;CA;95032-7639;U.S.
> > version:2.1
> > email;internet:kelem@adaptivesilicon.com
> > title:Chief Scientist
> > fn:Steve Kelem
> > end:vcard
> > 
> > > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pathname with spaces causes problems for tcsh
  2000-03-21 13:53   ` Bob McGowan
@ 2000-03-21 13:57     ` Chris Faylor
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Faylor @ 2000-03-21 13:57 UTC (permalink / raw)
  To: Cygwin

On Tue, Mar 21, 2000 at 01:58:58PM -0800, Bob McGowan wrote:
>When I used the //c/dir...  format to change to "Multimedia Files" and
>typed pwd, it printed out "/cygdrive/c/Multimedia Files" (expected) but
>"echo $PWD" printed "/c/Multimedia Files".  This is clearly not
>correct.

It is precisely because of problems like this that we switched to using
/cygdrive/x rather than //x.  Many UNIX utilities assume that they can
clean up multiple slashes.  That results in your "/c/Multimedia Files"
above.

That's why the //x form will be deprecated in the next release.

-Chris Faylor
-Cygwin Engineering Manager
-Cygnus Solutions, a Red Hat Company

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pathname with spaces causes problems for tcsh
  2000-03-21 13:10 ` Christos Zoulas
  2000-03-21 13:37   ` Chris Faylor
@ 2000-03-21 13:53   ` Bob McGowan
  2000-03-21 13:57     ` Chris Faylor
  1 sibling, 1 reply; 7+ messages in thread
From: Bob McGowan @ 2000-03-21 13:53 UTC (permalink / raw)
  To: Christos Zoulas; +Cc: earnie_boyd, Steve Kelem, Cygwin

I have the CD 1.0 with the same version of tcsh as the original poster. 
If I use double quotes around the path with spaces, there seems to be no
problem.  When I use a backslash to escape the spaces in the pathname, I
also have no problem.

But I did notice that the original poster gave the path name as /c/...
and I am wondering if the problem seen relates to this.  When I used the
//c/dir... format to change to "Multimedia Files" and typed pwd, it
printed out "/cygdrive/c/Multimedia Files" (expected) but "echo $PWD"
printed "/c/Multimedia Files".  This is clearly not correct.  The tests
I mentioned above used pathnames beginning with /cygpath/c/...  When I
repeated the tests using the //c... path name, the following happens:

   pushd "$PWD"  # errors with "no such file or directory"
   pushd $PWD    # errors with "pushd:  Too many arguments."

My only issue is that I cannot reproduce the setenv error mentioned in
the original post, nor can I get it to "work" with $PWD when I use "cd
//c/dir..." to change to the pathname with spaces.

So, spaces can be a problem but once input (through some quoting
mechanism), things should work, since the system now has a single null
terminated string to work with.  The spaces would only be problematic a
second time if they were passed in such a way that the string was
re-parsed by the shell as if it were a complete command line (or at
least an argument list).


Christos Zoulas wrote:
> 
> On Mar 21, 12:52pm, earnie_boyd@yahoo.com (Earnie Boyd) wrote:
> -- Subject: Re: pathname with spaces causes problems for tcsh
> 
> | Pathnames with spaces are a problem, period.  By the time that pushd got the
> | argument the backslashes had been removed and pushd passed to setenv more than
> | one argument thus the complaint.
> |
> | You'll have to modify the source of tcsh to fix this problem.
> |
> | Earnie.
> |
> | P.S.: This problem would exist on UNIX if the directory contained spaces.
> 
> No it would not. chdir("foo bar") works fine as well as
> setenv/putenv("foo bar", "bar baz"). The problem is in the way
> the interface call to the win32 setenv is implemented.
> 
> christos
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com


-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pathname with spaces causes problems for tcsh
  2000-03-21 13:10 ` Christos Zoulas
@ 2000-03-21 13:37   ` Chris Faylor
  2000-03-21 13:53   ` Bob McGowan
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Faylor @ 2000-03-21 13:37 UTC (permalink / raw)
  To: Cygwin

On Tue, Mar 21, 2000 at 04:09:26PM -0500, Christos Zoulas wrote:
>On Mar 21, 12:52pm, earnie_boyd@yahoo.com (Earnie Boyd) wrote:
>-- Subject: Re: pathname with spaces causes problems for tcsh
>
>| Pathnames with spaces are a problem, period.  By the time that pushd got the
>| argument the backslashes had been removed and pushd passed to setenv more than
>| one argument thus the complaint.
>| 
>| You'll have to modify the source of tcsh to fix this problem.
>| 
>| Earnie.
>| 
>| P.S.: This problem would exist on UNIX if the directory contained spaces.
>
>No it would not. chdir("foo bar") works fine as well as
>setenv/putenv("foo bar", "bar baz"). The problem is in the way
>the interface call to the win32 setenv is implemented.

I'm not sure what you mean by "interface call" but it's not likely that cygwin
itself is doing something bad with environment variables with spaces in them.
There is no parsing to be done (besides possibly looking for an '=') by the
time the putenv or setenv is invoked by the DLL.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pathname with spaces causes problems for tcsh
  2000-03-21 12:52 Earnie Boyd
@ 2000-03-21 13:10 ` Christos Zoulas
  2000-03-21 13:37   ` Chris Faylor
  2000-03-21 13:53   ` Bob McGowan
  0 siblings, 2 replies; 7+ messages in thread
From: Christos Zoulas @ 2000-03-21 13:10 UTC (permalink / raw)
  To: earnie_boyd, Steve Kelem, Cygwin

On Mar 21, 12:52pm, earnie_boyd@yahoo.com (Earnie Boyd) wrote:
-- Subject: Re: pathname with spaces causes problems for tcsh

| Pathnames with spaces are a problem, period.  By the time that pushd got the
| argument the backslashes had been removed and pushd passed to setenv more than
| one argument thus the complaint.
| 
| You'll have to modify the source of tcsh to fix this problem.
| 
| Earnie.
| 
| P.S.: This problem would exist on UNIX if the directory contained spaces.

No it would not. chdir("foo bar") works fine as well as
setenv/putenv("foo bar", "bar baz"). The problem is in the way
the interface call to the win32 setenv is implemented.

christos

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pathname with spaces causes problems for tcsh
@ 2000-03-21 12:52 Earnie Boyd
  2000-03-21 13:10 ` Christos Zoulas
  0 siblings, 1 reply; 7+ messages in thread
From: Earnie Boyd @ 2000-03-21 12:52 UTC (permalink / raw)
  To: Steve Kelem, Cygwin, christos

Pathnames with spaces are a problem, period.  By the time that pushd got the
argument the backslashes had been removed and pushd passed to setenv more than
one argument thus the complaint.

You'll have to modify the source of tcsh to fix this problem.

Earnie.

P.S.: This problem would exist on UNIX if the directory contained spaces.

--- Steve Kelem <kelem@adaptivesilicon.com> wrote:
> I'm running tcsh 6.09.00 from the Cygwin 1.0 release on NT 4.0 SP6.
> When I type
> pushd /c/My\ Download\ Files/Cygnus/Xfree/
> it responds:
> /c/My Download Files/Cygnus/Xfree /
> setenv: Too many arguments.
> % which pushd
> pushd: shell built-in command.
> % pwd
> /c/My Download Files/Cygnus/Xfree
> 
> This indicates that it works, but the complaint is odd.
> 
> Steve Kelem
> > begin:vcard 
> n:Kelem;Steve
> tel;fax:408-399-8905
> tel;work:408-335-2718
> x-mozilla-html:FALSE
> url: http://www.adaptivesilicon.com
> org:Adaptive Silicon, Inc.
> adr:;;985 University Ave., Suite 31;Los Gatos;CA;95032-7639;U.S.
> version:2.1
> email;internet:kelem@adaptivesilicon.com
> title:Chief Scientist
> fn:Steve Kelem
> end:vcard
> 
> > --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* pathname with spaces causes problems for tcsh
@ 2000-03-21 11:35 Steve Kelem
  0 siblings, 0 replies; 7+ messages in thread
From: Steve Kelem @ 2000-03-21 11:35 UTC (permalink / raw)
  To: Cygwin, christos

I'm running tcsh 6.09.00 from the Cygwin 1.0 release on NT 4.0 SP6.
When I type
pushd /c/My\ Download\ Files/Cygnus/Xfree/
it responds:
/c/My Download Files/Cygnus/Xfree /
setenv: Too many arguments.
% which pushd
pushd: shell built-in command.
% pwd
/c/My Download Files/Cygnus/Xfree

This indicates that it works, but the complaint is odd.

Steve Kelem

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-03-21 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-21 13:03 pathname with spaces causes problems for tcsh Halim, Salman
  -- strict thread matches above, loose matches on Subject: below --
2000-03-21 12:52 Earnie Boyd
2000-03-21 13:10 ` Christos Zoulas
2000-03-21 13:37   ` Chris Faylor
2000-03-21 13:53   ` Bob McGowan
2000-03-21 13:57     ` Chris Faylor
2000-03-21 11:35 Steve Kelem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).