Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 To: cygwin AT cygwin DOT com From: mitch gart Subject: sed and searches for $ Date: Tue, 5 Apr 2005 20:02:02 +0000 (UTC) Lines: 23 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 158.228.56.15 (Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2) X-IsSubscribed: yes It seems like sed works differently when searching for end-of-line ($) depending if it's launched from a DOS prompt or from inside a shell prompt. For example if I have a file named junk which contains 1 line hello\ ( \ is the last character of the line.) The command sed -n -e /\\$/= junk prints 1 when launched from DOS, and prints nothing when launched from the shell. I've been pretty mystefied by this but I'm guessing the reason has something to do with the difference between lines terminated by \r\n (DOS) and \n (Unix). Anyway what I want is to write a sed script that recognizes both kinds of line separators, and runs correctly from inside the shell. Can somebody tell me how? Thanks. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/