sh: Remove the "exp" builtin.

The "exp" builtin is undocumented, non-standard and not very useful.

If exp's return value is not used, something like
VAR=$(exp EXPRESSION)
is equivalent to
VAR=$((EXPRESSION))
except that errors in the expression are fatal and quoting special
characters is not needed in the latter case.

If exp's return value is used, something like
if exp EXPRESSION >/dev/null
can be replaced by
if [ $((EXPRESSION)) -ne 0 ]
with similar differences.

The exp-run showed that "let" is close enough to bash's and ksh's builtin
that removing it would break a few ports. Therefore, "let" remains in 9.x.

PR:		bin/104432
Exp-run done by: pav (with some other sh(1) changes)
This commit is contained in:
Jilles Tjoelker 2011-05-27 20:53:07 +00:00
parent 64fa41f3e1
commit 8d5a14301f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=222386
2 changed files with 2 additions and 2 deletions

View file

@ -344,7 +344,7 @@ arith_t arith(const char *s)
* The exp(1) builtin.
*/
int
expcmd(int argc, char **argv)
letcmd(int argc, char **argv)
{
const char *p;
char *concat;

View file

@ -60,7 +60,7 @@ echocmd echo
evalcmd -s eval
execcmd -s exec
exitcmd -s exit
expcmd exp let
letcmd let
exportcmd -s export -s readonly
#exprcmd expr
falsecmd false