From: "Fr. Br. George" <george@altlinux.ru>
To: ALT Linux Community <community@lists.altlinux.org>
Subject: Re: [Comm] sed
Date: Tue, 15 Aug 2006 14:24:49 +0400
Message-ID: <20060815102449.GA38282@grep.po.cs.msu.su> (raw)
In-Reply-To: <44D86931.3080200@altlinux.ru>
On Tue, Aug 08, 2006 at 02:36:33PM +0400, Anton Gorlov wrote:
> Artem Zolochevskiy пишет:
>
> > а что вот такое не прокатит?
> > sed "s/RADIUS_VERSION\t105/RADIUS_VERSION\t`echo ${ver} | sed 's/\.//g'`/g"
> В таком варианте может сработаь не только там где надо sed 's/\.//g'`/g"
Эта программа полностью эквивалентна вашей: "sed 's/\.//g'`/g"
отработает один раз, а результат подставится в `...`.
Вот если $version (которое без точек) у вас вычисляется _заранее_, а
затем _много_ раз запускается sed "s/RADIUS_VERSION...", тогда да.
Но тогда вам _на самом деле_ нужна эта переменная! :)
Только я бы написал "tr -d ." вместо "sed 's/\.//g'", но это дела не меняет.
--
Георгий Курячий (aka Fr. Br. George)
Руководитель образовательных проектов ALT Linux
mailto : george at altlinux_ru
P.S. На bash-е можно было бы сделать вообще без sed-а, но башизм -- это зло
next prev parent reply other threads:[~2006-08-15 10:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-08 10:07 Anton Gorlov
2006-08-08 10:33 ` Artem Zolochevskiy
2006-08-08 10:36 ` Anton Gorlov
2006-08-15 10:24 ` Fr. Br. George [this message]
2006-08-08 10:35 ` LVU
2006-08-08 11:59 ` Yura Kalinichenko
2006-08-08 13:10 ` Anton Gorlov
2006-08-08 19:44 ` Michael Shigorin
2006-08-08 19:50 ` Andrey Rahmatullin
2006-08-21 16:17 ` Peter Volkov
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=20060815102449.GA38282@grep.po.cs.msu.su \
--to=george@altlinux.ru \
--cc=community@lists.altlinux.org \
/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 Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git