Re: cd to the path including space.

2009-01-08 Thread Eric Blake
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/



cd to the path including space.

2009-01-08 Thread Hongyi Zhao
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/



Re: cd to the path including space.

2009-01-08 Thread Larry Hall (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/



Re: cd to the path including space.

2009-01-08 Thread Hongyi Zhao
On Thu, 8 Jan 2009 16:46:26 + (UTC), Eric Blake e...@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/



Re: cd to the path including space.

2009-01-08 Thread Christopher Faylor
On Thu, Jan 08, 2009 at 04:46:26PM +, 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/



Re: cd to the path including space.

2009-01-08 Thread Eric Blake
Christopher Faylor cgf-use-the-mailinglist-please at cygwin.com writes:

 
 On Thu, Jan 08, 2009 at 04:46:26PM +, 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/



Re: cd to the path including space.

2009-01-08 Thread Christopher Faylor
On Thu, Jan 08, 2009 at 09:57:48PM +, Eric Blake wrote:
Christopher Faylor cgf-use-the-mailinglist-please at cygwin.com writes:

 
 On Thu, Jan 08, 2009 at 04:46:26PM +, 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/



Re: cd to the path including space.

2009-01-08 Thread Hongyi Zhao
On Thu, 8 Jan 2009 16:46:26 + (UTC), Eric Blake e...@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/