### gMOO Tcl configuration script
#

### Register macros:
#
register.macro run do_run {This command runs a file on your system and shows it in your room}
register.macro sh  do_sh  {This command runs a file on your system}

### Implement macros
#
proc do_run {ID args} {
	set output [exec /bin/sh -c "$args" < /dev/null  2>&1]
	send $ID ":LINUXes: $args"
	send $ID "sp --------"
	set lis [split $output "\n"]
	foreach element $lis {
		send $ID "sp $element"
	}
	send $ID "sp --------"
}

proc do_sh {ID args} {
	set output [exec /bin/sh -c "$args" < /dev/null  2>&1]
	tell $ID "You LINUX (private): $args"
	tell $ID "--------"
	tell lis [split $output "\n"]
	foreach element $lis {
		tell $ID "sp $element"
	}
	tell $ID "sp --------"
}

