This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Programatically finding value of "cygdrive" prefix
- From: ericblake at comcast dot net (Eric Blake)
- To: L Anderson <lowella at serv dot net>, cygwin at cygwin dot com
- Date: Wed, 10 Aug 2005 23:39:55 +0000
- Subject: Re: Programatically finding value of "cygdrive" prefix
> mount -p | sed -nr '2s/([^ ].*) +\S+ +\S+/\1/p'
For readability, what about something like:
$ mount -m | sed -ne 's/.*cygdrive[^"]*"\([^"]*\)"$/\1/p'
This is tolerant of spaces, and works even if other mountpoints
include the phrase cygdrive, since mount -m outputs
--change-cygdrive-prefix outside of quotes but directories in
quotes, and relies on the fact that the mountpoint won't have
an embedded " (thanks to Windows)...
--
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/