X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Mon, 14 Jan 2008 21:10:33 -0800
From: Gary Johnson <garyjohn@spk.agilent.com>
To: cygwin@cygwin.com
Subject: Re: need help with bash -c <command> with cygpath
Message-ID: <20080115051032.GA8900@suncomp1.spk.agilent.com>
Mail-Followup-To: cygwin@cygwin.com
References: <2D9E96311DCA4C48BF185EA6928BC7BB030AAB8D@asc-mail.int.ascribe.com> <01a501c85470$647dde60$2e08a8c0@CAM.ARTIMI.COM> <4787E0A0.3010102@byu.net> <loom.20080111T215048-569@post.gmane.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <loom.20080111T215048-569@post.gmane.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 2008-01-11, Jay wrote:

> Thanks everyone for the help.  Since i'm getting the path from the registry i
> can't add in the extra backslashes without using sed.  I ended up with this
> registy key which seems to work for local drives as well as network drives
> (UNCs) (haven't tested files with special characters).

Something I used to work around this problem was to have Windows 
invoke a bat file and have that bat file invoke bash.  The key, 
though, suggested in this list some time ago, is to add "noglob" to 
the CYGWIN environment variable in the bat file, so that the bat 
file can pass the file name, directory name, or network path given 
to it by Windows to the bash command unchanged.  E.g.,

   set cygwin_save=%CYGWIN%
   set CYGWIN=%CYGWIN% noglob
   C:\cygwin\bin\rxvt.exe -e C:/cygwin/bin/bash --login -c "run_bash_here "'%1'" "'%cygwin_save%'

where run_bash_here is a function defined in ~/.bashrc that 
contains, among other things,

    # Restore original value of CYGPATH.
    #
    CYGWIN="$2"

Regards,
Gary


--
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/

