ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 12 Jun 2018 11:14:17 -0500Running several commands from command linehttp://ask.sagemath.org/question/42571/running-several-commands-from-command-line/You can make Sage evaluate a given Python expression by running `sage -c <your-command>` from command line. However, it seems that the `-c` parameter can only be given once. How do I make sage evaluate several commands in succession then?Tue, 12 Jun 2018 09:13:50 -0500http://ask.sagemath.org/question/42571/running-several-commands-from-command-line/Answer by Sébastien for <p>You can make Sage evaluate a given Python expression by running <code>sage -c <your-command></code> from command line. However, it seems that the <code>-c</code> parameter can only be given once. How do I make sage evaluate several commands in succession then?</p>
http://ask.sagemath.org/question/42571/running-several-commands-from-command-line/?answer=42573#post-id-42573One way is to concatenate the commands with a `;` in between:
$ sage -c "m=matrix(2,2,range(4));print(m^10)"
[ 44726 79647]
[159294 283667]Tue, 12 Jun 2018 11:14:17 -0500http://ask.sagemath.org/question/42571/running-several-commands-from-command-line/?answer=42573#post-id-42573