Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last modification of the tesh2 files (variable extend and some corrections)
[simgrid.git] / tools / tesh2 / examples / var.tesh
index 7b42d40..31000bc 100644 (file)
@@ -105,27 +105,62 @@ $ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
 > [stdin:1] A system variable named `(ENOENT)' already exists
 > Test unit `stdin': NOK (<stdin:1> syntax error)
 
+# Substitution usage
 
+! new=1
 
+p new is `$new ' or `${new}'
 
+p the len of new is : ${#new}
 
+! unset new
 
+p new is empty <$new> and is len is <${#new}>
 
+# display 66 and assign 6 to the value 66 of the variable new
 
+p ${new:=66}
 
+p new is `$new ' or `${new}'
 
+p the len of new is : ${#new}
 
+# display 66 and do not assign the value 69 to the variable
 
+p ${new:=69}
 
+p new is `$new ' or `${new}'
 
+p the len of new is : ${#new}
 
+! unset new
 
+# display 79 and do not assigne the value 79 to the variable
+# new is empty
+p ${new:-79}
 
+p new is `$new ' or `${new}'
 
+p the len of new is : ${#new}
 
+# display nothing and do not assigne the value 89 to the variable
+# new is empty
+p is empty ${new:+89}
 
+p new is `$new ' or `${new}'
 
+p the len of new is : ${#new}
 
+! set new=999
 
+# display 99 and do not assigne the value 99 to the variable (do not dispaly the value of new)
+# new is empty
+p is empty ${new:+99}
 
+p new is `$new ' or `${new}'
 
+p the len of new is : ${#new}
+
+! unset new
+
+# p ${new:?new is empty}