On Wed, 7 Apr 2021, Riccardo (Jack) Lucchetti wrote:
On Wed, 7 Apr 2021, Iago Varela wrote:
> Hi, it wasn't clear to me how to save to a file and print to the console at
> the same time, but you're right I didn't focus enogh, I worked around it
> with eval readfile("logit_summary.txt")
One of the nice little utilities you have in the UNIX world is called "tee",
and makes it possible to redirect output to a file while still having it
displayed on stdout.
Maybe we could have a --tee option to "outfile"; Allin, what do you think?
That wouldn't be very easy. Gretl's "prn" is designed for
flexibility -- print to buffer (auto-sized or fixed size), to disk
file, to standard stream, or to nowhere. But it's not designed to do
more than one of these things at a time. I'd say the recommendation
if you want this effect is:
outfile somefile.txt
# commands
end outfile
printf "%s", readfile("somefile.txt")
with just one extra line required. Or, if the commands are not very
time-consuming:
# commands
outfile somefile.txt
# repeat commands for the record
end outfile
Allin