Re: turn off maxima command echo when I run a script in batch mode



You wrote:
-----------------
Hi,

How can I turn off maxima command echo when I
run a script in batch mode ?  Thanks

Regards
KC
kccheng@LinuxDAQ-Labs.org
---------------------------

Look at the TTYOFF variable:

 	
(%i3) describe(TTYOFF);

 0: TTYOFF :(maxima.info)Definitions for Input and Output.

Info from file C:/PROGRA~1/MAXIMA~1.1/info/maxima.info:
 - Variable: TTYOFF
     default: [FALSE] - if TRUE stops printing output to the console.


 - macro: WITH_STDOUT (file,stmt1,stmt2,...)
     Opens file and then evaluates stmt1, stmt2, ....  Any printing to
     standard output goes to the file instead of the terminal.  It
     always returns FALSE.   Note the binding of display2d to be false,
     otherwise the printing will have things like "- 3" instead of "-3".

          mygnuplot(f,var,range,number_ticks):=
           block([numer:true,display2d:false],
           with_stdout("/tmp/gnu",
             for x:range[1] thru range[2] step
                          (range[2]-range[1])/number_ticks
                do (print(x,at(f,var=x)))),
           system("echo \"set data style lines; set title '",
                  f,"' ;plot '/tmp/gnu'
          ;pause 10 \" | gnuplot"));
          
          (%i8) with_stdout("/home/wfs/joe",
                n:10,
                for i:8 thru n
                  do(print("factorial(",i,") gives ",i!)));
          (%o8) 				     FALSE
          (%i9) system("cat /home/wfs/joe");
          factorial( 8 ) gives  40320
          factorial( 9 ) gives  362880
          factorial( 10 ) gives  3628800
          (%o9) 				       0
(%o3) 				     FALSE

I usually put this line first in my .mac-files:
eval_when(batch,ttyoff : true)$

And this last:
eval_when(batch,ttyoff : false)$

In the contrib/unit/unit.mac it is done this way: 
TTYOFF: NOLABELS, TRUE$

Try and see what fits you best.

Best regards,
			Goran
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.f-secure.com/