output file mode is set to input file mode
[ikh.git] / miconf / README
blob520954c20d8bcef80444c9e027e2ab751644c9e7
1 $ cat sample.config
2 a = 5
3 b = 200
4 c = "Hello, world!"
5 if a < 100 then
6    d = {x=a, "boo"}
7 else 
8    d = {x=10, "foo"}
9 end
10 function square(x)
11    return x*x
12 end
14 $ cat file.template
15 text0
16 text1,<<<c>>>,text2
17 === if b > 100 then
18 text3
19 === end
20 text4
21 === for i = 1, a do
22 text5,<<<square(i)>>>,text6,<<<d[1]>>>,text7
23 === end
24 text8
26 $ miconf sample.config sample.template >sample 
28 $ cat sample
29 text0
30 text1,Hello, world!,text2
31 text3
32 text4
33 text5,1,text6,boo,text7
34 text5,4,text6,boo,text7
35 text5,9,text6,boo,text7
36 text5,16,text6,boo,text7
37 text5,25,text6,boo,text7
38 text8