[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: control-M characters that are NOT end of line characters

From: Alan Barrett <apb_at_cequrux.com>
Date: Thu, 5 Jan 2012 09:04:16 +0200

On Wed, 04 Jan 2012, James Hartleroad wrote:
>But I have a shell script removeCTLM.ksh that has an embedded cntl-m as
>part of a regular expression, for example sed 's/^M//g' $file > tmpfile

If this is a shell programming question rather than a subversion
question, then I suggest changing the script to not use an embedded
control-M. Here are two ways of doing that:

        tr -d '\r' <"$infile" >"$outfile"

        control_M="$(printf '\r')"
        sed -e "s/${control_M}//" <"$infile" >"$outfile"

--apb (Alan Barrett)
Received on 2012-01-05 08:05:29 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.