This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: bash - command - PATH question


I double and triple checked for DOS things \r,  ^M, etc.
I use emacs to edit and so it's pretty clear about DOS things.
Anyway, I ran od -c on files and outputs of 'echo $PATH', etc.
I compared PATH in normal shell with PATH after 
spawning a new bash, since the command worked in the new bash.
The only difference in PATH is that ":/cygdrive/c/DOCUME~1/harryr/bin"
was appended to PATH.  This is understandable since my .bashrc does
"export PATH=$PATH:~/bin".  So, in my normal shell where the error
was happening I next tried this:

PATH=$PATH:~/bin

and low and behold foo ran correctly.

FWIW, /cygdrive/c/DOCUME~1/harryr/bin is in PATH twice now, both at
the end.

I agree that the shebang is normaly the problem.  But all this 
difference in behavior is external to foo.

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of Rockefeller, Harry
Sent: Wednesday, May 19, 2010 10:38 AM
To: cygwin@cygwin.com
Subject: RE: bash - command - PATH question

I found that if I give the simple 'bash' command to create a new
shell then type 'foo' it does work.

[quote on]
-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of Andrew DeFaria
Sent: Wednesday, May 19, 2010 10:28 AM
To: cygwin@cygwin.com
Subject: Re: bash - command - PATH question

Again, have you tried dos2unix foo?

On 05/19/2010 08:16 AM, Rockefeller, Harry wrote:
>> On 5/19/2010 8: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
>>>        
>    
>> What happens when you directly run ./bin/foo?
>>      
> I get exactly the same error.  The error is correct.
> ./bin/foo doesn't exist. (I'm not in home directory when
> I issue the command.)
>
>    
>> What is the shebang (first line) of foo?
>>      
> #!/bin/bash
> I thought it might have something to do with this and tried commenting
> It out but nothing changed.
>
>    
>>> BUT since foo is *really in* PATH, e.g.,
>>>
>>> $ `which foo`
>>>
>>> runs correctly?
>>>        
>    
>> What is the output of "which foo" in this case?
>>      
> /cygdrive/c/DOCUME~1/harryr/bin/foo
>
[quote off]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]