On Sun, 1999-09-19 08:48:47 +0200, Leif Neland wrote:
> On Sat, 18 Sep 1999, Tõnu Samuel wrote:
> > There is utility in most unixes called "tee" which can redirect
> > output to some place and at once output it to stdout. Using it
> > prorably can be done this "dual output" for file and printer.
> It would be nice to be able turn on spool (save output to file) at
> will, instead of remembering to turn on a hack at entry to mysql.
I really wouldn't call using tee a hack, that's quite a normal and
frequently used Unix command, but ...
Just quit 'mysql' and have a look at ~/.mysql_history, when your query
finally runs successfully. This file stores all your input lines.
You could even use a small shell script to select the last queries for
printing, see attachment.
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26 E4 EC 80 58 7B 31 3A D7
set -- `tail -20 $HISTFILE`
PS3='Please, select number of SQL statement: #'
select query in "$@"
if [ -n "$query" ]; then break; fi
echo -e "\nPrint: $query"