xXm0dzXx

Untitled

Jun 13th, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. local tCommandHistory = {}
  2. while not bExit do
  3. write( shell.dir() .. "> " )
  4.  
  5. local sLine = read( nil, tCommandHistory )
  6. table.insert( tCommandHistory, sLine )
  7.  
  8. local tWords = {}
  9. for match in string.gmatch(sLine, "[^ \t]+") do
  10. table.insert( tWords, match )
  11. end
  12.  
  13. local sCommand = tWords[1]
  14. if sCommand then
  15. shell.run( sCommand, unpack( tWords, 2 ) )
  16. end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment