K
K
Kirill Gerasenkov2014-08-27 16:21:06
bash
Kirill Gerasenkov, 2014-08-27 16:21:06

How to insert a word using bash between repeated characters in a file?

Hello!
Is available:
a certain file with the text inside.
the desired piece of text:
" mydomain.ru/blablablabla "
Need:
insert "www" in each place where the domain is specified, so that it is " www.mydomain.ru/blablabla ".
I know that using sed, but I don’t know how exactly, there is absolutely no time to thoroughly manual sed :(
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Petrikov, 2014-08-27
@m000dy

sed 's/mydomain\.ru/www.mydomain.ru/g'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question