Если вам нужно решение 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.
Ссылки