trun

Script for parsing any output. Yes, it is all it does.
git clone git://gtms.dev/trun
Log | Files | Refs | README | LICENSE

gen.lua (487B)


      1 #!/usr/bin/env lua
      2 -- simple script that output lines every second. Run run.zsh script to test
      3 -- handler.lua and watch status file being updated
      4 --
      5 local sleep = function(s) os.execute('sleep ' .. s) end
      6 
      7 local success = 'success'
      8 local normal = 'normal'
      9 local error = 'error'
     10 
     11 local out
     12 local leaps = 10
     13 while leaps > 0 do
     14   if (leaps == 5) then
     15     out = error
     16   elseif (leaps == 1) then
     17     out = success
     18   else
     19     out = normal
     20   end
     21   print(out)
     22   sleep(1)
     23   leaps = leaps - 1
     24 end