views:

53

answers:

3

I wrote a clisp program that prints out n sets of x*y random integers. I'd like to make n=100, but I can't copy and paste the whole thing because my linux terminal doesn't go back far enough, for lack of a better word.

I'd like the simplest way possible to capture 2200 lines of linux terminal readout.

+1  A: 

There are several different Linux terminal programs. They all have more or less accessible ways to configure the number of scrollback lines. I am not on my Linux box right now, but I recall this being in a relatively obvious place under the Preferences menu option for GNOME's terminal, and I would imagine KDE is similar.

I second the recommendation to use shell redirection, though; that's the more generally useful tactic.

Zack
+3  A: 

From Lisp there are various ways to have your output in a file.

  • you can have the REPL interaction saved to a file. See the DRIBBLE function.

  • you can also enclose your code with WITH-OPEN-FILE.

example:

(with-open-file (*standard-output* "/tmp/foo.text" :direction :output)
   (your-print-function-here))
Rainer Joswig
+2  A: 

Further to the comment above, I use sbcl on the command line to capture output. Simply load your library and then evaluate what you need.

example:

sbcl --noinform --load "compass.lisp" \
                --eval "(print (table-egs (cocomo81)))" \
                --eval "(quit)" > copy.txt
abutcher