delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/26/01:50:47

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <3948f0730805252250q187cb485u25f5c87a0f73c395@mail.gmail.com>
Date: Mon, 26 May 2008 08:50:23 +0300
From: "Gadi Oron" <gadior AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin Digest 25 May 2008 15:30:48 -0000 Issue 5990
In-Reply-To: <1211729448.28588.ezmlm@cygwin.com>
MIME-Version: 1.0
References: <1211729448 DOT 28588 DOT ezmlm AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi Christopher,

On Sun, May 25, 2008 at 6:30 PM,  <cygwin-digest-help AT cygwin DOT com> wrote:

> Found: c:\Program Files\GnuWin32\bin\rm.exe
> Warning: C:\cygwin\bin\rm.exe hides c:\Program Files\GnuWin32\bin\rm.exe
>
> in your cygcheck output.  I wonder if you're running a non-cygwin version
> of sh (or make) somehow.
>
> ls -l `which make`
> ls -l `which sh`

I don't think this is the case. Both commands returned the executables
at /usr/bin.

Anyway, I believe that I've pin-pointed the behaviour of bash -c (when
executed as sh).

The fault is that executing

/bin/sh -c "cd <dir>"

will fail for <din> in the working folder unless it has a preceding "./"

For example

$ ls -d Code
Code/

$ /bin/sh -c "cd Code; pwd"
/bin/sh: line 0: cd: Code: No such file or directory
/home

$ /bin/bash -c "cd Code; pwd"
/home/Code

$ /bin/ash -c "cd Code; pwd"
/home/Code

$ /bin/sh -c "cd ./Code; pwd"
/home/Code

Since /bin/sh is a copy of bash, it seems that somehow my bash
misbehaves when runnning in sh compatibility mode.

What is strange that this only happens on one computer. On a second
box I use with the same version this is not happening.

Thank you for the help.

- Gadi

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019