Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 X-Nonspoof-Check: 20040304 From: "Victor Atkinson" To: Subject: RE: Bash behavior change 2.05b-17 vs 2.05b-16 Date: Mon, 25 Jul 2005 15:23:54 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Message-ID: > Victor Atkinson syrres.com> writes: > >> >> Greetings, >> >> I recently updated my Cygwin installation from version 1.5.11-1 to 1.5.17-1. >> As I did so, I also updated all of my packages, including updating Bash from >> version 2.05b-16 to version 2.05b-17. > > As long as you are upgrading, why not go all the way to cygwin-1.5.18-1 and > bash-3.0-8? > Unfortunately, I had just upgraded to cygwin-1.5.17-1 and Bash 2.0b-17 a day or two before the most recent versions came out. I don't usually like to upgrade too often, so that I can avoid confusion in versions while debugging problems, should they occur. I try to run at least a few months between upgrades. >> >> After updating, a Bash script that I use for backing up my computer using >> WinZip failed to operate. After some debugging, I concluded that the >> behavior of Bash when calling the WinZip command-line executable had >> changed. Specifically, the treatment of the backslash '\' when launching >> executables seems to have changed. Version 2.05b-17 seems to no longer >> accept '\' in the path name of an executable, even when protected or >> escaped. >> > > Are you sure it was bash and not cygwin that changed behavior? Bash should not > do anything special with backslash; it passes filenames to cygwin as they were > typed. Maybe it was cygwin's behavior of \ handling in converting POSIX paths > back to Windows paths, particularly in the exec*() family of calls, that > changed. However, I noticed that when doing "strace bash -c > c:\\\\winnt\\\\system32\\\\notepad.exe" (double quoting, since one level is > stripped before strace, the other is stripped by the bash being traced) that > bash treats c:\winnt\system32\notepad.exe as a relative path rather than > absolute, and tries to prepend PATH entries to it. > I believe that it is Bash itself that is causing this behavior, and not some underlying Cygwin mechanism, for two reasons: First, the backslash format of the command works fine under zsh, tcsh, and csh. Second, backslashed paths work fine under Bash, if used as parameters to built-in commands like cd, or external commands like wzzip.exe. I recreated your results using "strace bash -c c:\\\\windows\\\\system32\\\\notepad.exe", and I agree that it Bash seems to be treating the backslashed path version of the command as though it is a relative pathed command, whereas the command using forward slashes does not result in a search along the path. > > My solution - DON'T USE BACKSLASHES in cygwin if you can help it. Cygwin > understands forward slash, and provides /cygdrive/c, so you might as well use > them. Besides, cygpath(1) is there to help you convert between Windows and > POSIX path names. > I understand your advice, and can follow it as a very minor nit that I may forget occasionally when I am typing. I am more concerned that since I am the local "guru" on the Cygwin environment (and I use the term very loosely), that I may get inundated with questions, when/if other people update. (I installed Cygwin on several people's PC for them, but it was version 1.5.11-1 or earlier. On the other hand, I am not sure how many other people know enough to try to update their installations.) > > -- > Eric Blake > volunteer cygwin bash maintainer > > > > -- > 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/ I will probably just update to the latest Cygwin and Bash versions, and see what happens. Thanks! ************************************************** * Victor Atkinson * Syracuse, NY, USA * atkinson AT syrres DOT com ************************************************** -- 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/