Browse Source

complete documentation about tempfile handling

Jaromil 5 years ago
parent
commit
c59ed6b7bd
1 changed files with 10 additions and 0 deletions
  1. 10 0
      README.md

+ 10 - 0
README.md

@@ -59,6 +59,16 @@ testfun() {
59 59
     fn "testfun"
60 60
     # print out with nice green colors
61 61
     notice "Custom var: $myvar"
62
+    # create a tempfile
63
+    ztmp && mytmp=$ztmpfile
64
+    # put the value into the tempfile
65
+    print $myvar >> $mytmp
66
+    # print out the path to the tempfile
67
+    act "Temp file: $mytmp"
68
+    # print out the contents of the tempfile
69
+    act "Content: `cat $mytmp`"
70
+    # the tempfile will be deleted in endgame()
71
+    # but can also be delete earlier here, optionally
62 72
 }
63 73
 
64 74
 # wrap the init phase