Flag for batch mode?



David Ronis <ronis at ronispc.chem.mcgill.ca> writes:

> I sometimes use maxima within a makefile, (as maxima -b file).   Is
> there a flag or something that allows my maxima script to decided if
> I've run from a console or from a file?

You can do this a number of ways. Here is one way to do it in your Makefile

%.out: %.mac
    maxima --batch-string='(batch_mode:true,batch("$<"));'

In your scripts, you can then use conditionals like

if batch_mode=true then ...

Maxima does have an internal flag, batch-flag, but this is not
accessible from the top-level.

-- 
Leo Butler                <l_butler at users.sourceforge.net>
SDF Public Access UNIX System -   http://sdf.lonestar.org