Re: output from sage to file

502 views
Skip to first unread message

P Purkayastha

unread,
Nov 21, 2012, 12:02:53 AM11/21/12
to sage-s...@googlegroups.com
The sage prompt is *not* a bash (or shell) prompt! It is an ipython
prompt. If you want the output dumped to a file, then you need to run
the asd.sage file like this:

$ sage asd.sage > output.txt

On 11/21/2012 12:57 PM, Александр Шевченко wrote:
> I have encountered problem using Sage 5.4.
> I want output information in file from console. On usually solve of this
> problem Sage write. My OS is Ubuntu.
>
> sage: asd.sage > output.txt
> ---------------------------------------------------------------------------
> NameError Traceback (most recent call last)
>
> /home/toivo/sage/<ipython console> in <module>()
>
> NameError: name 'asd' is not defined
>
> sage: asd.sage | tee output.txt
> ------------------------------------------------------------
> File "<ipython console>", line 1
> asd.sage | tee output.txt
> ^
> SyntaxError: invalid syntax
>
> I can't directly run file from console. I must use function load.
>
> I hope this information proves useful in correcting the problem.
>
> Best regards,
>
> Aleksandr

Александр Шевченко

unread,
Nov 21, 2012, 1:30:27 AM11/21/12
to sage-s...@googlegroups.com
I understood. Then next question.
I build sage from source.
In terminal.

$ sage
No command 'sage' found, did you mean:
 Command 'osage' from package 'graphviz' (main)
 Command 'save' from package 'atfs' (universe)
 Command 'page' from package 'tcllib' (universe)
sage: command not found

Best regards,

Aleksandr

Jan Groenewald

unread,
Nov 21, 2012, 1:37:53 AM11/21/12
to sage-s...@googlegroups.com
Hi

Your sage installation seems to be in /home/toivo/sage/.
This is normally called SAGE_ROOT, which is a bash variable.
You can set the command sage to be an alias for /home/toivo/sage/sage
like this

alias sage='/home/toivo/sage/sage'

and you can make this permanent for all new terminals you open by
adding that line to your /home/toivo/.bashrc file, the configuration file
for bash.

Regards,
Jan





Best regards,

Aleksandr

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To post to this group, send email to sage-s...@googlegroups.com.
To unsubscribe from this group, send email to sage-support...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 



--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^


Reply all
Reply to author
Forward
0 new messages