public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: strange script behavior with cygwin 1.0 bash
@ 2000-09-19 10:03 Earnie Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Earnie Boyd @ 2000-09-19 10:03 UTC (permalink / raw)
  To: Arlen Barr, 'cygwin@sourceware.cygnus.com'

--- Arlen Barr <abarr@telogy.com> wrote:
> Hi all,
> 
> I'm using bash 2.03 that came with the cygwin 1.0 distribution and am unable
> to run shell scripts that contain blank lines, I'm guessing because the
> files were created with a dos/windows editor that uses CRLF instead of LF.
> Every blank line produces the error message ": command not found", which
> leads me to believe it is a CRLF/LF problem.  The same scripts work fine,
> however, with bash in the cygwin beta 20 and cygwin 1.1 releases, and I have
> been using --norc and --noprofile options with the cygwin 1.0 bash which
> doesn't seem to help.  Anyone seen this behavior before?
> 

Yes, your error is most likely caused by \r\n line endings.  You must have
text=binary mounts, correct?  There are two ways to correct the problem:

1) remount your directories into text!=binary mode

2) cp foo.sh foo.tmp && tr -d '\r' < foo.tmp > foo.sh

3) Oops I said there were only two, use the most recent net release.

Cheers,

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: strange script behavior with cygwin 1.0 bash
@ 2000-09-19 11:34 Earnie Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Earnie Boyd @ 2000-09-19 11:34 UTC (permalink / raw)
  To: Arlen Barr, 'cygwin@sources.redhat.com'
  Cc: 'earnie_boyd@yahoo.com'

--- Arlen Barr <abarr@telogy.com> wrote:
> Hi Earnie,
> 
> I filtered the scripts through tr and it was indeed a CRLF problem.  However
> I would like to be able to edit the script in windows and run it as is ...
> Could the other versions of cygwin be working because the directories are
> mounted differently?
> 

No, it is because bash and ash have been modified to always read scripts in
text mode.  Therefore the \r of \r\n is removed when read.

Cheers,

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: strange script behavior with cygwin 1.0 bash
@ 2000-09-19 10:56 Arlen Barr
  0 siblings, 0 replies; 6+ messages in thread
From: Arlen Barr @ 2000-09-19 10:56 UTC (permalink / raw)
  To: 'cygwin@sources.redhat.com'; +Cc: 'earnie_boyd@yahoo.com'

Hi Earnie,

I filtered the scripts through tr and it was indeed a CRLF problem.  However
I would like to be able to edit the script in windows and run it as is ...
Could the other versions of cygwin be working because the directories are
mounted differently?

arlen


Yes, your error is most likely caused by \r\n line endings.  You must have
text=binary mounts, correct?  There are two ways to correct the problem:

1) remount your directories into text!=binary mode

2) cp foo.sh foo.tmp && tr -d '\r' < foo.tmp > foo.sh

3) Oops I said there were only two, use the most recent net release.

Cheers,

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: strange script behavior with cygwin 1.0 bash
@ 2000-09-19 10:03 Earnie Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Earnie Boyd @ 2000-09-19 10:03 UTC (permalink / raw)
  To: Arlen Barr, 'cygwin@sourceware.cygnus.com'

--- Arlen Barr <abarr@telogy.com> wrote:
> Hi all,
> 
> I'm using bash 2.03 that came with the cygwin 1.0 distribution and am unable
> to run shell scripts that contain blank lines, I'm guessing because the
> files were created with a dos/windows editor that uses CRLF instead of LF.
> Every blank line produces the error message ": command not found", which
> leads me to believe it is a CRLF/LF problem.  The same scripts work fine,
> however, with bash in the cygwin beta 20 and cygwin 1.1 releases, and I have
> been using --norc and --noprofile options with the cygwin 1.0 bash which
> doesn't seem to help.  Anyone seen this behavior before?
> 

Yes, your error is most likely caused by \r\n line endings.  You must have
text=binary mounts, correct?  There are two ways to correct the problem:

1) remount your directories into text!=binary mode

2) cp foo.sh foo.tmp && tr -d '\r' < foo.tmp > foo.sh

3) Oops I said there were only two, use the most recent net release.

Cheers,

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* strange script behavior with cygwin 1.0 bash
@ 2000-09-19  8:20 Arlen Barr
  0 siblings, 0 replies; 6+ messages in thread
From: Arlen Barr @ 2000-09-19  8:20 UTC (permalink / raw)
  To: 'cygwin@sourceware.cygnus.com'

Hi all,

I'm using bash 2.03 that came with the cygwin 1.0 distribution and am unable
to run shell scripts that contain blank lines, I'm guessing because the
files were created with a dos/windows editor that uses CRLF instead of LF.
Every blank line produces the error message ": command not found", which
leads me to believe it is a CRLF/LF problem.  The same scripts work fine,
however, with bash in the cygwin beta 20 and cygwin 1.1 releases, and I have
been using --norc and --noprofile options with the cygwin 1.0 bash which
doesn't seem to help.  Anyone seen this behavior before?

arlen

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* strange script behavior with cygwin 1.0 bash
@ 2000-09-19  7:42 Arlen Barr
  0 siblings, 0 replies; 6+ messages in thread
From: Arlen Barr @ 2000-09-19  7:42 UTC (permalink / raw)
  To: 'cygwin@sourceware.cygnus.com'

Hi all,

I'm using bash 2.03 that came with the cygwin 1.0 distribution and am unable
to run shell scripts that contain blank lines, I'm guessing because the
files were created with a dos/windows editor that uses CRLF instead of LF.
Every blank line produces the error message ": command not found", which
leads me to believe it is a CRLF/LF problem.  The same scripts work fine,
however, with bash in the cygwin beta 20 and cygwin 1.1 releases, and I have
been using --norc and --noprofile options with the cygwin 1.0 bash which
doesn't seem to help.  Anyone seen this behavior before?

arlen

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-09-19 11:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-19 10:03 strange script behavior with cygwin 1.0 bash Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
2000-09-19 11:34 Earnie Boyd
2000-09-19 10:56 Arlen Barr
2000-09-19 10:03 Earnie Boyd
2000-09-19  8:20 Arlen Barr
2000-09-19  7:42 Arlen Barr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).