Re: How to always output result in InputForm from the command line
- To: mathgroup at smc.vnet.net
- Subject: [mg91810] Re: How to always output result in InputForm from the command line
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 9 Sep 2008 06:54:27 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ga2pnn$p6t$1@smc.vnet.net>
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