bash:strings:find_replace
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bash:strings:find_replace [2021/01/13 22:02] – peter | bash:strings:find_replace [2021/02/10 16:04] (current) – peter | ||
---|---|---|---|
Line 31: | Line 31: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Changing contents within a file ===== | ||
+ | |||
+ | <code bash> | ||
+ | contents=$(< | ||
+ | $ echo " | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **infile.txt**: | ||
+ | * **$old**: | ||
+ | * **$new**: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | To change the file in-place: | ||
+ | |||
+ | <code bash> | ||
+ | echo " | ||
+ | </ | ||
bash/strings/find_replace.1610575369.txt.gz · Last modified: 2021/01/13 22:02 by peter