This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: How does a script find where Cygwin is installed?


you wrote, luke.kendall@zzzzz.zzzzz.zzz.zz:

> On Fri, 3 Sep 2004, luke.kendall wrote:
>
>> $ CYGPATH=`cygpath -w /`
>> $ echo $CYGPATH
>> C:\cygwin
>> $ CYGPATH=`cygpath -u "$CYGPATH"`
>> $ echo $CYGPATH
>> /
>>
>> What I really want to get is "C:/cygwin"
>
> $ cygpath -m /
>
>> or "/cygdrive/c/cygwin", in my case.
>
> $ cygpath -m / | sed 's,^\([A-Za-z]\):,/cygdrive/\1,'

That might produce false results, depending on the "mount -c" setting. Here
is a (working/stable?) remedy:

$ cygpath -m / | \
sed "s,^\([A-Za-z]\):,$( \
  mount -p | \
  sed -n '2s/^\([^ ]*\).*/\1/p' \
)/\1,"
/cygdrive/C/Program/Cygwin


/Hannu E K Nevalainen, B.Sc. EE Microcomputer systems            --72-->

** mailing list preference; please keep replies on list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]