This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Nasuno's profile picture

help with shell.run

Started by Nasuno, 08 October 2014 - 11:08 AM
Nasuno #1
Posted 08 October 2014 - 01:08 PM
Came here looking for a solution for issuing a command to linux.
Is that what this is?
shell.run(string command [, string args1, string args2, …])
I know nothing about Computer craft, please forgive me if this is just for issuing commands inside the computercraft shell.
If so, is there another solution available?
Would like next to be able to receive signals from the os to computer craft, to controll pistons.
Is this also possible? Don't really want to sift through this quite extensive mod. I would get sidetracked and never get finished. I appreciate the help.
*edit: Is there a way to send text to a file? I could monitor for changes. Would also solve my problem nicely. I could varify the changes if I could get signals from the os somehow.
Edited on 08 October 2014 - 11:47 AM
KingofGamesYami #2
Posted 08 October 2014 - 02:10 PM
What? Linux???

In game, you can run a program by typing it in. To run, say, "test", you would enter this

test
To run test from within a program, you would do

shell.run( "test" )

Controlling pistons sounds like you want the redstone api
You can read/write to files with the fs api.

If you want to communicate with an irl operating system (windows, mac, linux, etc.) you would want the http api. The pastebin program uses this api to download scripts from pastebin.
Nasuno #3
Posted 09 October 2014 - 05:40 AM
You are amazing. Thank you.