delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/11/07:34:57

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
Message-ID: <42FB37AE.7060001@alltel.net>
Date: Thu, 11 Aug 2005 06:34:06 -0500
From: Ken Dibble <kdibble AT alltel DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Programatically finding value of "cygdrive" prefix
References: <42FA4604 DOT 8000507 AT tlinx DOT org> <20050810183616 DOT GA5892 AT trixie DOT casa DOT cgf DOT cx> <20050810184119 DOT GA6155 AT trixie DOT casa DOT cgf DOT cx> <42FA7608 DOT 4070501 AT serv DOT net> <42FA7C4C DOT 4010607 AT serv DOT net> <20050811012423 DOT GD10161 AT trixie DOT casa DOT cgf DOT cx> <42FAB187 DOT 8020503 AT alltel DOT net> <20050811020633 DOT GF10161 AT trixie DOT casa DOT cgf DOT cx> <42FAB49E DOT 2010401 AT alltel DOT net> <42FAB7FF DOT A04524AA AT dessent DOT net> <42FB30A8 DOT 6020509 AT alltel DOT net> <42FB35E7 DOT 1D988F0B AT dessent DOT net>
In-Reply-To: <42FB35E7.1D988F0B@dessent.net>
X-IsSubscribed: yes


Brian Dessent wrote:

>Ken Dibble wrote:
>
>  
>
>>mount -m |  grep "mount -u" | tail -1  | awk -F'"' '{ print $2 }'
>>
>>as
>>echo 'mount -s -b --change-cygdrive-prefix "/thing with spaces"'  | awk
>>-F'"' '{ print $2 }'
>>results in
>>/thing with spaces
>>    
>>
>
>The awk part seems fine, but I don't know about the "mount -u".  That
>will only match if you have a user-mode cygdrive set.  As you can see
>from my example, that doesn't include me (or anyone else that installs
>cygwin choosing "All users" in setup.exe.)
>
>If you're going to use awk then you can simplify and not bother with
>grep and tail, they're extraneous.
>
>mount -m | awk -F '"' '/--change-cygdrive-prefix/ { print $2 }'
>
>Brian
>  
>
Well, maybe my installation is hosed then.  I have installed for all 
users, but mount -m returns

mount -f -s -b "C:/cygwin/usr/X11R6/lib/X11/fonts" 
"/usr/X11R6/lib/X11/fonts"
mount -f -s -b "C:/cygwin/bin" "/usr/bin"
mount -f -s -b "C:/cygwin/lib" "/usr/lib"
mount -f -s -b "C:/cygwin" "/"
mount -u -b --change-cygdrive-prefix "/cygdrive"
mount -s -b --change-cygdrive-prefix "/"

so...

mount -m | awk -F '"' '/--change-cygdrive-prefix/ { print $2 }'

results in

/cygdrive
/


so, I can see that the grep is not needed, but since there is more than 
one output line, tail, head or the like
would be needed,  no?

Ken


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