Re: (newbie) storing outputs from all lines of procs into a string
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: (newbie) storing outputs from all lines of procs into a string

From: <just80n@gmail.com>
Date: Mon Dec 19 2005 - 17:41:13 CET

I'll use this one but following code :

proc ex {COMMAND} {
set OUTPUT ""
rename puts _puts
proc puts {args} { append OUTPUT $args "\n"; eval _puts $args }
eval $COMMAND
rename _puts puts
return $OUTPUT
}

gives me :

 % ex choucroute
qdsfsd 33 (normal output from
choucroute)
qdsfsd 4444 4 (normal output from
choucroute)
can't rename to "puts": command already exists

in other words " rename _puts puts " fails.... a workaround?
Received on Fri Dec 23 19:02:13 2005