Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.70 KB | None | 0 0
  1. #!/bin/iosh
  2.  
  3. ! +indent 4
  4.  
  5. & > $/in                        # > /proc/shell/XXX/in
  6.     accept text/json
  7.     |
  8.     cat ?type=text/plain
  9.  
  10. echo hello world > $/thing      # > /proc/shell/XXX/thing
  11.  
  12.  
  13.  
  14. thing1
  15.     thing2
  16.     thing3 < $/in               # < /proc/shell/XXX/in
  17.  
  18. ~                               # try
  19.     foo | bar
  20.     foo1
  21.     foo2
  22.     foo3
  23. &&                              # (finally)
  24.     echo we done
  25. ||                              # else (catch)
  26.     echo fail
  27.     exit 2
  28.  
  29.  
  30. >!                              # output to null
  31.     @ $a=1                      # test
  32.         ~
  33.             a=($a+7)            # expr
  34.             a1
  35.             foo
  36.             bar
  37.         ||
  38.             echo we suck
  39.     ||                          # else (if)
  40.     @ ($a-1)=1                  # test and expr
  41.         a2
  42.  
  43.  
  44.     test1
  45.         b1
  46.     ||
  47.     test2
  48.         b2
  49.  
  50.  
  51. * seq 1 10                      # for-each 1 to 10
  52.     print _                     # print current output row
  53.     print .                     # print current row index
  54.  
  55.  
  56. *
  57.     echo 1
  58.     echo 2
  59.     seq 3 10
  60. &&                              # && is required here
  61.     print _
  62.     print .
  63.  
  64.  
  65. seq 1 10 | *
  66. &&                              # && is required here too
  67.     print _
  68.     print .
  69.  
  70.  
  71. * < somefile
  72. &&
  73.     print _
  74.     print .
  75.  
  76.  
  77. thing4
  78. ||
  79. > /var/log                      # else send the following to log
  80.     x= 48
  81.     y= 72
  82.     do_a_thing
  83.  
  84.  
  85. & > $/stuff                    
  86.     bar1
  87.     bar2
  88.     bar3
  89.  
  90. & do_a_thing
  91.     echo what now?              # FIXME
  92.  
  93. & set in
  94.     echo or this?               # FIXME
  95.  
  96. rug_ties_the_room_together $|in $|stuff
  97.  
  98.  
  99. z=
  100.     echo 1
  101.     echo 2
  102.     echo 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement