Posted to tcl by Stu at Thu Jun 08 13:55:56 GMT 2023view raw
- $ cat filter2.tcl
- # Filters 2
- package require tov
- set o [[::tov::FileReader new in.txt] cascade {
- receiver [[::tov::FilterDoer new] cascade ^ {
- tocalc {string toupper $value}
- ^ receiver [[::tov::FilterDoer new] cascade ~ {
- tocalc {regsub -all I $value A}
- ~ receiver [[::tov::FileWriter new out.txt] cascade , {
- configure -buffering none
- , yourself
- }]
- ~ yourself
- }]
- ^ yourself
- }]
- ` value -1
- ` yourself
- }]
- # EOF
- $ cat in.txt;rm -f out.txt;tclsh8.6 filter2.tcl;cat out.txt
- A Tcl script is a string containing one or more commands.
- A TCL SCRAPT AS A STRANG CONTAANANG ONE OR MORE COMMANDS.