Dear Experts,
I am able to print the required columns in an output file with awk command using following command in a .SH file
awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
I want achieve the same thing using tcl command
But when i used following command in a .TCL, file it throws the following error
exec awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
can't read "1": no such variable
Could you please give me a correct syntax for the above issue?
On Sat, 21 Aug 2021 10:47:42 -0700, gpa...@gmail.com wrote:
Dear Experts,
I am able to print the required columns in an output file with awk command using following command in a .SH file
awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
I want achieve the same thing using tcl command
But when i used following command in a .TCL, file it throws the following error
exec awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
can't read "1": no such variable
Could you please give me a correct syntax for the above issue?
Not really. tcl is (now) a moderately obscure scripting language, and
while I have the book ("Tcl and the Tk toolkit" by John K. Ousterhout)
I don't /know/ the language.
Please realize that the argument handling and quoting requirements of
TCL are /not/ the same as posix shell, and you will have to do some work
to translate from shell to TCL. If you are working in TCL, you probably
need to read the book; "Tcl and the Tk toolkit" is the canonical book on
TCL, written by the author of the TCL language.
HTH
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 185 |
Nodes: | 16 (2 / 14) |
Uptime: | 11:34:04 |
Calls: | 3,718 |
Calls today: | 1 |
Files: | 11,157 |
Messages: | 3,451,865 |