This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Programatically finding value of "cygdrive" prefix
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 10 Aug 2005 14:36:16 -0400
- Subject: Re: Programatically finding value of "cygdrive" prefix
- References: <42FA4604.8000507@tlinx.org>
- Reply-to: cygwin at cygwin dot com
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'
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/