perl -de 42Not only does this give a(n unprompted) command evaluator, it also exposes the symbol table and variable values, permits stack backtraces, and allows for breakpoints.
#!/usr/bin/perl print ":-) "; while (<>) { print eval; print ( ($@ || "\n") . ":-)" ) }There are slightly more elaborate forms in the standard distribution and elsewhere.