[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: David Chapman <dcchapman_at_acm.org>
Date: Wed, 04 Jan 2012 16:11:27 -0800

On 1/4/2012 12:56 PM, James Hartleroad wrote:
>
> For autopopulate I’ve setup for shell scripts to be text/plain, native
> eol and executable
>
> *.ksh= svn:mime-type=text/plain;svn:eol-style=native;svn:executable
>
> 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
>
> I’ve ended up renaming it to removeCTLM.ksk so I could not include the
> native eol style
>
> *.ksk= svn:mime-type=text/x-ksh;svn:executable
>
> But I’m wondering if anyone has a better solution to this so I don’t
> have to play games with the filetypes to avoid Subversion from
> complaining about the ^M in the file?
>

It's been awhile since I've played with the Korn shell, but this works
in bash:

#!/bin/bash -f
sed 's/\r//g' $1 > tmpfile

Rather than use a special character, I used the shell's escape sequence.

-- 
     David Chapman         dcchapman_at_acm.org
     Chapman Consulting -- San Jose, CA
     Software Development Done Right.
     www.chapman-consulting-sj.com
Received on 2012-01-05 01:12:06 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.