From owner-freebsd-questions@FreeBSD.ORG Sun May 8 20:35:52 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7F4F16A4E6 for ; Sun, 8 May 2005 20:35:52 +0000 (GMT) Received: from kraid.nerim.net (smtp-100-sunday.nerim.net [62.4.16.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BF9843D78 for ; Sun, 8 May 2005 20:35:52 +0000 (GMT) (envelope-from regisr@pobox.com) Received: from crocoite.home.regix.com (regisr.net1.nerim.net [62.212.109.60]) by kraid.nerim.net (Postfix) with SMTP id DCA3B40E21 for ; Sun, 8 May 2005 22:35:49 +0200 (CEST) Date: Sun, 8 May 2005 22:35:45 +0200 From: regisr To: freebsd-questions@freebsd.org Message-Id: <20050508223545.1ab06331.regisr@pobox.com> In-Reply-To: <427E6E22.3030400@cox.net> References: <20050508192019.127ED1CE303@ws1-6.us4.outblaze.com> <20050508214047.109a3584.regisr@pobox.com> <427E6E22.3030400@cox.net> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-portbld-freebsd5.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: On removing ^M X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2005 20:35:52 -0000 On Sun, 08 May 2005 12:53:06 -0700 > > tr -d "\r" < input-file > output-file > Or: > perl -pi -e 's/\015//' *.c > which will edit all .c files in place, or: > perl -pi.bak -e's/\015//' *.c (I forget to add a for or foreach line!) If there is a large number of files (i.e. if the command is too long - error: "Argument list too long") try something like: find -X . -type f -print | xargs -L 1 perl -pi.bak -e's/\015//' Don't forget to do a backup copy of your original files! If filenames should be protected (enclosed in "" or '' ) the -X find option complains and skip them. --