X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Mon, 14 Jan 2008 21:10:33 -0800 From: Gary Johnson To: cygwin AT cygwin DOT com Subject: Re: need help with bash -c with cygpath Message-ID: <20080115051032.GA8900@suncomp1.spk.agilent.com> Mail-Followup-To: cygwin AT cygwin DOT com References: <2D9E96311DCA4C48BF185EA6928BC7BB030AAB8D AT asc-mail DOT int DOT ascribe DOT com> <01a501c85470$647dde60$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <4787E0A0 DOT 3010102 AT byu DOT net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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/