Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2002 09:27:47 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        questions@FreeBSD.ORG
Subject:   Re: FreeBSD bootable floppy Script NOT WORKING
Message-ID:  <20021022082747.GB7271@happy-idiot-talk.infracaninophi>
In-Reply-To: <3DB4F006.8020109@401.cx>
References:  <Pine.LNX.4.44.0210211633120.19721-100000@janeway.vonbek.dhs.org> <3DB4F006.8020109@401.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 22, 2002 at 08:28:22AM +0200, Roger 'Rocky' Vetterberg wrote:

> perl -i.bak -npe 's/\r\n/\n/g'

Pedant point of the day.  Be careful of combining the -n and -p flags
on the perl command line, as they mean contradictory things.  '-n' is
loop over all the lines of the input *without* printing then, whereas
'-p' is loop over all the lines of the input and print them to stdout.

The command as written will work, for as perlrun(1) says:

    A -p overrides a -n switch.

but it would be better to write the command as:

    perl -i.bak -pe 's/\r\n/\n/g'

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021022082747.GB7271>