Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17819

Sed Question/Help

$
0
0

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!

submitted by /u/laffytaffykidd
[link] [comments]

Viewing all articles
Browse latest Browse all 17819

Trending Articles