X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Message-ID: <4C5F7B79.60805@gmail.com> Date: Sun, 08 Aug 2010 20:52:25 -0700 From: Monte Cabet User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Batch-style variables to detect change in Cygdrive Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Is there anyway I can get batch-style relative drive paths in Cygwin? An example of what I mean is "%~d0". The reason for is is that I would like to mount folders from a USB, so the drive (the variable I showed does drive) will change everytime I plug the USB in. After abit of playing around I found how to mount folders, but it needs be ran from inside Cygwin via a file ran on start-up or written manually. I am attempting to set the mounts from a batch script or atleast get a variable/function that will find out what drive to use. Below is some examples I've cooked up. # batch-style set "mono1=cygpath --type windows "%~d0\mono\"" set "mono2=cygpath --type mixed "%~d0/mono/"" set "mono3=cygpath --type unix "/cygdrive/%~d0/mono/"" mount -o binary '%mono1%' /mnt # Cygwin-style mount -o binary "$(cygpath --type windows "%~d0\mono\)" /mnt mount -o binary "$(cygpath --type mixed "%~d0/mono/)" /mnt mount -o binary "$(cygpath --type unix /cygdrive/%~d0/mono/)" /mnt -- 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