ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Mikhail Zabaluev <mhz@alt-linux.org>
To: devel@altlinux.ru
Subject: [devel] Re: Как сделать pipe с буфером?
Date: Tue, 19 Mar 2002 01:43:25 +0300
Message-ID: <20020318224325.GB3063@mhz.mikhail.zabaluev.name> (raw)
In-Reply-To: <20020318164253.GA29475@ramax.spb.ru>

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

Hello Igor,

On Mon, Mar 18, 2002 at 07:42:53PM +0300, Igor Homyakov wrote:
>
> > > > >> Мне нужно удалить несколько строк из файла, предварительно мною
> > > > >>туда записанных.
> > > > >>
> > > > >Лучше всего делать это через perl
> > > > >perl -pi -e 's@to_remove@@' somefile.txt
> > > > 
> > > >    Вот те раз! А я специально вычищал perl-зависимости
> > > >  из dosemu, заменяя perl на sed и grep.
> > > 
> > > к тому же в perl-овой документации подобные конструкции использовать
> > > настоятельно НЕ рекомендуют.
> > 
> > В каком месте?
> 
> В том смысле, что одно неосторожное движение и содержимое файла будет
> безвозвратно потеряно 'man perlrun'. В данном случае это не слишком важно,
> но лучше не иметь привычки писать такой код.

Для однострочных sed-подобных команд годится опция -i.bak

perl -pi.bak -e 's@to_remove@@' somefile.txt

-- 
Stay tuned,
  MhZ                                     JID: mookid@jabber.org
___________
There's no point in being grown up if you can't be childish sometimes.
		-- Dr. Who

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

      reply	other threads:[~2002-03-18 22:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-18 13:39 [devel] " Grigory Batalov
2002-03-18 14:50 ` Igor Homyakov
2002-03-18 13:53   ` Sergey Vlasov
2002-03-18 16:42     ` Igor Homyakov
2002-03-18 22:43       ` Mikhail Zabaluev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020318224325.GB3063@mhz.mikhail.zabaluev.name \
    --to=mhz@alt-linux.org \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git