This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to execute shell commands?

Old posts that have not been replied to for several years.
Locked
e
evenfall

How to execute shell commands?

Post by evenfall »

It is possible and how to execute external shell command? Like ifconfig for example or uptime.
Can anyone give me an example of how to run something in shell and grab the output and print it in channel.
M
Meltdown

Post by Meltdown »

either with
set mydata [exec ls]
foreach x $mydata {
#do something with $x
}
or with
set fs [open |ls]
while {![eof $fs]} {
gets $fs data
#do something with $data
}
close $fs
Locked