X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 31 Dec 2011 16:32:21 -0500 Message-ID: Subject: Fwd: CRLF From: Chris Sutcliffe To: The Cygwin Mailing List Content-Type: text/plain; charset=windows-1252 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id pBVLXA5P009074 Below please find the response from Thorsten (the mksh developer) regarding CRLF. Chris ---------- Forwarded message ---------- From: Thorsten Glaser Date: 31 December 2011 15:00 Subject: Re: CRLF To: miros-discuss AT mirbsd DOT org Chris Sutcliffe dixit: >The mksh developer's preference is that mksh behave the same >irregardless of platform Yes. I’m even prepared to fight POSuX on some of the things they mandate that would require different behaviour across platforms, and, if necessary, be not compliant. This is a feature, and really a big one, trust me. Implicit CR stripping WILL break existing scripts. I know of at least one. >> Or you could use dos2unix... > >I think this would be the best course of action on this particular issue. tr -d \\r would work, too (but also strip CR in the middle). Quick hack (needs just a POSuX shell and no local builtin): mkshdos_re=$(printf 's/\r$//') mkshdos() {        if test -n "$1"; then                mkshdos_fn=$1                shift        else                mkshdos_fn=-        fi        mkshdos_T=$(mktemp /tmp/mkshdos.XXXXXXXXXX) || {                echo >&2 mkshdos: Error: Could not create temporary file.                return 255        }        sed "$mkshdos_re" <"$mkshdos_fn" >"$mkshdos_T"        mksh "$mkshdos_T" "$@"        mkshdos_rv=$?        rm -f "$mkshdos_T"        return $mkshdos_rv } Please forward this. -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d -- 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