You're replying to a comment by JESS.

JESS Permalink
February 09, 2013, 00:06

Hi, Can you please help me with the following question.

I'm using sed to add HELLO at the end of the each DATE* word.

$ echo $TAB_COLS
ID,TITLE,DATE_PROG1,DATE_PROG2

I get the following.
$ echo $TAB_COLS | sed -e 's/\(,DATE.*\),*/\1 \"HELLO\"/g'
ID,TITLE,DATE_PROG1,DATE_PROG2 "HELLO"

But, I expact the output as copied below.

ID,TITLE,DATE_PROG1 "HELLO",DATE_PROG2 "HELLO"

How can I achive this? Does this have to do anything with sed grediness?

Thanks for your help.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "linux_95": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.