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: identical scripts don't behave identically


I'll bet one has a carriage return ( and/or line feed) and the other doesn't which would fail on an incomplete last line.  I've been burned by this many times.  Always end the script by hitting the enter to avoid this.

-----Original Message-----
From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of Thrall, Bryan
Sent: Wednesday, July 08, 2009 3:19 PM
To: cygwin@cygwin.com
Subject: RE: identical scripts don't behave identically

roc97007 wrote on Wednesday, July 08, 2009 5:11 PM:
> To summarize, as far as I can tell the files are identical, but one
works
> and the other can't seem to find the current directory.  If, in the
broken
> script, I substitute any command that needs to read or write to or
from the
> file system, it will always fail with "file not found" or "no such
file or
> directory".  The other script with the exact same commands (assuming
they
> are legal and reasonable) will always work.
>
> Obviously there is a difference between the files.  I can't figure out
what
> it is.  The issue is demonstrably a characteristic of the file,
because if I
> delete or rename aaa.sh and then "cp aab.sh aaa.sh", then they will
both
> work.
>
> This is driving me crazy.  We are under a deadline, and some scripts
work
> and some do not, seemingly randomly.  Our current work-around is to
copy a
> script that works to a different name and then replace the content.
This is
> a ridiculous workaround, and since we don't know what the mechanism is
we
> have no idea if it'll still work tomorrow or next week.
>
> Please help!

Perhaps one of the files has DOS line endings and the other has UNIX
line endings? Try d2u on the broken one to see if it fixes the problem.

--
Bryan Thrall
FlightSafety International
bryan.thrall@flightsafety.com

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