From 96265e088e72e2c9130f86ad9be7b15621646f37 Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 20 Nov 2001 18:33:59 +0000 Subject: 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. --- bin/sh/Makefile | 5 ++--- bin/sh/builtins.def | 2 +- bin/sh/sh.1 | 8 ++------ share/man/man1/builtin.1 | 3 --- usr.bin/printf/printf.1 | 10 ---------- 5 files changed, 5 insertions(+), 23 deletions(-) diff --git a/bin/sh/Makefile b/bin/sh/Makefile index 14e07ea..64eb0f0 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -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 diff --git a/bin/sh/builtins.def b/bin/sh/builtins.def index bd4c1df..f06a98b 100644 --- a/bin/sh/builtins.def +++ b/bin/sh/builtins.def @@ -73,7 +73,7 @@ jobscmd jobs #linecmd line localcmd local #nlechocmd nlecho -printfcmd printf +#printfcmd printf pwdcmd pwd readcmd read returncmd return diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index fe2f3e3..9c8cc34 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -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 diff --git a/share/man/man1/builtin.1 b/share/man/man1/builtin.1 index b54a0ee..02f4f01 100644 --- a/share/man/man1/builtin.1 +++ b/share/man/man1/builtin.1 @@ -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 , diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1 index 0e44abc..12dcb36 100644 --- a/usr.bin/printf/printf.1 +++ b/usr.bin/printf/printf.1 @@ -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 -- cgit v1.1