Создание находящегося в Debian дистрибутива Linux онлайн

Если вам нужно решение awk , вы можете использовать что-нибудь вроде приведенного ниже.

 awk '/PATTERN/{system("cat file1");next}1' file2

Тестирование

cat file1
ramesh' has " and /
in this file
and trying
"to replace'
the contents in 
/other file.

Теперь у меня есть file2, как показано ниже.

cat file2
This is file2
PATTERN 
After pattern contents go here.
PATTERN 

Теперь я использую вышеупомянутую awk команду.

Выход:

This is file2
ramesh' has " and /
in this file
and trying
"to replace'
the contents in 
/other file.
After pattern contents go here.
ramesh' has " and /
in this file
and trying
"to replace'
the contents in 
/other file.

Ссылки

http://www.unix.com/shell-programming-and-scripting/158315-replace-string-contents-txt-file-containing-multiple-lines-strings.html

1
13.03.2014, 08:38
1 ответ
[117191]Что-то, что вы можете сделать с помощью [117496]Debian Live Build[117497] и выбрать да в программе установки Debian.[117192].
1
27.01.2020, 23:52

Теги

Похожие вопросы