Skip to content
How to save console output/view previous runs.
Profile icon
betwixtbetween

Hi all,

I'm new to Repl and to coding. I just created a MadLib program which I've had several friends run on my computer. Usually I clear the console before every run, but I just noticed upon sitting down again that the console contained the last four stories that had been created. Does that imply that it's already saved somewhere? Or how can I save it now and in the future so I can review and share the stories created?

Thanks for considering,
Arbor

You are viewing a single comment. View All
Answered by Roar123 [earned 5 cycles]
View Answer
Profile icon
CodeLongAndPros

For me, you can scroll up, but you could put this in a file named .replit:

run='{run commmand} >> replit.log'
Profile icon
betwixtbetween

@CodeLongAndPros
Thanks for your prompt response! Forgive my ignorance, but I'm confused. Do you mean each time I want to save the contents of the console so I can clear it, I should enter the code you gave into the console in a new file? Or can you be more specific?

Profile icon
CodeLongAndPros

@betwixtbetween
The file .replit configures how your program runs. The snippet was incorrect it should be:

run='{run_cmd} | tee run.log'

Where run_cmd is the command used to run the program on the command line.

Profile icon
betwixtbetween

@CodeLongAndPros
Great, thanks.

Profile icon
davidhcefx

It should be

run='YOUR_CMD | tee -a run.log'

instead if you like to append your result to the previous one.