Home > Programming > Capture Scala Terminal Output

Capture Scala Terminal Output

Often, when I am doing random coding on the scala terminal, I wish I could save it and be able to see to what I was doing later on. It would even help, if I made a discovery of doing something special and then be able to refer back to it. I could not find a way to do this in Windows command prompt (if anyone out there knows how to, I would highly appreciate that). If you have a Linux/Unix machine it is easier to do that. If you have Windows, like I do, install Cygwin. I often use the Cygwin bash over the Windows cmd (command prompt). Here is how I do it. I learned this from my introduction to programming language class.

  1. Before you type “scala” and hit Enter. Type this in your terminal (some refer to it as shell): script output_filename
  2. Thereafter begin your Scala terminal
  3. Do Scala programming until you are ready to quit
  4. Enter the “exit” command to exit the Scala terminal
  5. Enter “exit” one more time to exit your script
  6. cat output_filename to view your scala output 🙂
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: