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

Shell.Run help

Started by ebernerd, 21 June 2015 - 05:23 AM
ebernerd #1
Posted 21 June 2015 - 07:23 AM
Hai.

My question is how to autodetect "arguments" in a string. So, if my string was edit "this is a test" how would I get the shell.run function to get the arguments between the two? I dunno if that makes any sense at all

Thanks for any and all help
Creator #2
Posted 21 June 2015 - 07:44 AM
sherll.run can work in several ways:

1. shell.run("edit","this","is","a","test")

2. shell.run("edit this is a test")

If you want "this is a test to be one argument, then do this:

shell.run("edit \"this is a test\"")
ebernerd #3
Posted 21 June 2015 - 07:46 AM
The thing is it's user input in a string. So the string could be something with a billion spaces, but the program just doesn't run it for some reason.

If the string is edit "this is a test" it works just fine.
If the string is "this is a test" or this is a test it doesnt.
ebernerd #4
Posted 21 June 2015 - 08:03 AM
Nevermind, I got it working.
Creator #5
Posted 21 June 2015 - 09:02 AM
Glad you did! Where did the problem lie?
ebernerd #6
Posted 21 June 2015 - 10:51 AM
Glad you did! Where did the problem lie?

I seriously have no idea. I just futzed with it over and over again and then it worked. xD