Date: Wed, 18 Dec 2002 19:30:23 +0100 From: Roman Neuhauser <neuhauser@bellavista.cz> To: questions@FreeBSD.ORG Subject: Re: is there a delete/backspace command on Freebsd ? Message-ID: <20021218183022.GJ45336@freepuppy.bellavista.cz> In-Reply-To: <20021218134137.GA74300@happy-idiot-talk.infracaninophi> References: <007101c2a688$ccc06880$dc96eed5@ymmaslak> <20021218134137.GA74300@happy-idiot-talk.infracaninophi>
next in thread | previous in thread | raw e-mail | index | archive | help
# m.seaman@infracaninophile.co.uk / 2002-12-18 13:41:37 +0000: > On Wed, Dec 18, 2002 at 01:29:59PM +0200, Malik Bülent wrote: > > > I have a file. > > How can I backspace 5 character that start with expressions(the expression > > starts /aaa) in a file ? > > for example my file; > > " /aaa/yy/ > > /aaa/.. > > " > > If you mean "how can I delete each instance of 5 characters starting > with /aaa from a file", then something like this should do it: > > perl -pi.bak -e 's:/aaa.::g;' filename > > which deletes the /aaa and the following (fifth) character. If you > mean to delete the 5 characters immediately *following* /aaa then: > > perl -pi.bak -e 's:(?<=/aaa).{5}::g' filename sed -i.bak 's:/aaa.::g' filename sed -Ei.bak 's:(/aaa).{5}:\\1:g' filename would probably be quite faster (neither tested) -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html 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?20021218183022.GJ45336>