This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Accessing folders elsewhere than C:\cygwin
cygwin-owner wrote on 02/10/2011 03:35:53 PM:
>
> On Thu, Feb 10, 2011 at 03:23:38PM -0500, RISINGP1 wrote:
> >Eric wrote on 02/10/2011 12:15:33 PM:
> >
> >> On 02/10/2011 10:13 AM, Buchbinder, Barry (NIH/NIAID) [E] wrote:
> >> > Might the ability to identify cygwin's root be a good
> >> > thing to add to cygpath?
> >>
> >> And what's so hard about 'cygpath -w /'?
> >>
> >> > Under "System information", one could have an option
> >> >
> >> > -R, --root output cygwin root directory
> >> >
> >> > where
> >> >
> >> > $ cygpath -Rw
> >> > C:\cygwin
> >>
> >> Trading / for -R doesn't justify the bloat and burning another short
> >> option character, in my opinion.
> >
> >If you need it ofetn enough, here is a simple script for displaying the
> >cygwin root:
> >
> >case $1 in
> > -w)
> > mount | grep " / " | cut -d" " -f1 | sed 's:/:\\:g'
> > ;;
> > -u)
> > DRIVE=$(mount | grep " / " | cut -d":" -f1):
> > echo $(mount | grep "^$DRIVE " | \
> > cut -d" " -f3)$(mount | grep " / " | cut -d" " -f1) | \
> > sed 's/'$DRIVE'//'
> > ;;
> > *)
> > echo "Please specify -w (Windows) or -u (Unix)"
> > ;;
> >esac
>
> Why would we need a simple script to display the cygwin root when
> "cygpath -w /" works fine?
>
> cgf
>
OK. You are right (somehow I missed the "cygpath -w /" mention in the
thread - oops).
Change
-w)
mount | grep " / " | cut -d" " -f1 | sed 's:/:\\:g'
;;
to
-w)
cygpath -w /
;;
But "cygpath -u /" will give "/" as an answer. The script will give (for
me) "/cygdrive/c/cygwin".
I was merely trying to offer an alternative to Barry's request for the
"-R" option on cygpath. Specifically, it answers this part of his
request:
> $ cygpath -Ru
> /cygdrive/c/cygwin
>
> or, if the cygdrive prefix has been changed to a simple /,
>
> $ cygpath -Ru
> /c/cygwin
- Phil
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple