D
D
dsmaslov2018-08-07 12:41:34
linux
dsmaslov, 2018-08-07 12:41:34

How to replace all/first occurrence of TEST with TEST2 in a file?

You need to do the following using any grep, sed, awk utility :

Replace all/first occurrence(s) of TEST with TEST2 in the test.txt file. Output a line from the file only if the searched substring matches \s+SOMETEXT\s+.

Tell me where to dig and how to do it?

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-08-07
@dsmaslov

Tell me where to dig and how to do it?

Read manuals. This is the simplest thing that can be done with these utilities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question