chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Scraping the REPL?


From: Matt Gushee
Subject: Re: [Chicken-users] Scraping the REPL?
Date: Sat, 23 Jan 2016 15:39:49 -0700

Hi, James--

On Sat, Jan 23, 2016 at 10:51 AM, Hefferon, James S. <address@hidden> wrote:

Thank you for the "script" suggestion.  I apologize but I don't understand it.

​I see the problem. I had forgotten that csi has a -script option. I meant something entirely different - the 'script' command, which is entirely independent of Chicken Scheme​, and is available on most if not all POSIX systems. You use it like this:

$ script /path/to/transcript.file           # You are now in a subshell
$ csi
#;1>
[ doing whatever in Chicken ]
#;N> (exit)                                      ; exit from REPL
$ exit                                             # exit from subshell

You will now have a complete transcript of your csi session, including all the prompts, everything you entered, and all the output. I mentioned that you will probably need to edit the result. That's because script captures raw keystrokes - e.g. if you type

   (defin foo 21)

and you see you misspelled 'define', and correct it, what you get in your transcript will be not

   (define foo 21)

but rather

   (defin foo 21)^H^H
^H^H
^H^H
^H^H
e foo 21)

script also, for some reason, adds a carriage return at the end of every line, which you may not want. There is apparently no way to change that behavior. But it does capture your entire session.

​Hope your project goes well.​


reply via email to

[Prev in Thread] Current Thread [Next in Thread]