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)
Any advice ?
Thank you.
FullForm[Hold[1 + 1]]
? $\endgroup$FullForm[Hold[1+1]]
$\endgroup$echo 'FullForm[{1,2,3}]' | /Applications/Mathematica.app/Contents/MacOS/MathKernel -noprompt
returnsFullForm[{1, 2, 3}]
and notList[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 likePlus[1,1]
. $\endgroup$echo 'z=a+b*c';FullForm[z] | ....
it also returnsFullForm[a + b*c]
$\endgroup$