Import NetBSD true and false commands

Replaces the 'true' and 'false' functionality provided by commands/true
and commands/false.

Change-Id: I736efb9a650f3154eb21e442d676a0f5d2dee957
This commit is contained in:
Zachary Storer 2014-02-22 13:20:45 -07:00 committed by Lionel Sambuc
parent 757e83288a
commit 1d48ef9844
19 changed files with 143 additions and 48 deletions

View File

@ -88,8 +88,8 @@ int main(int argc, char *argv[])
fprintf(stderr,"%s: fork failed\n", argv[0]);
exit(1);
} else if (pid == 0) {
execl("/bin/true", (char *) 0);
fprintf(stderr,"%s: exec /bin/true failed\n", argv[0]);
execl("/usr/bin/true", (char *) 0);
fprintf(stderr,"%s: exec /usr/bin/true failed\n", argv[0]);
exit(1);
} else {
if (waitpid(pid, NULL, 0) < 0) {

View File

@ -35,7 +35,7 @@ SUBDIR= add_route arp ash at backup btrace \
atnormalize dosread fdisk loadfont \
autopart part partition playwave \
recwave repartition screendump \
command echo expr false getopts read test true \
command echo expr getopts read test \
umask wait
.if ${MACHINE_ARCH} == "earm"

View File

@ -1,5 +0,0 @@
SCRIPTS= false.sh
BINDIR= /bin
MAN=
.include <bsd.prog.mk>

View File

@ -1 +0,0 @@
../shared/builtin.sh

View File

@ -9,11 +9,9 @@ At this moment it is installed as the following commands:
/bin/command
/bin/echo
/bin/expr
/bin/false
/bin/getopts
/bin/read
/bin/test
/bin/true
/bin/umask
/bin/wait

View File

@ -1,5 +0,0 @@
SCRIPTS= true.sh
BINDIR= /bin
MAN=
.include <bsd.prog.mk>

View File

@ -1 +0,0 @@
../shared/builtin.sh

View File

@ -22,7 +22,6 @@
./bin/echo minix-sys
./bin/ed minix-sys
./bin/expr minix-sys
./bin/false minix-sys
./bin/getopts minix-sys
./bin/intr minix-sys
./bin/kill minix-sys
@ -50,7 +49,6 @@
./bin/sysenv minix-sys
./bin/tar minix-sys
./bin/test minix-sys
./bin/true minix-sys
./bin/umask minix-sys
./bin/umount minix-sys
./bin/updateboot minix-sys
@ -291,6 +289,7 @@
./usr/bin/ex minix-sys
./usr/bin/expand minix-sys
./usr/bin/factor minix-sys
./usr/bin/false minix-sys
./usr/bin/fbdctl minix-sys
./usr/bin/fdisk minix-sys
./usr/bin/fetch minix-sys
@ -493,6 +492,7 @@
./usr/bin/touch minix-sys
./usr/bin/tput minix-sys
./usr/bin/tr minix-sys
./usr/bin/true minix-sys
./usr/bin/truncate minix-sys
./usr/bin/tsort minix-sys
./usr/bin/ttn minix-sys
@ -2038,6 +2038,7 @@
./usr/man/man1/export.1 minix-sys
./usr/man/man1/expr.1 minix-sys
./usr/man/man1/factor.1 minix-sys
./usr/man/man1/false.1 minix-sys
./usr/man/man1/fetch.1 minix-sys
./usr/man/man1/fgrep.1 minix-sys
./usr/man/man1/file.1 minix-sys

View File

@ -11,7 +11,7 @@ server:*:11:11::0:0:OS Servers:/:/bin/sh
service:*:12:12::0:0:System Services:/:/bin/sh
sshd:*:22:22::0:0:sshd:/:/bin/sh
smtpd:*:25:25::0:0:smtpd:/:/bin/sh
postfix:*:27:27::0:0:postfix:/usr/var/spool/postfix:/bin/false
postgres:*:30:30::0:0:postgresql:/:/bin/false
postfix:*:27:27::0:0:postfix:/usr/var/spool/postfix:/usr/bin/false
postgres:*:30:30::0:0:postgresql:/:/usr/bin/false
games:*:9998:13::0:0:games:/:/bin/sh
nobody:*:9999:39::0:0:Unprivileged user:/tmp:/bin/sh

View File

@ -18,7 +18,7 @@ MAN= ash.1 at.1 \
shar.1 sleep.1 spell.1 \
svc.1 svrctl.1 \
synctree.1 sysenv.1 sz.1 tail.1 telnet.1 template.1 \
term.1 termcap.1 tget.1 time.1 true.1 \
term.1 termcap.1 tget.1 time.1 \
truncate.1 umount.1 \
uud.1 uue.1 vol.1 whereis.1 which.1 \
yap.1 linkfarm.1 pkg_view.1

View File

@ -1,24 +0,0 @@
.TH TRUE 1
.SH NAME
true, false \- exit with the value true or false
.SH SYNOPSIS
\fBtrue\fR
.br
\fBfalse\fR
.SH EXAMPLES
.ta +20n
.ft B
.nf
while true \fR# List the directory until DEL is hit\fP
do ls \-l
done
.fi
.ft P
.SH DESCRIPTION
These commands return the value
.I true
or
.I false .
They are used for shell programming.
.SH "SEE ALSO"
.BR sh (1).

View File

@ -177,6 +177,7 @@
2013/12/1 12:00:00,usr.bin/du
2013/12/1 12:00:00,usr.bin/expand
2013/12/1 12:00:00,usr.bin/env
2013/12/1 12:00:00,usr.bin/false
2013/12/1 12:00:00,usr.bin/finger
2013/12/1 12:00:00,usr.bin/fold
2013/12/1 12:00:00,usr.bin/fpr
@ -243,6 +244,7 @@
2013/12/1 12:00:00,usr.bin/tic
2013/12/1 12:00:00,usr.bin/tput
2013/12/1 12:00:00,usr.bin/tr
2013/12/1 12:00:00,usr.bin/true
2013/12/1 12:00:00,usr.bin/tsort
2013/12/1 12:00:00,usr.bin/tty
2013/12/1 12:00:00,usr.bin/ul

View File

@ -10,7 +10,7 @@ SUBDIR= asa \
column comm csplit ctags cut \
deroff dirname du \
env expand \
finger fold fpr from \
false finger fold fpr from \
fsplit ftp genassym getopt \
head hexdump id indent infocmp join jot \
lam last ldd leave \
@ -26,7 +26,7 @@ SUBDIR= asa \
sdiff sed seq shlock \
shuffle sort split stat su \
tee tic tput \
tr tsort tty ul uname unexpand unifdef \
tr true tsort tty ul uname unexpand unifdef \
uniq units unvis unzip users \
uuidgen vis \
\

7
usr.bin/false/Makefile Normal file
View File

@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.9 1997/03/24 21:59:34 christos Exp $
# from: @(#)Makefile 5.3 (Berkeley) 5/11/90
MAN= false.1
SCRIPTS=false.sh
.include <bsd.prog.mk>

56
usr.bin/false/false.1 Normal file
View File

@ -0,0 +1,56 @@
.\" $NetBSD: false.1,v 1.8 2003/08/07 11:13:40 agc Exp $
.\"
.\" Copyright (c) 1983, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" from: @(#)false.1 6.6 (Berkeley) 7/24/91
.\" $NetBSD: false.1,v 1.8 2003/08/07 11:13:40 agc Exp $
.\"
.Dd July 24, 1991
.Dt FALSE 1
.Os
.Sh NAME
.Nm false
.Nd return false value
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
The
.Nm
utility always exits with a nonzero exit code.
.Sh SEE ALSO
.Xr csh 1 ,
.Xr sh 1 ,
.Xr true 1
.Sh STANDARDS
The
.Nm
utility conforms to
.St -p1003.2-92 .

2
usr.bin/false/false.sh Normal file
View File

@ -0,0 +1,2 @@
#! /bin/sh
exit 1

7
usr.bin/true/Makefile Normal file
View File

@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.9 1997/03/24 21:59:56 christos Exp $
# from: @(#)Makefile 5.3 (Berkeley) 5/11/90
MAN= true.1
SCRIPTS=true.sh
.include <bsd.prog.mk>

56
usr.bin/true/true.1 Normal file
View File

@ -0,0 +1,56 @@
.\" $NetBSD: true.1,v 1.7 2003/08/07 11:16:48 agc Exp $
.\"
.\" Copyright (c) 1983, 1985, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" from: @(#)true.1 6.4 (Berkeley) 6/27/91
.\" $NetBSD: true.1,v 1.7 2003/08/07 11:16:48 agc Exp $
.\"
.Dd June 27, 1991
.Dt TRUE 1
.Os
.Sh NAME
.Nm true
.Nd return true value
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
The
.Nm
utility always returns with exit code zero.
.Sh SEE ALSO
.Xr csh 1 ,
.Xr false 1 ,
.Xr sh 1
.Sh STANDARDS
The
.Nm
utility conforms to
.St -p1003.2-92 .

2
usr.bin/true/true.sh Normal file
View File

@ -0,0 +1,2 @@
#! /bin/sh
exit 0