#!/bin/tclsh set tests { {exec curl -i http://localhost:8000} {exec curl -i http://localhost:8000/style.css} {exec curl -i http://localhost:8000/index.html} } if [expr ($argc == 0)] { set j 0; foreach i $tests { puts "($j) : [string range $i 13 end]" incr j } } elseif [expr ($argc == 1)] { set a [lindex $argv 0]; if { ($a >= 0) && ($a < [llength $tests]) } { puts [eval [lindex $tests $a]] } else { puts "Argument not in range." } }