MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to always output result in InputForm from the command line


Peng Yu wrote:

> By default the command line program show results not in InputForm. I
> want all the output be in InputForm. Instead of appending each line
> with "//InputForm", is there any better solution?
> 
> Thanks,
> Peng
> 
> $ math < test.m
> Mathematica 6.0 for Linux x86 (64-bit)
> Copyright 1988-2007 Wolfram Research, Inc.
> 
> In[1]:=
>           a
> Out[1]= -----
>         x + y
> 
> In[2]:=
> $ cat test.m
> a/(x+y)

Add the following expression at the beginning of test.m

     $PrePrint = InputForm[#] &;

Use $PrePrint =.; to get back the default behavior.

(Alternatively, you could modify the file init.m for a permanent setting.)

Regards,
-- Jean-Marc




  • Prev by Date: Re: Comparison of coefficients
  • Next by Date: Real and Complex Roots presented in a single plot
  • Previous by thread: Re: How to always output result in InputForm from the command line
  • Next by thread: Comparison of coefficients