This the second question of (152743), the preamble of which is reproduced here:
Those who don't have/prefer the front end of Mathematica will either use a plain ASCII editor to write a script in an
.mfile or just use Mathematica directly from a command-line terminal. In either case, everything must be supplied inInputForm.When working with a Mathematica package, commonly used symbols/functions might be excessively verbose in
InputForm, and certain shortcuts/aliases would be greatly desired. Examples of built-inInputFormshortcuts are the infix operators+(Plus),-(Minus), ... and.(Dot).
Two questions that arise as a package developer:
Is there something analogous to
#defineof C and C++ that can be placed at the top of an.mfile that instructs the kernel to make replacements of literal occurrences before the lines are read? (this issue may be easily bypassed if question 1 is answered.)
$Preand$PreReadare not observed when using Mathematica from a command-line terminal. Are$Preand$PreReadstrictly front-end functions? – QuantumDot Aug 01 '17 at 15:11$Preis working fine, it's only$PreReadis broken. Are you use$Preisn't working for you? Try$Pre=Echo. – Itai Seggev Aug 02 '17 at 03:34-rawtermoption, it will fix$PreRead, though that will disable the arrow keys. On Linux (and probably on OSX using homebrew or similar), you can use therlwrapprogram as wrapper around the kernel to restore the arrow OKs – Itai Seggev Aug 02 '17 at 03:51$Preactually does work on my system. I'll try the-rawtermoption to see if it fixes$PreRead; EDIT yes it does work. Also, it allows me to enter special characters, too. (I was wondering why I couldn't do that before). – QuantumDot Aug 02 '17 at 04:12