delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/10/19:40:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: ericblake AT comcast DOT net (Eric Blake)
To: L Anderson <lowella AT serv DOT net>, cygwin AT cygwin DOT com
Subject: Re: Programatically finding value of "cygdrive" prefix
Date: Wed, 10 Aug 2005 23:39:55 +0000
Message-Id: <081020052339.9968.42FA904B000A1356000026F022007348300A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019