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


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


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