I have the following TCL script which executes a Linux command to format a file.
exec sed -r '2,$s/(.{55} )/\1\n\t/g' $formatfileName | sed 's/ $//' > $formatfileName
I get an error saying can't read "s": no such variable while executing
the above line - It is considering $ sign in Linux command as a variable. I tried to put curly braces {} but that did not work.
Can you please advise how to use the above command without errors? Thanks for your help.
Copyright Notice:Content Author:「NewCoder」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/46085397/error-executing-linux-command-using-tcl