It would look something like this:
local tArgs = {...} --#get the program arguments
for i = 1, tonumber( tArgs[ 1 ] ) do --#loop for the first argument number of times (will error if it isn't given a number!)
shell.run( "q", unpack( tArgs, 2 ) ) --#run the program 'q', supply the rest of the arguments passed to this program
end
..at least in recent versions of computercraft. If you're on an older version which does not support multiple arguments to shell.run, you'd do something like this:
local tArgs = {...} --#get the program arguements
for i = 1, tonumber( tArgs[ 1 ] ) do --#loop for the first argument number of times (will error if it isn't given a number!)
shell.run( "q " .. table.concat( tArgs, " ", 2 ) ) --#run the program 'q', concatenating the rest of the arguments (seperated by spaces) to form a single string
end
Edited by KingofGamesYami, 30 January 2016 - 01:26 AM.