Is there a way to use the sed command this to search for a special character at the beginning of line, replace it with another special character, and append a special character to that line only?
I did some digging and and have looked thru a few forums, and tried to understand the man page for sed. It does look like I have to do something with the special characters. I am using the sed command to append the lines that would start with a [ and add a ] but it does not do anything. I think I am still missing something. The other issue is that its reliant on another sed* that replaces a //for a[`.
The find and replace:
sed -e 'y#//#[#'
This returns an error:
sed: -e expression #1, char 7: strings for `y' command are different lengths
The append:
sed -e "/^'['/s/$/']/g"
I created a copy of the file and did a find and and replace with a text editor changing the // for a [ however this command does not return any results and it does not add the character to the end.
I think i am still missing something for these command to work properly, and not sure if there is a way i can combine them to a single command.