summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-05-29 22:38:37 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-05-29 22:38:37 +0000
commit5c6b0b391751cf944e107a5ddab480f5b3d82f51 (patch)
treeee836fb7d1770d9cc76d401b0cbc83b61858ffc0 /bin
parentd2d02801b93cc9bf0c9fadd6d3a319d2ebe85b4e (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile4
-rw-r--r--bin/Makefile.inc10
-rw-r--r--bin/chmod/chmod.13
-rw-r--r--bin/cp/cp.123
-rw-r--r--bin/cp/cp.c11
-rw-r--r--bin/cp/extern.h4
-rw-r--r--bin/cp/utils.c19
-rw-r--r--bin/csh/const.c6
-rw-r--r--bin/csh/csh.14
-rw-r--r--bin/csh/csh.c6
-rw-r--r--bin/csh/func.c9
-rw-r--r--bin/date/date.c6
-rw-r--r--bin/dd/dd.c4
-rw-r--r--bin/df/df.c7
-rw-r--r--bin/echo/echo.16
-rw-r--r--bin/echo/echo.c12
-rw-r--r--bin/ed/Makefile11
-rw-r--r--bin/ed/io.c6
-rw-r--r--bin/expr/Makefile4
-rw-r--r--bin/hostname/hostname.14
-rw-r--r--bin/ln/ln.c15
-rw-r--r--bin/ls/ls.c5
-rw-r--r--bin/ls/print.c11
-rw-r--r--bin/ls/util.c4
-rw-r--r--bin/mv/mv.119
-rw-r--r--bin/mv/mv.c25
-rw-r--r--bin/pax/ar_io.c3
-rw-r--r--bin/pax/ar_subs.c3
-rw-r--r--bin/pax/buf_subs.c3
-rw-r--r--bin/pax/cache.c3
-rw-r--r--bin/pax/cpio.c3
-rw-r--r--bin/pax/file_subs.c3
-rw-r--r--bin/pax/ftree.c3
-rw-r--r--bin/pax/gen_subs.c3
-rw-r--r--bin/pax/options.c3
-rw-r--r--bin/pax/pat_rep.c3
-rw-r--r--bin/pax/pax.c4
-rw-r--r--bin/pax/sel_subs.c3
-rw-r--r--bin/pax/tables.c3
-rw-r--r--bin/pax/tar.c3
-rw-r--r--bin/pax/tty_subs.c3
-rw-r--r--bin/ps/Makefile4
-rw-r--r--bin/ps/fmt.c3
-rw-r--r--bin/ps/keyword.c3
-rw-r--r--bin/ps/print.c9
-rw-r--r--bin/ps/ps.161
-rw-r--r--bin/ps/ps.c10
-rw-r--r--bin/rcp/rcp.c23
-rw-r--r--bin/rm/rm.118
-rw-r--r--bin/rm/rm.c9
-rw-r--r--bin/rmail/rmail.c4
-rw-r--r--bin/sh/Makefile5
-rw-r--r--bin/sh/bltin/bltin.h10
-rw-r--r--bin/sh/parser.c40
-rw-r--r--bin/stty/stty.18
-rw-r--r--bin/sync/sync.86
56 files changed, 281 insertions, 216 deletions
diff --git a/bin/Makefile b/bin/Makefile
index b324bba44ab9..1310471e6101 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $Id$
+# $Id: Makefile,v 1.2 1994/09/18 21:25:26 wollman Exp $
-SUBDIR= cat chmod cp csh date dd df domainname echo ed expr hostname \
+SUBDIR= cat chmod cp csh date dd df domainname echo ed expr hostname \
kill ln ls mkdir mv pax ps pwd rcp rm rmail rmdir sh sleep \
stty sync test
diff --git a/bin/Makefile.inc b/bin/Makefile.inc
index 4760782bef05..5e19e782632a 100644
--- a/bin/Makefile.inc
+++ b/bin/Makefile.inc
@@ -2,3 +2,13 @@
BINDIR?= /bin
NOSHARED?= YES
+
+.if exists (${.CURDIR}/../../secure)
+
+.if exists(${.CURDIR}/../../secure/lib/libcipher/obj)
+CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher/obj
+.else
+CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher
+.endif
+
+.endif
diff --git a/bin/chmod/chmod.1 b/bin/chmod/chmod.1
index 5c06913f0cf6..60974ef53363 100644
--- a/bin/chmod/chmod.1
+++ b/bin/chmod/chmod.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
-.\" $Id$
+.\" $Id: chmod.1,v 1.2 1994/09/24 02:53:37 davidg Exp $
.\"
.Dd March 31, 1994
.Dt CHMOD 1
@@ -274,6 +274,7 @@ There's no
.Ar perm
option for the naughty bits.
.Sh SEE ALSO
+.Xr chflags 1 ,
.Xr install 1 ,
.Xr chmod 2 ,
.Xr stat 2 ,
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1
index 9d4a77d5dcf9..4841e41c666b 100644
--- a/bin/cp/cp.1
+++ b/bin/cp/cp.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
-.\" $Id$
+.\" $Id: cp.1,v 1.2 1994/09/24 02:53:40 davidg Exp $
.\"
.Dd April 18, 1994
.Dt CP 1
@@ -47,14 +47,16 @@
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
-.Op Fl fip
+.Op Fl f | i
+.Op Fl p
.Ar source_file target_file
.Nm cp
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
-.Op Fl fip
+.Op Fl f | i
+.Op Fl p
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@@ -105,18 +107,25 @@ For each existing destination pathname, remove it and
create a new file, without prompting for confirmation
regardless of its permissions.
(The
-.Fl i
-option is ignored if the
.Fl f
-option is specified.)
+option overrides any previous
+.Fl i
+options.)
.It Fl i
Causes
.Nm cp
to write a prompt to the standard error output before copying a file
that would overwrite an existing file.
If the response from the standard input begins with the character
-.Sq Li y ,
+.Sq Li y
+or
+.Sq Li Y ,
the file copy is attempted.
+(The
+.Fl i
+option overrides any previous
+.Fl f
+options.)
.It Fl p
Causes
.Nm cp
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index ef88b8cb4d31..8b69f83b415b 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cp.c,v 1.5 1995/04/02 00:49:16 bde Exp $
+ * $Id: cp.c,v 1.6 1995/05/30 00:06:21 rgrimes Exp $
*/
#ifndef lint
@@ -86,7 +86,7 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
PATH_T to = { to.p_path, "" };
uid_t myuid;
-int Rflag, iflag, pflag, rflag;
+int Rflag, iflag, pflag, rflag, fflag;
int myumask;
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -104,7 +104,7 @@ main(argc, argv)
int Hflag, Lflag, Pflag, ch, fts_options, r;
char *target;
- Hflag = Lflag = Pflag = Rflag = 0;
+ Hflag = Lflag = Pflag = 0;
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
switch (ch) {
case 'H':
@@ -123,10 +123,12 @@ main(argc, argv)
Rflag = 1;
break;
case 'f':
+ fflag = 1;
iflag = 0;
break;
case 'i':
- iflag = isatty(fileno(stdin));
+ iflag = 1;
+ fflag = 0;
break;
case 'p':
pflag = 1;
@@ -134,7 +136,6 @@ main(argc, argv)
case 'r':
rflag = 1;
break;
- case '?':
default:
usage();
break;
diff --git a/bin/cp/extern.h b/bin/cp/extern.h
index 6f84535b34ca..6ca9910c3eb5 100644
--- a/bin/cp/extern.h
+++ b/bin/cp/extern.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)extern.h 8.2 (Berkeley) 4/1/94
- * $Id$
+ * $Id: extern.h,v 1.2 1994/09/24 02:53:41 davidg Exp $
*/
typedef struct {
@@ -42,7 +42,7 @@ typedef struct {
extern PATH_T to;
extern uid_t myuid;
-extern int iflag, pflag, myumask;
+extern int iflag, pflag, fflag, myumask;
#include <sys/cdefs.h>
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index 0aa480d7b163..3d73c790a7c5 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: utils.c,v 1.5 1995/10/03 12:55:01 bde Exp $
+ * $Id: utils.c,v 1.3.4.2 1995/10/05 07:24:24 davidg Exp $
*/
#ifndef lint
@@ -86,12 +86,21 @@ copy_file(entp, dne)
checkch = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
- if (checkch != 'y') {
+ if (checkch != 'y' && checkch != 'Y') {
(void)close(from_fd);
return (0);
}
}
- to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
+
+ if (fflag) {
+ /* remove existing destination file name,
+ * create a new file */
+ (void)unlink(to.p_path);
+ to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
+ fs->st_mode & ~(S_ISUID | S_ISGID));
+ } else
+ /* overwrite existing destination file name */
+ to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
} else
to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
fs->st_mode & ~(S_ISUID | S_ISGID));
@@ -281,7 +290,7 @@ void
usage()
{
(void)fprintf(stderr, "%s\n%s\n",
-"usage: cp [-R [-H | -L | -P] [-fip] src target",
-" cp [-R [-H | -L | -P] [-fip] src1 ... srcN directory");
+"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] src target",
+" cp [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory");
exit(1);
}
diff --git a/bin/csh/const.c b/bin/csh/const.c
index 4dac78293cdd..0d6068b2d73f 100644
--- a/bin/csh/const.c
+++ b/bin/csh/const.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: const.c,v 1.2 1994/09/24 02:53:48 davidg Exp $
+ * $Id: const.c,v 1.3 1995/05/30 00:06:29 rgrimes Exp $
*/
#ifndef lint
@@ -47,7 +47,9 @@ Char STR0[] = { '0', '\0' };
Char STR1[] = { '1', '\0' };
Char STRHOME[] = { 'H', 'O', 'M', 'E', '\0' };
Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' };
-Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E' ,'\0' };
+Char STRLC_ALL[] = { 'L', 'C', '_', 'A', 'L', 'L', '\0' };
+Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E', '\0' };
+Char STRLC_COLLATE[] = { 'L', 'C', '_', 'C', 'O', 'L', 'L', 'A', 'T', 'E', '\0' };
Char STRLOGNAME[] = { 'L', 'O', 'G', 'N', 'A', 'M', 'E', '\0' };
Char STRLbrace[] = { '{', '\0' };
Char STRLparen[] = { '(', '\0' };
diff --git a/bin/csh/csh.1 b/bin/csh/csh.1
index 52e7dc279138..7400412ad7ad 100644
--- a/bin/csh/csh.1
+++ b/bin/csh/csh.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)csh.1 8.2 (Berkeley) 1/21/94
-.\" $Id: csh.1,v 1.2 1994/09/24 02:53:49 davidg Exp $
+.\" $Id: csh.1,v 1.3 1995/05/06 13:52:29 ache Exp $
.\"
.Dd January 21, 1994
.Dt CSH 1
@@ -1405,7 +1405,7 @@ of the names suffice.
.Pp
.It Ic login
Terminate a login shell, replacing it with an instance of
-.Pa /bin/login.
+.Pa /usr/bin/login.
This is one way to log off, included for compatibility with
.Xr sh 1 .
.Pp
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index 826c4276ce3f..727cf4641349 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: csh.c,v 1.3 1995/05/30 00:06:30 rgrimes Exp $
+ * $Id: csh.c,v 1.3.4.1 1995/08/25 02:55:47 davidg Exp $
*/
#ifndef lint
@@ -186,7 +186,9 @@ main(argc, argv)
AsciiOnly = k > 0377;
}
#else
- AsciiOnly = getenv("LANG") == NULL && getenv("LC_CTYPE") == NULL;
+ AsciiOnly = getenv("LANG") == NULL &&
+ getenv("LC_ALL") == NULL &&
+ getenv("LC_CTYPE") == NULL;
#endif /* NLS */
/*
diff --git a/bin/csh/func.c b/bin/csh/func.c
index e409197e90fe..445d42edab01 100644
--- a/bin/csh/func.c
+++ b/bin/csh/func.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: func.c,v 1.2 1994/09/24 02:54:04 davidg Exp $
+ * $Id: func.c,v 1.3 1995/05/30 00:06:34 rgrimes Exp $
*/
#ifndef lint
@@ -967,7 +967,8 @@ dosetenv(v, t)
importpath(lp);
dohash(NULL, NULL);
}
- else if (eq(vp, STRLANG) || eq(vp, STRLC_CTYPE)) {
+ else if (eq(vp, STRLANG) || eq(vp, STRLC_CTYPE) ||
+ eq(vp, STRLC_ALL) || eq(vp, STRLC_COLLATE)) {
#ifdef NLS
int k;
@@ -1015,7 +1016,8 @@ dounsetenv(v, t)
if (!Gmatch(name, *v))
continue;
maxi = 1;
- if (eq(name, STRLANG) || eq(name, STRLC_CTYPE)) {
+ if (eq(name, STRLANG) || eq(name, STRLC_CTYPE) ||
+ eq(name, STRLC_ALL) || eq(name, STRLC_COLLATE)) {
#ifdef NLS
int k;
@@ -1025,6 +1027,7 @@ dounsetenv(v, t)
AsciiOnly = k > 0377;
#else
AsciiOnly = getenv("LANG") == NULL &&
+ getenv("LC_ALL") == NULL &&
getenv("LC_CTYPE") == NULL;
#endif /* NLS */
}
diff --git a/bin/date/date.c b/bin/date/date.c
index 94e3b33227e6..811cb9f88a34 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: date.c,v 1.4 1995/04/03 20:08:33 joerg Exp $
+ * $Id: date.c,v 1.4.4.1 1995/08/28 10:31:25 davidg Exp $
*/
#ifndef lint
@@ -54,6 +54,7 @@ static char sccsid[] = "@(#)date.c 8.1 (Berkeley) 5/31/93";
#include <string.h>
#include <syslog.h>
#include <unistd.h>
+#include <locale.h>
#include "extern.h"
@@ -79,6 +80,7 @@ main(argc, argv)
char *endptr;
int set_timezone;
+ (void) setlocale(LC_TIME, "");
tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 0;
set_timezone = 0;
@@ -208,7 +210,7 @@ setthetime(p)
/* convert broken-down time to GMT clock time */
if ((tval = mktime(lt)) == -1)
- badformat();
+ errx(1, "nonexistent time");
/* set the time */
if (nflag || netsettime(tval)) {
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index d3428701a43f..55c4e76a06c8 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: dd.c,v 1.3 1995/01/17 22:55:59 ache Exp $
+ * $Id: dd.c,v 1.4 1995/01/17 23:04:29 ache Exp $
*/
#ifndef lint
@@ -61,6 +61,7 @@ static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <locale.h>
#include "dd.h"
#include "extern.h"
@@ -84,6 +85,7 @@ main(argc, argv)
int argc;
char *argv[];
{
+ (void) setlocale(LC_CTYPE, "");
jcl(argv);
setup();
diff --git a/bin/df/df.c b/bin/df/df.c
index 80cbba4abe16..701a9adac46c 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: df.c,v 1.6 1995/03/19 13:28:15 joerg Exp $
+ * $Id: df.c,v 1.7 1995/05/30 00:06:42 rgrimes Exp $
*/
#ifndef lint
@@ -386,10 +386,7 @@ ufs_df(file, maxwidth)
sfsp->f_blocks = sblock.fs_dsize;
sfsp->f_bfree = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag +
sblock.fs_cstotal.cs_nffree;
- sfsp->f_bavail = (sblock.fs_dsize * (100 - sblock.fs_minfree) / 100) -
- (sblock.fs_dsize - sfsp->f_bfree);
- if (sfsp->f_bavail < 0)
- sfsp->f_bavail = 0;
+ sfsp->f_bavail = freespace(&sblock, sblock.fs_minfree);
sfsp->f_files = sblock.fs_ncg * sblock.fs_ipg;
sfsp->f_ffree = sblock.fs_cstotal.cs_nifree;
sfsp->f_fsid.val[0] = 0;
diff --git a/bin/echo/echo.1 b/bin/echo/echo.1
index b74272c8a9f2..d045b3dcc67c 100644
--- a/bin/echo/echo.1
+++ b/bin/echo/echo.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
-.\" $Id$
+.\" $Id: echo.1,v 1.2 1994/09/24 02:55:17 davidg Exp $
.\"
.Dd July 22, 1993
.Dt ECHO 1
@@ -55,7 +55,9 @@ output.
The following option is available:
.Bl -tag -width flag
.It Fl n
-Do not print the trailing newline character.
+Do not print the trailing newline character. This may also be
+achieved by appending `\ec' to the end of the string, as is done
+by iBCS2 compatible systems.
.El
.Pp
The
diff --git a/bin/echo/echo.c b/bin/echo/echo.c
index ba9f9ed7cc2b..e604765e48a3 100644
--- a/bin/echo/echo.c
+++ b/bin/echo/echo.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: echo.c,v 1.2 1994/09/24 02:55:18 davidg Exp $
*/
#ifndef lint
@@ -62,8 +62,14 @@ main(argc, argv)
else
nflag = 0;
- while (*argv) {
- (void)printf("%s", *argv);
+ while (argv[0]) {
+ int len = strlen(argv[0]);
+
+ if (len >= 2 && !argv[1] && argv[0][len - 2] == '\\' && argv[0][len - 1] == 'c') {
+ argv[0][len - 2] = '\0';
+ nflag = 1;
+ }
+ (void)printf("%s", argv[0]);
if (*++argv)
putchar(' ');
}
diff --git a/bin/ed/Makefile b/bin/ed/Makefile
index 68cfc3a9aae9..fa13ceb61946 100644
--- a/bin/ed/Makefile
+++ b/bin/ed/Makefile
@@ -1,8 +1,15 @@
-# $Id: Makefile,v 1.9 1994/10/29 10:13:34 phk Exp $
+# $Id: Makefile,v 1.10 1994/12/18 15:15:10 jkh Exp $
PROG= ed
-SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
+SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
LINKS= ${BINDIR}/ed ${BINDIR}/red
MLINKS= ed.1 red.1
+.if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
+DISTRIBUTION=des
+CFLAGS+=-DDES
+LDADD+= -L${CIPHEROBJDIR} -lcipher
+DPADD+= ${CIPHEROBJDIR}/libcipher.a
+.endif
+
.include <bsd.prog.mk>
diff --git a/bin/ed/io.c b/bin/ed/io.c
index 1072d06b7a00..99e832acbb7b 100644
--- a/bin/ed/io.c
+++ b/bin/ed/io.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: io.c,v 1.3 1994/09/24 02:55:27 davidg Exp $
+ * $Id: io.c,v 1.4 1995/03/19 13:28:32 joerg Exp $
*/
#ifndef lint
@@ -58,7 +58,7 @@ read_file(fn, n)
sprintf(errmsg, "cannot close input file");
return ERR;
}
- fprintf(stderr, !scripted ? "%lu\n" : "", size);
+ fprintf(stdout, !scripted ? "%lu\n" : "", size);
return current_addr - n;
}
@@ -173,7 +173,7 @@ write_file(fn, mode, n, m)
sprintf(errmsg, "cannot close output file");
return ERR;
}
- fprintf(stderr, !scripted ? "%lu\n" : "", size);
+ fprintf(stdout, !scripted ? "%lu\n" : "", size);
return n ? m - n + 1 : 0;
}
diff --git a/bin/expr/Makefile b/bin/expr/Makefile
index c98e59fbcb3b..63c0055d945d 100644
--- a/bin/expr/Makefile
+++ b/bin/expr/Makefile
@@ -1,5 +1,5 @@
# /b/source/CVS/src/bin/expr/Makefile,v 1.5 1993/06/14 19:56:06 jtc Exp
-# $Id: Makefile,v 1.6 1994/09/24 02:55:36 davidg Exp $
+# $Id: Makefile,v 1.7 1995/05/30 00:06:49 rgrimes Exp $
PROG= expr
SRCS= expr.c
@@ -7,7 +7,7 @@ CLEANFILES+= expr.c y.tab.h
expr.c:
${YACC} -d ${.IMPSRC}
- mv y.tab.c expr.c
+ mv -f y.tab.c expr.c
.include <bsd.prog.mk>
diff --git a/bin/hostname/hostname.1 b/bin/hostname/hostname.1
index 8235045fb25f..68548f748813 100644
--- a/bin/hostname/hostname.1
+++ b/bin/hostname/hostname.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)hostname.1 8.1 (Berkeley) 5/31/93
-.\" $Id$
+.\" $Id: hostname.1,v 1.2 1994/09/24 02:55:40 davidg Exp $
.\"
.Dd May 31, 1993
.Dt HOSTNAME 1
@@ -58,7 +58,7 @@ Trims off any domain information from the printed
name.
.El
.Sh SEE ALSO
-.Xr gethostname 2
+.Xr gethostname 3
.Sh HISTORY
The
.Nm hostname
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 73fffa711856..b9c4f3f1eed5 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ln.c,v 1.4 1994/09/24 02:55:48 davidg Exp $
+ * $Id: ln.c,v 1.5 1994/12/06 18:50:44 bde Exp $
*/
#ifndef lint
@@ -53,7 +53,6 @@ static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#include <string.h>
#include <unistd.h>
-int dirflag; /* Undocumented directory flag. */
int fflag; /* Unlink existing files. */
int sflag; /* Symbolic, not hard, link. */
/* System link call. */
@@ -72,11 +71,8 @@ main(argc, argv)
int ch, exitval;
char *sourcedir;
- while ((ch = getopt(argc, argv, "Ffs")) != EOF)
+ while ((ch = getopt(argc, argv, "fs")) != EOF)
switch (ch) {
- case 'F':
- dirflag = 1; /* XXX: deliberately undocumented. */
- break;
case 'f':
fflag = 1;
break;
@@ -127,9 +123,10 @@ linkit(target, source, isdir)
warn("%s", target);
return (1);
}
- /* Only symbolic links to directories, unless -F option used. */
- if (!dirflag && (sb.st_mode & S_IFMT) == S_IFDIR) {
- warnx("%s: is a directory", target);
+ /* Only symbolic links to directories. */
+ if (S_ISDIR(sb.st_mode)) {
+ errno = EISDIR;
+ warn("%s", target);
return (1);
}
}
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 17f7137c1d3a..a02b1fbf8a38 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ls.c,v 1.5 1995/03/19 13:28:44 joerg Exp $
+ * $Id: ls.c,v 1.6 1995/03/23 19:05:00 phk Exp $
*/
#ifndef lint
@@ -58,6 +58,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <locale.h>
#include "ls.h"
#include "extern.h"
@@ -104,6 +105,8 @@ main(argc, argv)
int ch, fts_options, notused;
char *p;
+ (void) setlocale(LC_ALL, "");
+
/* Terminal defaults to -Cq, non-terminal defaults to -1. */
if (isatty(STDOUT_FILENO)) {
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == -1 ||
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 058d0b3a7a8a..d6a2bc7d2354 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: print.c,v 1.4 1995/05/30 00:06:50 rgrimes Exp $
+ * $Id: print.c,v 1.4.4.1 1995/08/28 10:30:27 davidg Exp $
*/
#ifndef lint
@@ -53,7 +53,6 @@ static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94";
#include <string.h>
#include <time.h>
#include <unistd.h>
-#include <utmp.h>
#include "ls.h"
#include "extern.h"
@@ -108,8 +107,12 @@ printlong(dp)
if (f_flags)
(void)printf("%-*s ", dp->s_flags, np->flags);
if (S_ISCHR(sp->st_mode) || S_ISBLK(sp->st_mode))
- (void)printf("%3d, %3d ",
- major(sp->st_rdev), minor(sp->st_rdev));
+ if (minor(sp->st_rdev) > 255)
+ (void)printf("%3d, 0x%08x ",
+ major(sp->st_rdev), minor(sp->st_rdev));
+ else
+ (void)printf("%3d, %3d ",
+ major(sp->st_rdev), minor(sp->st_rdev));
else if (dp->bcfile)
(void)printf("%*s%*qd ",
8 - dp->s_size, "", dp->s_size, sp->st_size);
diff --git a/bin/ls/util.c b/bin/ls/util.c
index e436c922ff61..d16ab6aa7a14 100644
--- a/bin/ls/util.c
+++ b/bin/ls/util.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: util.c,v 1.3 1994/09/24 02:55:58 davidg Exp $
+ * $Id: util.c,v 1.4 1994/10/09 15:25:23 ache Exp $
*/
#ifndef lint
@@ -57,7 +57,7 @@ prcopy(src, dest, len)
char *src, *dest;
int len;
{
- int ch;
+ unsigned char ch;
while (len--) {
ch = *src++;
diff --git a/bin/mv/mv.1 b/bin/mv/mv.1
index 01c0f2b7415d..9ad2ea34d050 100644
--- a/bin/mv/mv.1
+++ b/bin/mv/mv.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
-.\" $Id: mv.1,v 1.2 1994/09/24 02:56:06 davidg Exp $
+.\" $Id: mv.1,v 1.2.6.1 1995/08/29 11:14:21 davidg Exp $
.\"
.Dd May 31, 1993
.Dt MV 1
@@ -77,17 +77,25 @@ The following options are available:
Do not prompt for confirmation before overwriting the destination
path.
(The
-.Fl i
-option is ignored if the
.Fl f
-option is specified.)
+option overrides any previous
+.Fl i
+options.)
.It Fl i
Causes
.Nm mv
to write a prompt to standard error before moving a file that would
overwrite an existing file.
-If the response from the standard input begins with the character ``y'',
+If the response from the standard input begins with the character
+.Sq Li y
+or
+.Sq Li Y ,
the move is attempted.
+(The
+.Fl i
+option overrides any previous
+.Fl f
+options.)
.El
.Pp
It is an error for either the
@@ -121,6 +129,7 @@ The
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr cp 1 ,
+.Xr rm 1 ,
.Xr symlink 7
.Sh STANDARDS
The
diff --git a/bin/mv/mv.c b/bin/mv/mv.c
index 28da455ecd6f..1486052ddaa5 100644
--- a/bin/mv/mv.c
+++ b/bin/mv/mv.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: mv.c,v 1.3 1995/10/07 10:42:48 bde Exp $
+ * $Id: mv.c,v 1.2.6.1 1995/10/09 05:12:21 davidg Exp $
*/
#ifndef lint
@@ -79,21 +79,20 @@ main(argc, argv)
int ch;
char path[MAXPATHLEN + 1];
- while ((ch = getopt(argc, argv, "-if")) != EOF)
+ while ((ch = getopt(argc, argv, "fi")) != EOF)
switch (ch) {
case 'i':
iflg = 1;
+ fflg = 0;
break;
case 'f':
fflg = 1;
+ iflg = 0;
break;
- case '-': /* Undocumented; for compatibility. */
- goto endarg;
- case '?':
default:
usage();
}
-endarg: argc -= optind;
+ argc -= optind;
argv += optind;
if (argc < 2)
@@ -152,6 +151,13 @@ do_move(from, to)
* make sure the user wants to clobber it.
*/
if (!fflg && !access(to, F_OK)) {
+
+ /* prompt only if source exist */
+ if (lstat(from, &sb) == -1) {
+ warn("%s", from);
+ return (1);
+ }
+
ask = 0;
if (iflg) {
(void)fprintf(stderr, "overwrite %s? ", to);
@@ -167,7 +173,7 @@ do_move(from, to)
if (ask) {
if ((ch = getchar()) != EOF && ch != '\n')
while (getchar() != '\n');
- if (ch != 'y')
+ if (ch != 'y' && ch != 'Y')
return (0);
}
}
@@ -302,7 +308,8 @@ copy(from, to)
void
usage()
{
- (void)fprintf(stderr,
-"usage: mv [-if] src target;\n or: mv [-if] src1 ... srcN directory\n");
+ (void)fprintf(stderr, "%s\n%s\n",
+ "usage: mv [-f | -i] src target",
+ " mv [-f | -i] src1 ... srcN directory");
exit(1);
}
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index e3481bda9e2e..827a02d2224d 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ar_io.c,v 1.2 1994/09/24 02:56:11 davidg Exp $
+ * $Id: ar_io.c,v 1.3 1995/05/30 00:06:52 rgrimes Exp $
*/
#ifndef lint
@@ -52,7 +52,6 @@ static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
-#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include "pax.h"
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
index c725fe854a27..7777afb79f41 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ar_subs.c,v 1.2 1994/09/24 02:56:12 davidg Exp $
+ * $Id: ar_subs.c,v 1.3 1995/05/30 00:06:52 rgrimes Exp $
*/
#ifndef lint
@@ -48,7 +48,6 @@ static char sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94";
#include <signal.h>
#include <string.h>
#include <stdio.h>
-#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c
index b8b6a8c966c6..fa6f925ac3b1 100644
--- a/bin/pax/buf_subs.c
+++ b/bin/pax/buf_subs.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: buf_subs.c,v 1.2 1994/09/24 02:56:13 davidg Exp $
+ * $Id: buf_subs.c,v 1.3 1995/05/30 00:06:53 rgrimes Exp $
*/
#ifndef lint
@@ -46,7 +46,6 @@ static char sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94";
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
-#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/cache.c b/bin/pax/cache.c
index 8d88abe15b29..6ffe469ac7c4 100644
--- a/bin/pax/cache.c
+++ b/bin/pax/cache.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: cache.c,v 1.2 1994/09/24 02:56:14 davidg Exp $
*/
#ifndef lint
@@ -47,7 +47,6 @@ static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
#include <sys/param.h>
#include <string.h>
#include <stdio.h>
-#include <ctype.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index 0307c54ff95c..e3fd4f1a420d 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpio.c,v 1.2 1994/09/24 02:56:16 davidg Exp $
+ * $Id: cpio.c,v 1.3 1995/05/30 00:06:54 rgrimes Exp $
*/
#ifndef lint
@@ -46,7 +46,6 @@ static char sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
#include <sys/stat.h>
#include <sys/param.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c
index f220639870d6..107a1003329e 100644
--- a/bin/pax/file_subs.c
+++ b/bin/pax/file_subs.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: file_subs.c,v 1.2 1994/09/24 02:56:19 davidg Exp $
+ * $Id: file_subs.c,v 1.3 1995/05/30 00:06:56 rgrimes Exp $
*/
#ifndef lint
@@ -49,7 +49,6 @@ static char sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93";
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
-#include <ctype.h>
#include <errno.h>
#include <sys/uio.h>
#include <stdlib.h>
diff --git a/bin/pax/ftree.c b/bin/pax/ftree.c
index 6f2b14b256bd..375e62071693 100644
--- a/bin/pax/ftree.c
+++ b/bin/pax/ftree.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ftree.c,v 1.2 1994/09/24 02:56:20 davidg Exp $
+ * $Id: ftree.c,v 1.3 1995/05/30 00:06:57 rgrimes Exp $
*/
#ifndef lint
@@ -48,7 +48,6 @@ static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
#include <unistd.h>
#include <string.h>
#include <stdio.h>
-#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <fts.h>
diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
index fba1699f0955..dc0d5a07280c 100644
--- a/bin/pax/gen_subs.c
+++ b/bin/pax/gen_subs.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: gen_subs.c,v 1.5 1995/08/07 19:17:36 wollman Exp $
+ * $Id: gen_subs.c,v 1.4.4.1 1995/08/28 10:41:14 davidg Exp $
*/
#ifndef lint
@@ -46,7 +46,6 @@ static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
-#include <ctype.h>
#include <utmp.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/options.c b/bin/pax/options.c
index e8e5cc6d0f7b..53a9ad6b06a2 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: options.c,v 1.2 1994/09/24 02:56:22 davidg Exp $
+ * $Id: options.c,v 1.3 1995/03/19 13:28:53 joerg Exp $
*/
#ifndef lint
@@ -47,7 +47,6 @@ static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#include <sys/mtio.h>
#include <sys/param.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index aadd17cd5d61..451a9dfc0a2f 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pat_rep.c,v 1.3 1995/03/19 13:28:56 joerg Exp $
+ * $Id: pat_rep.c,v 1.4 1995/05/30 00:06:59 rgrimes Exp $
*/
#ifndef lint
@@ -46,7 +46,6 @@ static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/pax/pax.c b/bin/pax/pax.c
index 2bdf6bd81166..5d5e31f21e68 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pax.c,v 1.2 1994/09/24 02:56:27 davidg Exp $
+ * $Id: pax.c,v 1.3 1995/05/30 00:07:00 rgrimes Exp $
*/
#ifndef lint
@@ -57,6 +57,7 @@ static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
+#include <locale.h>
#include "pax.h"
#include "extern.h"
static int gen_init __P((void));
@@ -227,6 +228,7 @@ main(argc, argv)
char **argv;
#endif
{
+ (void) setlocale(LC_TIME, "");
/*
* parse options, determine operational mode, general init
*/
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
index c90dc786ee7b..e759bdb58dbc 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: sel_subs.c,v 1.2 1994/09/24 02:56:29 davidg Exp $
*/
#ifndef lint
@@ -48,7 +48,6 @@ static char sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
#include <pwd.h>
#include <grp.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
diff --git a/bin/pax/tables.c b/bin/pax/tables.c
index c3ccc1c6a9e3..b0694176c06d 100644
--- a/bin/pax/tables.c
+++ b/bin/pax/tables.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tables.c,v 1.2 1994/09/24 02:56:34 davidg Exp $
+ * $Id: tables.c,v 1.3 1995/05/30 00:07:01 rgrimes Exp $
*/
#ifndef lint
@@ -47,7 +47,6 @@ static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93";
#include <sys/param.h>
#include <sys/fcntl.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index fc5ca2fa7f42..a88f6585c090 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tar.c,v 1.2 1994/09/24 02:56:37 davidg Exp $
+ * $Id: tar.c,v 1.3 1995/05/30 00:07:03 rgrimes Exp $
*/
#ifndef lint
@@ -47,7 +47,6 @@ static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
#include <sys/param.h>
#include <string.h>
#include <stdio.h>
-#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include "pax.h"
diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c
index 4a6cb5839719..0c47facdca90 100644
--- a/bin/pax/tty_subs.c
+++ b/bin/pax/tty_subs.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: tty_subs.c,v 1.2 1994/09/24 02:56:38 davidg Exp $
*/
#ifndef lint
@@ -47,7 +47,6 @@ static char sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
#include <sys/param.h>
#include <fcntl.h>
#include <stdio.h>
-#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/bin/ps/Makefile b/bin/ps/Makefile
index e8885f24d177..d7d3094bb65f 100644
--- a/bin/ps/Makefile
+++ b/bin/ps/Makefile
@@ -1,10 +1,10 @@
# @(#)Makefile 8.1 (Berkeley) 6/2/93
-# $Id: Makefile,v 1.4 1995/04/15 03:23:36 davidg Exp $
+# $Id: Makefile,v 1.5 1995/04/15 03:31:19 davidg Exp $
PROG= ps
SRCS= fmt.c keyword.c nlist.c print.c ps.c
CFLAGS+=-I/sys
-DPADD= ${LIBMATH} ${LIBKVM}
+DPADD= ${LIBM} ${LIBKVM}
LDADD= -lm -lkvm
BINGRP= kmem
BINMODE=2555
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c
index ce8efe902fab..8231c73850be 100644
--- a/bin/ps/fmt.c
+++ b/bin/ps/fmt.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fmt.c,v 1.4 1994/11/10 23:25:12 ats Exp $
+ * $Id: fmt.c,v 1.5 1995/03/09 20:40:17 davidg Exp $
*/
#ifndef lint
@@ -41,7 +41,6 @@ static char sccsid[] = "@(#)fmt.c 8.4 (Berkeley) 4/15/94";
#include <sys/syslimits.h>
#include <sys/time.h>
#include <sys/resource.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index d2423181b81d..4fb2bd28969f 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: keyword.c,v 1.7 1995/09/26 17:48:58 peter Exp $
+ * $Id: keyword.c,v 1.5.6.1 1995/10/05 07:46:36 davidg Exp $
*/
#ifndef lint
@@ -57,6 +57,7 @@ static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#ifdef NEWVM
#include <sys/ucred.h>
+#include <sys/user.h>
#include <sys/sysctl.h>
#endif
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 01f815abfcf3..b1d76ee28c77 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: print.c,v 1.10 1995/09/26 17:48:59 peter Exp $
+ * $Id: print.c,v 1.7.4.2 1995/10/05 07:46:37 davidg Exp $
*/
#ifndef lint
@@ -49,6 +49,7 @@ static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#ifdef NEWVM
#include <sys/ucred.h>
+#include <sys/user.h>
#include <sys/sysctl.h>
#include <vm/vm.h>
#else
@@ -418,7 +419,7 @@ wchan(k, ve)
(void)printf("%-*s", v->width, "-");
}
-#define pgtok(a) (((a)*NBPG)/1024)
+#define pgtok(a) (((a)*getpagesize())/1024)
void
vsize(k, ve)
@@ -574,7 +575,7 @@ getpmem(k)
/* XXX want pmap ptpages, segtab, etc. (per architecture) */
szptudot = UPAGES;
/* XXX don't have info about shared */
- fracmem = ((float)e->e_vm.vm_rssize + szptudot)/CLSIZE/mempages;
+ fracmem = ((float)e->e_vm.vm_rssize + szptudot)/getpagesize()/mempages;
#endif
return (100.0 * fracmem);
}
@@ -611,7 +612,7 @@ maxrss(k, ve)
v = ve->var;
#ifndef NEWVM /* not yet */
- if (KI_PROC(k)->p_maxrss != (RLIM_INFINITY/NBPG))
+ if (KI_PROC(k)->p_maxrss != (RLIM_INFINITY/PAGE_SIZE))
(void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_maxrss));
else
#endif
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index dfc5d23c080d..e77ab9975730 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
-.\" $Id: ps.1,v 1.4.6.1 1995/12/30 13:53:17 joerg Exp $
+.\" $Id: ps.1,v 1.4.6.2 1996/02/22 19:51:39 peter Exp $
.\"
.Dd April 18, 1994
.Dt PS 1
@@ -186,46 +186,29 @@ fields to exceed 100%.
.It %mem
The percentage of real memory used by this process.
.It flags
-The flags (in hexadecimal) associated with the process as in
+The flags associated with the process as in
the include file
.Aq Pa sys/proc.h :
-.Bl -column SNOCLDSTOP SNOCLDSTOP
-.It Dv "SLOAD" Ta No "0x0000001 in core"
-.It Dv "SSYS" Ta No "0x0000002 swapper or pager process"
-.It Dv "SLOCK" Ta No "0x0000004 process being swapped out"
-.It Dv "SSWAP" Ta No "0x0000008 save area flag"
-.It Dv "STRC" Ta No "0x0000010 process is being traced"
-.It Dv "SWTED" Ta No "0x0000020 another tracing flag"
-.It Dv "SSINTR" Ta No "0x0000040 sleep is interruptible"
-.It Dv "SKEEP" Ta No "0x0000100 another flag to prevent swap out"
-.It Dv "SOMASK" Ta No "0x0000200 restore old mask after taking signal"
-.It Dv "SWEXIT" Ta No "0x0000400 working on exiting"
-.It Dv "SPHYSIO" Ta No "0x0000800 doing physical"
-.Tn I/O
-.It Dv "SVFORK" Ta No "0x0001000 process resulted from"
-.Xr vfork 2
-.It Dv "SVFDONE" Ta No "0x0002000 another"
-.Xr vfork
-flag
-.It Dv "SNOVM" Ta No "0x0004000 no vm, parent in a"
-.Xr vfork
-.It Dv "SPAGV" Ta No "0x0008000 init data space on demand, from vnode"
-.It Dv "SSEQL" Ta No "0x0010000 user warned of sequential vm behavior"
-.It Dv "SUANOM" Ta No "0x0020000 user warned of random vm behavior"
-.It Dv "STIMO" Ta No "0x0040000 timing out during sleep"
-.It Dv "SNOCLDSTOP" Ta No "0x0080000 no"
-.Dv SIGCHLD
-when children stop
-.It Dv "SCTTY" Ta No "0x0100000 has a controlling terminal"
-.It Dv "SOWEUPC" Ta No "0x0200000 owe process an addupc() call at next ast"
-.\" the routine addupc is not documented in the man pages
-.It Dv "SSEL" Ta No "0x0400000 selecting; wakeup/waiting danger"
-.It Dv "SEXEC" Ta No "0x0800000 process called"
-.Xr exec 2
-.It Dv "SHPUX" Ta No "0x1000000 \\*(tNHP-UX\\*(sP process
-.Pq Dv HPUXCOMPAT
-.It Dv "SULOCK" Ta No "0x2000000 locked in core after swap error"
-.It Dv "SPTECHG" Ta No "0x4000000 pte's for process have changed"
+.Bl -column P_NOCLDSTOP P_NOCLDSTOP
+.It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock"
+.It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal"
+.It Dv "P_INMEM" Ta No "0x00004 Loaded into memory"
+.It Dv "P_NOCLDSTOP" Ta No "0x00008 No SIGCHLD when children stop"
+.It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit"
+.It Dv "P_PROFIL" Ta No "0x00020 Has started profiling"
+.It Dv "P_SELECT" Ta No "0x00040 Selecting; wakeup/waiting danger"
+.It Dv "P_SINTR" Ta No "0x00080 Sleep is interruptible"
+.It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec"
+.It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping"
+.It Dv "P_TIMEOUT" Ta No "0x00400 Timing out during sleep"
+.It Dv "P_TRACED" Ta No "0x00800 Debugged process being traced"
+.It Dv "P_WAITED" Ta No "0x01000 Debugging process has waited for child"
+.It Dv "P_WEXIT" Ta No "0x02000 Working on exiting"
+.It Dv "P_EXEC" Ta No "0x04000 Process called exec"
+.It Dv "P_NOSWAP" Ta No "0x08000 Another flag to prevent swap out"
+.It Dv "P_PHYSIO" Ta No "0x10000 Doing physical I/O"
+.It Dv "P_OWEUPC" Ta No "0x20000 Owe process an addupc() call at next ast"
+.It Dv "P_SWAPPING" Ta No "0x40000 Process is being swapped"
.El
.It lim
The soft limit on memory used, specified via a call to
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 21d67cca8e9a..1684810314f7 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ps.c,v 1.7 1995/05/30 00:07:05 rgrimes Exp $
+ * $Id: ps.c,v 1.7.4.1 1996/02/22 19:51:40 peter Exp $
*/
#ifndef lint
@@ -57,13 +57,15 @@ static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
+#include <limits.h>
#include <nlist.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <pwd.h>
#include <unistd.h>
+#include <locale.h>
+#include <pwd.h>
#include "ps.h"
@@ -116,7 +118,9 @@ main(argc, argv)
uid_t uid;
int all, ch, flag, i, fmt, lineno, nentries;
int prtheader, wflag, what, xflg;
- char *nlistf, *memf, *swapf, errbuf[256];
+ char *nlistf, *memf, *swapf, errbuf[_POSIX2_LINE_MAX];
+
+ (void) setlocale(LC_ALL, "");
if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 &&
ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 &&
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index 564786828af7..34c38a852bde 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rcp.c,v 1.3 1995/03/19 13:29:14 joerg Exp $
+ * $Id: rcp.c,v 1.4 1995/05/30 00:07:06 rgrimes Exp $
*/
#ifndef lint
@@ -69,9 +69,11 @@ static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
#include "extern.h"
#ifdef KERBEROS
-#include <kerberosIV/des.h>
+#include <des.h>
#include <kerberosIV/krb.h>
+#include "../../usr.bin/rlogin/krb.h"
+
char dst_realm_buf[REALM_SZ];
char *dest_realm = NULL;
int use_kerberos = 1;
@@ -590,22 +592,21 @@ sink(argc, argv)
if (ch == '\n')
*--cp = 0;
-#define getnum(t) (t) = 0; while (isdigit(*cp)) (t) = (t) * 10 + (*cp++ - '0');
cp = buf;
if (*cp == 'T') {
setimes++;
cp++;
- getnum(mtime.tv_sec);
- if (*cp++ != ' ')
+ mtime.tv_sec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != ' ')
SCREWUP("mtime.sec not delimited");
- getnum(mtime.tv_usec);
- if (*cp++ != ' ')
+ mtime.tv_usec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != ' ')
SCREWUP("mtime.usec not delimited");
- getnum(atime.tv_sec);
- if (*cp++ != ' ')
+ atime.tv_sec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != ' ')
SCREWUP("atime.sec not delimited");
- getnum(atime.tv_usec);
- if (*cp++ != '\0')
+ atime.tv_usec = strtol(cp, &cp, 10);
+ if (!cp || *cp++ != '\0')
SCREWUP("atime.usec not delimited");
(void)write(rem, "", 1);
continue;
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index 2e523b9a8639..693c1cf35705 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rm.1 8.2 (Berkeley) 4/18/94
-.\" $Id$
+.\" $Id: rm.1,v 1.2 1994/09/24 02:57:00 davidg Exp $
.\"
.Dd April 18, 1994
.Dt RM 1
@@ -118,10 +118,26 @@ removed.
If an error occurs,
.Nm rm
exits with a value >0.
+.Sh NOTE
+.Nm rm
+use
+.Xr getopt 3
+parsing routine. Getopt accept a
+.Sq Li --
+argument, which stop reading options, anything after this
+is not an option.
+So
+.Nm rm
+handle files whose names begins with a
+.Sq Li - .
+Example:
+
+``$ rm -- -filename''.
.Sh SEE ALSO
.Xr rmdir 1 ,
.Xr unlink 2 ,
.Xr fts 3 ,
+.Xr getopt 3 ,
.Xr symlink 7
.Sh BUGS
The
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 1a743786030d..8df172f61cf0 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rm.c,v 1.5 1994/09/24 02:57:02 davidg Exp $
+ * $Id: rm.c,v 1.6 1995/04/13 13:35:09 ache Exp $
*/
#ifndef lint
@@ -81,7 +81,7 @@ main(argc, argv)
{
int ch, rflag;
- Pflag = rflag = 0;
+ rflag = 0;
while ((ch = getopt(argc, argv, "dfiPRr")) != EOF)
switch(ch) {
case 'd':
@@ -102,7 +102,6 @@ main(argc, argv)
case 'r': /* Compatibility. */
rflag = 1;
break;
- case '?':
default:
usage();
}
@@ -378,7 +377,7 @@ check(path, name, sp)
first = ch = getchar();
while (ch != '\n' && ch != EOF)
ch = getchar();
- return (first == 'y');
+ return (first == 'y' || first == 'Y');
}
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
@@ -410,6 +409,6 @@ void
usage()
{
- (void)fprintf(stderr, "usage: rm [-dfiRr] file ...\n");
+ (void)fprintf(stderr, "usage: rm [-f | -i] [-dPRr] file ...\n");
exit(1);
}
diff --git a/bin/rmail/rmail.c b/bin/rmail/rmail.c
index aeec46cca134..b45ec457682e 100644
--- a/bin/rmail/rmail.c
+++ b/bin/rmail/rmail.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rmail.c,v 1.4 1995/03/19 13:29:18 joerg Exp $
+ * $Id: rmail.c,v 1.5 1995/05/30 00:07:08 rgrimes Exp $
*/
#ifndef lint
@@ -211,6 +211,8 @@ main(argc, argv)
/* Save off from user's address; the last one wins. */
for (p = addrp; *p && !isspace(*p); ++p);
*p = '\0';
+ if (*addrp == '\0')
+ addrp = "<>";
if (from_user != NULL)
free(from_user);
if ((from_user = strdup(addrp)) == NULL)
diff --git a/bin/sh/Makefile b/bin/sh/Makefile
index cd0932b90d1b..d703e92b082b 100644
--- a/bin/sh/Makefile
+++ b/bin/sh/Makefile
@@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/8/93
-# $Id: Makefile,v 1.8 1995/08/27 20:26:40 joerg Exp $
+# $Id: Makefile,v 1.7.6.1 1995/12/11 23:04:38 joerg Exp $
PROG= sh
SRCS= alias.c builtins.c cd.c echo.c error.c eval.c exec.c expand.c \
@@ -23,6 +23,9 @@ CLEANFILES+=\
token.def: mktokens
sh ${.CURDIR}/mktokens
+${.CURDIR}/builtins:
+ # just override the default rule
+
builtins.h builtins.c: ${.CURDIR}/mkbuiltins ${.CURDIR}/builtins
cd ${.CURDIR}; sh mkbuiltins
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index f10ded216019..0300d14ba626 100644
--- a/bin/sh/bltin/bltin.h
+++ b/bin/sh/bltin/bltin.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)bltin.h 8.1 (Berkeley) 5/31/93
- * $Id: bltin.h,v 1.3 1995/12/10 15:37:44 joerg Exp $
+ * $Id: bltin.h,v 1.2.6.1 1995/12/11 23:05:26 joerg Exp $
*/
/*
@@ -60,10 +60,10 @@
#define fputs outstr
#define fflush flushout
#define INITARGS(argv)
-#define warnx(a, b, c) { \
- char buf[64]; \
- (void)snprintf(buf, sizeof(buf), a, b, c); \
- error(buf); \
+#define warnx(a, b, c) { \
+ char buf[64]; \
+ (void)snprintf(buf, sizeof(buf), a, b, c); \
+ error(buf); \
}
#else
#undef NULL
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index d12932685dd4..d96667350e3d 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: parser.c,v 1.6.4.1 1995/08/25 03:21:06 davidg Exp $
+ * $Id: parser.c,v 1.6.4.2 1995/08/30 05:53:05 davidg Exp $
*/
#ifndef lint
@@ -150,29 +150,12 @@ list(nlflag) {
for (;;) {
switch (readtoken()) {
case TBACKGND:
- if (n1->type == NCMD || n1->type == NPIPE) {
- n1->ncmd.backgnd = 1;
- } else if (n1->type == NREDIR) {
- n1->type = NBACKGND;
- } else {
- n3 = (union node *)stalloc(sizeof (struct nredir));
- n3->type = NBACKGND;
- n3->nredir.n = n1;
- n3->nredir.redirect = NULL;
- n1 = n3;
- }
- goto tsemi;
case TNL:
- tokpushback++;
+ parseheredoc();
+ if (nlflag)
+ return n1;
/* fall through */
-tsemi: case TSEMI:
- if (readtoken() == TNL) {
- parseheredoc();
- if (nlflag)
- return n1;
- } else {
- tokpushback++;
- }
+ case TSEMI:
checkkwd = 2;
if (tokendlist[peektoken()])
return n1;
@@ -212,6 +195,19 @@ andor() {
} else if (t == TOR) {
t = NOR;
} else {
+ if (t == TBACKGND) {
+ if (n1->type == NCMD || n1->type == NPIPE) {
+ n1->ncmd.backgnd = 1;
+ } else if (n1->type == NREDIR) {
+ n1->type = NBACKGND;
+ } else {
+ n3 = (union node *)stalloc(sizeof (struct nredir));
+ n3->type = NBACKGND;
+ n3->nredir.n = n1;
+ n3->nredir.redirect = NULL;
+ n1 = n3;
+ }
+ }
tokpushback++;
return n1;
}
diff --git a/bin/stty/stty.1 b/bin/stty/stty.1
index addbe1b4d0fe..e582a16ae103 100644
--- a/bin/stty/stty.1
+++ b/bin/stty/stty.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)stty.1 8.4 (Berkeley) 4/18/94
-.\" $Id$
+.\" $Id: stty.1,v 1.2 1994/09/24 02:59:01 davidg Exp $
.\"
.Dd April 18, 1994
.Dt STTY 1
@@ -160,10 +160,10 @@ Signal (do not signal)
on
break.
.It Cm ignpar Pq Fl ignpar
-Ignore (do not ignore) parity
+Ignore (do not ignore) characters with parity
errors.
.It Cm parmrk Pq Fl parmrk
-Mark (do not mark) parity errors.
+Mark (do not mark) characters with parity errors.
.It Cm inpck Pq Fl inpck
Enable (disable) input parity
checking.
@@ -235,7 +235,7 @@ output modes).
Map (do not map)
.Dv NL
to
-.DV CR-NL
+.Dv CR-NL
on output.
.It Cm oxtabs Pq Fl oxtabs
Expand (do not expand) tabs to spaces on output.
diff --git a/bin/sync/sync.8 b/bin/sync/sync.8
index 1dafffd6723b..513b7016810c 100644
--- a/bin/sync/sync.8
+++ b/bin/sync/sync.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)sync.8 8.1 (Berkeley) 5/31/93
-.\" $Id$
+.\" $Id: sync.8,v 1.2 1994/09/24 02:59:08 davidg Exp $
.\"
.Dd May 31, 1993
.Dt SYNC 8
@@ -64,9 +64,9 @@ function call.
.Sh SEE ALSO
.Xr sync 2 ,
.Xr fsync 2 ,
+.Xr update 4 ,
.Xr halt 8 ,
-.Xr reboot 8 ,
-.Xr update 8
+.Xr reboot 8
.Sh HISTORY
A
.Nm sync