Posted to tcl by Stu at Thu Jun 08 13:55:56 GMT 2023view raw

  1. $ cat filter2.tcl
  2. # Filters 2
  3.  
  4. package require tov
  5.  
  6. set o [[::tov::FileReader new in.txt] cascade {
  7. receiver [[::tov::FilterDoer new] cascade ^ {
  8. tocalc {string toupper $value}
  9. ^ receiver [[::tov::FilterDoer new] cascade ~ {
  10. tocalc {regsub -all I $value A}
  11. ~ receiver [[::tov::FileWriter new out.txt] cascade , {
  12. configure -buffering none
  13. , yourself
  14. }]
  15. ~ yourself
  16. }]
  17. ^ yourself
  18. }]
  19. ` value -1
  20. ` yourself
  21. }]
  22.  
  23.  
  24. # EOF
  25.  
  26.  
  27. $ cat in.txt;rm -f out.txt;tclsh8.6 filter2.tcl;cat out.txt
  28. A Tcl script is a string containing one or more commands.
  29. A TCL SCRAPT AS A STRANG CONTAANANG ONE OR MORE COMMANDS.