Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 16 Aug 2005 17:46:55 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Programatically finding value of "cygdrive" prefix Message-ID: <20050816214654.GA18585@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <42FA4604 DOT 8000507 AT tlinx DOT org> <20050810183616 DOT GA5892 AT trixie DOT casa DOT cgf DOT cx> <1124222681 DOT 29974 DOT 37 DOT camel AT p450> <20050816212826 DOT GG16323 AT trixie DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050816212826.GG16323@trixie.casa.cgf.cx> User-Agent: Mutt/1.5.8i On Tue, Aug 16, 2005 at 05:28:26PM -0400, Christopher Faylor wrote: >On Tue, Aug 16, 2005 at 05:10:25PM -0400, Igor Pechtchanski wrote: >>There may not be a C: drive, but "cygpath -u c:" will do the right thing >>-- try it with a drive you don't have. > > mount -f c: /willthisthreadeverdie > cygpath -u c: > /willthisthreadeverdie In the spirit of my other contribution, here's the fix for the above problem: #!/bin/bash mount -m > /tmp/saveme.$$ eval `sed -nre '/"[a-zA-Z]:"/s/^mount\s.*("[^"]*")\s".*$/umount \1;/p' /tmp/saveme.$$` echo $(dirname $(cygpath -u c:)) eval `sed -nre '/"[a-zA-Z]:"/s/^.*$/&;/p' /tmp/saveme.$$` . /tmp/saveme.$$ rm /tmp/saveme.$$ I think this one is slightly faster than my previous attempt. cgf -- 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/