Does Tcl have the equivalent of PERL and Ruby backtic

In Ruby / PERL, I can very easily get the console output of a system command filed. For instance:

$k = `ls` 

Will inject ls output into the $ k variable in PERL (and Ruby).
How can I do something like this in Tcl?
Thanks

+5
source share
1 answer

Use the exec command to get the same thing.

 set output [ exec ls ] puts $output 

Man page: exec

+9
source

Source: https://habr.com/ru/post/1210485/


All Articles