1 | assert(bash_start, "Sorry: Need privileges. (e.g.: run -power 208)") |
2 | |
3 | bash_start() |
4 | bash_send('date\n')
|
5 | --bash_send('date\n')
|
6 | bash_send('exit\n')
|
7 | |
8 | for i=1, 10 do |
9 | os_sleep(500) |
10 | local alive = bash_alive() |
11 | out, err = unpack(bash_poll()) |
12 | |
13 | -- print err first so bash output looks prettier. |
14 | if err ~= '' then print(err) end |
15 | if out ~= '' then print(out) end |
16 | if not alive then break end |
17 | end |
18 | |
19 | if bash_alive() then bash_kill() end |
20 | return 'ok' |
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | 468 | [visualize] |
| Snippet ID: | #208 |
| Snippet name: | BASH access test |
| Eternal ID of this version: | #208/1 |
| Text MD5: | b2af831c8d62b2a384cf08d59cb0dc19 |
| Author: | stefan |
| Category: | |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2014-01-25 16:13:39 |
| Source code size: | 468 bytes / 20 lines |
| Pitched / IR pitched: | Yes / Yes |
| Views / Downloads: | 2074 / 365 |
| Referenced in: | [show references] |