K
K
kkorolev2021-09-26 11:24:11
bash
kkorolev, 2021-09-26 11:24:11

How to use SED to insert a word in quotation marks?

There is a primer.conf file template with the following content:
...

CONFIG="USER OUTPUT"

...

How do I use SED to insert the word "CONSOLE" in quotes to get CONFIG="USER OUTPUT CONSOLE"? The USER word may change.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xibir, 2021-09-26
@kkorolev

echo 'CONFIG="USER OUTPUT"' | sed -r 's/(CONFIG="USER OUTPUT)"/\1 CONSOLE"/'

V
Viktor Taran, 2021-09-26
@shambler81

Wrote here
https://klondike-studio.ru/blog/sed-spetssimvoly/?...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question