# FullForm in Linux Command Line with -noprompt

I am looking for a way to get the output of FullForm in Command Line under Linux (Debian) using -noprompt argument.

Example : What I have : a+b*c

What I want : Plus[a, Times[b, c]].

I can have it like this (without -noprompt but I get useless text)

#  echo 'FullForm[a+b*c]' | math
Mathematica blah blah
Out[1]//FullForm= Plus[a, Times[b, c]]


Usually to avoid the "blah blah" I use "-noprompt" but here is what I get with -noprompt :

#  echo 'FullForm[a+b*c]' | math -noprompt
FullForm[a + b*c]


So my question is How to get the Correct Output ? (with noprompt)

Thank you.

• You mean FullForm[Hold[1 + 1]]? – bobthechemist Dec 26 '14 at 18:28
• I dunno why it answers FullForm[Hold[1+1]] – Crypto Dec 28 '14 at 19:12
• it seems in fact true that the behaviour is different – chris Jan 2 '15 at 21:43
• @chris I confirm also the problem (v.10.0.2, OS X 10.9.5). For example echo 'FullForm[{1,2,3}]' | /Applications/Mathematica.app/Contents/MacOS/MathKernel -noprompt returns FullForm[{1, 2, 3}] and not List[1, 2, 3] (as in the interactive mode). Same problem also if I put the command in a file e.g. "test.m" and execute /Applications/Mathematica.app/Contents/MacOS/MathematicaScript -script test.m. In both cases, no problem if I replace the FullForm command by any other like Plus[1,1]. – SquareOne Jan 3 '15 at 3:17
• If I try echo 'z=a+b*c';FullForm[z] | .... it also returns FullForm[a + b*c] – SquareOne Jan 3 '15 at 3:21

The -noprompt switch does several things: it suppresses the Mathematica ... banner and all the In/Out prompts, sets the page width to Infinity and, most relevantly, switches the kernel default print form to InputForm (being preferable, in batch mode, to the regular two-dimensional typesetting used for interactive terminal sessions).
Example : What I have : a+b*c
What I want : Plus[a, Times[b, c]]
\$ echo 'OutputForm @ FullForm[a+b*c]' | math -noprompt