www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/19/10:59:52

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
connect(): No such file or directory
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: bash - command - PATH question
Date: Wed, 19 May 2010 07:59:21 -0700
Lines: 22
Message-ID: <ht0uc9$tem$1@dough.gmane.org>
References: <3185EFAF9C8F7B4E9DBDF56829BF7C78378E8F0B AT srv060ex01 DOT ssd DOT fsi DOT com>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.10) Gecko/20100512 Lightning/1.0b2pre Thunderbird/3.0.5
In-Reply-To: <3185EFAF9C8F7B4E9DBDF56829BF7C78378E8F0B@srv060ex01.ssd.fsi.com>
X-IsSubscribed: yes
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

On 05/19/2010 06:50 AM, Rockefeller, Harry wrote:
> Given that 'foo' is a bash script, why is it that:
>
> $ foo
>
> returns the error:
>
> bash: ./bin/foo: No such file or directory
>
> BUT since foo is *really in* PATH, e.g.,
>
> $ `which foo`
>
> runs correctly?
Usually this means that foo is in "DOS" mode and contains extra carriage 
returns. So your she-bang line (i.e. #!/bin/bash) is actually 
#!/bin/bash<cr>, a file that doesn't exist. Do a dos2unix foo and you 
should be fine.
-- 
Andrew DeFaria <http://defaria.com>
You have the right to remain silent. Anything you say will be misquoted, 
then used against you.


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

- Raw text -


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