Singular
https://www.singular.uni-kl.de/forum/

Write to file
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1456
Page 1 of 1

Author:  E-mail to Singular-Team [ Thu Sep 22, 2005 5:07 pm ]
Post subject:  Write to file

Dear Research group of Singular.

I would like to know if there are some special command to write into a file the results of Singular but in the same format as the standard output.
When I simply use the write command, I obtain something like this:

x4,y8+3556x2

but, I would like to have something like this:

_[1]=x4
_[2]=y8+3556x2

Is that possible?

Author:  lossen [ Thu Sep 22, 2005 5:21 pm ]
Post subject: 

The solution is provided by the monitor command.

This command writes a copy of the input (or of the output or of both) into a file (with name specified when calling monitor): for instance the Singular session

Code:
> monitor("prot.txt","o");
> ring r=0,(x,y),dp;
> ideal I=x4,  y8+3556x2;
> I;
I[1]=x4
I[2]=y8+3556x2


creates a file prot.txt with the content

Code:
I[1]=x4
I[2]=y8+3556x2


Similarly,

Code:
> monitor("prot2.txt","i");
> ring r=0,(x,y),dp;
> ideal I=x4,  y8+3556x2;
> I;
I[1]=x4
I[2]=y8+3556x2


creates a file prot2.txt with the content

Code:
ring r=0,(x,y),dp;
ideal I=x4,  y8+3556x2;
I;


The writing to a file is terminated when
Code:
monitor("");
is entered.

See also: http://www.singular.uni-kl.de/Manual/3-0-0/sing_238.htm

Christoph Lossen
(Singular Team)

Author:  vinay [ Thu Dec 01, 2005 3:45 pm ]
Post subject:  Re: Write to file

One can simply make use of Operating System redirection commands.
e.g. One can use
$ > Singular < myfile.sing > Output.txt
at your command prompt.

If you dont want Singular Headers use -q option.

I am not sure whether this command will work on Windows/Mac? But I guess there should be similar redirection commands.

Regards

Vinay


E-mail to Singular-Team wrote:
Dear Research group of Singular.

I would like to know if there are some special command to write into a file the results of Singular but in the same format as the standard output.
When I simply use the write command, I obtain something like this:

x4,y8+3556x2

but, I would like to have something like this:

_[1]=x4
_[2]=y8+3556x2

Is that possible?

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/