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 Message-ID: <42FB7057.2000601@serv.net> Date: Thu, 11 Aug 2005 08:35:51 -0700 From: L Anderson User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b) Gecko/20050217 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> <20050811012333 DOT GC10161 AT trixie DOT casa DOT cgf DOT cx> In-Reply-To: <20050811012333.GC10161@trixie.casa.cgf.cx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Christopher Faylor wrote: > On Wed, Aug 10, 2005 at 02:47:52PM -0700, L Anderson wrote: > >>Christopher Faylor wrote: >> >>>On Wed, Aug 10, 2005 at 02:36:16PM -0400, Christopher Faylor wrote: >>> >>> >>>>On Wed, Aug 10, 2005 at 11:23:00AM -0700, Linda W wrote: >>>> >>>> >>>>>Is there a way to find out in a bash script the cygdrive prefix? >>>>>I thought something simple like >>>>>mount -p|tail -1|cut -f1 >>>>>but that incorrectly assumed the fields were tab delimited. >>>>>Since there can be spaces in the cygdrive prefix, I can't >>>>>use space a delimiter, example: >>>>># mount -p >>>>>Prefix Type Flags >>>>>/cyg drive posix path system binmode >>>>>---- >>>> >>>>There may be a simpler way to do it, but this seems to work: >>>> >>>>mount -p | sed -n '2s/\([^ ]\) *[^ ][^ ]* *[^ ][^ ]*$/\1/p' >>> >>> >>>This is shorter: >>> >>>mount -p | sed -nr '2s/([^ ]) +\S+ +\S+$/\1/p' >>> >> >>Neither of which work if there is a space in the cygdrive prefix; viz a viz: >> >>Prefix Type Flags >>/cyg drive posix path system binmode > > > Actually yes they will. Did you actually try the above? I did. > [red face on] Ummm, yah I did try them both using a number of test scenarios but all tests failed. That's why I posted. However, I had been using my Win98SE system for about 5 hours when I did the tests. This morning I cold restarted my system and tried to verify yesterday's results. Now I can't get any of my tests to fail and I have not installed or updated any software. That's the last time I report an alleged problem without verifying it after a cold restart! Sorry for the noise. [red face off in a bit] Regards, L Anderson -- 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/