Backtick with variables?

I want to run an external command and capture the output.

hosts =net view

will store the results from running net view (XP command to list
machines on network) in a string called hosts.

How do I execute a command stored in a string and capture its output
though?

Hi,

From: [email protected]

I want to run an external command and capture the output.

hosts =net view

will store the results from running net view (XP command to list
machines on network) in a string called hosts.

How do I execute a command stored in a string and capture its output
though?

cmd = “net view”
hosts = #{cmd}

There’s also popen() if you would prefer to read the output from a
pipe.

Regards,

Bill