[Solved] Which is better way? Variables related

If in a namespace eval, use variable to avoid the weirdness of the variable name resolver. (I don’t want to describe in detail what it does, other than to say that code that relies on it can be automatically described as buggy and in hard to accurately describe ways.) If in a procedure, (usually) use … Read more

[Solved] TCL Sort program without using lsort [closed]

While we won’t give you the answer, we can suggest a few useful things. For example, you compare two elements of a list (at $idx1 and $idx2) with this: string compare [lindex $theList $idx1] [lindex $theList $idx2] And you might use this procedure to swap those two elements: proc swap {nameOfListVar idx1 idx2} { upvar … Read more

[Solved] how to get the time after two minutes [closed]

To get the date-string in bash: echo “Current: ” $(date +”%Y”-“%m”-“%d”T”%H”-“%M”-“%S”) echo “+2 min : ” $(date –date=”@$(($(date +%s)+120))” +”%Y”-“%m”-“%d”T”%H”-“%M”-“%S”) prints Current: 2014-09-10T15-58-15 +2 min : 2014-09-10T16-00-15 Read the time from string and print +2min string str=”2014-09-10T15-58-15″ new=$(date –date=”@$(($( IFS=”-T” read y m d H M S <<< “$str”;date –date=”$y-$m-${d}T$H:$M:$S” +%s )+120))” +”%Y”-“%m”-“%d”T”%H”-“%M”-“%S”) echo “From … Read more