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


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