Here's a Wiki location for those code snippets and idioms that might well belong in every script you write. [LV] hopes that people explain '''why''' for the novices that stumble across the page... ---- Here's a way to have a procedure accept its arguments both "whole" (as a list) or in pieces, which may sometimes be helpful ([RS]): proc foo { args } { if {[llength $args] == 1} {set args [lindex $args 0]} ... } I've been thinking this a lot and still can't figure out, what is so cool about this code. Can you explain a bit more, what is the idea behind this? --[mjk] - [RS]: It's very simple. Say you have a ''max'' function to return a numeric maximum: proc max list {lindex [lsort -real $list] end} Now if you want to call this with discrete values, you'd have to [list]ify them: puts [max [list $foo $bar $grill]] But with the above boilerplate code, you can have it both ways: proc max args { if {[llength $args]==1} {set args [lindex $args 0]} lindex [lsort -real $list] end } puts [max $foo $bar $grill] puts [max $myValueList] ---- [Phil Ehrens] says nearly every executable script should start with this: if { [ regexp {(root|wheel)} $::env(GROUP) ] } { puts stderr "DID YOU REALLY MEAN TO RUN $::argv0 AS ROOT?" exit 666 } [LV] notes for the novice that it is seldom a good idea to accidentally run miscellaneous commands while in the root or wheel group on Unix, as those groups often have write permission on files that should not be changed accidentally. ---- [[Category ???]]