Text file contains the following:
old regex
old old regex
old old old regex
I want to add a comma before the word regex
I know one method is: sed 's/regex/,regex/g'
Question is there a method where I can store what I find from sed into a variable?
For example: sed finds the word regex > I store what sed finds into a variable > and then replace what sed finds with a new value
I hope I'm making sense here! Thank you in advance!
[link] [comments]