Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <42FB3CB4.CD113AAC@dessent.net>
Date: Thu, 11 Aug 2005 04:55:32 -0700
From: Brian Dessent <brian@dessent.net>
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Programatically finding value of "cygdrive" prefix
References: <42FA4604.8000507@tlinx.org> <20050810183616.GA5892@trixie.casa.cgf.cx> <20050810184119.GA6155@trixie.casa.cgf.cx> <42FA7608.4070501@serv.net> <42FA7C4C.4010607@serv.net> <20050811012423.GD10161@trixie.casa.cgf.cx> <42FAB187.8020503@alltel.net> <20050811020633.GF10161@trixie.casa.cgf.cx> <42FAB49E.2010401@alltel.net> <42FAB7FF.A04524AA@dessent.net> <42FB30A8.6020509@alltel.net> <42FB35E7.1D988F0B@dessent.net> <42FB37AE.7060001@alltel.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com

Ken Dibble wrote:

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

It's not hosed, you just happen to have both flavors of cygdrive
prefix.  The user mounts always take precedence over the system-wide
ones.  If I were you I'd remove the user cygdrive (since all your other
mounts are system) with "umount -uc" and then change your system
cygdrive to the desired value, presumably "mount -c /cygdrive".

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

Nope, use { print $2; exit } to print the first one and stop.  You could
modify the regexp to try to match -u or -s but that's a bad idea because
you don't know in advance which one(s) will be present.

Brian

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

