fork(4) download
  1. proc lines {lines} {
  2. foreach item [uplevel [list subst -nobackslash $lines]] {
  3. lappend list $item
  4. }
  5. return $list
  6. }
  7.  
  8. set another_pet fish;
  9.  
  10. set pets [lines {
  11. cat
  12. [string range hotdog 3 end]
  13. elephant
  14. $another_pet
  15. "african pygmy hedgehog"
  16. snapping\ turtle
  17. "\"henry\" the bengali tiger"
  18. }]
  19.  
  20. puts $pets
Success #stdin #stdout 0.02s 5272KB
stdin
Standard input is empty
stdout
cat dog elephant fish {african pygmy hedgehog} {snapping turtle} {"henry" the bengali tiger}