Can someone tell me why the following line works when it is in a separate sed script, but doesn't when the line is part of a larger script?The script is called with the command:
sed -f sedscr input > output
And this is the line that works as I want it to:
s/ VARCHAR2(3)/,3,' '\)\|\|/
But if I have the following in a larger shell script, the single quotes won't allow the sed command to parse and I get a command garbled error message:
sed -e 's/ VARCHAR2(3)/,3,' '\)\|\|/g' input > output
But, if rather than having the single quotes, I put double quotes, it does work.
sed -e 's/ VARCHAR2(3)/,3," "\)\|\|/g' input > output
I think I tried every combination possible of trying to escape the single quotes, but never could get it to work. Does anyone have any ideas?
Thanks in advance.
sed -f sedscr input > output
And this is the line that works as I want it to:
s/ VARCHAR2(3)/,3,' '\)\|\|/
But if I have the following in a larger shell script, the single quotes won't allow the sed command to parse and I get a command garbled error message:
sed -e 's/ VARCHAR2(3)/,3,' '\)\|\|/g' input > output
But, if rather than having the single quotes, I put double quotes, it does work.
sed -e 's/ VARCHAR2(3)/,3," "\)\|\|/g' input > output
I think I tried every combination possible of trying to escape the single quotes, but never could get it to work. Does anyone have any ideas?
Thanks in advance.