diff options
author | jilles <jilles@FreeBSD.org> | 2010-11-19 12:56:13 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2010-11-19 12:56:13 +0000 |
commit | 129853101d5707b7d18f28f39e748fa65a36add2 (patch) | |
tree | bf15bc2b264e5ca2469d76c04865a14c1e99127c /bin/sh/sh.1 | |
parent | 7be275d6a786ef414ab769fb1b61fa9a4b041f4d (diff) | |
download | FreeBSD-src-129853101d5707b7d18f28f39e748fa65a36add2.zip FreeBSD-src-129853101d5707b7d18f28f39e748fa65a36add2.tar.gz |
sh: Add printf builtin.
This was removed in 2001 but I think it is appropriate to add it back:
* I do not want to encourage people to write fragile and non-portable echo
commands by making printf much slower than echo.
* Recent versions of Autoconf use it a lot.
* Almost no software still wants to support systems that do not have
printf(1) at all.
* In many other shells printf is already a builtin.
Side effect: printf is now always the builtin version (which behaves
identically to /usr/bin/printf) and cannot be overridden via PATH (except
via the undocumented %builtin mechanism).
Code size increases about 5K on i386. Embedded folks might want to replace
/usr/bin/printf with a hard link to /usr/bin/alias.
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r-- | bin/sh/sh.1 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 7b1eb61..ba06a0c 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd November 12, 2010 +.Dd November 19, 2010 .Dt SH 1 .Os .Sh NAME @@ -2049,6 +2049,9 @@ line. See the .Sx Functions subsection. +.It Ic printf +A built-in equivalent of +.Xr printf 1 . .It Ic pwd Op Fl L | P Print the path of the current directory. The built-in command may @@ -2470,6 +2473,7 @@ will return the argument. .Xr echo 1 , .Xr ed 1 , .Xr emacs 1 , +.Xr printf 1 , .Xr pwd 1 , .Xr test 1 , .Xr vi 1 , |