shell.run

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function shell.run
Runs program with as many specified arguments as are provided.

Essentially takes all parameters passed to it and runs them as one line - for eg, shell.run("monitor","top","alongtimeago") is the same as shell.run("monitor top alongtimeago"), and you can use whichever syntax happens to suit you.

See also: shell.openTab()
Syntax shell.run(string program [, string args1, string args2, ...])
Returns boolean success
Part of ComputerCraft
API shell

Examples

Grid paper.png  Example
Runs the program "myProgram" with arguments "test" and "ing":
Code
shell.run("myProgram", "test", "ing")
Output The program myProgram with the arguments "test" and "ing".



Grid paper.png  Example
Runs the program "monitor" along with the other arguments set in "myTable":
Code
local myTable = {"monitor","left","worm"}

shell.run( unpack(myTable) )