I have a line as follows
// Testing this
I am trying to use a sed command to replace the // with a /* (sentence or word in between) */ on each line.
so it should look something like this
/* Testing this */
The first part is easy with calling
sed 's#//#/*#'
however, with the second part, I tried this solution
Appending word at the end of line with sed [duplicate]
I tried with -e
which gave me an error of 'unterminated s command'. Then, I tried with a semi colon to make it one so it was something along the lines of
's#//#/*#;#//#s#/$#*/#'
but all that seems to do is the first part (replacing //
with /*
)and not the second (putting a */
at the end of the same line).
What am I not doing correctly? Any pointers would be appreciated.