Getting the return values of procedures from the command line

Here is a handy tip to return the values of tcl procedures whilst on the command line:

#!/usr/bin/tclsh
source "procs.tcl"
if {$argv==""} {} else {puts [$argv]}

Now you can create a link of this program in /usr/local/bin and make executable with chmod +x:

ln -s tclproc /home/user/tcl/procs.tcl && chmod +x tclproc

Usage: tclproc name of procedure in procs.tcl

This will output the return value of the procedure specified.