Posted to tcl by Bradipo at Tue Mar 25 23:16:09 GMT 2025view raw

  1. set dir [lindex $argv 0]
  2. if {[catch {glob -directory $dir *} files]} {
  3. exit 1
  4. } else {
  5. set i [expr {int(rand() * [llength $files])}]
  6. set o [lindex $files $i]
  7. if {[catch {exec cat $o} r]} {
  8. puts stderr "[lindex $argv 0]: $r"
  9. exit 2
  10. }
  11. }

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week