How to evaluate the whole notebook ?

How to run/execute a .nb file? I could not find the answer in the Mathematica documentation. Also, I had to choose a random group because I could not find a fitting group for the question and the web page would not allow me to post a question without choosing a group.

On a OS X, I run Mathematica from the the X11 command line by typing the following command, where mma_simple.txt is the desired nb saved as text format. The last line of the notebook (or manually modified txt file) should be " Exit[ ] ", so that the x11 prompt can return from calling Mathematica. Hope this helps.

x11_prompt>> ../../Applications/Mathematica.app/Contents/MacOS/MathKernel -run "<< /Users/iabraham/Desktop/mma_simple.txt"

I got the above idea (and variations) from the guidance at http://pages.uoregon.edu/noeckel/Mathematica.html

.nb files are documents and are open with help of Mathematica. Like for example a .txt file is open with a text editor. Once you open a .nb file you can run code inside it, because it also serves a interactive programming environment.

Hi Issac, tnx for your response

Hi Sam, thanks for the response. I understand that part. But what I do not understand is that how to run an entire .nb file. For eg., I downloaded the file GameofLife.nb. I could run individual commands doing shift+enter within a square bracket. I was not sure how to run the entire file. But I later figured out that there are bigger square brackets enclosing the smaller square brackets, and if skillfully manage to move the mouse pointer to select the square bracket higest in the hierarchy I am able to run the entire code.

Is there a simple way of doing this? Why is there not a simple ‘run/execute’ button?

Yes: Top menu >> Evaluation >> Evaluate Notebook

thanks. that helps.