public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cd to the path including space.
@ 2009-01-08 16:52 Hongyi Zhao
  2009-01-08 16:57 ` Eric Blake
  2009-01-08 16:59 ` Larry Hall (Cygwin)
  0 siblings, 2 replies; 8+ messages in thread
From: Hongyi Zhao @ 2009-01-08 16:52 UTC (permalink / raw)
  To: cygwin

Hi all,

I want to jump to the following path with a cygwin/bash command:

C:\Documents and Settings\All Users\Application
Data\MiKTeX\2.7\fontconfig\cache

In my case, I've the following issues:

1- I only know that use the following command to obtain the the  above
path's stem:

findtexmf psfonts_t1.map

this command will give the following result:

C:\Documents and Settings\All Users\Application
Data\MiKTeX\2.7\dvips\config\psfonts_t1.map

So I must compose the destination directory based on this path.

2- In the cygwin/bash, the path's delimitor is / instead of \.

3- In the cygwin/bash, if the space are included in the path, it will
be troublesome.

4- Furthermore, the cygwin use the following path as the initial part
of its path:

/cygdrive/c/...

So, how can I can get my path and then cd to that path within
cygwin/bash?   I've tried a bit but failed.

Regards,

-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 16:52 cd to the path including space Hongyi Zhao
@ 2009-01-08 16:57 ` Eric Blake
  2009-01-08 17:08   ` Hongyi Zhao
                     ` (2 more replies)
  2009-01-08 16:59 ` Larry Hall (Cygwin)
  1 sibling, 3 replies; 8+ messages in thread
From: Eric Blake @ 2009-01-08 16:57 UTC (permalink / raw)
  To: cygwin

Hongyi Zhao <hongyi.zhao <at> gmail.com> writes:

> 
> Hi all,
> 1- I only know that use the following command to obtain the the  above
> path's stem:
> 
> findtexmf psfonts_t1.map

cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"

> 
> 2- In the cygwin/bash, the path's delimitor is / instead of \.

cygpath takes care of that for you

> 
> 3- In the cygwin/bash, if the space are included in the path, it will
> be troublesome.

quoting the cygpath command substitution takes care of that for you

> 
> 4- Furthermore, the cygwin use the following path as the initial part
> of its path:
> 
> /cygdrive/c/...

cygpath takes care of that for you

-- 
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 16:52 cd to the path including space Hongyi Zhao
  2009-01-08 16:57 ` Eric Blake
@ 2009-01-08 16:59 ` Larry Hall (Cygwin)
  1 sibling, 0 replies; 8+ messages in thread
From: Larry Hall (Cygwin) @ 2009-01-08 16:59 UTC (permalink / raw)
  To: cygwin

On 01/08/2009, Hongyi Zhao wrote:
> 3- In the cygwin/bash, if the space are included in the path, it will
> be troublesome.

FWIW, this is not specific to Cygwin.  You'd see the same problem in Windows
using the command prompt.  Quoting, as Eric points out, is the solution.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 16:57 ` Eric Blake
@ 2009-01-08 17:08   ` Hongyi Zhao
  2009-01-08 21:58   ` Christopher Faylor
  2009-01-09  4:01   ` Hongyi Zhao
  2 siblings, 0 replies; 8+ messages in thread
From: Hongyi Zhao @ 2009-01-08 17:08 UTC (permalink / raw)
  To: cygwin

On Thu, 8 Jan 2009 16:46:26 +0000 (UTC), Eric Blake <ebb9@byu.net>
wrote:

>Hongyi Zhao <hongyi.zhao <at> gmail.com> writes:
>
>> 
>> Hi all,
>> 1- I only know that use the following command to obtain the the  above
>> path's stem:
>> 
>> findtexmf psfonts_t1.map
>
>cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"

See the following error:

$ cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"
bash: cd: /cygdrive/c/Documents and Settings/All Users/Application
Data/MiKTeX/2
: No such file or directorymap

Regards,

-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 16:57 ` Eric Blake
  2009-01-08 17:08   ` Hongyi Zhao
@ 2009-01-08 21:58   ` Christopher Faylor
  2009-01-08 23:07     ` Eric Blake
  2009-01-09  4:01   ` Hongyi Zhao
  2 siblings, 1 reply; 8+ messages in thread
From: Christopher Faylor @ 2009-01-08 21:58 UTC (permalink / raw)
  To: cygwin

On Thu, Jan 08, 2009 at 04:46:26PM +0000, Eric Blake wrote:
>> findtexmf psfonts_t1.map
>
>cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"

cd  "$(cygpath -u '$(findtexmf psfonts_t1.map)')"

will probably work a little better.  As Eric knows, you can't nest quotes
that way.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 21:58   ` Christopher Faylor
@ 2009-01-08 23:07     ` Eric Blake
  2009-01-08 23:16       ` Christopher Faylor
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Blake @ 2009-01-08 23:07 UTC (permalink / raw)
  To: cygwin

Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:

> 
> On Thu, Jan 08, 2009 at 04:46:26PM +0000, Eric Blake wrote:
> >> findtexmf psfonts_t1.map
> >
> >cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"
> 
> cd  "$(cygpath -u '$(findtexmf psfonts_t1.map)')"
> 
> will probably work a little better.  As Eric knows, you can't nest quotes
> that way.

Huh?  My example works just fine; it's yours that is broken (since '' 
surpresses the innermost $() command substitution):

$ echo "$(echo '$(echo 'a  b')')"
$(echo a b)

By the way, $() is saner than `` when it comes to nesting and "" (as required 
by POSIX):

$ echo "$(echo "$(echo 'a  b')")"
a  b

Here's the same thing in properly quoted ``, at least when using a POSIX-
compliant shell (in general, "`""`" is non-portable, since other bourne shell 
implementations parse it differently than what POSIX requires):

$ echo "`echo \"\`echo 'a  b'\`\"`"
a  b

(in examples like these, I like to use two spaces to guarantee that I've used 
enough quoting)

-- 
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 23:07     ` Eric Blake
@ 2009-01-08 23:16       ` Christopher Faylor
  0 siblings, 0 replies; 8+ messages in thread
From: Christopher Faylor @ 2009-01-08 23:16 UTC (permalink / raw)
  To: cygwin

On Thu, Jan 08, 2009 at 09:57:48PM +0000, Eric Blake wrote:
>Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:
>
>> 
>> On Thu, Jan 08, 2009 at 04:46:26PM +0000, Eric Blake wrote:
>> >> findtexmf psfonts_t1.map
>> >
>> >cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"
>> 
>> cd  "$(cygpath -u '$(findtexmf psfonts_t1.map)')"
>> 
>> will probably work a little better.  As Eric knows, you can't nest quotes
>> that way.
>
>Huh?  My example works just fine; it's yours that is broken (since '' 
>surpresses the innermost $() command substitution):

I stand corrected.  I should have tried this before sending it.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: cd to the path including space.
  2009-01-08 16:57 ` Eric Blake
  2009-01-08 17:08   ` Hongyi Zhao
  2009-01-08 21:58   ` Christopher Faylor
@ 2009-01-09  4:01   ` Hongyi Zhao
  2 siblings, 0 replies; 8+ messages in thread
From: Hongyi Zhao @ 2009-01-09  4:01 UTC (permalink / raw)
  To: cygwin

On Thu, 8 Jan 2009 16:46:26 +0000 (UTC), Eric Blake <ebb9@byu.net>
wrote:

>Hongyi Zhao <hongyi.zhao <at> gmail.com> writes:
>
>> 
>> Hi all,
>> 1- I only know that use the following command to obtain the the  above
>> path's stem:
>> 
>> findtexmf psfonts_t1.map
>
>cd "$(cygpath -u "$(findtexmf psfonts_t1.map)")"

Finally, I use the following line to do the trick:

cd "$(cygpath -u "$(dirname "$(findtexmf psfonts_t1.map)")" )"

Thanks again.

-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2009-01-09  3:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-08 16:52 cd to the path including space Hongyi Zhao
2009-01-08 16:57 ` Eric Blake
2009-01-08 17:08   ` Hongyi Zhao
2009-01-08 21:58   ` Christopher Faylor
2009-01-08 23:07     ` Eric Blake
2009-01-08 23:16       ` Christopher Faylor
2009-01-09  4:01   ` Hongyi Zhao
2009-01-08 16:59 ` Larry Hall (Cygwin)

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