In Ruby/PERL, I can very easily get the console output of a system command fed into a file. For example:
$k = `ls`
Would input the output of ls into variable $k in PERL (and Ruby).
How can one do something like this in Tcl?
Thanks
Use exec
command to get the same.
set output [ exec ls ]
puts $output
Man page : exec
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With