Remove the printf builtin command from sh(1), which command is not

used so often that it's worth keeping it as a builtin.

Now that all the printf invocations from within the system startup
scripts, we can safely remove it.

Urged by:	sheldonh  :)

No MFC is planned so far because it may break compatibility and
violate POLA.
This commit is contained in:
Akinori MUSHA 2001-11-20 18:33:59 +00:00
parent c25081010f
commit 018d9f6237
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86692
5 changed files with 5 additions and 23 deletions

View File

@ -4,7 +4,7 @@
PROG= sh
SHSRCS= alias.c arith.y arith_lex.l cd.c echo.c error.c eval.c exec.c expand.c \
histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
mystring.c options.c output.c parser.c printf.c redir.c show.c \
mystring.c options.c output.c parser.c redir.c show.c \
test.c trap.c var.c
GENSRCS= builtins.c init.c nodes.c syntax.c
GENHDRS= builtins.h nodes.h syntax.h token.h y.tab.h
@ -23,8 +23,7 @@ CFLAGS+=-DSHELL -I. -I${.CURDIR}
# CFLAGS+= -g -DDEBUG=2
.PATH: ${.CURDIR}/bltin \
${.CURDIR}/../../bin/test \
${.CURDIR}/../../usr.bin/printf
${.CURDIR}/../../bin/test
CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
mksyntax mksyntax.o

View File

@ -73,7 +73,7 @@ jobscmd jobs
#linecmd line
localcmd local
#nlechocmd nlecho
printfcmd printf
#printfcmd printf
pwdcmd pwd
readcmd read
returncmd return

View File

@ -1273,12 +1273,9 @@ make it the first or last character listed.
This section lists the commands which
are builtin because they need to perform some operation
that cannot be performed by a separate process. In addition to
these, builtin versions of the
.Xr printf 1
command and
the
these, a builtin version of the
.Xr test 1
command are provided for efficiency.
command is provided for efficiency.
.Bl -tag -width Ds
.It Ic \&:
A null command that returns a 0 (true) exit value.
@ -1945,7 +1942,6 @@ emacs-style command line editing features.
.Xr builtin 1 ,
.Xr echo 1 ,
.Xr expr 1 ,
.Xr printf 1 ,
.Xr pwd 1 ,
.Xr test 1
.Sh HISTORY

View File

@ -88,7 +88,6 @@
.Nm notify ,
.Nm onintr ,
.Nm popd ,
.Nm printf ,
.Nm printenv ,
.Nm pushd ,
.Nm pwd ,
@ -230,7 +229,6 @@ with the other shells.
.It Ic onintr Ta \&No Ta Yes Ta \&No
.It Ic popd Ta \&No Ta Yes Ta \&No
.It Ic printenv Ta Yes Ta Yes Ta \&No
.It Ic printf Ta Yes Ta \&No Ta Yes
.It Ic pushd Ta \&No Ta Yes Ta \&No
.It Ic pwd Ta Yes Ta \&No Ta Yes
.It Ic read Ta \&No Ta \&No Ta Yes
@ -278,7 +276,6 @@ with the other shells.
.Xr nice 1 ,
.Xr nohup 1 ,
.Xr printenv 1 ,
.Xr printf 1 ,
.Xr pwd 1 ,
.Xr sh 1 ,
.Xr test 1 ,

View File

@ -257,20 +257,10 @@ character is defined in the program's locale (category
In no case does a non-existent or small field width cause truncation of
a field; padding takes place only if the specified field width exceeds
the actual width.
.Pp
Some shells may provide a builtin
.Nm
command which is similar or identical to this utility.
Consult the
.Xr builtin 1
manual page.
.Sh RETURN VALUES
.Nm Printf
exits 0 on success, 1 on failure.
.Sh SEE ALSO
.Xr builtin 1 ,
.Xr csh 1 ,
.Xr sh 1 ,
.Xr printf 3
.Sh HISTORY
The