First time here? Check out the FAQ!

Ask Your Question
1

Running several commands from command line

asked 6 years ago

RegularUser gravatar image

updated 6 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 6 years ago

Sébastien gravatar image

updated 6 years ago

One 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]
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 575 times

Last updated: Jun 12 '18