X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Thorsten Kampe Subject: Re: How to uniformly point to the root of a drive? Date: Sun, 20 May 2007 18:52:31 +0100 Lines: 37 Message-ID: References: <46506BA1 DOT C3502CCD AT dessent DOT net> <0a3801c79af6$c32395b0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <46507312 DOT 2EDBD2A5 AT dessent DOT net> <0a3901c79afa$41cf13a0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <20070520172705 DOT GA9280 AT ednor DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 * Christopher Faylor (Sun, 20 May 2007 13:27:05 -0400) > On Sun, May 20, 2007 at 06:20:51PM +0100, Thorsten Kampe wrote: > >* Dave Korn (Sun, 20 May 2007 17:16:43 +0100) > >> On 20 May 2007 17:11, Brian Dessent wrote: > >> > Dave Korn wrote: > >> > > >> >> This relies on the mountpoints being set correctly, which might not work > >> >> if your drive letter changes ... > >> > > >> > Well if that is the case and / points to the wrong dir then I don't see > >> > how you can be using Cygwin at all, > >> > >> I'm not sure exactly what Thorsten is looking for in his original question, > > > >Something like "cat /cygdrive/g/autorun.inf" from a shell script. > > > >> so I don't know if it's relevant here or not, but it might be useful for a > >> portable installation to have a way to detect the drive letter so as to be > >> able to (re)assign the mountpoints (e.g. from Cygwin.bat) before starting up a > >> shell or other cygwin app. > > > >I already do that (something like "mount -fu %~d0\cygwin /") in a > >batch script. Unfortunately the %~d0" trick is a Cmd thing so I can't > >directly use it from bash or zsh. > > So it sounds like Brian's method would work then wouldn't it? I suppose so. Something like [1] is even simpler and avoids running an external three times (which is quite expensive when runnning from a flash drive). Probably [1] could be even more concise. The "$usb[1]" to refer to the first character is zsh syntax. Thorsten [1] usb=$(cygpath -m /); usb=$usb[1] -- 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/