program and then filling it out like a worksheet. My goal is to create a startup program on a floppy disk which will start up
a program called "cmd". the cmd program is like the shell in the computers, the difference is that it will use my own commands
which will also accept parameters. I know that you can create multiple files that use the tArgs = {…} and that then you
can do it that way, but i want my own personal shell that gives a specific line to write your command on and then it will use that
command that you just typed (parameters and all) and then run the program that you specified with the parameters. So for instance.
[disk/startup]
term.clear()
term.setCursorPos(1,1)
print("My terminal")
shell.run("disk/cmd")
[end]
[disk/cmd]
–This is were it gets sketchy
–I want to take the command I'm about to enter and execute it on another program with the parameters so please bear with me.
term.clear()
term.setCursorPos(1,1)
tArgs = {…}
command = tArgs[1]
parameter = tArgs[2]
print("Chad's Terminal v1.0")
print()
com()
function com()
write(">")
command = tArgs[1]
if #tArgs < 1 then
print()
print("Syntax: <command> <parameters>")
print()
print("Type: help for list of commands")
print()
rep()
else
print(command)
shell.run("disk/"..(command))
end
end
function rep()
com()
end
[end]
And then lets say the command i typed was "echo one"
i have a file called "echo" and another tArgs = {…} that looks for "one"
and then will "print(tArgs[1])" and go back to the cmd program so that i have run the command and stayed in the custom shell.