* [Comm] Замена одного двумя
@ 2005-09-19 12:56 Aleksander N. Gorohovski
2005-09-19 14:04 ` Eugene Ostapets
0 siblings, 1 reply; 5+ messages in thread
From: Aleksander N. Gorohovski @ 2005-09-19 12:56 UTC (permalink / raw)
To: community
Доброго времени суток сообщество!
Подскажите как можно элегантно средствами bash
выполнить замену одного символа в файле двумя другими?
Пробовал, например:
tr -s "1" "23" < file1 > file2
ругается (вообщем справедливо) и не помогает.
Конечно можно и на Perl программку сделать, но хотелось bash.
:-)
Спасибо.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Comm] Замена одного двумя
2005-09-19 12:56 [Comm] Замена одного двумя Aleksander N. Gorohovski
@ 2005-09-19 14:04 ` Eugene Ostapets
2005-09-19 14:11 ` На один cat меньше " Dmytro O. Redchuk
2005-09-20 5:30 ` Aleksander N. Gorohovski
0 siblings, 2 replies; 5+ messages in thread
From: Eugene Ostapets @ 2005-09-19 14:04 UTC (permalink / raw)
To: ALT Linux Community
19.09.05, Aleksander N. Gorohovski<angel feht.dgtu.donetsk.ua> написал(а):
> Доброго времени суток сообщество!
>
> Подскажите как можно элегантно средствами bash
> выполнить замену одного символа в файле двумя другими?
>
> Пробовал, например:
> tr -s "1" "23" < file1 > file2
> ругается (вообщем справедливо) и не помогает.
Это не bash
>
> Конечно можно и на Perl программку сделать, но хотелось bash.
Ну на таком баше и я могу: cat file1 | sed 's@1@23@g' > file2 или
subst 's@1@23@g' file
--
С уважением,
Евгений Остапец
uin: 23747217
jid: eugene_ostapets@jabber.ru
^ permalink raw reply [flat|nested] 5+ messages in thread
* На один cat меньше Re: [Comm] Замена одного двумя
2005-09-19 14:04 ` Eugene Ostapets
@ 2005-09-19 14:11 ` Dmytro O. Redchuk
2005-09-20 5:34 ` Aleksander N. Gorohovski
2005-09-20 5:30 ` Aleksander N. Gorohovski
1 sibling, 1 reply; 5+ messages in thread
From: Dmytro O. Redchuk @ 2005-09-19 14:11 UTC (permalink / raw)
To: ALT Linux Community
On Mon, Sep 19, 2005 at 05:04:11PM +0300, Eugene Ostapets wrote:
> 19.09.05, Aleksander N. Gorohovski<angel feht.dgtu.donetsk.ua> написал(а):
> > Доброго времени суток сообщество!
> >
> > Подскажите как можно элегантно средствами bash
> > выполнить замену одного символа в файле двумя другими?
> >
> > Пробовал, например:
> > tr -s "1" "23" < file1 > file2
> > ругается (вообщем справедливо) и не помогает.
> Это не bash
> >
> > Конечно можно и на Perl программку сделать, но хотелось bash.
> Ну на таком баше и я могу: cat file1 | sed 's@1@23@g' > file2 или
sed 's@1@23@g' < file1 > file2
> subst 's@1@23@g' file
>
>
> --
> С уважением,
> Евгений Остапец
> uin: 23747217
> jid: eugene_ostapets@jabber.ru
--
_,-=._ /|_/|
`-.} `=._,.-=-._., @ @._,
`._ _,-. ) _,.-'
` G.m-"^m`m' Dmytro O. Redchuk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: На один cat меньше Re: [Comm] Замена одного двумя
2005-09-19 14:11 ` На один cat меньше " Dmytro O. Redchuk
@ 2005-09-20 5:34 ` Aleksander N. Gorohovski
0 siblings, 0 replies; 5+ messages in thread
From: Aleksander N. Gorohovski @ 2005-09-20 5:34 UTC (permalink / raw)
To: ALT Linux Community
On Mon, 19 Sep 2005 18:11:42 +0400, Dmytro O. Redchuk wrote:
> On Mon, Sep 19, 2005 at 05:04:11PM +0300, Eugene Ostapets wrote:
>> 19.09.05, Aleksander N. Gorohovski<angel feht.dgtu.donetsk.ua>
>> написал(а):
>> > Доброго времени суток сообщество!
>> >
>> > Подскажите как можно элегантно средствами bash
>> > выполнить замену одного символа в файле двумя другими?
>> >
>> > Пробовал, например:
>> > tr -s "1" "23" < file1 > file2
>> > ругается (вообщем справедливо) и не помогает.
>> Это не bash
>> >
>> > Конечно можно и на Perl программку сделать, но хотелось bash.
>> Ну на таком баше и я могу: cat file1 | sed 's@1@23@g' > file2 или
> sed 's@1@23@g' < file1 > file2
Спасибо.
:-)
>> subst 's@1@23@g' file
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Comm] Замена одного двумя
2005-09-19 14:04 ` Eugene Ostapets
2005-09-19 14:11 ` На один cat меньше " Dmytro O. Redchuk
@ 2005-09-20 5:30 ` Aleksander N. Gorohovski
1 sibling, 0 replies; 5+ messages in thread
From: Aleksander N. Gorohovski @ 2005-09-20 5:30 UTC (permalink / raw)
To: eostapets, ALT Linux Community
On Mon, 19 Sep 2005 18:04:11 +0400, Eugene Ostapets wrote:
> 19.09.05, Aleksander N. Gorohovski<angel feht.dgtu.donetsk.ua>
> написал(а):
>> Доброго времени суток сообщество!
>>
>> Подскажите как можно элегантно средствами bash
>> выполнить замену одного символа в файле двумя другими?
>>
>> Пробовал, например:
>> tr -s "1" "23" < file1 > file2
>> ругается (вообщем справедливо) и не помогает.
> Это не bash
>>
>> Конечно можно и на Perl программку сделать, но хотелось bash.
> Ну на таком баше и я могу: cat file1 | sed 's@1@23@g' > file2 или
> subst 's@1@23@g' file
O-o-o!
Шикарно!
Премного Вам благодарен.
:-)
Простите меня, может я не правильно выразился про bash,
но это то!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-09-20 5:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-19 12:56 [Comm] Замена одного двумя Aleksander N. Gorohovski
2005-09-19 14:04 ` Eugene Ostapets
2005-09-19 14:11 ` На один cat меньше " Dmytro O. Redchuk
2005-09-20 5:34 ` Aleksander N. Gorohovski
2005-09-20 5:30 ` Aleksander N. Gorohovski
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