public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "arrl via cygwin" <cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Grep can't match characters before EOL marker without ^M
Date: Wed, 03 Jan 2018 18:45:00 -0000	[thread overview]
Message-ID: <00e694f3-1e50-24be-95dd-8b6bf2bb1323@aol.com> (raw)
In-Reply-To: <CAA5t8Vrr_GcYqaLq-1noAj7mxQ7KsMnd43k10-ef1anuCr60Tg@mail.gmail.com>

On 1/3/2018 12:31 PM, David Karr wrote:
> My cygwin version appears to be "2.9.0(0.318/5/3)".
> 
> If I have a text file that has a line that ends with "abc", and I try
> to grep for "abc$", it doesn't match.  I find that it does match "$"
> and "abc^M$".
> 
> I've read some of the documentation about line endings in Cygwin.
> 
> I need to write some scripting that works on both Cygwin and Linux.
> What do I need to do here?
> 

Consider running dos2unix on files containing ^M at line ends.


-- 
Tim Prince

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

  parent reply	other threads:[~2018-01-03 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 17:31 David Karr
2018-01-03 17:56 ` Brian Inglis
2018-01-03 18:45 ` arrl via cygwin [this message]
2018-01-04 19:51   ` cyg Simple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00e694f3-1e50-24be-95dd-8b6bf2bb1323@aol.com \
    --to=cygwin@cygwin.com \
    --cc=tprince@intelretiree.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).