X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:subject:to:references :content-type; q=dns; s=default; b=o0A7jhQWcp3yPOGOibF4zkwPEoxQt 6K48Cjq1PyrFhq6SWI2ND8ByRNQ+bV1s9XDx7VLC4ebL/ISpAoYT1t3DWv+VOAEM TyQlgGv/O48s7wB3Tb31a83Wtkhqz6bPNiZX5WR62IiIiaK7D5QCXLIf0u89QP/H QqNNVaCY68mJ2Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:subject:to:references :content-type; s=default; bh=DVAxWzp3p7NsCl+q3ReJPXEPC/k=; b=Bne tXCHrzVvwlfS89w1xJU6mugp5yWY6hHYUJ/f2GByPa6DMtaH77RGaJfbZNcD7J9f 9RR5jkMgMLD8EAz77QjJCFJWTIQ6QlVNsQxe/1OYRgKe2utTVyjaTfg65msUqcCQ IPzNEAIxEmYrQFiaz1QZRKZEmiXtLNwlGdLVIR9E= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=carriage, H*M:1c69fb81, H*M:google X-HELO: mail-ot1-f48.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:subject:to:references:user-agent; bh=XDKsmE9BgrzDFKztl8EZvrXfV03FAmommiXVZBDM4+E=; b=W/Zya/K+nrwy5ye497QQQV58n67tezvmYccwR5ws6Bp7Y96jVmlV3hZ0UBDRlz9Pxd J7zmFRCbNruSNTq4wkJ7ZrQHQPFtgDzArHx5r92VCIpC14wvTyCo2Ry+9ilcNtlbbV5o /Em7ae2/Rdz4rvGQaPjTX/8Bb24IZp2oiqTeywOFbdj/OWa5gSY4dbPXnQ7f047jH8ic r7A4wREUKCmp+aZ62tdTO9bZsucA3BObBW+AjEeHPrzW6CEG+a3J2dd/asRwdPBuEP5Q Fr46jMVaDO9idLpmFSddSrYZx/aC9klhM5oU1aEpRyZV7Q1ddaNFu6Umd9QMneK0C5oD kUJA== Message-ID: <5c179f2c.1c69fb81.64a2a.1b89@mx.google.com> Date: Mon, 17 Dec 2018 05:05:48 -0800 (PST) From: Steven Penny Subject: Re: grep 3.0-2 not stripping CRs on Windows To: cygwin AT cygwin DOT com References: <35FC3865-8891-4058-86DF-DA5F1DEFAFD4 AT isc DOT org> Content-Type: text/plain; charset=utf8; format=flowed User-Agent: Tryst/2.8.0 (cup.github.io/umber/awk/tryst) On Mon, 17 Dec 2018 13:22:48, Ondřej Surý wrote: > # No amount of options makes the grep find the text in the file > $ ./grep-3.0-2.exe 'foo$’ crlf.txt > $ ./grep-3.0-2.exe -U 'foo$' crlf.txt > $ ./grep-3.0-2.exe -a 'foo$’ crlf.txt Your commands are failing because you are not accounding for the carriage returns. as was said, this change was intentionally done for the purpose of making scripts MORE portable: https://cygwin.com/ml/cygwin/2017-02/msg00155.html if you want to keep your grep command, you need to remove CR first: $ printf 'alpha\r\nbeta\r\n' > CRLF.txt $ tr -d '\r' < CRLF.txt | grep 'a$' alpha beta -- 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