2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
6 # Copyright (C) 2006 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
17 # This is a simple lua bash example.
19 # init lua bash and load code chunk from file internal.lua.
20 enable -f ..
/luabash.so luabash
21 luabash load .
/internal.lua
23 # perform some arithmetic using a lua function called "plus".
25 for ((i
=1;i
<3;i
++)) ; do
26 for ((j
=1;j
<3;j
++)) ; do
30 echo "total sum is: " $total
33 # bash function to be called from within lua context
34 some_bashy_function
()
38 some_bashy_function $@
43 # call the lua function that calls bash function above
46 # test if io redirection works
47 cat <<EOF | redirections | sed 's,xx,yy,g'
53 # print ten shell variables