mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-30 12:25:10 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58fda9eaae |
No files matched your search
@@ -1,13 +1,14 @@
|
||||
#
|
||||
# $Id: Makefile,v 1.109.2.32 1998/06/29 10:15:32 jkh Exp $
|
||||
# $Id: Makefile,v 1.109.2.18 1997/09/17 23:50:26 rgrimes Exp $
|
||||
#
|
||||
# Make command line options:
|
||||
# -DCLOBBER will remove /usr/include
|
||||
# -DMAKE_KERBEROS4 to build KerberosIV
|
||||
# -DMAKE_EBONES to build eBones (KerberosIV)
|
||||
# -DALLLANG to build documentation for all languages
|
||||
# (where available -- see share/doc/Makefile)
|
||||
#
|
||||
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
||||
# -DNOCLEAN do not clean at all
|
||||
# -DNOTOOLS do not rebuild any tools first
|
||||
# -DNOCRYPT will prevent building of crypt versions
|
||||
# -DNOLKM do not build loadable kernel modules
|
||||
# -DNOOBJDIR do not run ``${MAKE} obj''
|
||||
@@ -16,8 +17,6 @@
|
||||
# -DNOGAMES do not go into games subdir
|
||||
# -DNOSHARE do not go into share subdir
|
||||
# -DNOINFO do not make or install info files
|
||||
# -DNOLIBC_R do not build libc_r.
|
||||
# -DNOPERL do not make or install perl
|
||||
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
||||
|
||||
#
|
||||
@@ -40,13 +39,6 @@
|
||||
# Put initial settings here.
|
||||
SUBDIR=
|
||||
|
||||
# We must do share/info early so that installation of info `dir'
|
||||
# entries works correctly. Do it first since it is less likely to
|
||||
# grow dependencies on include and lib than vice versa.
|
||||
.if exists(share/info)
|
||||
SUBDIR+= share/info
|
||||
.endif
|
||||
|
||||
# We must do include and lib first so that the perl *.ph generation
|
||||
# works correctly as it uses the header files installed by this.
|
||||
.if exists(include)
|
||||
@@ -65,8 +57,8 @@ SUBDIR+= games
|
||||
.if exists(gnu)
|
||||
SUBDIR+= gnu
|
||||
.endif
|
||||
.if exists(kerberosIV) && exists(crypto) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
|
||||
SUBDIR+= kerberosIV
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
SUBDIR+= eBones
|
||||
.endif
|
||||
.if exists(libexec)
|
||||
SUBDIR+= libexec
|
||||
@@ -125,8 +117,8 @@ CLEANDIR= cleandir
|
||||
.endif
|
||||
.endif
|
||||
|
||||
SUP?= cvsup
|
||||
SUPFLAGS?= -g -L 2 -P -
|
||||
SUP?= sup
|
||||
SUPFLAGS?= -v
|
||||
|
||||
#
|
||||
# While building tools for bootstrapping, we dont need to waste time on
|
||||
@@ -154,7 +146,7 @@ world:
|
||||
cd ${.CURDIR} && ${MAKE} pre-world
|
||||
.endif
|
||||
cd ${.CURDIR} && ${MAKE} buildworld
|
||||
cd ${.CURDIR} && ${MAKE} -B installworld
|
||||
cd ${.CURDIR} && ${MAKE} installworld
|
||||
.if target(post-world)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@@ -217,22 +209,14 @@ buildworld:
|
||||
chflags -R noschg ${WORLDTMP}/
|
||||
rm -rf ${WORLDTMP}
|
||||
.endif
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making make"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}/usr/bin
|
||||
.if !defined(NOCLEAN) || !defined(NOOBJDIR)
|
||||
cd ${.CURDIR}/usr.bin/make && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
cd ${.CURDIR}/usr.bin/make && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk depend && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean cleandepend
|
||||
.endif
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${OBJDIR} clean cleandepend depend && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all install clean cleandepend
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making hierarchy"
|
||||
@@ -243,16 +227,15 @@ buildworld:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Cleaning up the obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} par-${CLEANDIR}
|
||||
cd ${.CURDIR} && ${BMAKE} ${CLEANDIR}
|
||||
.endif
|
||||
.if !defined(NOOBJDIR)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding the obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} par-obj
|
||||
cd ${.CURDIR} && ${BMAKE} obj
|
||||
.endif
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding bootstrap tools"
|
||||
@@ -263,36 +246,31 @@ buildworld:
|
||||
@echo " Rebuilding tools necessary to build the include files"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} include-tools
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/include"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && SHARED=symlinks ${BMAKE} includes
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools needed to build the libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} lib-tools
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/lib"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} libraries
|
||||
.if !defined(NOTOOLS)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding all other tools needed to build the world"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} build-tools
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding dependencies"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${XMAKE} ${.MAKEFLAGS} par-depend
|
||||
cd ${.CURDIR} && ${XMAKE} depend
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Building everything.."
|
||||
@@ -326,11 +304,6 @@ reinstall:
|
||||
cd ${.CURDIR} && ${MAKE} install
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Re-scanning the shared libraries.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ldconfig -R
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding man page indexes"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/share/man && ${MAKE} makedb
|
||||
@@ -344,7 +317,7 @@ reinstall:
|
||||
update:
|
||||
.if defined(SUP_UPDATE)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "Running ${SUP}"
|
||||
@echo "Running sup"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@${SUP} ${SUPFLAGS} ${SUPFILE}
|
||||
.if defined(SUPFILE1)
|
||||
@@ -378,8 +351,8 @@ most:
|
||||
cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
|
||||
#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/kerberosIV && ${MAKE} ${.MAKEFLAGS} most
|
||||
#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
|
||||
#.endif
|
||||
#.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} most
|
||||
@@ -403,8 +376,8 @@ installmost:
|
||||
cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
|
||||
#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/kerberos4 && ${MAKE} ${.MAKEFLAGS} installmost
|
||||
#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
|
||||
#.endif
|
||||
#.if !defined(NOSECURE) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/secure && ${MAKE} ${.MAKEFLAGS} installmost
|
||||
@@ -440,14 +413,11 @@ bootstrap:
|
||||
cd ${.CURDIR}/include && make symlinks
|
||||
.endif
|
||||
cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB all && \
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR}
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR}
|
||||
.if !defined(NOOBJDIR)
|
||||
cd ${.CURDIR}/usr.bin/lex && ${MAKE} obj
|
||||
.endif
|
||||
@@ -461,9 +431,8 @@ bootstrap:
|
||||
# on cleaned away headers in ${WORLDTMP}.
|
||||
#
|
||||
include-tools:
|
||||
cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} -B cleandepend depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} cleandepend depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
#
|
||||
# includes - possibly generate and install the include files.
|
||||
@@ -474,22 +443,17 @@ includes:
|
||||
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
||||
-p ${DESTDIR}/usr/include
|
||||
.endif
|
||||
cd ${.CURDIR}/include && ${MAKE} -B all install
|
||||
cd ${.CURDIR}/include && ${MAKE} all install
|
||||
cd ${.CURDIR}/gnu/include && ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
|
||||
.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
|
||||
cd ${.CURDIR}/kerberosIV/lib/libacl && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkadm && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkafs && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkdb && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libkrb && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/kerberosIV/lib/libtelnet && ${MAKE} beforeinstall
|
||||
.else
|
||||
cd ${.CURDIR}/lib/libtelnet && ${MAKE} beforeinstall
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkadm && ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/csu/i386 && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libalias && ${MAKE} beforeinstall
|
||||
@@ -525,17 +489,16 @@ lib-tools:
|
||||
usr.bin/tsort \
|
||||
gnu/usr.bin/as \
|
||||
gnu/usr.bin/bison \
|
||||
gnu/usr.bin/cc \
|
||||
usr.bin/ar \
|
||||
usr.bin/compile_et \
|
||||
usr.bin/lex/lib \
|
||||
usr.bin/mk_cmds \
|
||||
usr.bin/nm \
|
||||
usr.bin/ranlib \
|
||||
usr.bin/uudecode \
|
||||
gnu/usr.bin/cc
|
||||
usr.bin/uudecode
|
||||
cd ${.CURDIR}/$d && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
#
|
||||
@@ -544,70 +507,43 @@ lib-tools:
|
||||
libraries:
|
||||
.if exists(lib/csu/i386)
|
||||
cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libcompat)
|
||||
cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libc)
|
||||
cd ${.CURDIR}/lib/libc && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libmytinfo)
|
||||
cd ${.CURDIR}/lib/libmytinfo && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libncurses)
|
||||
cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib/libtermcap)
|
||||
cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(gnu)
|
||||
cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib)
|
||||
cd ${.CURDIR}/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(usr.bin/lex/lib)
|
||||
cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(kerberosIV) && exists(crypto) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
|
||||
cd ${.CURDIR}/kerberosIV/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(usr.sbin/pcvt/keycap)
|
||||
cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
|
||||
# Exclude perl from the build-tools if NOPERL is defined.
|
||||
.if defined(NOPERL)
|
||||
_perl=
|
||||
.else
|
||||
_perl= gnu/usr.bin/perl/perl
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
|
||||
#
|
||||
@@ -635,6 +571,7 @@ build-tools:
|
||||
bin/mkdir \
|
||||
bin/mv \
|
||||
bin/rm \
|
||||
bin/sh \
|
||||
bin/test \
|
||||
gnu/usr.bin/awk \
|
||||
gnu/usr.bin/bc \
|
||||
@@ -642,10 +579,9 @@ build-tools:
|
||||
gnu/usr.bin/groff \
|
||||
gnu/usr.bin/gzip \
|
||||
gnu/usr.bin/man/makewhatis \
|
||||
gnu/usr.bin/patch \
|
||||
${_perl} \
|
||||
gnu/usr.bin/sort \
|
||||
gnu/usr.bin/texinfo \
|
||||
share/info \
|
||||
usr.bin/basename \
|
||||
usr.bin/cap_mkdb \
|
||||
usr.bin/chflags \
|
||||
@@ -656,7 +592,6 @@ build-tools:
|
||||
usr.bin/file2c \
|
||||
usr.bin/find \
|
||||
usr.bin/gencat \
|
||||
usr.bin/id \
|
||||
usr.bin/lorder \
|
||||
usr.bin/m4 \
|
||||
usr.bin/mkdep \
|
||||
@@ -677,28 +612,9 @@ build-tools:
|
||||
usr.bin/yacc \
|
||||
usr.sbin/chown \
|
||||
usr.sbin/mtree \
|
||||
usr.sbin/zic \
|
||||
bin/sh
|
||||
usr.sbin/zic
|
||||
cd ${.CURDIR}/$d && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all && \
|
||||
${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
.for __target in clean cleandir obj depend
|
||||
.for entry in ${SUBDIR}
|
||||
${entry}.${__target}__D: .PHONY
|
||||
if test -d ${.CURDIR}/${entry}.${MACHINE}; then \
|
||||
${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE}"; \
|
||||
edir=${entry}.${MACHINE}; \
|
||||
cd ${.CURDIR}/$${edir}; \
|
||||
else \
|
||||
${ECHODIR} "===> ${DIRPRFX}${entry}"; \
|
||||
edir=${entry}; \
|
||||
cd ${.CURDIR}/$${edir}; \
|
||||
fi; \
|
||||
${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
|
||||
.endfor
|
||||
par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
@@ -1,5 +1,5 @@
|
||||
This is the top level of the FreeBSD source directory. This file
|
||||
was last revised on: $Id: README,v 1.7.2.2 1998/02/15 10:47:57 jkh Exp $
|
||||
was last revised on: $Id: README,v 1.7 1997/01/01 14:06:29 jkh Exp $
|
||||
|
||||
For copyright information, please see the file COPYRIGHT in this
|
||||
directory (additional copyright information also exists for some
|
||||
@@ -14,10 +14,10 @@ kernel and the contents of /etc. Please see the top of the Makefile
|
||||
in this directory for more information on the standard build targets
|
||||
and compile-time flags.
|
||||
|
||||
Building a kernel with config(8) is a somewhat more involved process,
|
||||
Building a kernel with config(1) is a somewhat more involved process,
|
||||
documentation for which can be found at:
|
||||
http://www.freebsd.org/handbook/kernelconfig.html
|
||||
And in the config(8) man page.
|
||||
And in the config(1) man page.
|
||||
|
||||
The sample kernel configuration files reside in the sys/i386/conf
|
||||
sub-directory (assuming that you've installed the kernel sources), the
|
||||
@@ -34,7 +34,7 @@ bin System/User commands.
|
||||
|
||||
contrib Packages contributed by 3rd parties.
|
||||
|
||||
crypto Export controlled stuff (see crypto/README).
|
||||
eBones Kerberos package - NOT FOR EXPORT!
|
||||
|
||||
etc Template files for /etc
|
||||
|
||||
@@ -45,8 +45,6 @@ gnu Various commands and libraries under the GNU Public License.
|
||||
|
||||
include System include files.
|
||||
|
||||
kerberosIV Kerberos package - also export controlled.
|
||||
|
||||
lib System libraries.
|
||||
|
||||
libexec System daemons.
|
||||
|
||||
+18
-16
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
|
||||
.\" $Id: cat.1,v 1.3.2.2 1998/06/30 06:42:19 charnier Exp $
|
||||
.\" $Id: cat.1,v 1.6 1997/02/22 14:01:26 peter Exp $
|
||||
.\"
|
||||
.Dd May 2, 1995
|
||||
.Dt CAT 1
|
||||
@@ -48,7 +48,7 @@
|
||||
.Op Ar
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm cat
|
||||
utility reads files sequentially, writing them to the standard output.
|
||||
The
|
||||
.Ar file
|
||||
@@ -56,44 +56,47 @@ operands are processed in command line order.
|
||||
A single dash represents the standard input.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width indent
|
||||
.Bl -tag -width Ds
|
||||
.It Fl b
|
||||
Number the non-blank output lines, starting at 1.
|
||||
Implies the
|
||||
.Fl n
|
||||
option but doesn't number blank lines.
|
||||
.It Fl e
|
||||
Display non-printing characters (see the
|
||||
Implies the
|
||||
.Fl v
|
||||
option), and display a dollar sign
|
||||
option, and displays a dollar sign
|
||||
.Pq Ql \&$
|
||||
at the end of each line.
|
||||
at the end of each line
|
||||
as well.
|
||||
.It Fl n
|
||||
Number the output lines, starting at 1.
|
||||
.It Fl s
|
||||
Squeeze multiple adjacent empty lines, causing the output to be
|
||||
single spaced.
|
||||
.It Fl t
|
||||
Display non-printing characters (see the
|
||||
Implies the
|
||||
.Fl v
|
||||
option), and display tab characters as
|
||||
.Ql ^I .
|
||||
option, and displays tab characters as
|
||||
.Ql ^I
|
||||
as well.
|
||||
.It Fl u
|
||||
The
|
||||
.Fl u
|
||||
option guarantees that the output is unbuffered.
|
||||
.It Fl v
|
||||
Display non-printing characters so they are visible.
|
||||
Displays non-printing characters so they are visible.
|
||||
Control characters print as
|
||||
.Ql ^X
|
||||
for control-X; the delete
|
||||
character (octal 0177) prints as
|
||||
.Ql ^?
|
||||
.Pf Non- Tn ASCII
|
||||
characters (with the high bit set) are printed as
|
||||
Non-ascii characters (with the high bit set) are printed as
|
||||
.Ql M-
|
||||
(for meta) followed by the character for the low 7 bits.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm cat
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh BUGS
|
||||
Because of the shell language mechanism used to perform output
|
||||
@@ -116,8 +119,7 @@ will cause the original data in file1 to be destroyed!
|
||||
A
|
||||
.Nm
|
||||
command appeared in Version 1 AT&T UNIX.
|
||||
.An Dennis Ritchie
|
||||
designed and wrote the first man page.
|
||||
Dennis Ritchie designed and wrote the first man page.
|
||||
It appears to have been
|
||||
.Xr cat 1 .
|
||||
|
||||
+53
-55
@@ -30,8 +30,6 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 2, 1996
|
||||
.Dt CHIO 1
|
||||
.Os
|
||||
@@ -63,53 +61,49 @@ rather than the default device
|
||||
.El
|
||||
.Pp
|
||||
The default changer may be overridden by setting the environment variable
|
||||
.Ev CHANGER
|
||||
.Nm CHANGER
|
||||
to the desired changer device.
|
||||
.Pp
|
||||
A medium changer apparatus is made up of
|
||||
.Em elements .
|
||||
.Pa elements .
|
||||
There are four element types:
|
||||
.Em picker
|
||||
.Pa picker
|
||||
(medium transport),
|
||||
.Em slot
|
||||
.Pa slot
|
||||
(storage),
|
||||
.Em portal
|
||||
.Pa portal
|
||||
(import/export), and
|
||||
.Em drive
|
||||
.Pa drive
|
||||
(data transfer). In this command description, the shorthand
|
||||
.Em ET
|
||||
.Nm ET
|
||||
will be used to represent an element type, and
|
||||
.Em EU
|
||||
.Nm EU
|
||||
will be used to represent an element unit. For example, to represent
|
||||
the first robotic arm in the changer, the
|
||||
.Em ET
|
||||
would be
|
||||
the first robotic arm in the changer, the ET would be
|
||||
.Dq picker
|
||||
and the
|
||||
.Em EU
|
||||
would be
|
||||
and the EU would be
|
||||
.Dq 0 .
|
||||
.Pp
|
||||
.Sh SUPPORTED COMMANDS
|
||||
.Bl -tag -width indent
|
||||
.It Xo Nm chio move
|
||||
.Nm chio move
|
||||
.Ar <from ET> <from EU> <to ET> <to EU>
|
||||
.Op Ar inv
|
||||
.Xc
|
||||
Move the media unit from
|
||||
.Pp
|
||||
Moves the media unit from
|
||||
.Pa <from ET/EU>
|
||||
to
|
||||
.Pa <to ET/EU> .
|
||||
If the optional modifier
|
||||
.Pa inv
|
||||
is specified, the media unit will be inverted before insertion.
|
||||
.It Xo Nm chio exchange
|
||||
.Pp
|
||||
.Nm chio exchange
|
||||
.Ar <src ET> <src EU> <dst1 ET> <dst1 EU>
|
||||
.Op Ar <dst2 ET> <dst2 ET>
|
||||
.Op Ar inv1
|
||||
.Op Ar inv2
|
||||
.Xc
|
||||
Perform a media unit exchange operation. The media unit in
|
||||
.Pp
|
||||
Performs a media unit exchange operation. The media unit in
|
||||
.Pa <src ET/EU>
|
||||
is moved to
|
||||
.Pa <dst1 ET/EU>
|
||||
@@ -136,10 +130,11 @@ Note that not all medium changers support the
|
||||
.Nm exchange
|
||||
operation; The changer must have multiple free pickers or emulate
|
||||
multiple free pickers with transient storage.
|
||||
.It Xo Nm chio position
|
||||
.Pp
|
||||
.Nm chio position
|
||||
.Ar <to ET> <to EU>
|
||||
.Op Ar inv
|
||||
.Xc
|
||||
.Pp
|
||||
Position the picker in front of the element described by
|
||||
.Pa <to ET/EU> .
|
||||
If the optional modifier
|
||||
@@ -147,59 +142,62 @@ If the optional modifier
|
||||
is specified, the media unit will be inverted before insertion.
|
||||
.Pp
|
||||
Note that not all changers behave as expected when issued this command.
|
||||
.It Nm chio params
|
||||
.Pp
|
||||
.Nm chio params
|
||||
.Pp
|
||||
Report the number of slots, drives, pickers, and portals in the changer,
|
||||
and which picker unit the changer is currently configured to use.
|
||||
.It Nm chio getpicker
|
||||
.Pp
|
||||
.Nm chio getpicker
|
||||
.Pp
|
||||
Report which picker unit the changer is currently configured to use.
|
||||
.It Xo Nm chio setpicker
|
||||
.Pp
|
||||
.Nm chio setpicker
|
||||
.Ar <unit>
|
||||
.Xc
|
||||
.Pp
|
||||
Configure the changer to use picker
|
||||
.Pa <unit> .
|
||||
.It Xo Nm chio status
|
||||
.Pp
|
||||
.Nm chio status
|
||||
.Op Ar <type>
|
||||
.Xc
|
||||
.Pp
|
||||
Report the status of all elements in the changer. If
|
||||
.Pa <type>
|
||||
is specified, report the status of all elements of type
|
||||
.Pa <type> .
|
||||
.El
|
||||
.Pp
|
||||
The status bits are defined as follows:
|
||||
.Bl -tag -width indent
|
||||
.It FULL
|
||||
.It Nm FULL
|
||||
Element contains a media unit.
|
||||
.It IMPEXP
|
||||
.It Nm IMPEXP
|
||||
Media was deposited into element by an outside human operator.
|
||||
.It EXCEPT
|
||||
.It Nm EXCEPT
|
||||
Element is in an abnormal state.
|
||||
.It ACCESS
|
||||
.It Nm ACCESS
|
||||
Media in this element is accessible by a picker.
|
||||
.It EXENAB
|
||||
Element supports passing media (exporting) to an outside human operator.
|
||||
.It INENAB
|
||||
.It Nm EXENAB
|
||||
Element supports passing media (exporting) to an outsite human operator.
|
||||
.It Nm INENAB
|
||||
Element supports receiving media (importing) from an outside human operator.
|
||||
.El
|
||||
.Pp
|
||||
.Sh EXAMPLES
|
||||
.Bl -tag -width indent
|
||||
.It Nm chio move slot 3 drive 0
|
||||
Move the media in slot 3 (fourth slot) to drive 0 (first drive).
|
||||
.It Nm chio setpicker 2
|
||||
Configure the changer to use picker 2 (third picker) for operations.
|
||||
.El
|
||||
.Nm chio move slot 3 drive 0
|
||||
.Pp
|
||||
Moves the media in slot 3 (fourth slot) to drive 0 (first drive).
|
||||
.Pp
|
||||
.Nm chio setpicker 2
|
||||
Configures the changer to use picker 2 (third picker) for operations.
|
||||
.Pp
|
||||
.Sh FILES
|
||||
.Bl -tag -width /dev/ch0 -compact
|
||||
.It Pa /dev/ch0
|
||||
default changer device
|
||||
.El
|
||||
/dev/ch0 - default changer device
|
||||
.Sh SEE ALSO
|
||||
.Xr mt 1 ,
|
||||
.Xr ch 4 ,
|
||||
.Xr mount 8
|
||||
.Sh AUTHORS
|
||||
.Xr mount 8 .
|
||||
.Sh AUTHOR
|
||||
The
|
||||
.Nm
|
||||
program and SCSI changer driver were written by
|
||||
.An Jason R. Thorpe Aq [email protected]
|
||||
for And Communications, http://www.and.com/
|
||||
.Nm chio
|
||||
program and SCSI changer driver were written by Jason R. Thorpe
|
||||
<[email protected]> for And Communications, http://www.and.com/
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* $Id: chio.c,v 1.1.1.1.2.2 1997/08/24 10:29:16 jkh Exp $ */
|
||||
/* $Id: chio.c,v 1.1.1.1.2.1 1997/06/06 16:02:01 charnier Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Jason R. Thorpe <[email protected]>
|
||||
@@ -374,7 +374,7 @@ do_params(cname, argc, argv)
|
||||
|
||||
/* No arguments to this command. */
|
||||
if (argc) {
|
||||
warnx("%s: no arguments expected", cname);
|
||||
warnx("%s: no arguements expected", cname);
|
||||
goto usage;
|
||||
}
|
||||
|
||||
|
||||
+21
-51
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
|
||||
.\" $Id: chmod.1,v 1.4.2.3 1998/05/22 10:41:45 jkoshy Exp $
|
||||
.\" $Id: chmod.1,v 1.7 1997/02/22 14:01:29 peter Exp $
|
||||
.\"
|
||||
.Dd March 31, 1994
|
||||
.Dt CHMOD 1
|
||||
@@ -51,7 +51,7 @@
|
||||
.Ar file ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm chmod
|
||||
utility modifies the file mode bits of the listed files
|
||||
as specified by the
|
||||
.Ar mode
|
||||
@@ -82,7 +82,7 @@ Symbolic links do not have modes, so unless the
|
||||
or
|
||||
.Fl L
|
||||
option is set,
|
||||
.Nm
|
||||
.Nm chmod
|
||||
on a symbolic link always succeeds and has no effect.
|
||||
The
|
||||
.Fl H ,
|
||||
@@ -99,63 +99,35 @@ Only the owner of a file or the super-user is permitted to change
|
||||
the mode of a file.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm chmod
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh MODES
|
||||
Modes may be absolute or symbolic.
|
||||
An absolute mode is an octal number constructed from the sum of
|
||||
one or more of the following values:
|
||||
An absolute mode is an octal number constructed by
|
||||
.Ar or-ing
|
||||
the following values:
|
||||
.Pp
|
||||
.Bl -tag -width 6n -compact -offset indent
|
||||
.It Li 4000
|
||||
(the set-user-ID-on-execution bit) Executable files with this bit set
|
||||
will run with effective uid set to the uid of the file owner.
|
||||
Directories with the set-user-id bit set will force all files and
|
||||
sub-directories created in them to be owned by the directory owner
|
||||
and not by the uid of the creating process, if the underlying file
|
||||
system supports this feature: see
|
||||
.Xr chmod 2
|
||||
and the
|
||||
.Ar suiddir
|
||||
option to
|
||||
.Xr mount 1 .
|
||||
set-user-ID-on-execution
|
||||
.It Li 2000
|
||||
(the set-group-ID-on-execution bit) Executable files with this bit set
|
||||
will run with effective gid set to the gid of the file owner.
|
||||
set-group-ID-on-execution
|
||||
.It Li 1000
|
||||
(the sticky bit)
|
||||
When set on a directory, unprivileged users can delete and rename
|
||||
only those files in the directory that are owned by them, regardless of
|
||||
the permissions on the directory. Under FreeBSD, the sticky bit is
|
||||
ignored for executable files and may only be set for directories (see
|
||||
.Xr sticky 8 ).
|
||||
sticky bit, see chmod(2)
|
||||
.It Li 0400
|
||||
Allow read by owner.
|
||||
read by owner
|
||||
.It Li 0200
|
||||
Allow write by owner.
|
||||
write by owner
|
||||
.It Li 0100
|
||||
For files, allow execution by owner. For directories, allow the owner to
|
||||
search in the directory.
|
||||
.It Li 0040
|
||||
Allow read by group members.
|
||||
.It Li 0020
|
||||
Allow write by group members.
|
||||
.It Li 0010
|
||||
For files, allow execution by group members. For directories, allow
|
||||
group members to search in the directory.
|
||||
.It Li 0004
|
||||
Allow read by others.
|
||||
.It Li 0002
|
||||
Allow write by others.
|
||||
.It Li 0001
|
||||
For files, allow execution by others. For directories allow others to
|
||||
search in the directory.
|
||||
execute (or search for directories) by owner
|
||||
.It Li 0070
|
||||
read, write, execute/search by group
|
||||
.It Li 0007
|
||||
read, write, execute/search by others
|
||||
.El
|
||||
.Pp
|
||||
For example, the absolute mode that permits read, write and execute by
|
||||
the owner, read and execute by group members, read and execute by
|
||||
others, and no set-uid or set-gid behaviour is 755
|
||||
(400+200+100+040+010+004+001).
|
||||
The read, write, and execute/search values for group and others
|
||||
are encoded as described for owner.
|
||||
.Pp
|
||||
The symbolic mode is described by the following grammar:
|
||||
.Bd -literal -offset indent
|
||||
@@ -304,18 +276,16 @@ option for the naughty bits.
|
||||
.Sh SEE ALSO
|
||||
.Xr chflags 1 ,
|
||||
.Xr install 1 ,
|
||||
.Xr mount 1 ,
|
||||
.Xr chmod 2 ,
|
||||
.Xr stat 2 ,
|
||||
.Xr umask 2 ,
|
||||
.Xr fts 3 ,
|
||||
.Xr setmode 3 ,
|
||||
.Xr symlink 7 ,
|
||||
.Xr chown 8 ,
|
||||
.Xr sticky 8
|
||||
.Xr chown 8
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm chmod
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible with the exception of the
|
||||
|
||||
+11
-11
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: cp.1,v 1.6.2.1 1997/02/28 07:54:27 mpp Exp $
|
||||
.\" $Id: cp.1,v 1.9 1997/02/22 14:01:32 peter Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt CP 1
|
||||
@@ -60,7 +60,7 @@
|
||||
.Ar source_file ... target_directory
|
||||
.Sh DESCRIPTION
|
||||
In the first synopsis form, the
|
||||
.Nm
|
||||
.Nm cp
|
||||
utility copies the contents of the
|
||||
.Ar source_file
|
||||
to the
|
||||
@@ -72,7 +72,7 @@ is copied to the destination
|
||||
.Ar target_directory .
|
||||
The names of the files themselves are not changed.
|
||||
If
|
||||
.Nm
|
||||
.Nm cp
|
||||
detects an attempt to copy a file to itself, the copy will fail.
|
||||
.Pp
|
||||
The following options are available:
|
||||
@@ -94,11 +94,11 @@ option is specified, no symbolic links are followed.
|
||||
If
|
||||
.Ar source_file
|
||||
designates a directory,
|
||||
.Nm
|
||||
.Nm cp
|
||||
copies the directory and the entire subtree connected at that point.
|
||||
This option also causes symbolic links to be copied, rather than
|
||||
indirected through, and for
|
||||
.Nm
|
||||
.Nm cp
|
||||
to create special files rather than copying them as normal files.
|
||||
Created directories have the same mode as the corresponding source
|
||||
directory, unmodified by the process' umask.
|
||||
@@ -112,8 +112,8 @@ option overrides any previous
|
||||
.Fl i
|
||||
options.)
|
||||
.It Fl i
|
||||
Cause
|
||||
.Nm
|
||||
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
|
||||
@@ -127,8 +127,8 @@ option overrides any previous
|
||||
.Fl f
|
||||
options.)
|
||||
.It Fl p
|
||||
Cause
|
||||
.Nm
|
||||
Causes
|
||||
.Nm cp
|
||||
to preserve in the copy as many of the modification time, access time,
|
||||
file flags, file mode, user ID, and group ID as allowed by permissions.
|
||||
.Pp
|
||||
@@ -200,7 +200,7 @@ command's actions are determined by the last one specified.
|
||||
exits 0 on success, >0 if an error occurred.
|
||||
.Sh COMPATIBILITY
|
||||
Historic versions of the
|
||||
.Nm
|
||||
.Nm cp
|
||||
utility had a
|
||||
.Fl r
|
||||
option.
|
||||
@@ -215,7 +215,7 @@ or fifo's.
|
||||
.Xr symlink 7
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm cp
|
||||
command is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+1
-2
@@ -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.10.2.1 1997/08/24 10:34:45 jkh Exp $
|
||||
* $Id: cp.c,v 1.10 1996/03/08 06:58:06 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -261,7 +261,6 @@ copy(argv, type, fts_options)
|
||||
for (rval = 0; (curr = fts_read(ftsp)) != NULL;) {
|
||||
switch (curr->fts_info) {
|
||||
case FTS_NS:
|
||||
case FTS_DNR:
|
||||
case FTS_ERR:
|
||||
warnx("%s: %s",
|
||||
curr->fts_path, strerror(curr->fts_errno));
|
||||
|
||||
+21
-50
@@ -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.9.2.2 1998/02/15 10:53:17 jkh Exp $
|
||||
* $Id: utils.c,v 1.9 1996/03/08 06:58:08 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -60,8 +60,7 @@ copy_file(entp, dne)
|
||||
{
|
||||
static char buf[MAXBSIZE];
|
||||
struct stat to_stat, *fs;
|
||||
int ch, checkch, from_fd, rcount, rval, to_fd, wcount, wresid;
|
||||
char *bufp;
|
||||
int ch, checkch, from_fd, rcount, rval, to_fd, wcount;
|
||||
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
char *p;
|
||||
#endif
|
||||
@@ -82,16 +81,13 @@ copy_file(entp, dne)
|
||||
* modified by the umask.)
|
||||
*/
|
||||
if (!dne) {
|
||||
#define YESNO "(y/n [n]) "
|
||||
if (iflag) {
|
||||
(void)fprintf(stderr, "overwrite %s? %s",
|
||||
to.p_path, YESNO);
|
||||
(void)fprintf(stderr, "overwrite %s? ", to.p_path);
|
||||
checkch = ch = getchar();
|
||||
while (ch != '\n' && ch != EOF)
|
||||
ch = getchar();
|
||||
if (checkch != 'y' && checkch != 'Y') {
|
||||
(void)close(from_fd);
|
||||
(void)fprintf(stderr, "not overwritten\n");
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
@@ -129,13 +125,7 @@ copy_file(entp, dne)
|
||||
warn("%s", entp->fts_path);
|
||||
rval = 1;
|
||||
} else {
|
||||
for (bufp = p, wresid = fs->st_size; ;
|
||||
bufp += wcount, wresid -= wcount) {
|
||||
wcount = write(to_fd, bufp, wresid);
|
||||
if (wcount >= wresid || wcount <= 0)
|
||||
break;
|
||||
}
|
||||
if (wcount != wresid) {
|
||||
if (write(to_fd, p, fs->st_size) != fs->st_size) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
@@ -149,13 +139,8 @@ copy_file(entp, dne)
|
||||
#endif
|
||||
{
|
||||
while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) {
|
||||
for (bufp = buf, wresid = rcount; ;
|
||||
bufp += wcount, wresid -= wcount) {
|
||||
wcount = write(to_fd, bufp, wresid);
|
||||
if (wcount >= wresid || wcount <= 0)
|
||||
break;
|
||||
}
|
||||
if (wcount != wresid) {
|
||||
wcount = write(to_fd, buf, rcount);
|
||||
if (rcount != wcount || wcount == -1) {
|
||||
warn("%s", to.p_path);
|
||||
rval = 1;
|
||||
break;
|
||||
@@ -207,7 +192,7 @@ copy_link(p, exists)
|
||||
int len;
|
||||
char link[MAXPATHLEN];
|
||||
|
||||
if ((len = readlink(p->fts_path, link, sizeof(link) - 1)) == -1) {
|
||||
if ((len = readlink(p->fts_path, link, sizeof(link))) == -1) {
|
||||
warn("readlink: %s", p->fts_path);
|
||||
return (1);
|
||||
}
|
||||
@@ -262,9 +247,7 @@ setfile(fs, fd)
|
||||
int fd;
|
||||
{
|
||||
static struct timeval tv[2];
|
||||
struct stat ts;
|
||||
int rval;
|
||||
int gotstat;
|
||||
|
||||
rval = 0;
|
||||
fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX |
|
||||
@@ -276,42 +259,30 @@ setfile(fs, fd)
|
||||
warn("utimes: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
if (fd ? fstat(fd, &ts) : stat(to.p_path, &ts))
|
||||
gotstat = 0;
|
||||
else {
|
||||
gotstat = 1;
|
||||
ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX |
|
||||
S_IRWXU | S_IRWXG | S_IRWXO;
|
||||
}
|
||||
/*
|
||||
* Changing the ownership probably won't succeed, unless we're root
|
||||
* or POSIX_CHOWN_RESTRICTED is not set. Set uid/gid before setting
|
||||
* the mode; current BSD behavior is to remove all setuid bits on
|
||||
* chown. If chown fails, lose setuid/setgid bits.
|
||||
*/
|
||||
if (!gotstat || fs->st_uid != ts.st_uid || fs->st_gid != ts.st_gid)
|
||||
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
|
||||
chown(to.p_path, fs->st_uid, fs->st_gid)) {
|
||||
if (errno != EPERM) {
|
||||
warn("chown: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
fs->st_mode &= ~(S_ISUID | S_ISGID);
|
||||
}
|
||||
|
||||
if (!gotstat || fs->st_mode != ts.st_mode)
|
||||
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
|
||||
if (fd ? fchown(fd, fs->st_uid, fs->st_gid) :
|
||||
chown(to.p_path, fs->st_uid, fs->st_gid)) {
|
||||
if (errno != EPERM) {
|
||||
warn("chown: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
fs->st_mode &= ~(S_ISUID | S_ISGID);
|
||||
}
|
||||
if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) {
|
||||
warn("chown: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
|
||||
if (!gotstat || fs->st_flags != ts.st_flags)
|
||||
if (fd ?
|
||||
fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) {
|
||||
warn("chflags: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
|
||||
if (fd ?
|
||||
fchflags(fd, fs->st_flags) : chflags(to.p_path, fs->st_flags)) {
|
||||
warn("chflags: %s", to.p_path);
|
||||
rval = 1;
|
||||
}
|
||||
return (rval);
|
||||
}
|
||||
|
||||
|
||||
+76
-85
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.1 8.2 (Berkeley) 1/21/94
|
||||
.\" $Id: csh.1,v 1.5.2.2 1998/06/30 06:42:24 charnier Exp $
|
||||
.\" $Id: csh.1,v 1.8 1997/02/22 14:01:40 peter Exp $
|
||||
.\"
|
||||
.Dd January 21, 1994
|
||||
.Dt CSH 1
|
||||
@@ -46,15 +46,15 @@
|
||||
.Op Fl l
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm csh
|
||||
is a command language interpreter
|
||||
incorporating a history mechanism (see
|
||||
.Sx History Substitutions ) ,
|
||||
.Nm History Substitutions ) ,
|
||||
job control facilities (see
|
||||
.Sx Jobs ) ,
|
||||
.Nm Jobs ) ,
|
||||
interactive file name
|
||||
and user name completion (see
|
||||
.Sx File Name Completion ) ,
|
||||
.Nm File Name Completion ) ,
|
||||
and a C-like syntax. It is used both as an interactive
|
||||
login shell and a shell script command processor.
|
||||
.Ss Argument list processing
|
||||
@@ -100,7 +100,7 @@ is the only flag specified).
|
||||
The shell loads
|
||||
.Pa .cshrc
|
||||
even if it does not belong to the effective user.
|
||||
.Xr Su 1
|
||||
.Xr su 1
|
||||
can pass
|
||||
.Fl m
|
||||
to the shell.
|
||||
@@ -116,16 +116,16 @@ A
|
||||
may be used to escape the newline at the end of this
|
||||
line and continue onto another line.
|
||||
.It Fl v
|
||||
Cause the
|
||||
Causes the
|
||||
.Ar verbose
|
||||
variable to be set, with the effect
|
||||
that command input is echoed after history substitution.
|
||||
.It Fl x
|
||||
Cause the
|
||||
Causes the
|
||||
.Ar echo
|
||||
variable to be set, so that commands are echoed immediately before execution.
|
||||
.It Fl V
|
||||
Cause the
|
||||
Causes the
|
||||
.Ar verbose
|
||||
variable to be set even before
|
||||
.Pa .cshrc
|
||||
@@ -157,7 +157,7 @@ Remaining arguments initialize the variable
|
||||
.Ar argv .
|
||||
.Pp
|
||||
An instance of
|
||||
.Nm
|
||||
.Nm csh
|
||||
begins by executing commands from the file
|
||||
.Pa /etc/csh.cshrc
|
||||
and,
|
||||
@@ -256,7 +256,7 @@ showing that the job which was started asynchronously was job number
|
||||
1 and had one (top-level) process, whose process id was 1234.
|
||||
.Pp
|
||||
If you are running a job and wish to do something else you may hit the key
|
||||
.Em ^Z
|
||||
.Nm ^Z
|
||||
(control-Z) which sends a STOP signal to the current job.
|
||||
The shell will then normally show that the job has been `Stopped',
|
||||
and print another prompt. You can then manipulate the state of this job,
|
||||
@@ -271,11 +271,11 @@ the
|
||||
command
|
||||
.Ar fg .
|
||||
A
|
||||
.Em ^Z
|
||||
.Nm ^Z
|
||||
takes effect immediately and
|
||||
is like an interrupt in that pending output and unread input are discarded
|
||||
when it is typed. There is another special key
|
||||
.Em ^Y
|
||||
.Nm ^Y
|
||||
that does not generate a STOP signal until a program attempts to
|
||||
.Xr read 2
|
||||
it.
|
||||
@@ -353,7 +353,7 @@ the shell variable
|
||||
.Ar filec
|
||||
(see
|
||||
.Ic set ) ,
|
||||
.Nm
|
||||
.Nm csh
|
||||
will
|
||||
interactively complete file names and user names from unique
|
||||
prefixes, when they are input from the terminal followed by
|
||||
@@ -370,7 +370,7 @@ and the input is
|
||||
.Pp
|
||||
.Dl % vi ch<escape>
|
||||
.Pp
|
||||
.Nm
|
||||
.Nm csh
|
||||
will complete the prefix ``ch''
|
||||
to the only matching file name ``chaosnet'', changing the input
|
||||
line to
|
||||
@@ -381,7 +381,7 @@ However, given
|
||||
.Pp
|
||||
.Dl % vi D<escape>
|
||||
.Pp
|
||||
.Nm
|
||||
.Nm csh
|
||||
will only expand the input to
|
||||
.Pp
|
||||
.Dl % vi DSC.
|
||||
@@ -391,7 +391,7 @@ incomplete, since there are two file names matching the prefix ``D''.
|
||||
.Pp
|
||||
If a partial file name is followed by the end-of-file character
|
||||
(usually control-D), then, instead of completing the name,
|
||||
.Nm
|
||||
.Nm csh
|
||||
will list all file names matching the prefix. For example,
|
||||
the input
|
||||
.Pp
|
||||
@@ -455,7 +455,7 @@ in the previous command with little typing and a high degree of confidence.
|
||||
History substitutions begin with the character `!' and may begin
|
||||
.Ar anywhere
|
||||
in the input stream (with the proviso that they
|
||||
.Em "do not"
|
||||
.Nm "do not"
|
||||
nest.)
|
||||
This `!' may be preceded by a `\e' to prevent its special meaning; for
|
||||
convenience, an `!' is passed unchanged when it is followed by a blank,
|
||||
@@ -631,7 +631,7 @@ Strings enclosed in `"' may be expanded as described below.
|
||||
.Pp
|
||||
In both cases the resulting text becomes (all or part of) a single word;
|
||||
only in one special case (see
|
||||
.Sx Command Substitution
|
||||
.Em Command Substitution
|
||||
below) does a `"' quoted string yield parts of more than one word;
|
||||
`\'' quoted strings never do.
|
||||
.Ss Alias substitution
|
||||
@@ -708,7 +708,7 @@ occurs, and within `\''s where it
|
||||
.Em never
|
||||
occurs.
|
||||
Strings quoted by `\*(ga' are interpreted later (see
|
||||
.Sx "Command substitution"
|
||||
.Nm "Command substitution"
|
||||
below) so `$' substitution does not occur there until later, if at all.
|
||||
A `$' is passed unchanged if followed by a blank, tab, or end-of-line.
|
||||
.Pp
|
||||
@@ -764,11 +764,11 @@ It is not an error for a range to be empty if the second argument is omitted
|
||||
or in range.
|
||||
.It $#name
|
||||
.It ${#name}
|
||||
Give the number of words in the variable.
|
||||
Gives the number of words in the variable.
|
||||
This is useful for later use in a
|
||||
`$argv[selector]'.
|
||||
.It $0
|
||||
Substitute the name of the file from which command input is being read.
|
||||
Substitutes the name of the file from which command input is being read.
|
||||
An error occurs if the name is not known.
|
||||
.It $number
|
||||
.It ${number}
|
||||
@@ -788,16 +788,16 @@ The following substitutions may not be modified with `:' modifiers.
|
||||
.Bl -tag -width Ds -compact -offset indent
|
||||
.It $?name
|
||||
.It ${?name}
|
||||
Substitute the string `1' if name is set, `0' if it is not.
|
||||
Substitutes the string `1' if name is set, `0' if it is not.
|
||||
.It $?0
|
||||
Substitute `1' if the current input filename is known, `0' if it is not.
|
||||
Substitutes `1' if the current input filename is known, `0' if it is not.
|
||||
.It \&$\&$\&
|
||||
Substitute the (decimal) process number of the (parent) shell.
|
||||
.It $!
|
||||
Substitute the (decimal) process number of the last background process
|
||||
started by this shell.
|
||||
.It $<
|
||||
Substitute a line from the standard
|
||||
Substitutes a line from the standard
|
||||
input, with no further interpretation.
|
||||
It can be used to read from the keyboard in a shell script.
|
||||
.El
|
||||
@@ -922,7 +922,7 @@ is expanded in the same way as `<' input filenames are.
|
||||
.It >>& name
|
||||
.It >>! name
|
||||
.It >>&! name
|
||||
Use file
|
||||
Uses file
|
||||
.Ar name
|
||||
as the standard output;
|
||||
like `>' but places output at the end of the file.
|
||||
@@ -961,11 +961,11 @@ Several of the builtin commands (to be described later)
|
||||
take expressions, in which the operators are similar to those of C, with
|
||||
the same precedence.
|
||||
These expressions appear in the
|
||||
.Em @ ,
|
||||
.Em exit ,
|
||||
.Em if ,
|
||||
.Nm @,
|
||||
.Ar exit ,
|
||||
.Ar if ,
|
||||
and
|
||||
.Em while
|
||||
.Ar while
|
||||
commands.
|
||||
The following operators are available:
|
||||
.Bd -ragged -offset indent
|
||||
@@ -1076,7 +1076,7 @@ or
|
||||
.Ar unalias .
|
||||
.Pp
|
||||
.It Ic alloc
|
||||
Show the amount of dynamic memory acquired, broken down into used and
|
||||
Shows the amount of dynamic memory acquired, broken down into used and
|
||||
free memory.
|
||||
With an argument shows the number of free and used blocks in each size
|
||||
category. The categories start at size 8 and double at each step.
|
||||
@@ -1085,11 +1085,11 @@ systems other than the VAX may use a different memory allocator.
|
||||
.Pp
|
||||
.It Ic bg
|
||||
.It Ic bg \&% Ns Ar job ...
|
||||
Put the current or specified jobs into the background, continuing them
|
||||
Puts the current or specified jobs into the background, continuing them
|
||||
if they were stopped.
|
||||
.Pp
|
||||
.It Ic break
|
||||
Cause execution to resume after the
|
||||
Causes execution to resume after the
|
||||
.Ic end
|
||||
of the nearest enclosing
|
||||
.Ic foreach
|
||||
@@ -1099,7 +1099,7 @@ The remaining commands on the current line are executed.
|
||||
Multi-level breaks are thus possible by writing them all on one line.
|
||||
.Pp
|
||||
.It Ic breaksw
|
||||
Cause a break from a
|
||||
Causes a break from a
|
||||
.Ic switch ,
|
||||
resuming after the
|
||||
.Ic endsw .
|
||||
@@ -1137,7 +1137,7 @@ or
|
||||
The rest of the commands on the current line are executed.
|
||||
.Pp
|
||||
.It Ic default :
|
||||
Label the default case in a
|
||||
Labels the default case in a
|
||||
.Ic switch
|
||||
statement.
|
||||
The default should come after all
|
||||
@@ -1145,7 +1145,7 @@ The default should come after all
|
||||
labels.
|
||||
.Pp
|
||||
.It Ic dirs
|
||||
Print the directory stack; the top of the stack is at the left,
|
||||
Prints the directory stack; the top of the stack is at the left,
|
||||
the first directory in the stack being the current directory.
|
||||
.Pp
|
||||
.It Ic echo Ar wordlist
|
||||
@@ -1192,7 +1192,7 @@ variable (first form) or with the value of the specified
|
||||
.Pp
|
||||
.It Ic fg
|
||||
.It Ic fg % Ns Ar job ...
|
||||
Bring the current or specified jobs into the foreground, continuing them if
|
||||
Brings the current or specified jobs into the foreground, continuing them if
|
||||
they were stopped.
|
||||
.Pp
|
||||
.It Ic foreach Ar name (wordlist)
|
||||
@@ -1252,7 +1252,7 @@ that does not begin with a `/'.
|
||||
.It Ic history Ar n
|
||||
.It Ic history Fl r Ar n
|
||||
.It Ic history Fl h Ar n
|
||||
Display the history event list; if
|
||||
Displays the history event list; if
|
||||
.Ar n
|
||||
is given only the
|
||||
.Ar n
|
||||
@@ -1324,7 +1324,7 @@ must appear alone on its input line or after an
|
||||
.Pp
|
||||
.It Ic jobs
|
||||
.It Ic jobs Fl l
|
||||
List the active jobs; the
|
||||
Lists the active jobs; the
|
||||
.Fl l
|
||||
option lists process id's in addition to the normal information.
|
||||
.Pp
|
||||
@@ -1332,10 +1332,10 @@ option lists process id's in addition to the normal information.
|
||||
.It Ic kill Ar pid
|
||||
.It Ic kill Fl sig Ar pid ...
|
||||
.It Ic kill Fl l
|
||||
Send either the TERM (terminate) signal or the
|
||||
Sends either the TERM (terminate) signal or the
|
||||
specified signal to the specified jobs or processes.
|
||||
Signals are either given by number or by names (as given in
|
||||
.Pa /usr/include/signal.h ,
|
||||
.Pa /usr/include/signal.h,
|
||||
stripped of the prefix ``SIG'').
|
||||
The signal names are listed by ``kill \-l''.
|
||||
There is no default, just saying `kill' does not
|
||||
@@ -1349,7 +1349,7 @@ then the job or process will be sent a CONT (continue) signal as well.
|
||||
.It Ic limit Fl h
|
||||
.It Ic limit Fl h Ar resource
|
||||
.It Ic limit Fl h Ar resource maximum-use
|
||||
Limit the consumption by the current process and each process
|
||||
Limits the consumption by the current process and each process
|
||||
it creates to not individually exceed
|
||||
.Ar maximum-use
|
||||
on the
|
||||
@@ -1405,7 +1405,7 @@ of the names suffice.
|
||||
.Pp
|
||||
.It Ic login
|
||||
Terminate a login shell, replacing it with an instance of
|
||||
.Pa /usr/bin/login .
|
||||
.Pa /usr/bin/login.
|
||||
This is one way to log off, included for compatibility with
|
||||
.Xr sh 1 .
|
||||
.Pp
|
||||
@@ -1448,7 +1448,7 @@ All processes detached with `&' are effectively
|
||||
.Pp
|
||||
.It Ic notify
|
||||
.It Ic notify % Ns Ar job ...
|
||||
Cause the shell to notify the user asynchronously when the status of the
|
||||
Causes the shell to notify the user asynchronously when the status of the
|
||||
current or specified jobs change; normally notification is presented
|
||||
before a prompt. This is automatic if the shell variable
|
||||
.Ic notify
|
||||
@@ -1478,7 +1478,7 @@ are disabled (/etc/csh.cshrc, /etc/csh.login).
|
||||
.Pp
|
||||
.It Ic popd
|
||||
.It Ic popd Ar +n
|
||||
Pop the directory stack, returning to the new top directory.
|
||||
Pops the directory stack, returning to the new top directory.
|
||||
With an argument
|
||||
.Ns \`+ Ar n Ns \'
|
||||
discards the
|
||||
@@ -1511,7 +1511,7 @@ stack around to be the top element and changes to it. The members
|
||||
of the directory stack are numbered from the top starting at 0.
|
||||
.Pp
|
||||
.It Ic rehash
|
||||
Cause the internal hash table of the contents of the directories in
|
||||
Causes the internal hash table of the contents of the directories in
|
||||
the
|
||||
.Ic path
|
||||
variable to be recomputed. This is needed if new commands are added
|
||||
@@ -1589,7 +1589,7 @@ The most commonly used environment variables
|
||||
and
|
||||
.Ev PATH
|
||||
are automatically imported to and exported from the
|
||||
.Nm
|
||||
.Nm csh
|
||||
variables
|
||||
.Ar user ,
|
||||
.Ar term ,
|
||||
@@ -1625,21 +1625,19 @@ commands.
|
||||
Normally input during
|
||||
.Ic source
|
||||
commands is not placed on the history list;
|
||||
the
|
||||
.Fl h
|
||||
option causes the commands to be placed on the
|
||||
the \-h option causes the commands to be placed on the
|
||||
history list without being executed.
|
||||
.Pp
|
||||
.It Ic stop
|
||||
.It Ic stop % Ns Ar job ...
|
||||
Stop the current or specified jobs that are executing in the background.
|
||||
Stops the current or specified jobs that are executing in the background.
|
||||
.Pp
|
||||
.It Ic suspend
|
||||
Cause the shell to stop in its tracks, much as if it had been sent a stop
|
||||
Causes the shell to stop in its tracks, much as if it had been sent a stop
|
||||
signal with
|
||||
.Em ^Z .
|
||||
.Ic ^Z .
|
||||
This is most often used to stop shells started by
|
||||
.Xr su 1 .
|
||||
.Xr su 1 .
|
||||
.Pp
|
||||
.It Ic switch Ar (string)
|
||||
.It Ic case Ar str1 :
|
||||
@@ -1701,7 +1699,7 @@ is disabled.
|
||||
.It Ic unlimit Ar resource
|
||||
.It Ic unlimit Fl h
|
||||
.It Ic unlimit Fl h Ar resource
|
||||
Remove the limitation on
|
||||
Removes the limitation on
|
||||
.Ar resource .
|
||||
If no
|
||||
.Ar resource
|
||||
@@ -1720,7 +1718,7 @@ It is not an error for nothing to be
|
||||
.Ic unset .
|
||||
.Pp
|
||||
.It Ic unsetenv Ar pattern
|
||||
Remove all variables whose name match the specified pattern from the
|
||||
Removes all variables whose name match the specified pattern from the
|
||||
environment. See also the
|
||||
.Ic setenv
|
||||
command above and
|
||||
@@ -1732,7 +1730,7 @@ If the shell is interactive, then an interrupt can disrupt the wait.
|
||||
After the interrupt, the shell prints names and job numbers of all jobs
|
||||
known to be outstanding.
|
||||
.It Ic which Ar command
|
||||
Display the resolved command that will be executed by the shell.
|
||||
Displays the resolved command that will be executed by the shell.
|
||||
.Pp
|
||||
.It Ic while Ar (expr)
|
||||
.It \&...
|
||||
@@ -1757,10 +1755,10 @@ Prompting occurs here the first time through the loop as for the
|
||||
statement if the input is a terminal.
|
||||
.Pp
|
||||
.It Ic % Ns Ar job
|
||||
Bring the specified job into the foreground.
|
||||
Brings the specified job into the foreground.
|
||||
.Pp
|
||||
.It Ic % Ns Ar job Ic &
|
||||
Continue the specified job in the background.
|
||||
Continues the specified job in the background.
|
||||
.Pp
|
||||
.It Ic @
|
||||
.It Ic @ Ar name Ns = Ns expr
|
||||
@@ -1833,7 +1831,7 @@ is likewise handled; it is not
|
||||
necessary to worry about its setting other than in the file
|
||||
.Ar \&.cshrc
|
||||
as inferior
|
||||
.Nm
|
||||
.Nm csh
|
||||
processes will import the definition of
|
||||
.Ar path
|
||||
from the environment, and re-export it if you then change it.
|
||||
@@ -1844,7 +1842,7 @@ positional parameters are substituted, i.e., `$1' is replaced by
|
||||
`$argv[1]',
|
||||
etc.
|
||||
.It Ic cdpath
|
||||
Give a list of alternate directories searched to find subdirectories
|
||||
Gives a list of alternate directories searched to find subdirectories
|
||||
in
|
||||
.Ar chdir
|
||||
commands.
|
||||
@@ -1912,9 +1910,10 @@ files are not accidentally destroyed, and that `>>' redirections
|
||||
refer to existing files.
|
||||
.It Ic noglob
|
||||
If set, filename expansion is inhibited.
|
||||
This inhibition is most useful in shell scripts that are not dealing with
|
||||
filenames, or after a list of filenames has been obtained and further
|
||||
expansions are not desirable.
|
||||
This inhibition is most useful in shell scripts that
|
||||
are not dealing with filenames,
|
||||
or after a list of filenames has been obtained and further expansions
|
||||
are not desirable.
|
||||
.It Ic nonomatch
|
||||
If set, it is not an error for a filename expansion to not match any
|
||||
existing files; instead the primitive pattern is returned.
|
||||
@@ -1982,7 +1981,7 @@ If it terminated abnormally, then 0200 is added to the status.
|
||||
Builtin commands that fail return exit status `1',
|
||||
all other builtin commands set status to `0'.
|
||||
.It Ic time
|
||||
Control automatic timing of commands.
|
||||
Controls automatic timing of commands.
|
||||
If set, then any command that takes more than this many cpu seconds
|
||||
will cause a line giving user, system, and real times and a utilization
|
||||
percentage which is the ratio of user plus system times to real time
|
||||
@@ -2081,35 +2080,27 @@ signal; otherwise this signal is passed on to children from the state in the
|
||||
shell's parent.
|
||||
Interrupts are not allowed when a login shell is reading the file
|
||||
.Pa \&.logout .
|
||||
.Sh AUTHORS
|
||||
.An William Joy .
|
||||
.Pp
|
||||
Job control and directory stack features first implemented by
|
||||
.An J.E. Kulp
|
||||
of IIASA, Laxenburg, Austria,
|
||||
.Sh AUTHOR
|
||||
William Joy.
|
||||
Job control and directory stack features first implemented by J.E. Kulp of
|
||||
IIASA, Laxenburg, Austria,
|
||||
with different syntax than that used now.
|
||||
.Pp
|
||||
File name completion code written by
|
||||
.An Ken Greer ,
|
||||
HP Labs.
|
||||
.Pp
|
||||
Eight-bit implementation
|
||||
.An Christos S. Zoulas ,
|
||||
Cornell University.
|
||||
File name completion code written by Ken Greer, HP Labs.
|
||||
Eight-bit implementation Christos S. Zoulas, Cornell University.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /etc/passwd -compact
|
||||
.It Pa ~/.cshrc
|
||||
read at beginning of execution by each shell.
|
||||
Read at beginning of execution by each shell.
|
||||
.It Pa ~/.login
|
||||
read by login shell, after `.cshrc' at login.
|
||||
Read by login shell, after `.cshrc' at login.
|
||||
.It Pa ~/.logout
|
||||
read by login shell, at logout.
|
||||
Read by login shell, at logout.
|
||||
.It Pa /bin/sh
|
||||
standard shell, for shell scripts not starting with a `#'.
|
||||
Standard shell, for shell scripts not starting with a `#'.
|
||||
.It Pa /tmp/sh*
|
||||
temporary file for `<<'.
|
||||
Temporary file for `<<'.
|
||||
.It Pa /etc/passwd
|
||||
source of home directories for `~name'.
|
||||
Source of home directories for `~name'.
|
||||
.El
|
||||
.Sh LIMITATIONS
|
||||
Word lengths \-
|
||||
|
||||
+7
-8
@@ -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.6.2.2 1998/01/31 17:06:13 joerg Exp $
|
||||
* $Id: csh.c,v 1.6 1995/10/23 23:08:25 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -46,7 +46,6 @@ static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
@@ -230,7 +229,7 @@ main(argc, argv)
|
||||
*/
|
||||
set(STRstatus, Strsave(STR0));
|
||||
|
||||
if ((tcp = getenv("HOME")) != NULL && strlen(tcp) < MAXPATHLEN)
|
||||
if ((tcp = getenv("HOME")) != NULL)
|
||||
cp = SAVE(tcp);
|
||||
else
|
||||
cp = NULL;
|
||||
@@ -525,7 +524,7 @@ notty:
|
||||
{
|
||||
int osetintr = setintr;
|
||||
sig_t oparintr = parintr;
|
||||
int omask = sigblock(sigmask(SIGINT));
|
||||
sigset_t omask = sigblock(sigmask(SIGINT));
|
||||
|
||||
setintr = 0;
|
||||
parintr = SIG_IGN; /* Disable onintr */
|
||||
@@ -696,7 +695,7 @@ srcunit(unit, onlyown, hflg)
|
||||
bool otell = cantell;
|
||||
|
||||
struct Bin saveB;
|
||||
volatile int omask;
|
||||
volatile sigset_t omask;
|
||||
jmp_buf oldexit;
|
||||
|
||||
/* The (few) real local variables */
|
||||
@@ -932,9 +931,9 @@ pintr1(wantnl)
|
||||
bool wantnl;
|
||||
{
|
||||
Char **v;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
omask = sigblock(0);
|
||||
omask = sigblock((sigset_t) 0);
|
||||
if (setintr) {
|
||||
(void) sigsetmask(omask & ~sigmask(SIGINT));
|
||||
if (pjobs) {
|
||||
@@ -1004,7 +1003,7 @@ process(catch)
|
||||
* Interruptible during interactive reads
|
||||
*/
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
/*
|
||||
* For the sake of reset()
|
||||
|
||||
+5
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dir.c,v 1.4.2.1 1997/08/24 21:41:30 jkh Exp $
|
||||
* $Id: dir.c,v 1.4 1995/06/18 14:34:48 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -702,7 +702,8 @@ dcanon(cp, p)
|
||||
*/
|
||||
*--sp = 0; /* form the pathname for readlink */
|
||||
if (sp != cp && !adrof(STRignore_symlinks) &&
|
||||
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
|
||||
(cc = readlink(short2str(cp), tlink,
|
||||
sizeof tlink)) >= 0) {
|
||||
(void) Strcpy(link, str2short(tlink));
|
||||
link[cc] = '\0';
|
||||
|
||||
@@ -786,7 +787,8 @@ dcanon(cp, p)
|
||||
|
||||
if (sp != cp && adrof(STRchase_symlinks) &&
|
||||
!adrof(STRignore_symlinks) &&
|
||||
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
|
||||
(cc = readlink(short2str(cp), tlink,
|
||||
sizeof tlink)) >= 0) {
|
||||
(void) Strcpy(link, str2short(tlink));
|
||||
link[cc] = '\0';
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: err.c,v 1.2.8.1 1997/08/24 21:41:31 jkh Exp $
|
||||
* $Id: err.c,v 1.2 1994/09/24 02:53:57 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -307,7 +307,7 @@ seterror(id, va_alist)
|
||||
#endif
|
||||
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
|
||||
id = ERR_INVALID;
|
||||
vsnprintf(berr, sizeof(berr), errorlist[id], va);
|
||||
vsprintf(berr, errorlist[id], va);
|
||||
va_end(va);
|
||||
|
||||
seterr = strsave(berr);
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.4.2.1 1997/08/24 21:41:31 jkh Exp $
|
||||
* $Id: exec.c,v 1.4 1995/06/18 14:20:16 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -193,7 +193,7 @@ doexec(v, t)
|
||||
* We must do this AFTER any possible forking (like `foo` in glob) so that
|
||||
* this shell can still do subprocesses.
|
||||
*/
|
||||
(void) sigsetmask(0);
|
||||
(void) sigsetmask((sigset_t) 0);
|
||||
/*
|
||||
* If no path, no words in path, or a / in the filename then restrict the
|
||||
* command search.
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: file.c,v 1.4.2.1 1997/08/24 21:41:33 jkh Exp $
|
||||
* $Id: file.c,v 1.4 1995/06/18 14:08:44 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -450,7 +450,7 @@ tsearch(word, command, max_word_length)
|
||||
|
||||
looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
|
||||
if (looking_for_lognames) {
|
||||
setpwent();
|
||||
(void) setpwent();
|
||||
copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */
|
||||
dir_fd = NULL;
|
||||
}
|
||||
@@ -498,7 +498,7 @@ again: /* search for matches */
|
||||
ignoring = FALSE;
|
||||
nignored = 0;
|
||||
if (looking_for_lognames)
|
||||
setpwent();
|
||||
(void) setpwent();
|
||||
else
|
||||
rewinddir(dir_fd);
|
||||
goto again;
|
||||
|
||||
+5
-5
@@ -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.5.2.1 1997/08/24 21:41:33 jkh Exp $
|
||||
* $Id: func.c,v 1.5 1996/08/11 23:10:38 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -507,7 +507,7 @@ preread()
|
||||
{
|
||||
whyles->w_end.type = I_SEEK;
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
search(T_BREAK, 0, NULL); /* read the expression in */
|
||||
if (setintr)
|
||||
@@ -565,7 +565,7 @@ dorepeat(v, kp)
|
||||
struct command *kp;
|
||||
{
|
||||
int i;
|
||||
int omask = 0;
|
||||
sigset_t omask = 0;
|
||||
|
||||
i = getn(v[1]);
|
||||
if (setintr)
|
||||
@@ -907,7 +907,7 @@ xecho(sep, v)
|
||||
int nonl = 0;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
v++;
|
||||
if (*v == 0)
|
||||
return;
|
||||
@@ -955,7 +955,7 @@ dosetenv(v, t)
|
||||
Char **ep;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
for (ep = STR_environ; *ep; ep++)
|
||||
(void) fprintf(cshout, "%s\n", vis_str(*ep));
|
||||
return;
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: hist.c,v 1.2.8.1 1997/08/24 21:41:34 jkh Exp $
|
||||
* $Id: hist.c,v 1.2 1994/09/24 02:54:06 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -127,7 +127,7 @@ dohist(v, t)
|
||||
if (getn(value(STRhistory)) == 0)
|
||||
return;
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
while (*++v && **v == '-') {
|
||||
Char *vp = *v;
|
||||
|
||||
|
||||
+10
-12
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: proc.c,v 1.2.8.2 1998/01/31 17:06:15 joerg Exp $
|
||||
* $Id: proc.c,v 1.2 1994/09/24 02:54:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -86,7 +86,6 @@ pchild(notused)
|
||||
struct process *fp;
|
||||
int pid;
|
||||
extern int insource;
|
||||
int save_errno = errno;
|
||||
union wait w;
|
||||
int jobflags;
|
||||
struct rusage ru;
|
||||
@@ -102,7 +101,6 @@ loop:
|
||||
goto loop;
|
||||
}
|
||||
pnoprocesses = pid == -1;
|
||||
errno = save_errno;
|
||||
return;
|
||||
}
|
||||
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
|
||||
@@ -205,7 +203,7 @@ pnote()
|
||||
{
|
||||
struct process *pp;
|
||||
int flags;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
neednote = 0;
|
||||
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next) {
|
||||
@@ -228,7 +226,7 @@ void
|
||||
pwait()
|
||||
{
|
||||
struct process *fp, *pp;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
* Here's where dead procs get flushed.
|
||||
@@ -259,7 +257,7 @@ pjwait(pp)
|
||||
{
|
||||
struct process *fp;
|
||||
int jobflags, reason;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
while (pp->p_pid != pp->p_jobid)
|
||||
pp = pp->p_friends;
|
||||
@@ -348,7 +346,7 @@ dowait(v, t)
|
||||
struct command *t;
|
||||
{
|
||||
struct process *pp;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
pjobs++;
|
||||
omask = sigblock(sigmask(SIGCHLD));
|
||||
@@ -356,7 +354,7 @@ loop:
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next)
|
||||
if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */
|
||||
pp->p_flags & PRUNNING) {
|
||||
(void) sigpause(0);
|
||||
(void) sigpause((sigset_t) 0);
|
||||
goto loop;
|
||||
}
|
||||
(void) sigsetmask(omask);
|
||||
@@ -1003,7 +1001,7 @@ pkill(v, signum)
|
||||
struct process *pp, *np;
|
||||
int jobflags = 0;
|
||||
int pid, err1 = 0;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
Char *cp;
|
||||
|
||||
omask = sigmask(SIGCHLD);
|
||||
@@ -1087,7 +1085,7 @@ pstart(pp, foregnd)
|
||||
int foregnd;
|
||||
{
|
||||
struct process *np;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
long jobflags = 0;
|
||||
|
||||
omask = sigblock(sigmask(SIGCHLD));
|
||||
@@ -1233,7 +1231,7 @@ pfork(t, wanttty)
|
||||
int pid;
|
||||
bool ignint = 0;
|
||||
int pgrp;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
* A child will be uninterruptible only under very special conditions.
|
||||
@@ -1330,7 +1328,7 @@ void
|
||||
pgetty(wanttty, pgrp)
|
||||
int wanttty, pgrp;
|
||||
{
|
||||
int omask = 0;
|
||||
sigset_t omask = 0;
|
||||
|
||||
/*
|
||||
* christos: I am blocking the tty signals till I've set things
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sem.c,v 1.3.6.1 1997/08/24 21:41:38 jkh Exp $
|
||||
* $Id: sem.c,v 1.3 1995/05/30 00:06:37 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -70,9 +70,9 @@ execute(t, wanttty, pipein, pipeout)
|
||||
int pid = 0;
|
||||
int pv[2];
|
||||
|
||||
static int csigmask;
|
||||
static sigset_t csigmask;
|
||||
|
||||
static int ocsigmask;
|
||||
static sigset_t ocsigmask;
|
||||
static int onosigchld = 0;
|
||||
static int nosigchld = 0;
|
||||
|
||||
@@ -226,7 +226,7 @@ execute(t, wanttty, pipein, pipeout)
|
||||
else {
|
||||
int ochild, osetintr, ohaderr, odidfds;
|
||||
int oSHIN, oSHOUT, oSHERR, oOLDSTD, otpgrp;
|
||||
int omask;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
* Prepare for the vfork by saving everything that the child
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: set.c,v 1.4.2.1 1997/08/24 21:41:38 jkh Exp $
|
||||
* $Id: set.c,v 1.4 1995/07/07 23:13:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -819,7 +819,7 @@ plist(p)
|
||||
int len;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
for (;;) {
|
||||
while (p->v_left)
|
||||
|
||||
+20
-20
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\" $Id: date.1,v 1.8.2.8 1998/06/30 06:42:44 charnier Exp $
|
||||
.\" $Id: date.1,v 1.8.2.4 1997/09/14 13:07:03 jkh Exp $
|
||||
.\"
|
||||
.Dd November 17, 1993
|
||||
.Dt DATE 1
|
||||
@@ -43,16 +43,16 @@
|
||||
.Nd display or set date and time
|
||||
.Sh SYNOPSIS
|
||||
.Nm date
|
||||
.Op Fl nu
|
||||
.Op Fl d Ar dst
|
||||
.Op Fl r Ar seconds
|
||||
.Op Fl t Ar minutes_west
|
||||
.Op Fl v Ns Ar [+|-]val Ns Op ymwdHM
|
||||
.Op Fl nu
|
||||
.Op Cm + Ns Ar format
|
||||
.Op Fl v Ar [+|-]val[ymwdHM]
|
||||
.Ar ...
|
||||
.Op Fl f Ar fmt Ar date | [[[[yy]mm]dd]HH]MM[\&.ss]
|
||||
.Op Cm + Ns Ar format
|
||||
.Sh DESCRIPTION
|
||||
.Nm Date
|
||||
.Nm
|
||||
displays the current date and time when invoked without arguments.
|
||||
Providing arguments will format the date and time in a user-defined
|
||||
way or set the date.
|
||||
@@ -84,12 +84,12 @@ is used to synchronize the clocks on groups of machines.
|
||||
By default, if
|
||||
.Xr timed
|
||||
is running,
|
||||
.Nm
|
||||
.Nm date
|
||||
will set the time on all of the machines in the local group.
|
||||
The
|
||||
.Fl n
|
||||
option stops
|
||||
.Nm
|
||||
.Nm date
|
||||
from setting the time for other than the current machine.
|
||||
.It Fl r
|
||||
Print out the date and time in
|
||||
@@ -112,14 +112,14 @@ Adjust the minute, hour, month day, week day, month or year according to
|
||||
.Ar val .
|
||||
If
|
||||
.Ar val
|
||||
is preceded with a plus or minus sign, the date is adjusted forwards
|
||||
is preceeded with a plus or minus sign, the date is adjusted forwards
|
||||
or backwards according to the remaining string, otherwise the relevant
|
||||
part of the date is set. The date can be adjusted as many times as
|
||||
required using these flags. Flags are processed in the order given.
|
||||
.Pp
|
||||
Minutes are in the range 0-59, hours are in the range 1-12, month days
|
||||
are in the range 1-31, week days are in the range 0-6 (Sun-Sat), months
|
||||
are in the range 1-12 (Jan-Dec) and years are in the range 80-38 or
|
||||
are in the range 1-31, week days are in the range 0-6 (sun-sat), months
|
||||
are in the range 1-12 (jan-dec) and years are in the range 80-38 or
|
||||
1980-2038.
|
||||
.Pp
|
||||
If
|
||||
@@ -183,12 +183,12 @@ and years are handled automatically.
|
||||
.Sh EXAMPLES
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date "+DATE: 19%y-%m-%d%nTIME: %H:%M:%S"
|
||||
date ``+DATE: %m/%d/%y%nTIME: %H:%M:%S''
|
||||
.Ed
|
||||
.Pp
|
||||
will display:
|
||||
.Bd -literal -offset indent
|
||||
DATE: 1987-11-21
|
||||
DATE: 11/21/87
|
||||
TIME: 13:36:16
|
||||
.Ed
|
||||
.Pp
|
||||
@@ -219,7 +219,7 @@ The command:
|
||||
date -v1d -v+1m -v-1d -v-fri
|
||||
.Ed
|
||||
.Pp
|
||||
will display the last Friday of the month:
|
||||
will display the last friday of the month:
|
||||
.Bd -literal -offset indent
|
||||
Fri Aug 29 04:31:11 BST 1997
|
||||
.Ed
|
||||
@@ -242,7 +242,7 @@ date 1432
|
||||
sets the time to
|
||||
.Li "2:32 PM" ,
|
||||
without modifying the date.
|
||||
.Sh ENVIRONMENT
|
||||
.Sh ENVIRONMENT VARIABLES
|
||||
The execution of
|
||||
.Nm
|
||||
is affected by the following environment variables:
|
||||
@@ -250,7 +250,7 @@ is affected by the following environment variables:
|
||||
.It Ev TZ
|
||||
The timezone to use when displaying dates.
|
||||
The normal format is a pathname relative to
|
||||
.Pa /usr/share/zoneinfo .
|
||||
.Dq Pa /usr/share/zoneinfo .
|
||||
For example, the command
|
||||
.Dq TZ=America/Los_Angeles date
|
||||
displays the current time in California.
|
||||
@@ -261,9 +261,9 @@ for more information.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/log/messages -compact
|
||||
.It Pa /var/log/wtmp
|
||||
a record of date resets and time changes
|
||||
A record of date resets and time changes.
|
||||
.It Pa /var/log/messages
|
||||
a record of the user setting the time
|
||||
A record of the user setting the time.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr gettimeofday 2 ,
|
||||
@@ -285,14 +285,14 @@ Occasionally, when
|
||||
synchronizes the time on many hosts, the setting of a new time value may
|
||||
require more than a few seconds.
|
||||
On these occasions,
|
||||
.Nm
|
||||
.Nm date
|
||||
prints:
|
||||
.Ql Network time being set .
|
||||
The message
|
||||
.Ql Communication error with timed
|
||||
occurs when the communication
|
||||
between
|
||||
.Nm
|
||||
.Nm date
|
||||
and
|
||||
.Xr timed
|
||||
fails.
|
||||
@@ -313,7 +313,7 @@ will be running on
|
||||
.Tn GMT .
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm date
|
||||
command is expected to be compatible with
|
||||
.St -p1003.2 .
|
||||
.Sh HISTORY
|
||||
|
||||
+5
-6
@@ -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.7.2.6 1997/10/03 12:54:30 danny Exp $
|
||||
* $Id: date.c,v 1.7.2.5 1997/10/01 06:12:58 danny Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -187,9 +187,9 @@ setthetime(fmt, p)
|
||||
lt = localtime(&tval);
|
||||
return;
|
||||
} else if (*t != '\0')
|
||||
fprintf(stderr, "Warning: Ignoring %ld extraneous"
|
||||
fprintf(stderr, "Warning: Ignoring %d extraneous"
|
||||
" characters in date string (%s)\n",
|
||||
(long) strlen(t), t);
|
||||
strlen(t), t);
|
||||
} else {
|
||||
for (t = p, dot = NULL; *t; ++t) {
|
||||
if (isdigit(*t))
|
||||
@@ -276,8 +276,7 @@ static void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] "
|
||||
"[-v[+|-]val[ymwdHM]] ... ",
|
||||
" [-f fmt date | [[[[yy]mm]dd]HH]MM[.ss]] [+format]");
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]",
|
||||
" [-v [+|-]val[ymwdHM]] ... [-f fmt date | [[[[yy]mm]dd]HH]MM[.ss]]");
|
||||
exit(1);
|
||||
}
|
||||
@@ -1,31 +1,3 @@
|
||||
/*-
|
||||
* Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,31 +1,3 @@
|
||||
/*-
|
||||
* Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
struct vary {
|
||||
char *arg;
|
||||
struct vary *next;
|
||||
|
||||
+1
-4
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: args.c,v 1.3.8.2 1997/08/24 21:45:26 jkh Exp $
|
||||
* $Id: args.c,v 1.3.8.1 1996/11/21 16:30:28 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -101,8 +101,6 @@ jcl(argv)
|
||||
in.dbsz = out.dbsz = 512;
|
||||
|
||||
while ((oper = *++argv) != NULL) {
|
||||
if ((oper = strdup(oper)) == NULL)
|
||||
errx(1, "unable to allocate space for the argument \"%s\"", *argv);
|
||||
if ((arg = strchr(oper, '=')) == NULL)
|
||||
errx(1, "unknown operand %s", oper);
|
||||
*arg++ = '\0';
|
||||
@@ -284,7 +282,6 @@ static struct conv {
|
||||
{ "oldebcdic", C_EBCDIC, C_ASCII, a2e_32V },
|
||||
{ "oldibm", C_EBCDIC, C_ASCII, a2ibm_32V },
|
||||
{ "osync", C_OSYNC, C_BS, NULL },
|
||||
{ "sparse", C_SPARSE, 0, NULL },
|
||||
{ "swab", C_SWAB, 0, NULL },
|
||||
{ "sync", C_SYNC, 0, NULL },
|
||||
{ "ucase", C_UCASE, C_LCASE, NULL },
|
||||
|
||||
+9
-16
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $Id: dd.1,v 1.2.8.3 1998/02/15 11:04:28 jkh Exp $
|
||||
.\" $Id: dd.1,v 1.2.8.1 1997/02/28 07:54:33 mpp Exp $
|
||||
.\"
|
||||
.Dd January 13, 1994
|
||||
.Dt DD 1
|
||||
@@ -52,7 +52,7 @@ Input data is read and written in 512-byte blocks.
|
||||
If input reads are short, input from multiple reads are aggregated
|
||||
to form the output block.
|
||||
When finished,
|
||||
.Nm
|
||||
.Nm dd
|
||||
displays the number of complete and partial input and output blocks
|
||||
and truncated input records to the standard error output.
|
||||
.Pp
|
||||
@@ -237,7 +237,7 @@ will be positioned past the block in which the error occurred using
|
||||
Do not truncate the output file.
|
||||
This will preserve any blocks in the output file not explicitly written
|
||||
by
|
||||
.Nm Ns .
|
||||
.Nm dd .
|
||||
The
|
||||
.Cm notrunc
|
||||
value is not supported for tapes.
|
||||
@@ -250,13 +250,6 @@ regularly sized blocks to be written.
|
||||
This option is incompatible with use of the
|
||||
.Cm bs= Ns Ar n
|
||||
block size specification.
|
||||
.It Cm sparse
|
||||
If one or more output blocks would consist solely of
|
||||
.Tn NUL
|
||||
bytes, try to seek the output file by the required space instead of
|
||||
filling them with
|
||||
.Tn NULs ,
|
||||
resulting in a sparse file.
|
||||
.It Cm swab
|
||||
Swap every pair of input bytes.
|
||||
If an input buffer has an odd number of bytes, the last byte will be
|
||||
@@ -287,7 +280,7 @@ in an integer, respectively.
|
||||
Two or more numbers may be separated by an ``x'' to indicate a product.
|
||||
.Pp
|
||||
When finished,
|
||||
.Nm
|
||||
.Nm dd
|
||||
displays the number of complete and partial input and output blocks,
|
||||
truncated input records and odd-length byte-swapping blocks to the
|
||||
standard error output.
|
||||
@@ -310,7 +303,7 @@ This means that the final output block may be shorter than the output
|
||||
block size.
|
||||
.Pp
|
||||
If
|
||||
.Nm
|
||||
.Nm dd
|
||||
receives a
|
||||
.Dv SIGINFO
|
||||
(see the ``status'' argument for
|
||||
@@ -319,17 +312,17 @@ signal, the current input and output block counts will
|
||||
be written to the standard error output
|
||||
in the same format as the standard completion message.
|
||||
If
|
||||
.Nm
|
||||
.Nm dd
|
||||
receives a
|
||||
.Dv SIGINT
|
||||
signal, the current input and output block counts will
|
||||
be written to the standard error output
|
||||
in the same format as the standard completion message and
|
||||
.Nm
|
||||
.Nm dd
|
||||
will exit.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm dd
|
||||
utility exits 0 on success and >0 if an error occurred.
|
||||
.Sh SEE ALSO
|
||||
.Xr cp 1 ,
|
||||
@@ -337,7 +330,7 @@ utility exits 0 on success and >0 if an error occurred.
|
||||
.Xr tr 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm dd
|
||||
utility is expected to be a superset of the
|
||||
.St -p1003.2
|
||||
standard.
|
||||
|
||||
+5
-34
@@ -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.5.2.4 1998/01/09 09:13:06 joerg Exp $
|
||||
* $Id: dd.c,v 1.5.2.2 1997/08/21 02:52:39 jlemon Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -75,7 +75,6 @@ IO in, out; /* input/output state */
|
||||
STAT st; /* statistics */
|
||||
void (*cfunc) __P((void)); /* conversion function */
|
||||
u_long cpy_cnt; /* # of blocks to copy */
|
||||
u_long pending = 0; /* pending seek if sparse */
|
||||
u_int ddflags; /* conversion options */
|
||||
u_int cbsz; /* conversion block size */
|
||||
u_int files_cnt = 1; /* # of files to copy */
|
||||
@@ -316,7 +315,7 @@ dd_in()
|
||||
}
|
||||
|
||||
if (ddflags & C_SWAB) {
|
||||
if ((n = in.dbrcnt) & 1) {
|
||||
if ((n = in.dbcnt) & 1) {
|
||||
++st.swab;
|
||||
--n;
|
||||
}
|
||||
@@ -348,7 +347,7 @@ dd_close()
|
||||
memset(out.dbp, 0, out.dbsz - out.dbcnt);
|
||||
out.dbcnt = out.dbsz;
|
||||
}
|
||||
if (out.dbcnt || pending)
|
||||
if (out.dbcnt)
|
||||
dd_out(1);
|
||||
}
|
||||
|
||||
@@ -357,7 +356,7 @@ dd_out(force)
|
||||
int force;
|
||||
{
|
||||
static int warned;
|
||||
int cnt, n, nw, i, sparse;
|
||||
int cnt, n, nw;
|
||||
u_char *outp;
|
||||
|
||||
/*
|
||||
@@ -379,35 +378,7 @@ dd_out(force)
|
||||
outp = out.db;
|
||||
for (n = force ? out.dbcnt : out.dbsz;; n = out.dbsz) {
|
||||
for (cnt = n;; cnt -= nw) {
|
||||
sparse = 0;
|
||||
if (ddflags & C_SPARSE) {
|
||||
sparse = 1; /* Is buffer sparse? */
|
||||
for (i = 0; i < cnt; i++)
|
||||
if (outp[i] != 0) {
|
||||
sparse = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sparse && !force) {
|
||||
pending += cnt;
|
||||
nw = cnt;
|
||||
} else {
|
||||
if (pending != 0) {
|
||||
if (force)
|
||||
pending--;
|
||||
if (lseek (out.fd, pending, SEEK_CUR) == -1)
|
||||
err(2, "%s: seek error creating sparse file",
|
||||
out.name);
|
||||
if (force)
|
||||
write(out.fd, outp, 1);
|
||||
pending = 0;
|
||||
}
|
||||
if (cnt)
|
||||
nw = write(out.fd, outp, cnt);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
nw = write(out.fd, outp, cnt);
|
||||
if (nw <= 0) {
|
||||
if (nw == 0)
|
||||
errx(1, "%s: end of device", out.name);
|
||||
|
||||
+2
-3
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)dd.h 8.3 (Berkeley) 4/2/94
|
||||
* $Id: dd.h,v 1.2.8.2 1998/02/11 02:24:40 asami Exp $
|
||||
* $Id: dd.h,v 1.2 1994/09/24 02:54:54 davidg Exp $
|
||||
*/
|
||||
|
||||
/* Input/output stream state. */
|
||||
@@ -69,7 +69,7 @@ typedef struct {
|
||||
u_long out_part; /* # of partial output blocks */
|
||||
u_long trunc; /* # of truncated records */
|
||||
u_long swab; /* # of odd-length swab blocks */
|
||||
u_int64_t bytes; /* # of bytes written */
|
||||
u_long bytes; /* # of bytes written */
|
||||
double start; /* start time of dd */
|
||||
} STAT;
|
||||
|
||||
@@ -95,4 +95,3 @@ typedef struct {
|
||||
#define C_UCASE 0x40000
|
||||
#define C_UNBLOCK 0x80000
|
||||
#define C_OSYNC 0x100000
|
||||
#define C_SPARSE 0x200000
|
||||
+5
-9
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: misc.c,v 1.2.8.4 1998/02/15 11:04:30 jkh Exp $
|
||||
* $Id: misc.c,v 1.2.8.1 1996/11/21 16:30:35 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -45,7 +45,6 @@ static char const sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -82,7 +81,7 @@ summary()
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
(void)snprintf(buf, sizeof(buf),
|
||||
"%qu bytes transferred in %.6f secs (%.0f bytes/sec)\n",
|
||||
"%u bytes transferred in %.6f secs (%.0f bytes/sec)\n",
|
||||
st.bytes, secs, st.bytes / secs);
|
||||
(void)write(STDERR_FILENO, buf, strlen(buf));
|
||||
}
|
||||
@@ -92,18 +91,15 @@ void
|
||||
summaryx(notused)
|
||||
int notused;
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
summary();
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
terminate(sig)
|
||||
int sig;
|
||||
terminate(notused)
|
||||
int notused;
|
||||
{
|
||||
|
||||
/* XXX exit() shouldn't call exit() from a signal handler. */
|
||||
exit(sig == 0 ? 0 : 1);
|
||||
exit(0);
|
||||
}
|
||||
+25
-32
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)df.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $Id: df.1,v 1.4.2.3 1998/02/15 11:06:23 jkh Exp $
|
||||
.\" $Id: df.1,v 1.4.2.1 1996/12/13 17:15:10 joerg Exp $
|
||||
.\"
|
||||
.Dd January 13, 1994
|
||||
.Dt DF 1
|
||||
@@ -40,7 +40,7 @@
|
||||
.Nd display free disk space
|
||||
.Sh SYNOPSIS
|
||||
.Nm df
|
||||
.Op Fl ikn
|
||||
.Op Fl ink
|
||||
.Op Fl t Ar type
|
||||
.Op Ar file | Ar filesystem ...
|
||||
.Sh DESCRIPTION
|
||||
@@ -72,37 +72,31 @@ This option should be used if it is possible that one or more
|
||||
filesystems are in a state such that they will not be able to provide
|
||||
statistics without a long delay.
|
||||
When this option is specified,
|
||||
.Nm
|
||||
.Nm df
|
||||
will not request new statistics from the filesystems, but will respond
|
||||
with the possibly stale statistics that were previously obtained.
|
||||
.It Fl t
|
||||
Only print out statistics for filesystems of the specified types.
|
||||
More than one type may be specified in a comma separated list.
|
||||
The list of filesystem types can be prefixed with
|
||||
.Dq no
|
||||
to specify the filesystem types for which action should
|
||||
.Em not
|
||||
be taken.
|
||||
For example, the
|
||||
.Nm
|
||||
command:
|
||||
.Bd -literal -offset indent
|
||||
df -t nonfs,mfs
|
||||
.Ed
|
||||
.Pp
|
||||
lists all filesystems except those of type
|
||||
.Tn NFS
|
||||
and
|
||||
.Tn MFS .
|
||||
The
|
||||
.Xr sysctl 8
|
||||
command can be used to find out the types of filesystems
|
||||
that are available on the system:
|
||||
.Bd -literal -offset indent
|
||||
sysctl vfs
|
||||
.Ed
|
||||
The recognized types are:
|
||||
ufs, nfs, mfs, lfs, msdos, fdesc, portal, kernfs, procfs, afs, isofs,
|
||||
iso9660fs, cdfs, and cd9660,
|
||||
along with the aggregates:
|
||||
all (the default),
|
||||
local (ufs, mfs, lfs, msdos, cd9660),
|
||||
and misc (fdesc, portal, kernfs, procfs).
|
||||
The names isofs, iso9660fs, cdfs, and cd9660 are aliases to each other
|
||||
all of them refering to the same type of file system.
|
||||
The string ``no'' may be prepending to a type to get its complement
|
||||
(e.g. ``nonfs'' to get non-NFS filesystems). The first
|
||||
.Fl t
|
||||
option overrides the default, additional such options will add to
|
||||
(or subtract from) the current set of types; e.g. either
|
||||
``df -t ufs -t lfs''
|
||||
or
|
||||
``df -t local -t nomfs''
|
||||
will display statistics for UFS and LFS filesystems.
|
||||
.El
|
||||
.Sh ENVIRONMENT
|
||||
.Sh ENVIRONMENTAL VARIABLES
|
||||
.Bl -tag -width BLOCKSIZE
|
||||
.It Ev BLOCKSIZE
|
||||
If the environment variable
|
||||
@@ -117,16 +111,15 @@ and
|
||||
flags are ignored if a file or filesystem is specified.
|
||||
.Sh SEE ALSO
|
||||
.Xr quota 1 ,
|
||||
.Xr statfs 2 ,
|
||||
.Xr fstatfs 2 ,
|
||||
.Xr getfsstat 2 ,
|
||||
.Xr statfs 2 ,
|
||||
.Xr getmntinfo 3 ,
|
||||
.Xr fstab 5 ,
|
||||
.Xr mount 8 ,
|
||||
.Xr quot 8 ,
|
||||
.Xr sysctl 8
|
||||
.Xr quot 8
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
.Nm df
|
||||
command appeared in
|
||||
.At v1 .
|
||||
+2
-2
@@ -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.8.2.1 1996/12/13 17:15:11 joerg Exp $
|
||||
* $Id: df.c,v 1.8 1996/01/14 18:55:09 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -129,7 +129,7 @@ main(argc, argv)
|
||||
iflag = nflag = tflag = 0;
|
||||
fsmask = MT_NONE;
|
||||
|
||||
while ((ch = getopt(argc, argv, "iknt:")) != -1)
|
||||
while ((ch = getopt(argc, argv, "iknt:")) != EOF)
|
||||
switch (ch) {
|
||||
case 'i':
|
||||
iflag = 1;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" From: @(#)hostname.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: domainname.1,v 1.2.6.1 1997/08/24 21:48:26 jkh Exp $
|
||||
.\" $Id: domainname.1,v 1.2 1995/01/14 17:02:33 ats Exp $
|
||||
.\"
|
||||
.Dd September 18, 1994
|
||||
.Dt DOMAINNAME 1
|
||||
@@ -42,7 +42,7 @@
|
||||
.Nm domainname
|
||||
.Op Ar ypdomain
|
||||
.Sh DESCRIPTION
|
||||
.Nm Domainname
|
||||
.Nm domainname
|
||||
prints the name of the current YP/NIS domain. The super-user can
|
||||
set the domain name by supplying an argument; this is usually done in the
|
||||
network initialization script
|
||||
|
||||
+4
-4
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
|
||||
.\" $Id: echo.1,v 1.3 1995/08/31 17:25:54 jkh Exp $
|
||||
.\" $Id: echo.1,v 1.2 1994/09/24 02:55:17 davidg Exp $
|
||||
.\"
|
||||
.Dd July 22, 1993
|
||||
.Dt ECHO 1
|
||||
@@ -47,7 +47,7 @@
|
||||
.Op "string ..."
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm echo
|
||||
utility writes any specified operands, separated by single blank (`` '')
|
||||
characters and followed by a newline (``\en'') character, to the standard
|
||||
output.
|
||||
@@ -61,13 +61,13 @@ by iBCS2 compatible systems.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm echo
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh SEE ALSO
|
||||
.Xr printf 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm echo
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
# $Id: Makefile,v 1.13 1995/10/22 20:14:13 ache Exp $
|
||||
# $Id: Makefile,v 1.12 1995/10/03 15:44:50 markm Exp $
|
||||
|
||||
PROG= ed
|
||||
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
|
||||
LINKS= ${BINDIR}/ed ${BINDIR}/red
|
||||
MLINKS= ed.1 red.1
|
||||
|
||||
.if exists(${.CURDIR}/../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
.if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
DISTRIBUTION=des
|
||||
CFLAGS+=-DDES
|
||||
LDADD+= -L${CIPHEROBJDIR} -lcipher
|
||||
|
||||
+3
-11
@@ -24,15 +24,11 @@
|
||||
* 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.
|
||||
*
|
||||
* $Id: buf.c,v 1.7 1995/05/30 00:06:43 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char * const rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$Id: buf.c,v 1.15 1997/12/31 12:25:33 helbig Exp $";
|
||||
#endif
|
||||
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/file.h>
|
||||
@@ -268,10 +264,6 @@ init_buffers()
|
||||
hello, world
|
||||
EOF */
|
||||
setbuffer(stdin, stdinbuf, 1);
|
||||
|
||||
/* Ensure stdout is line buffered. This avoids bogus delays
|
||||
of output if stdout is piped through utilities to a terminal. */
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
if (open_sbuf() < 0)
|
||||
quit(2);
|
||||
REQUE(&buffer_head, &buffer_head);
|
||||
|
||||
+549
-441
File diff suppressed because it is too large.
Load diff
+2
-1
@@ -25,9 +25,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ed.h,v 1.5 1994/02/01 00:34:39 alm Exp
|
||||
* $Id: ed.h,v 1.8 1994/11/03 21:46:55 davidg Exp $
|
||||
* $Id: ed.h,v 1.7 1994/09/24 02:55:25 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h> /* for MAXPATHLEN */
|
||||
#include <errno.h>
|
||||
#if defined(sun) || defined(__NetBSD__)
|
||||
|
||||
+3
-8
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: main.c,v 1.6.2.1 1997/08/24 21:50:21 jkh Exp $
|
||||
* $Id: main.c,v 1.6 1996/08/11 16:48:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -1355,8 +1355,7 @@ signal_hup(signo)
|
||||
{
|
||||
if (mutex)
|
||||
sigflags |= (1 << (signo - 1));
|
||||
else
|
||||
handle_hup(signo);
|
||||
else handle_hup(signo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1366,8 +1365,7 @@ signal_int(signo)
|
||||
{
|
||||
if (mutex)
|
||||
sigflags |= (1 << (signo - 1));
|
||||
else
|
||||
handle_int(signo);
|
||||
else handle_int(signo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1417,8 +1415,6 @@ void
|
||||
handle_winch(signo)
|
||||
int signo;
|
||||
{
|
||||
int save_errno = errno;
|
||||
|
||||
struct winsize ws; /* window size structure */
|
||||
|
||||
sigflags &= ~(1 << (signo - 1));
|
||||
@@ -1426,7 +1422,6 @@ handle_winch(signo)
|
||||
if (ws.ws_row > 2) rows = ws.ws_row - 2;
|
||||
if (ws.ws_col > 8) cols = ws.ws_col - 8;
|
||||
}
|
||||
errno = save_errno;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-4
@@ -1,7 +1,13 @@
|
||||
# $Id: Makefile,v 1.10 1996/06/02 17:05:48 phk Exp $
|
||||
# /b/source/CVS/src/bin/expr/Makefile,v 1.5 1993/06/14 19:56:06 jtc Exp
|
||||
# $Id: Makefile,v 1.8 1996/05/07 23:14:17 wosch Exp $
|
||||
|
||||
PROG= expr
|
||||
SRCS= expr.y
|
||||
YFLAGS=
|
||||
PROG= expr
|
||||
SRCS= expr.c
|
||||
CLEANFILES+= expr.c y.tab.h
|
||||
|
||||
expr.c:
|
||||
${YACC} -d ${.IMPSRC}
|
||||
mv -f y.tab.c expr.c
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
+11
-11
@@ -28,7 +28,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: expr.1,v 1.4 1996/01/29 22:53:24 mpp Exp $
|
||||
.\" $Id: expr.1,v 1.3 1994/04/24 01:18:46 jkh Exp $
|
||||
.\"
|
||||
.Dd July 3, 1993
|
||||
.Dt EXPR 1
|
||||
@@ -41,13 +41,13 @@
|
||||
.Ar expression
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm expr
|
||||
utility evaluates
|
||||
.Ar expression
|
||||
and writes the result on standard output.
|
||||
.Pp
|
||||
All operators are separate arguments to the
|
||||
.Nm
|
||||
.Nm expr
|
||||
utility.
|
||||
Characters special to the command interpreter must be escaped.
|
||||
.Pp
|
||||
@@ -55,26 +55,26 @@ Operators are listed below in order of increasing precedence.
|
||||
Operators with equal precedence are grouped within { } symbols.
|
||||
.Bl -tag -width indent
|
||||
.It Ar expr1 Li | Ar expr2
|
||||
Return the evaluation of
|
||||
Returns the evaluation of
|
||||
.Ar expr1
|
||||
if it is neither an empty string nor zero;
|
||||
otherwise, returns the evaluation of
|
||||
.Ar expr2 .
|
||||
.It Ar expr1 Li & Ar expr2
|
||||
Return the evaluation of
|
||||
Returns the evaluation of
|
||||
.Ar expr1
|
||||
if neither expression evaluates to an empty string or zero;
|
||||
otherwise, returns zero.
|
||||
.It Ar expr1 Li "{=, >, >=, <, <=, !=}" Ar expr2
|
||||
Return the results of integer comparison if both arguments are integers;
|
||||
Returns the results of integer comparison if both arguments are integers;
|
||||
otherwise, returns the results of string comparison using the locale-specific
|
||||
collation sequence.
|
||||
The result of each comparison is 1 if the specified relation is true,
|
||||
or 0 if the relation is false.
|
||||
.It Ar expr1 Li "{+, -}" Ar expr2
|
||||
Return the results of addition or subtraction of integer-valued arguments.
|
||||
Returns the results of addition or subtraction of integer-valued arguments.
|
||||
.It Ar expr1 Li "{*, /, %}" Ar expr2
|
||||
Return the results of multiplication, integer division, or remainder of integer-valued arguments.
|
||||
Returns the results of multiplication, integer division, or remainder of integer-valued arguments.
|
||||
.It Ar expr1 Li : Ar expr2
|
||||
The
|
||||
.Dq \:
|
||||
@@ -115,9 +115,9 @@ The following example returns the number of characters in variable a.
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
The
|
||||
.Nm
|
||||
.Nm expr
|
||||
utility exits with one of the following values:
|
||||
.Bl -tag -width indent -compact
|
||||
.Bl -tag -width Ds -compact
|
||||
.It 0
|
||||
the expression is neither an empty string nor 0.
|
||||
.It 1
|
||||
@@ -127,6 +127,6 @@ the expression is invalid.
|
||||
.El
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm expr
|
||||
utility conforms to
|
||||
.St -p1003.2 .
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)hostname.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $Id: hostname.1,v 1.3.2.3 1998/06/30 06:43:13 charnier Exp $
|
||||
.\" $Id: hostname.1,v 1.3.2.1 1997/02/28 07:54:36 mpp Exp $
|
||||
.\"
|
||||
.Dd April 28, 1995
|
||||
.Dt HOSTNAME 1
|
||||
@@ -43,7 +43,7 @@
|
||||
.Op Fl s
|
||||
.Op Ar name-of-host
|
||||
.Sh DESCRIPTION
|
||||
.Nm Hostname
|
||||
.Nm
|
||||
prints the name of the current host. The super-user can
|
||||
set the hostname by supplying an argument; this is usually done in the
|
||||
network initialization script
|
||||
@@ -54,13 +54,13 @@ time.
|
||||
Options:
|
||||
.Bl -tag -width flag
|
||||
.It Fl s
|
||||
Trim off any domain information from the printed
|
||||
Trims off any domain information from the printed
|
||||
name.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr gethostname 3
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
.Nm hostname
|
||||
command appeared in
|
||||
.Bx 4.2 .
|
||||
+6
-6
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)kill.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $Id: kill.1,v 1.3.2.2 1998/05/22 10:50:26 jkoshy Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 28, 1995
|
||||
.Dt KILL 1
|
||||
@@ -110,22 +110,22 @@ ALRM (alarm clock)
|
||||
TERM (software termination signal)
|
||||
.El
|
||||
.Pp
|
||||
.Nm Kill
|
||||
.Nm
|
||||
is a built-in to
|
||||
.Xr csh 1 ;
|
||||
it allows job specifiers of the form ``%...'' as arguments
|
||||
so process id's are not as often used as
|
||||
.Nm
|
||||
.Nm kill
|
||||
arguments.
|
||||
See
|
||||
.Xr csh 1
|
||||
.Xr csh 1
|
||||
for details.
|
||||
.Sh SEE ALSO
|
||||
.Xr csh 1 ,
|
||||
.Xr killall 1 ,
|
||||
.Xr ps 1 ,
|
||||
.Xr kill 2 ,
|
||||
.Xr sigaction 2
|
||||
.Xr sigvec 2
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
@@ -134,7 +134,7 @@ function is expected to be
|
||||
compatible.
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
.Nm kill
|
||||
command appeared in
|
||||
.At v6 .
|
||||
.Sh BUGS
|
||||
|
||||
+6
-6
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ln.1 8.2 (Berkeley) 12/30/93
|
||||
.\" $Id: ln.1,v 1.3 1996/08/29 18:05:55 wosch Exp $
|
||||
.\" $Id: ln.1,v 1.2 1994/09/24 02:55:47 davidg Exp $
|
||||
.\"
|
||||
.Dd December 30, 1993
|
||||
.Dt LN 1
|
||||
@@ -52,7 +52,7 @@
|
||||
.Op target_dir
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm ln
|
||||
utility creates a new directory entry (linked file) which has the
|
||||
same modes as the original file.
|
||||
It is useful for maintaining multiple copies of a file in many places
|
||||
@@ -75,7 +75,7 @@ Create a symbolic link.
|
||||
.El
|
||||
.Pp
|
||||
By default
|
||||
.Nm
|
||||
.Nm ln
|
||||
makes
|
||||
.Em hard
|
||||
links.
|
||||
@@ -99,7 +99,7 @@ call may be used to read the contents of a symbolic link.
|
||||
Symbolic links may span file systems and may refer to directories.
|
||||
.Pp
|
||||
Given one or two arguments,
|
||||
.Nm
|
||||
.Nm ln
|
||||
creates a link to an existing file
|
||||
.Ar source_file .
|
||||
If
|
||||
@@ -113,7 +113,7 @@ to the last component of
|
||||
.Ar source_file .
|
||||
.Pp
|
||||
Given more than two arguments,
|
||||
.Nm
|
||||
.Nm ln
|
||||
makes links in
|
||||
.Ar target_dir
|
||||
to all the named source files.
|
||||
@@ -127,6 +127,6 @@ The links made will have the same name as the files being linked to.
|
||||
.Xr symlink 7
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
.Nm ln
|
||||
command appeared in
|
||||
.At v1 .
|
||||
+21
-16
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)symlink.7 8.3 (Berkeley) 3/31/94
|
||||
.\" $Id: symlink.7,v 1.2.8.2 1997/06/19 01:09:09 jdp Exp $
|
||||
.\" $Id: symlink.7,v 1.2.8.1 1997/06/14 18:47:31 jdp Exp $
|
||||
.\"
|
||||
.Dd March 31, 1994
|
||||
.Dt SYMLINK 7
|
||||
@@ -200,8 +200,6 @@ option is not specified),
|
||||
the
|
||||
.Nm ls
|
||||
command follows symbolic links named as arguments if the
|
||||
.Fl H
|
||||
or
|
||||
.Fl L
|
||||
option is specified,
|
||||
or if the
|
||||
@@ -209,13 +207,16 @@ or if the
|
||||
.Fl d
|
||||
or
|
||||
.Fl l
|
||||
options are not specified. (The
|
||||
.Nm ls
|
||||
command is the only command where the
|
||||
.Fl H
|
||||
and
|
||||
options are not specified.
|
||||
(If the
|
||||
.Fl L
|
||||
options affect its behavior even though it is not doing a walk of
|
||||
option is specified,
|
||||
.Nm ls
|
||||
always follows symbolic links.
|
||||
.Nm Ls
|
||||
is the only command where the
|
||||
.Fl L
|
||||
option affects its behavior even though it is not doing a walk of
|
||||
a file tree.)
|
||||
.Pp
|
||||
The
|
||||
@@ -393,19 +394,23 @@ options.
|
||||
To maintain compatibility with historic systems,
|
||||
the
|
||||
.Nm ls
|
||||
command acts a little differently. If you do not specify the
|
||||
.Fl F ,
|
||||
.Fl d or
|
||||
.Fl l
|
||||
options,
|
||||
.Nm ls
|
||||
will follow symbolic links specified on the command line. If the
|
||||
command never follows symbolic links unless the
|
||||
.Fl L
|
||||
flag is specified.
|
||||
If the
|
||||
.Fl L
|
||||
flag is specified,
|
||||
.Nm ls
|
||||
follows all symbolic links,
|
||||
regardless of their type,
|
||||
whether specified on the command line or encountered in the tree walk.
|
||||
The
|
||||
.Nm ls
|
||||
command does not support the
|
||||
.Fl H
|
||||
or
|
||||
.Fl P
|
||||
options.
|
||||
.Sh SEE ALSO
|
||||
.Xr chflags 1 ,
|
||||
.Xr chgrp 1 ,
|
||||
|
||||
+1
-3
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:55:52 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
int acccmp __P((const FTSENT *, const FTSENT *));
|
||||
@@ -49,5 +49,3 @@ void printcol __P((DISPLAY *));
|
||||
void printlong __P((DISPLAY *));
|
||||
void printscol __P((DISPLAY *));
|
||||
void usage __P((void));
|
||||
int len_octal __P((char *, int));
|
||||
int prn_octal __P((char *));
|
||||
+22
-77
@@ -13,7 +13,7 @@
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgment:
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the University of
|
||||
.\" California, Berkeley and its contributors.
|
||||
.\" 4. Neither the name of the University nor the names of its contributors
|
||||
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ls.1 8.6 (Berkeley) 4/18/94
|
||||
.\" $Id: ls.1,v 1.5.2.5 1997/12/25 09:35:55 hoek Exp $
|
||||
.\" $Id: ls.1,v 1.5.2.3 1997/03/26 17:55:17 obrien Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt LS 1
|
||||
@@ -43,20 +43,20 @@
|
||||
.Nd list directory contents
|
||||
.Sh SYNOPSIS
|
||||
.Nm ls
|
||||
.Op Fl ABCFHLPRTWabcdfgikloqrstu1
|
||||
.Op Fl ACFLRTacdfgikloqrstu1
|
||||
.Op Ar file ...
|
||||
.Sh DESCRIPTION
|
||||
For each operand that names a
|
||||
.Ar file
|
||||
of a type other than
|
||||
directory,
|
||||
.Nm
|
||||
.Nm ls
|
||||
displays its name as well as any requested,
|
||||
associated information.
|
||||
For each operand that names a
|
||||
.Ar file
|
||||
of type directory,
|
||||
.Nm
|
||||
.Nm ls
|
||||
displays the names of files contained
|
||||
within that directory, as well as any requested, associated
|
||||
information.
|
||||
@@ -76,9 +76,6 @@ List all entries except for
|
||||
and
|
||||
.Ql \&.. .
|
||||
Always set for the super-user.
|
||||
.It Fl B
|
||||
Force printing of non-graphic characters in file names as \\xxx,
|
||||
where xxx is the numeric value of the character in octal.
|
||||
.It Fl C
|
||||
Force multi-column output; this is the default when output is to a terminal.
|
||||
.It Fl F
|
||||
@@ -87,47 +84,24 @@ that is a directory, an asterisk (*) after each that is
|
||||
executable,
|
||||
an at sign (@) after each symbolic link,
|
||||
an equals sign (=) after each socket,
|
||||
a percent sign (%) after each whiteout,
|
||||
and a vertical bar (|) after each that is a
|
||||
.Tn FIFO .
|
||||
.It Fl H
|
||||
Symbolic links on the command line are followed. This option is assumed if
|
||||
none of the
|
||||
.Fl F ,
|
||||
.Fl d ,
|
||||
or
|
||||
.Fl l
|
||||
options are specified.
|
||||
.Tn FIFO .
|
||||
.It Fl L
|
||||
If argument is a symbolic link, list the file or directory the link references
|
||||
rather than the link itself. This option cancels the
|
||||
.Fl P
|
||||
option.
|
||||
.It Fl P
|
||||
If argument is a symbolic link, list the link itself rather than the
|
||||
object the link references. This option cancels the
|
||||
.Fl H
|
||||
and
|
||||
.Fl L
|
||||
options.
|
||||
rather than the link itself.
|
||||
.It Fl R
|
||||
Recursively list subdirectories encountered.
|
||||
.It Fl T
|
||||
Display complete time information for the file, including
|
||||
month, day, hour, minute, second, and year.
|
||||
.It Fl W
|
||||
Display whiteouts when scanning directories.
|
||||
.It Fl a
|
||||
Include directory entries whose names begin with a
|
||||
dot (.).
|
||||
.It Fl b
|
||||
As
|
||||
.Fl B ,
|
||||
but use C escape codes whenever possible.
|
||||
.It Fl c
|
||||
Use time when file status was last changed for sorting or printing.
|
||||
.It Fl d
|
||||
Directories are listed as plain files (not searched recursively).
|
||||
Directories are listed as plain files (not searched recursively) and
|
||||
symbolic links in the argument list are not indirected through.
|
||||
.It Fl f
|
||||
Output is not sorted.
|
||||
.It Fl g
|
||||
@@ -140,10 +114,8 @@ format output.
|
||||
.It Fl i
|
||||
For each file, print the file's file serial number (inode number).
|
||||
.It Fl k
|
||||
If the
|
||||
.Fl s
|
||||
option is specified, print the file size allocation in kilobytes,
|
||||
not blocks. This option overrides the environment variable BLOCKSIZE.
|
||||
If the 's' option is specified, print the file size allocation in kilobytes,
|
||||
not blocks.
|
||||
.It Fl l
|
||||
(The lowercase letter ``ell.'') List in long format. (See below.)
|
||||
If the output is to a terminal, a total sum for all the file
|
||||
@@ -162,8 +134,7 @@ lexicographical order or the oldest entries first.
|
||||
Display the number of file system blocks actually used by each file, in units
|
||||
of 512 bytes, where partial units are rounded up to the next integer value.
|
||||
If the output is to a terminal, a total sum for all the file
|
||||
sizes is output on a line before the listing. The environment variable
|
||||
BLOCKSIZE overrides the unit size of 512 bytes.
|
||||
sizes is output on a line before the listing.
|
||||
.It Fl t
|
||||
Sort by time modified (most recently modified
|
||||
first) before sorting the operands by lexicographical
|
||||
@@ -191,30 +162,14 @@ options all override each other; the last one specified determines
|
||||
the format used.
|
||||
.Pp
|
||||
The
|
||||
.Fl c
|
||||
.Fl c ,
|
||||
and
|
||||
.Fl u
|
||||
options override each other; the last one specified determines
|
||||
the file time used.
|
||||
.Pp
|
||||
The
|
||||
.Fl B ,
|
||||
.Fl b
|
||||
and
|
||||
.Fl q
|
||||
options all override each other; the last one specified determines
|
||||
the format used for non-printable characters.
|
||||
.Pp
|
||||
The
|
||||
.Fl H,
|
||||
.Fl L
|
||||
and
|
||||
.Fl P
|
||||
options all override each other (either partially or fully); they
|
||||
are applied in the order specified.
|
||||
.Pp
|
||||
By default,
|
||||
.Nm
|
||||
.Nm ls
|
||||
lists one entry per line to standard
|
||||
output; the exceptions are to terminals or when the
|
||||
.Fl C
|
||||
@@ -243,10 +198,6 @@ number of 512-byte blocks used by the files in the directory is displayed
|
||||
on a line by itself immediately before the information for the files in the
|
||||
directory.
|
||||
.Pp
|
||||
If the modification time of the file is more than 6 months
|
||||
in the past or future, then the year of the last modification
|
||||
is displayed in place of the hour and minute fields.
|
||||
.Pp
|
||||
If the owner or group names are not a known user or group name
|
||||
the numeric ID's are displayed.
|
||||
.Pp
|
||||
@@ -256,9 +207,7 @@ in the size field. If the file is a symbolic link the pathname of the
|
||||
linked-to file is preceded by
|
||||
.Dq \-> .
|
||||
.Pp
|
||||
The file mode printed under the
|
||||
.Fl l
|
||||
option consists of the
|
||||
The file mode printed under the -l option consists of the
|
||||
entry type, owner permissions, and group permissions.
|
||||
The entry type character describes the type of file, as
|
||||
follows:
|
||||
@@ -316,7 +265,7 @@ and setgroup-ID mode is set.
|
||||
The file is executable or the directory is
|
||||
searchable.
|
||||
.It Sy \-
|
||||
The file is neither readable, writable, executable,
|
||||
The file is neither readable, writeable, executable,
|
||||
nor set-user-ID nor set-group-ID mode, nor sticky. (See below.)
|
||||
.El
|
||||
.Pp
|
||||
@@ -343,11 +292,11 @@ or
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm ls
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh ENVIRONMENT
|
||||
.Sh ENVIRONMENT VARIABLES
|
||||
The following environment variables affect the execution of
|
||||
.Nm Ns :
|
||||
.Nm ls :
|
||||
.Bl -tag -width BLOCKSIZE
|
||||
.It Ev BLOCKSIZE
|
||||
If the environment variable
|
||||
@@ -362,7 +311,7 @@ decimal integer, it is used as the
|
||||
column position width for displaying
|
||||
multiple-text-column output.
|
||||
The
|
||||
.Nm
|
||||
.Nm ls
|
||||
utility calculates how
|
||||
many pathname text columns to display
|
||||
based on the width provided.
|
||||
@@ -385,16 +334,12 @@ specification.
|
||||
.Xr sticky 8
|
||||
.Sh HISTORY
|
||||
An
|
||||
.Nm
|
||||
.Nm ls
|
||||
command appeared in
|
||||
.At v1 .
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm ls
|
||||
function is expected to be a superset of the
|
||||
.St -p1003.2
|
||||
specification.
|
||||
.Sh BUGS
|
||||
To maintain backward compatibility, the relationships between the many
|
||||
options is quite complex.
|
||||
|
||||
+13
-33
@@ -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.10.2.1 1997/12/03 05:40:06 imp Exp $
|
||||
* $Id: ls.c,v 1.9 1995/10/26 10:56:38 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -82,16 +82,16 @@ int f_kblocks; /* print size in kilobytes */
|
||||
int f_listdir; /* list actual directory, not contents */
|
||||
int f_listdot; /* list files beginning with . */
|
||||
int f_longform; /* long listing format */
|
||||
int f_newline; /* if precede with newline */
|
||||
int f_nonprint; /* show unprintables as ? */
|
||||
int f_nosort; /* don't sort output */
|
||||
int f_octal; /* show unprintables as \xxx */
|
||||
int f_octal_escape; /* like f_octal but use C escapes if possible */
|
||||
int f_recursive; /* ls subdirectories also */
|
||||
int f_reversesort; /* reverse whatever sort is used */
|
||||
int f_sectime; /* print the real time for all files */
|
||||
int f_singlecol; /* use single column output */
|
||||
int f_size; /* list size in short listing */
|
||||
int f_statustime; /* use time of last mode change */
|
||||
int f_dirname; /* if precede with directory name */
|
||||
int f_timesort; /* sort by time vice name */
|
||||
int f_type; /* add type character for non-regular files */
|
||||
|
||||
@@ -131,7 +131,7 @@ main(argc, argv)
|
||||
f_listdot = 1;
|
||||
|
||||
fts_options = FTS_PHYSICAL;
|
||||
while ((ch = getopt(argc, argv, "1ABCFHLPRTWabcdfgikloqrstu")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != EOF) {
|
||||
switch (ch) {
|
||||
/*
|
||||
* The -1, -C and -l options all override each other so shell
|
||||
@@ -141,11 +141,6 @@ main(argc, argv)
|
||||
f_singlecol = 1;
|
||||
f_column = f_longform = 0;
|
||||
break;
|
||||
case 'B':
|
||||
f_nonprint = 0;
|
||||
f_octal = 1;
|
||||
f_octal_escape = 0;
|
||||
break;
|
||||
case 'C':
|
||||
f_column = 1;
|
||||
f_longform = f_singlecol = 0;
|
||||
@@ -166,18 +161,10 @@ main(argc, argv)
|
||||
case 'F':
|
||||
f_type = 1;
|
||||
break;
|
||||
case 'H':
|
||||
fts_options |= FTS_COMFOLLOW;
|
||||
break;
|
||||
case 'L':
|
||||
fts_options &= ~FTS_PHYSICAL;
|
||||
fts_options |= FTS_LOGICAL;
|
||||
break;
|
||||
case 'P':
|
||||
fts_options &= ~FTS_COMFOLLOW;
|
||||
fts_options &= ~FTS_LOGICAL;
|
||||
fts_options |= FTS_PHYSICAL;
|
||||
break;
|
||||
case 'R':
|
||||
f_recursive = 1;
|
||||
break;
|
||||
@@ -208,8 +195,6 @@ main(argc, argv)
|
||||
break;
|
||||
case 'q':
|
||||
f_nonprint = 1;
|
||||
f_octal = 0;
|
||||
f_octal_escape = 0;
|
||||
break;
|
||||
case 'r':
|
||||
f_reversesort = 1;
|
||||
@@ -223,11 +208,6 @@ main(argc, argv)
|
||||
case 't':
|
||||
f_timesort = 1;
|
||||
break;
|
||||
case 'b':
|
||||
f_nonprint = 0;
|
||||
f_octal = 0;
|
||||
f_octal_escape = 1;
|
||||
break;
|
||||
default:
|
||||
case '?':
|
||||
usage();
|
||||
@@ -431,10 +411,6 @@ display(p, list)
|
||||
prcopy(cur->fts_name, cur->fts_name, cur->fts_namelen);
|
||||
if (cur->fts_namelen > maxlen)
|
||||
maxlen = cur->fts_namelen;
|
||||
if (f_octal || f_octal_escape) {
|
||||
int t = len_octal(cur->fts_name, cur->fts_namelen);
|
||||
if (t > maxlen) maxlen = t;
|
||||
}
|
||||
if (needstats) {
|
||||
sp = cur->fts_statp;
|
||||
if (sp->st_blocks > maxblock)
|
||||
@@ -537,12 +513,16 @@ mastercmp(a, b)
|
||||
if (a_info == FTS_NS || b_info == FTS_NS)
|
||||
return (namecmp(*a, *b));
|
||||
|
||||
if (a_info != b_info &&
|
||||
(*a)->fts_level == FTS_ROOTLEVEL && !f_listdir) {
|
||||
if (a_info == b_info)
|
||||
return (sortfcn(*a, *b));
|
||||
|
||||
if ((*a)->fts_level == FTS_ROOTLEVEL)
|
||||
if (a_info == FTS_D)
|
||||
return (1);
|
||||
if (b_info == FTS_D)
|
||||
else if (b_info == FTS_D)
|
||||
return (-1);
|
||||
}
|
||||
return (sortfcn(*a, *b));
|
||||
else
|
||||
return (sortfcn(*a, *b));
|
||||
else
|
||||
return (sortfcn(*a, *b));
|
||||
}
|
||||
+1
-4
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -35,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ls.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: ls.h,v 1.2 1994/09/24 02:55:55 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define NO_PRINT 1
|
||||
@@ -46,8 +45,6 @@ extern int f_accesstime; /* use time of last access */
|
||||
extern int f_flags; /* show flags associated with a file */
|
||||
extern int f_inode; /* print inode */
|
||||
extern int f_longform; /* long listing format */
|
||||
extern int f_octal; /* print unprintables in octal */
|
||||
extern int f_octal_escape; /* like f_octal but use C escapes if possible */
|
||||
extern int f_sectime; /* print the real time for all files */
|
||||
extern int f_size; /* list size in short listing */
|
||||
extern int f_statustime; /* use time of last mode change */
|
||||
|
||||
+7
-17
@@ -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.8 1996/01/20 10:31:14 mpp Exp $
|
||||
* $Id: print.c,v 1.7 1995/12/30 18:15:30 joerg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -95,7 +95,7 @@ printlong(dp)
|
||||
continue;
|
||||
sp = p->fts_statp;
|
||||
if (f_inode)
|
||||
(void)printf("%*lu ", dp->s_inode, (u_long)sp->st_ino);
|
||||
(void)printf("%*lu ", dp->s_inode, sp->st_ino);
|
||||
if (f_size)
|
||||
(void)printf("%*qd ",
|
||||
dp->s_block, howmany(sp->st_blocks, blocksize));
|
||||
@@ -124,8 +124,7 @@ printlong(dp)
|
||||
printtime(sp->st_ctime);
|
||||
else
|
||||
printtime(sp->st_mtime);
|
||||
if (f_octal || f_octal_escape) (void)prn_octal(p->fts_name);
|
||||
else (void)printf("%s", p->fts_name);
|
||||
(void)printf("%s", p->fts_name);
|
||||
if (f_type)
|
||||
(void)printtype(sp->st_mode);
|
||||
if (S_ISLNK(sp->st_mode))
|
||||
@@ -216,12 +215,11 @@ printaname(p, inodefield, sizefield)
|
||||
sp = p->fts_statp;
|
||||
chcnt = 0;
|
||||
if (f_inode)
|
||||
chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino);
|
||||
chcnt += printf("%*lu ", (int)inodefield, sp->st_ino);
|
||||
if (f_size)
|
||||
chcnt += printf("%*qd ",
|
||||
(int)sizefield, howmany(sp->st_blocks, blocksize));
|
||||
chcnt += (f_octal || f_octal_escape) ? prn_octal(p->fts_name)
|
||||
: printf("%s", p->fts_name);
|
||||
chcnt += printf("%s", p->fts_name);
|
||||
if (f_type)
|
||||
chcnt += printtype(sp->st_mode);
|
||||
return (chcnt);
|
||||
@@ -233,10 +231,6 @@ printtime(ftime)
|
||||
{
|
||||
int i;
|
||||
char longstring[80];
|
||||
static time_t now;
|
||||
|
||||
if (now == 0)
|
||||
now = time(NULL);
|
||||
|
||||
strftime(longstring, sizeof(longstring), "%c", localtime(&ftime));
|
||||
for (i = 4; i < 11; ++i)
|
||||
@@ -246,7 +240,7 @@ printtime(ftime)
|
||||
if (f_sectime)
|
||||
for (i = 11; i < 24; i++)
|
||||
(void)putchar(longstring[i]);
|
||||
else if (ftime + SIXMONTHS > now && ftime < now + SIXMONTHS)
|
||||
else if (ftime + SIXMONTHS > time(NULL))
|
||||
for (i = 11; i < 16; ++i)
|
||||
(void)putchar(longstring[i]);
|
||||
else {
|
||||
@@ -299,9 +293,5 @@ printlink(p)
|
||||
return;
|
||||
}
|
||||
path[lnklen] = '\0';
|
||||
if (f_octal || f_octal_escape) {
|
||||
(void)printf(" -> ");
|
||||
(void)prn_octal(path);
|
||||
}
|
||||
else (void)printf(" -> %s", path);
|
||||
(void)printf(" -> %s", path);
|
||||
}
|
||||
+2
-89
@@ -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.5.2.1 1997/03/26 17:55:19 obrien Exp $
|
||||
* $Id: util.c,v 1.5 1996/03/31 16:14:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -65,96 +65,9 @@ prcopy(src, dest, len)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The fts system makes it difficult to replace fts_name with a different-
|
||||
* sized string, so we just calculate the real length here and do the
|
||||
* conversion in prn_octal()
|
||||
*
|
||||
* XXX when using f_octal_escape (-b) rather than f_octal (-B), the
|
||||
* length computed by len_octal may be too big. I just can't be buggered
|
||||
* to fix this as an efficient fix would involve a lookup table. Same goes
|
||||
* for the rather inelegant code in prn_octal.
|
||||
*
|
||||
* DES 1998/04/23
|
||||
*/
|
||||
|
||||
int
|
||||
len_octal(s, len)
|
||||
char *s;
|
||||
int len;
|
||||
{
|
||||
int r = 0;
|
||||
|
||||
while (len--)
|
||||
if (isprint((unsigned char)*s++)) r++; else r += 4;
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
prn_octal(s)
|
||||
char *s;
|
||||
{
|
||||
unsigned char ch;
|
||||
int len = 0;
|
||||
|
||||
while ((ch = *s++))
|
||||
{
|
||||
if (isprint(ch) && (ch != '\"') && (ch != '\\'))
|
||||
putchar(ch), len++;
|
||||
else if (f_octal_escape) {
|
||||
putchar('\\');
|
||||
switch (ch) {
|
||||
case '\\':
|
||||
putchar('\\');
|
||||
break;
|
||||
case '\"':
|
||||
putchar('"');
|
||||
break;
|
||||
case '\a':
|
||||
putchar('a');
|
||||
break;
|
||||
case '\b':
|
||||
putchar('b');
|
||||
break;
|
||||
case '\f':
|
||||
putchar('f');
|
||||
break;
|
||||
case '\n':
|
||||
putchar('n');
|
||||
break;
|
||||
case '\r':
|
||||
putchar('r');
|
||||
break;
|
||||
case '\t':
|
||||
putchar('t');
|
||||
break;
|
||||
case '\v':
|
||||
putchar('v');
|
||||
break;
|
||||
default:
|
||||
putchar('0' + (ch >> 6));
|
||||
putchar('0' + ((ch >> 3) & 3));
|
||||
putchar('0' + (ch & 3));
|
||||
len += 2;
|
||||
break;
|
||||
}
|
||||
len += 2;
|
||||
}
|
||||
else {
|
||||
putchar('\\');
|
||||
putchar('0' + (ch >> 6));
|
||||
putchar('0' + ((ch >> 3) & 3));
|
||||
putchar('0' + (ch & 3));
|
||||
len += 4;
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "usage: ls [-ACFHLPRTWacdfgikloqrstu1]"
|
||||
" [file ...]\n");
|
||||
(void)fprintf(stderr, "usage: ls [-1ACFLRTacdfikloqrstu] [file ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
+4
-4
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)mkdir.1 8.2 (Berkeley) 1/25/94
|
||||
.\" $Id: mkdir.1,v 1.3.2.2 1998/06/30 06:42:30 charnier Exp $
|
||||
.\" $Id: mkdir.1,v 1.6 1997/02/22 14:04:08 peter Exp $
|
||||
.\"
|
||||
.Dd January 25, 1994
|
||||
.Dt MKDIR 1
|
||||
@@ -47,7 +47,7 @@
|
||||
.Op Fl m Ar mode
|
||||
.Ar directory_name ...
|
||||
.Sh DESCRIPTION
|
||||
.Nm Mkdir
|
||||
.Nm
|
||||
creates the directories named as operands, in the order specified,
|
||||
using mode
|
||||
.Li rwxrwxrwx (\&0777)
|
||||
@@ -81,13 +81,13 @@ permission for the owner.
|
||||
.Pp
|
||||
The user must have write permission in the parent directory.
|
||||
.Pp
|
||||
.Nm Mkdir
|
||||
.Nm
|
||||
exits 0 if successful, and >0 if an error occurred.
|
||||
.Sh SEE ALSO
|
||||
.Xr rmdir 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm mkdir
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+11
-10
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: mv.1,v 1.7.2.1 1998/02/15 11:16:27 jkh Exp $
|
||||
.\" $Id: mv.1,v 1.6 1996/02/20 23:27:54 wosch Exp $
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt MV 1
|
||||
@@ -47,10 +47,11 @@
|
||||
.Ar source target
|
||||
.Nm mv
|
||||
.Op Fl f | Fl i
|
||||
.Ar source ... directory
|
||||
.Ar source ... source directory
|
||||
.Sh DESCRIPTION
|
||||
.Pp
|
||||
In its first form, the
|
||||
.Nm
|
||||
.Nm mv
|
||||
utility renames the file named by the
|
||||
.Ar source
|
||||
operand to the destination path named by the
|
||||
@@ -60,7 +61,7 @@ This form is assumed when the last operand does not name an already
|
||||
existing directory.
|
||||
.Pp
|
||||
In its second form,
|
||||
.Nm
|
||||
.Nm mv
|
||||
moves each file named by a
|
||||
.Ar source
|
||||
operand to a destination file in the existing directory named by the
|
||||
@@ -81,8 +82,8 @@ option overrides any previous
|
||||
.Fl i
|
||||
options.)
|
||||
.It Fl i
|
||||
Cause
|
||||
.Nm
|
||||
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
|
||||
@@ -102,7 +103,7 @@ It is an error for either the
|
||||
operand or the destination path to specify a directory unless both do.
|
||||
.Pp
|
||||
If the destination path does not have a mode which permits writing,
|
||||
.Nm
|
||||
.Nm mv
|
||||
prompts the user for confirmation as specified for the
|
||||
.Fl i
|
||||
option.
|
||||
@@ -110,7 +111,7 @@ option.
|
||||
As the
|
||||
.Xr rename 2
|
||||
call does not work across file systems,
|
||||
.Nm
|
||||
.Nm mv
|
||||
uses
|
||||
.Xr cp 1
|
||||
and
|
||||
@@ -124,7 +125,7 @@ rm -f destination_path && \e
|
||||
.Ed
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm mv
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh SEE ALSO
|
||||
.Xr cp 1 ,
|
||||
@@ -132,7 +133,7 @@ utility exits 0 on success, and >0 if an error occurs.
|
||||
.Xr symlink 7
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm mv
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+17
-39
@@ -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.8.2.3 1998/05/25 22:45:42 steve Exp $
|
||||
* $Id: mv.c,v 1.8 1996/03/01 06:14:13 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -50,7 +50,6 @@ static char const sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
|
||||
#include <sys/time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@@ -78,7 +77,7 @@ main(argc, argv)
|
||||
register char *p, *endp;
|
||||
struct stat sb;
|
||||
int ch;
|
||||
char path[MAXPATHLEN];
|
||||
char path[MAXPATHLEN + 1];
|
||||
|
||||
while ((ch = getopt(argc, argv, "fi")) != -1)
|
||||
switch (ch) {
|
||||
@@ -110,15 +109,11 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
/* It's a directory, move each file into it. */
|
||||
if (strlen(argv[argc - 1]) > sizeof(path) - 1)
|
||||
errx(1, "%s: destination pathname too long", *argv);
|
||||
(void)strcpy(path, argv[argc - 1]);
|
||||
baselen = strlen(path);
|
||||
endp = &path[baselen];
|
||||
if (!baselen || *(endp - 1) != '/') {
|
||||
*endp++ = '/';
|
||||
++baselen;
|
||||
}
|
||||
*endp++ = '/';
|
||||
++baselen;
|
||||
for (rval = 0; --argc; ++argv) {
|
||||
/*
|
||||
* Find the last component of the source pathname. It
|
||||
@@ -147,7 +142,7 @@ do_move(from, to)
|
||||
char *from, *to;
|
||||
{
|
||||
struct stat sb;
|
||||
int ask, ch, first;
|
||||
int ask, ch;
|
||||
char modep[15];
|
||||
|
||||
/*
|
||||
@@ -162,47 +157,30 @@ do_move(from, to)
|
||||
warn("%s", from);
|
||||
return (1);
|
||||
}
|
||||
|
||||
#define YESNO "(y/n [n]) "
|
||||
|
||||
ask = 0;
|
||||
if (iflg) {
|
||||
(void)fprintf(stderr, "overwrite %s? %s", to, YESNO);
|
||||
(void)fprintf(stderr, "overwrite %s? ", to);
|
||||
ask = 1;
|
||||
} else if (access(to, W_OK) && !stat(to, &sb)) {
|
||||
strmode(sb.st_mode, modep);
|
||||
(void)fprintf(stderr, "override %s%s%s/%s for %s? %s",
|
||||
(void)fprintf(stderr, "override %s%s%s/%s for %s? ",
|
||||
modep + 1, modep[9] == ' ' ? "" : " ",
|
||||
user_from_uid(sb.st_uid, 0),
|
||||
group_from_gid(sb.st_gid, 0), to, YESNO);
|
||||
group_from_gid(sb.st_gid, 0), to);
|
||||
ask = 1;
|
||||
}
|
||||
if (ask) {
|
||||
first = ch = getchar();
|
||||
while (ch != '\n' && ch != EOF)
|
||||
ch = getchar();
|
||||
if (first != 'y' && first != 'Y') {
|
||||
(void)fprintf(stderr, "not overwritten\n");
|
||||
if ((ch = getchar()) != EOF && ch != '\n')
|
||||
while (getchar() != '\n');
|
||||
if (ch != 'y' && ch != 'Y')
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!rename(from, to))
|
||||
return (0);
|
||||
|
||||
if (errno == EXDEV) {
|
||||
struct statfs sfs;
|
||||
char path[MAXPATHLEN];
|
||||
|
||||
/* Can't mv(1) a mount point. */
|
||||
if (realpath(from, path) == NULL) {
|
||||
warnx("cannot resolve %s: %s", from, path);
|
||||
return (1);
|
||||
}
|
||||
if (!statfs(path, &sfs) && !strcmp(path, sfs.f_mntonname)) {
|
||||
warnx("cannot rename a mount point");
|
||||
return (1);
|
||||
}
|
||||
} else {
|
||||
if (errno != EXDEV) {
|
||||
warn("rename %s to %s", from, to);
|
||||
return (1);
|
||||
}
|
||||
@@ -270,8 +248,8 @@ err: if (unlink(to))
|
||||
|
||||
oldmode = sbp->st_mode & ALLPERMS;
|
||||
if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) {
|
||||
warn("%s: set owner/group (was: %lu/%lu)", to,
|
||||
(u_long)sbp->st_uid, (u_long)sbp->st_gid);
|
||||
warn("%s: set owner/group (was: %u/%u)", to, sbp->st_uid,
|
||||
sbp->st_gid);
|
||||
if (oldmode & (S_ISUID | S_ISGID)) {
|
||||
warnx(
|
||||
"%s: owner/group changed; clearing suid/sgid (mode was 0%03o)",
|
||||
@@ -349,7 +327,7 @@ void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: mv [-f | -i] source target",
|
||||
" mv [-f | -i] source ... directory");
|
||||
"usage: mv [-f | -i] src target",
|
||||
" mv [-f | -i] src1 ... srcN directory");
|
||||
exit(1);
|
||||
}
|
||||
+3
-1
@@ -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.4.2.2 1997/09/14 13:07:09 jkh Exp $
|
||||
* $Id: ar_io.c,v 1.4.2.1 1997/08/25 08:36:50 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,9 +42,11 @@ static char const sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mtio.h>
|
||||
#include <sys/param.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
+3
-2
@@ -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.4.2.2 1997/09/14 13:07:11 jkh Exp $
|
||||
* $Id: ar_subs.c,v 1.4.2.1 1997/08/25 08:36:51 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,6 +44,7 @@ static char const sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -742,7 +743,7 @@ copy()
|
||||
* set up the destination dir path and make sure it is a directory. We
|
||||
* make sure we have a trailing / on the destination
|
||||
*/
|
||||
dlen = l_strncpy(dirbuf, dirptr, sizeof(dirbuf) - 1);
|
||||
dlen = l_strncpy(dirbuf, dirptr, PAXPATHLEN);
|
||||
dest_pt = dirbuf + dlen;
|
||||
if (*(dest_pt-1) != '/') {
|
||||
*dest_pt++ = '/';
|
||||
|
||||
+4
-1
@@ -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.4.2.2 1997/09/14 13:07:13 jkh Exp $
|
||||
* $Id: buf_subs.c,v 1.4.2.1 1997/08/25 08:36:52 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,7 +42,10 @@ static char const sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
+3
-1
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cache.c,v 1.3.2.3 1997/09/14 13:07:15 jkh Exp $
|
||||
* $Id: cache.c,v 1.3.2.2 1997/08/25 08:36:54 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,7 +42,9 @@ static char const sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
|
||||
+2
-1
@@ -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.4.2.2 1997/09/14 13:07:17 jkh Exp $
|
||||
* $Id: cpio.c,v 1.4.2.1 1997/08/25 08:36:55 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,6 +44,7 @@ static char const sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+2
-1
@@ -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.4.2.2 1997/09/14 13:07:21 jkh Exp $
|
||||
* $Id: file_subs.c,v 1.4.2.1 1997/08/25 08:36:56 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -45,6 +45,7 @@ static char const sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+4
-3
@@ -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.4.2.3 1998/02/15 11:18:19 jkh Exp $
|
||||
* $Id: ftree.c,v 1.4.2.1 1997/08/25 08:36:57 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,6 +44,7 @@ static char const sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -506,14 +507,14 @@ next_file(arcn)
|
||||
* have to read the symlink path from the file
|
||||
*/
|
||||
if ((cnt = readlink(ftent->fts_path, arcn->ln_name,
|
||||
PAXPATHLEN - 1)) < 0) {
|
||||
PAXPATHLEN)) < 0) {
|
||||
sys_warn(1, errno, "Unable to read symlink %s",
|
||||
ftent->fts_path);
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* set link name length, watch out readlink does not
|
||||
* allways NUL terminate the link path
|
||||
* allways null terminate the link path
|
||||
*/
|
||||
arcn->ln_name[cnt] = '\0';
|
||||
arcn->ln_nlen = cnt;
|
||||
|
||||
+2
-1
@@ -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.6.2.1 1997/08/25 08:37:00 jkh Exp $
|
||||
* $Id: gen_subs.c,v 1.6 1995/10/23 21:23:14 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,6 +44,7 @@ static char const sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <utmp.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+3
-1
@@ -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.4.2.2 1997/09/14 13:07:25 jkh Exp $
|
||||
* $Id: options.c,v 1.4.2.1 1997/08/25 08:37:01 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,8 +42,10 @@ static char const sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mtio.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+3
-1
@@ -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.5.2.3 1997/09/14 13:07:27 jkh Exp $
|
||||
* $Id: pat_rep.c,v 1.5.2.2 1997/08/25 08:37:02 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,7 +42,9 @@ static char const sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+39
-40
@@ -34,7 +34,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
|
||||
.\" $Id: pax.1,v 1.3.2.2 1998/06/30 06:42:49 charnier Exp $
|
||||
.\" $Id: pax.1,v 1.2 1994/09/24 02:56:26 davidg Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt PAX 1
|
||||
@@ -194,7 +194,7 @@ The presence of the
|
||||
and the
|
||||
.Fl w
|
||||
options specifies which of the following functional modes
|
||||
.Nm
|
||||
.Nm pax
|
||||
will operate under:
|
||||
.Em list , read , write ,
|
||||
and
|
||||
@@ -284,7 +284,7 @@ While processing a damaged archive during a
|
||||
or
|
||||
.Em list
|
||||
operation,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will attempt to recover from media defects and will search through the archive
|
||||
to locate and process the largest number of archive members possible (see the
|
||||
.Fl E
|
||||
@@ -298,7 +298,7 @@ If the
|
||||
.Ar directory
|
||||
operand does not exist, or it is not writable by the user,
|
||||
or it is not of type directory,
|
||||
.Nm
|
||||
.Nm Pax
|
||||
will exit with a non-zero exit status.
|
||||
.Pp
|
||||
The
|
||||
@@ -317,7 +317,7 @@ be selected.
|
||||
When a
|
||||
.Ar pattern
|
||||
operand does not select at least one archive member,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will write these
|
||||
.Ar pattern
|
||||
operands in a diagnostic message to
|
||||
@@ -330,7 +330,7 @@ operand specifies the pathname of a file to be copied or archived.
|
||||
When a
|
||||
.Ar file
|
||||
operand does not select at least one archive member,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will write these
|
||||
.Ar file
|
||||
operand pathnames in a diagnostic message to
|
||||
@@ -357,7 +357,7 @@ and
|
||||
as the mode argument.
|
||||
When the selected archive format supports the specification of linked
|
||||
files and these files cannot be linked while the archive is being extracted,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will write a diagnostic message to
|
||||
.Dv standard error
|
||||
and exit with a non-zero exit status at the completion of operation.
|
||||
@@ -381,7 +381,7 @@ If an archive format is not specified with a
|
||||
option, the format currently being used in the archive will be selected.
|
||||
Any attempt to append to an archive in a format different from the
|
||||
format already used in the archive will cause
|
||||
.Nm
|
||||
.Nm pax
|
||||
to exit immediately
|
||||
with a non-zero exit status.
|
||||
The blocking size used in the archive volume where writing starts
|
||||
@@ -450,7 +450,7 @@ or
|
||||
.Em write ) .
|
||||
A single archive may span multiple files and different archive devices.
|
||||
When required,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will prompt for the pathname of the file or device of the next volume in the
|
||||
archive.
|
||||
.It Fl i
|
||||
@@ -460,7 +460,7 @@ For each archive member matching a
|
||||
operand or each file matching a
|
||||
.Ar file
|
||||
operand,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will prompt to
|
||||
.Pa /dev/tty
|
||||
giving the name of the file, its file mode and its modification time.
|
||||
@@ -569,7 +569,7 @@ nor the
|
||||
.Cm o
|
||||
specification character is specified, or the user ID and group ID are not
|
||||
preserved for any reason,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will not set the
|
||||
.Dv S_ISUID
|
||||
.Em ( setuid )
|
||||
@@ -578,7 +578,7 @@ and
|
||||
.Em ( setgid )
|
||||
bits of the file mode.
|
||||
If the preservation of any of these items fails for any reason,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will write a diagnostic message to
|
||||
.Dv standard error .
|
||||
Failure to preserve these items will affect the final exit status,
|
||||
@@ -636,9 +636,9 @@ File or archive member names that substitute to the empty string
|
||||
are not selected and will be skipped.
|
||||
.It Fl t
|
||||
Reset the access times of any file or directory read or accessed by
|
||||
.Nm
|
||||
.Nm pax
|
||||
to be the same as they were before being read or accessed by
|
||||
.Nm Ns .
|
||||
.Nm pax .
|
||||
.It Fl u
|
||||
Ignore files that are older (having a less recent file modification time)
|
||||
than a pre-existing file or archive member with the same name.
|
||||
@@ -699,7 +699,7 @@ standard.
|
||||
The default blocksize for this format is 5120 bytes.
|
||||
Inode and device information about a file (used for detecting file hard links
|
||||
by this format) which may be truncated by this format is detected by
|
||||
.Nm
|
||||
.Nm pax
|
||||
and is repaired.
|
||||
.It Ar bcpio
|
||||
The old binary cpio format.
|
||||
@@ -708,21 +708,21 @@ This format is not very portable and should not be used when other formats
|
||||
are available.
|
||||
Inode and device information about a file (used for detecting file hard links
|
||||
by this format) which may be truncated by this format is detected by
|
||||
.Nm
|
||||
.Nm pax
|
||||
and is repaired.
|
||||
.It Ar sv4cpio
|
||||
The System V release 4 cpio.
|
||||
The default blocksize for this format is 5120 bytes.
|
||||
Inode and device information about a file (used for detecting file hard links
|
||||
by this format) which may be truncated by this format is detected by
|
||||
.Nm
|
||||
.Nm pax
|
||||
and is repaired.
|
||||
.It Ar sv4crc
|
||||
The System V release 4 cpio with file crc checksums.
|
||||
The default blocksize for this format is 5120 bytes.
|
||||
Inode and device information about a file (used for detecting file hard links
|
||||
by this format) which may be truncated by this format is detected by
|
||||
.Nm
|
||||
.Nm pax
|
||||
and is repaired.
|
||||
.It Ar tar
|
||||
The old BSD tar format as found in BSD4.3.
|
||||
@@ -790,20 +790,20 @@ archives to
|
||||
.Ar limit .
|
||||
With a positive
|
||||
.Ar limit ,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will attempt to recover from an archive read error and will
|
||||
continue processing starting with the next file stored in the archive.
|
||||
A
|
||||
.Ar limit
|
||||
of 0 will cause
|
||||
.Nm
|
||||
.Nm pax
|
||||
to stop operation after the first read error is detected on an archive volume.
|
||||
A
|
||||
.Ar limit
|
||||
of
|
||||
.Li NONE
|
||||
will cause
|
||||
.Nm
|
||||
.Nm pax
|
||||
to attempt to recover from read errors forever.
|
||||
The default
|
||||
.Ar limit
|
||||
@@ -813,7 +813,7 @@ is a small positive number of retries.
|
||||
Using this option with
|
||||
.Li NONE
|
||||
should be used with extreme caution as
|
||||
.Nm
|
||||
.Nm pax
|
||||
may get stuck in an infinite loop on a very badly flawed archive.
|
||||
.It Fl G Ar group
|
||||
Select a file based on its
|
||||
@@ -857,7 +857,7 @@ only files with a modification or inode change time of exactly that
|
||||
time will be selected.
|
||||
.Pp
|
||||
When
|
||||
.Nm
|
||||
.Nm pax
|
||||
is in the
|
||||
.Em write
|
||||
or
|
||||
@@ -887,7 +887,7 @@ created and had their modification time reset to an older time (as what
|
||||
happens when a file is extracted from an archive and the modification time
|
||||
is preserved).
|
||||
Time comparisons using both file times is useful when
|
||||
.Nm
|
||||
.Nm pax
|
||||
is used to create a time based incremental archive (only files that were
|
||||
changed during a specified time range will be archived).
|
||||
.Pp
|
||||
@@ -1053,13 +1053,13 @@ gives the verbose table of contents for an archive stored in
|
||||
.Pa filename .
|
||||
.Pp
|
||||
The following commands:
|
||||
.Dl mkdir /tmp/foo
|
||||
.Dl cd /tmp/bar
|
||||
.Dl pax -rw .\ /tmp/foo
|
||||
.Dl mkdir newdir
|
||||
.Dl cd olddir
|
||||
.Dl pax -rw .\ newdir
|
||||
will copy the entire
|
||||
.Pa /tmp/bar
|
||||
.Pa olddir
|
||||
directory hierarchy to
|
||||
.Pa /tmp/foo .
|
||||
.Pa newdir .
|
||||
.Pp
|
||||
The command:
|
||||
.Dl pax -r -s ',^//*usr//*,,' -f a.pax
|
||||
@@ -1093,7 +1093,7 @@ files with the same name found in the source file tree
|
||||
.Pa home .
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm pax
|
||||
utility is a superset of the
|
||||
.St -p1003.2
|
||||
standard.
|
||||
@@ -1121,11 +1121,10 @@ and
|
||||
operations are extensions to the
|
||||
.Tn POSIX
|
||||
standard.
|
||||
.Sh AUTHORS
|
||||
.An Keith Muller
|
||||
at the University of California, San Diego
|
||||
.Sh AUTHOR
|
||||
Keith Muller at the University of California, San Diego
|
||||
.Sh ERRORS
|
||||
.Nm Pax
|
||||
.Nm pax
|
||||
will exit with one of the following values:
|
||||
.Bl -tag -width 2n
|
||||
.It 0
|
||||
@@ -1135,7 +1134,7 @@ An error occurred.
|
||||
.El
|
||||
.Pp
|
||||
Whenever
|
||||
.Nm
|
||||
.Nm pax
|
||||
cannot create a file or a link when reading an archive or cannot
|
||||
find a file when writing an archive, or cannot preserve the user ID,
|
||||
group ID, or file mode when the
|
||||
@@ -1144,28 +1143,28 @@ option is specified, a diagnostic message is written to
|
||||
.Dv standard error
|
||||
and a non-zero exit status will be returned, but processing will continue.
|
||||
In the case where pax cannot create a link to a file,
|
||||
.Nm
|
||||
.Nm pax
|
||||
will not create a second copy of the file.
|
||||
.Pp
|
||||
If the extraction of a file from an archive is prematurely terminated by
|
||||
a signal or error,
|
||||
.Nm
|
||||
.Nm pax
|
||||
may have only partially extracted a file the user wanted.
|
||||
Additionally, the file modes of extracted files and directories
|
||||
may have incorrect file bits, and the modification and access times may be
|
||||
wrong.
|
||||
.Pp
|
||||
If the creation of an archive is prematurely terminated by a signal or error,
|
||||
.Nm
|
||||
.Nm pax
|
||||
may have only partially created the archive which may violate the specific
|
||||
archive format specification.
|
||||
.Pp
|
||||
If while doing a
|
||||
.Em copy ,
|
||||
.Nm
|
||||
.Nm pax
|
||||
detects a file is about to overwrite itself, the file is not copied,
|
||||
a diagnostic message is written to
|
||||
.Dv standard error
|
||||
and when
|
||||
.Nm
|
||||
.Nm pax
|
||||
completes it will exit with a non-zero exit status.
|
||||
+6
-5
@@ -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.5.2.2 1997/09/14 13:07:29 jkh Exp $
|
||||
* $Id: pax.c,v 1.5.2.1 1997/08/25 08:37:03 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -47,16 +47,17 @@ static char const copyright[] =
|
||||
static char const sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
static int gen_init __P((void));
|
||||
|
||||
+2
-1
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sel_subs.c,v 1.3.2.2 1997/09/14 13:07:33 jkh Exp $
|
||||
* $Id: sel_subs.c,v 1.3.2.1 1997/08/25 08:37:04 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,6 +44,7 @@ static char const sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+4
-3
@@ -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.4.2.3 1997/09/14 13:07:34 jkh Exp $
|
||||
* $Id: tables.c,v 1.4.2.2 1997/08/25 08:37:05 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,12 +44,13 @@ static char const sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "tables.h"
|
||||
#include "extern.h"
|
||||
|
||||
+2
-1
@@ -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.4.2.2 1997/09/14 13:07:35 jkh Exp $
|
||||
* $Id: tar.c,v 1.4.2.1 1997/08/25 08:37:05 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,6 +44,7 @@ static char const sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+4
-1
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tty_subs.c,v 1.3.2.2 1997/09/14 13:07:37 jkh Exp $
|
||||
* $Id: tty_subs.c,v 1.3.2.1 1997/08/25 08:37:06 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,9 +42,12 @@ static char const sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
+2
-8
@@ -1,15 +1,9 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/2/93
|
||||
# $Id: Makefile,v 1.6.2.1 1997/10/16 12:44:17 mckay Exp $
|
||||
# $Id: Makefile,v 1.6 1995/10/25 15:07:38 torstenb Exp $
|
||||
|
||||
PROG= ps
|
||||
SRCS= fmt.c keyword.c nlist.c print.c ps.c
|
||||
#
|
||||
# To support "lazy" ps for non root/wheel users
|
||||
# add -DLAZY_PS to the cflags. This helps
|
||||
# keep ps from being an unnecessary load
|
||||
# on large systems.
|
||||
#
|
||||
CFLAGS+=-I${.CURDIR}/../../sys -DLAZY_PS
|
||||
CFLAGS+=-I${.CURDIR}/../../sys
|
||||
DPADD= ${LIBM} ${LIBKVM}
|
||||
LDADD= -lm -lkvm
|
||||
BINGRP= kmem
|
||||
|
||||
+1
-2
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.3 (Berkeley) 4/2/94
|
||||
* $Id: extern.h,v 1.3 1996/10/21 07:30:23 peter Exp $
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:56:42 davidg Exp $
|
||||
*/
|
||||
|
||||
struct kinfo;
|
||||
@@ -64,7 +64,6 @@ void parsefmt __P((char *));
|
||||
void pcpu __P((KINFO *, VARENT *));
|
||||
void pmem __P((KINFO *, VARENT *));
|
||||
void pri __P((KINFO *, VARENT *));
|
||||
void rtprior __P((KINFO *, VARENT *));
|
||||
void printheader __P((void));
|
||||
void pvar __P((KINFO *, VARENT *));
|
||||
void rssize __P((KINFO *, VARENT *));
|
||||
|
||||
+2
-11
@@ -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.6.2.1 1997/03/10 19:10:52 guido Exp $
|
||||
* $Id: fmt.c,v 1.6 1995/10/23 21:03:40 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -44,7 +44,6 @@ static char sccsid[] = "@(#)fmt.c 8.4 (Berkeley) 4/15/94";
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <vis.h>
|
||||
#include "ps.h"
|
||||
|
||||
@@ -59,16 +58,8 @@ static char *
|
||||
shquote(argv)
|
||||
char **argv;
|
||||
{
|
||||
long arg_max;
|
||||
char **p, *dst, *src;
|
||||
static char *buf = NULL;
|
||||
|
||||
if (buf == NULL) {
|
||||
if ((arg_max = sysconf(_SC_ARG_MAX)) == -1)
|
||||
errx(1, "sysconf _SC_ARG_MAX failed");
|
||||
if ((buf = malloc((4 * arg_max) + 1)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
}
|
||||
static char buf[4*ARG_MAX]; /* XXX */
|
||||
|
||||
if (*argv == 0) {
|
||||
buf[0] = 0;
|
||||
|
||||
+2
-2
@@ -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.9 1996/07/31 09:27:23 davidg Exp $
|
||||
* $Id: keyword.c,v 1.8 1995/10/28 20:11:15 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -139,7 +139,7 @@ VAR var[] = {
|
||||
{"rss", "RSS", NULL, 0, p_rssize, 4},
|
||||
{"rssize", "", "rsz"},
|
||||
{"rsz", "RSZ", NULL, 0, rssize, 4},
|
||||
{"rtprio", "RTPRIO", NULL, 0, rtprior, 7, POFF(p_rtprio)},
|
||||
{"rtprio", "RTPRIO", NULL, 0, pvar, 7, POFF(p_rtprio), LONG, "d"},
|
||||
{"ruid", "RUID", NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_ruid),
|
||||
ULONG, UIDFMT},
|
||||
{"ruser", "RUSER", NULL, LJUST, runame, USERLEN},
|
||||
|
||||
+2
-34
@@ -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.16.2.2 1997/08/03 08:33:17 peter Exp $
|
||||
* $Id: print.c,v 1.16.2.1 1997/04/16 16:10:48 jdp Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -164,13 +164,12 @@ logname(k, ve)
|
||||
VARENT *ve;
|
||||
{
|
||||
VAR *v;
|
||||
char *s;
|
||||
|
||||
v = ve->var;
|
||||
#ifndef NEWVM
|
||||
(void)printf("%-*s", v->width, KI_PROC(k)->p_logname);
|
||||
#else
|
||||
(void)printf("%-*s", v->width, (s = KI_EPROC(k)->e_login, *s) ? s : "-");
|
||||
(void)printf("%-*s", v->width, KI_EPROC(k)->e_login);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -658,37 +657,6 @@ trss(k, ve)
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
rtprior(k, ve)
|
||||
KINFO *k;
|
||||
VARENT *ve;
|
||||
{
|
||||
VAR *v;
|
||||
struct rtprio *prtp;
|
||||
char str[8];
|
||||
unsigned type, prio;
|
||||
|
||||
v = ve->var;
|
||||
prtp = (struct rtprio *) ((char *)KI_PROC(k) + v->off);
|
||||
prio = prtp->prio;
|
||||
switch (type = prtp->type) {
|
||||
case RTP_PRIO_REALTIME:
|
||||
snprintf(str, sizeof(str), "real:%u", prio);
|
||||
break;
|
||||
case RTP_PRIO_NORMAL:
|
||||
strncpy(str, "normal", sizeof(str));
|
||||
break;
|
||||
case RTP_PRIO_IDLE:
|
||||
snprintf(str, sizeof(str), "idle:%u", prio);
|
||||
break;
|
||||
default:
|
||||
snprintf(str, sizeof(str), "%u:%u", type, prio);
|
||||
break;
|
||||
}
|
||||
str[sizeof(str)-1] = '\0';
|
||||
(void)printf("%*s", v->width, str);
|
||||
}
|
||||
|
||||
/*
|
||||
* Generic output routines. Print fields from various prototype
|
||||
* structures.
|
||||
|
||||
+2
-4
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: ps.1,v 1.11.2.1 1997/08/21 02:54:28 jlemon Exp $
|
||||
.\" $Id: ps.1,v 1.11 1996/10/21 07:30:25 peter Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt PS 1
|
||||
@@ -40,7 +40,7 @@
|
||||
.Nd process status
|
||||
.Sh SYNOPSIS
|
||||
.Nm \&ps
|
||||
.Op Fl aCcefhjlmrSTuvwx
|
||||
.Op Fl aCcehjlmrSTuvwx
|
||||
.Op Fl M Ar core
|
||||
.Op Fl N Ar system
|
||||
.Op Fl O Ar fmt
|
||||
@@ -88,8 +88,6 @@ cpu calculation that ignores ``resident'' time (this normally has
|
||||
no effect).
|
||||
.It Fl e
|
||||
Display the environment as well.
|
||||
.It Fl f
|
||||
Work harder to get detailed process information.
|
||||
.It Fl h
|
||||
Repeat the information header as often as necessary to guarantee one
|
||||
header per page of information.
|
||||
|
||||
+6
-32
@@ -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.13.2.2 1997/06/06 16:09:12 charnier Exp $
|
||||
* $Id: ps.c,v 1.13.2.1 1996/11/11 21:23:15 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -84,12 +84,6 @@ int totwidth; /* calculated width of requested variables */
|
||||
|
||||
static int needuser, needcomm, needenv;
|
||||
|
||||
#if defined(LAZY_PS)
|
||||
static int forceuread=0;
|
||||
#else
|
||||
static int forceuread=1;
|
||||
#endif
|
||||
|
||||
enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT;
|
||||
|
||||
static char *fmt __P((char **(*)(kvm_t *, const struct kinfo_proc *, int),
|
||||
@@ -145,11 +139,7 @@ main(argc, argv)
|
||||
ttydev = NODEV;
|
||||
memf = nlistf = swapf = NULL;
|
||||
while ((ch = getopt(argc, argv,
|
||||
#if defined(LAZY_PS)
|
||||
"aCcefghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != EOF)
|
||||
#else
|
||||
"aCceghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != EOF)
|
||||
#endif
|
||||
switch((char)ch) {
|
||||
case 'a':
|
||||
all = 1;
|
||||
@@ -163,12 +153,6 @@ main(argc, argv)
|
||||
case 'e': /* XXX set ufmt */
|
||||
needenv = 1;
|
||||
break;
|
||||
#if defined(LAZY_PS)
|
||||
case 'f':
|
||||
if (getuid() == 0 || getgid() == 0)
|
||||
forceuread = 1;
|
||||
break;
|
||||
#endif
|
||||
case 'g':
|
||||
break; /* no-op */
|
||||
case 'h':
|
||||
@@ -409,8 +393,6 @@ fmt(fn, ki, comm, maxlen)
|
||||
return (s);
|
||||
}
|
||||
|
||||
#define UREADOK(ki) (forceuread || (KI_PROC(ki)->p_flag & P_INMEM))
|
||||
|
||||
static void
|
||||
saveuser(ki)
|
||||
KINFO *ki;
|
||||
@@ -420,7 +402,7 @@ saveuser(ki)
|
||||
struct user *u_addr = (struct user *)USRSTACK;
|
||||
|
||||
usp = &ki->ki_u;
|
||||
if (UREADOK(ki) && kvm_uread(kd, KI_PROC(ki), (unsigned long)&u_addr->u_stats,
|
||||
if (kvm_uread(kd, KI_PROC(ki), (unsigned long)&u_addr->u_stats,
|
||||
(char *)&pstats, sizeof(pstats)) == sizeof(pstats)) {
|
||||
/*
|
||||
* The u-area might be swapped out, and we can't get
|
||||
@@ -437,23 +419,15 @@ saveuser(ki)
|
||||
/*
|
||||
* save arguments if needed
|
||||
*/
|
||||
if (needcomm && UREADOK(ki)) {
|
||||
if (needcomm)
|
||||
ki->ki_args = fmt(kvm_getargv, ki, KI_PROC(ki)->p_comm,
|
||||
MAXCOMLEN);
|
||||
} else if (needcomm) {
|
||||
ki->ki_args = malloc(strlen(KI_PROC(ki)->p_comm) + 3);
|
||||
sprintf(ki->ki_args, "(%s)", KI_PROC(ki)->p_comm);
|
||||
} else {
|
||||
else
|
||||
ki->ki_args = NULL;
|
||||
}
|
||||
if (needenv && UREADOK(ki)) {
|
||||
if (needenv)
|
||||
ki->ki_env = fmt(kvm_getenvv, ki, (char *)NULL, 0);
|
||||
} else if (needenv) {
|
||||
ki->ki_env = malloc(3);
|
||||
strcpy(ki->ki_env, "()");
|
||||
} else {
|
||||
else
|
||||
ki->ki_env = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)pwd.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $Id: pwd.1,v 1.2.8.2 1998/06/30 06:43:02 charnier Exp $
|
||||
.\" $Id: pwd.1,v 1.5 1997/02/22 14:05:15 peter Exp $
|
||||
.\"
|
||||
.Dd April 28, 1995
|
||||
.Dt PWD 1
|
||||
@@ -44,14 +44,14 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm pwd
|
||||
.Sh DESCRIPTION
|
||||
.Nm Pwd
|
||||
.Nm
|
||||
writes the absolute pathname of the current working directory to
|
||||
the standard output.
|
||||
.Pp
|
||||
The pwd utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm pwd
|
||||
command is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+8
-10
@@ -1,25 +1,23 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 7/19/93
|
||||
# $Id$
|
||||
# $Id: Makefile,v 1.4 1994/09/29 13:06:00 csgr Exp $
|
||||
|
||||
PROG= rcp
|
||||
SRCS= rcp.c util.c
|
||||
CFLAGS+=-Wall
|
||||
|
||||
.if exists(${DESTDIR}/usr/lib/libkrb.a) && defined(MAKE_KERBEROS4)
|
||||
SRCS+= krcmd.c kcmd.c rcmd_util.c encrypt.c
|
||||
|
||||
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|
||||
|| defined(MAKE_EBONES))
|
||||
SRCS+= kcmd.c krcmd.c
|
||||
CFLAGS+=-DKERBEROS -DCRYPT
|
||||
DPADD= ${LIBKRB} ${LIBDES}
|
||||
CFLAGS+=-DKERBEROS -DCRYPT -DHAVE_CONFIG_H \
|
||||
-I${.CURDIR}/../../kerberosIV/include \
|
||||
-I${.CURDIR}/../../crypto/kerberosIV/include \
|
||||
-I${.CURDIR}/../../crypto/kerberosIV/lib/roken \
|
||||
-I${.CURDIR}/../../crypto/kerberosIV/appl/bsd
|
||||
LDADD= -lkrb -ldes
|
||||
DISTRIBUTION= krb
|
||||
.PATH: ${.CURDIR}/../../crypto/kerberosIV/appl/bsd
|
||||
.endif
|
||||
|
||||
BINOWN= root
|
||||
BINMODE=4555
|
||||
INSTALLFLAGS=-fschg
|
||||
|
||||
.PATH: ${.CURDIR}/../../usr.bin/rlogin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+1
-3
@@ -31,12 +31,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: pathnames.h,v 1.2 1994/09/24 02:56:55 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <paths.h>
|
||||
|
||||
#define _PATH_CP "/bin/cp"
|
||||
#define _PATH_RCP "/bin/rcp"
|
||||
#define _PATH_RLOGIN "/usr/bin/rlogin"
|
||||
#define _PATH_RSH "/usr/bin/rsh"
|
||||
+21
-14
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)rcp.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: rcp.1,v 1.2.8.1 1997/02/28 07:54:41 mpp Exp $
|
||||
.\" $Id: rcp.1,v 1.5 1997/02/22 14:05:21 peter Exp $
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt RCP 1
|
||||
@@ -58,21 +58,26 @@ argument is either a remote file name of the
|
||||
form ``rname@rhost:path'', or a local file name (containing no `:' characters,
|
||||
or a `/' before any `:'s).
|
||||
.Pp
|
||||
The following options are available:
|
||||
.Bl -tag -width indent
|
||||
.Bl -tag -width flag
|
||||
.It Fl K
|
||||
Turn off all Kerberos authentication.
|
||||
The
|
||||
.Fl K
|
||||
option turns off all Kerberos authentication.
|
||||
.It Fl k
|
||||
Request
|
||||
.Nm
|
||||
The
|
||||
.Fl k
|
||||
option requests
|
||||
.Nm rcp
|
||||
to obtain tickets
|
||||
for the remote host in realm
|
||||
.Ar realm
|
||||
instead of the remote host's realm as determined by
|
||||
.Xr krb_realmofhost 3 .
|
||||
.It Fl p
|
||||
Cause
|
||||
.Nm
|
||||
The
|
||||
.Fl p
|
||||
option causes
|
||||
.Nm rcp
|
||||
to attempt to preserve (duplicate) in its copies the modification
|
||||
times and modes of the source files, ignoring the
|
||||
.Ar umask .
|
||||
@@ -84,14 +89,16 @@ modified by the
|
||||
on the destination host is used.
|
||||
.It Fl r
|
||||
If any of the source files are directories,
|
||||
.Nm
|
||||
.Nm rcp
|
||||
copies each subtree rooted at that name; in this case
|
||||
the destination must be a directory.
|
||||
.It Fl x
|
||||
Turn on
|
||||
The
|
||||
.Fl x
|
||||
option turns on
|
||||
.Tn DES
|
||||
encryption for all data passed by
|
||||
.Nm Ns .
|
||||
.Nm rcp .
|
||||
This may impact response time and
|
||||
.Tn CPU
|
||||
utilization, but provides
|
||||
@@ -127,11 +134,11 @@ are on the current machine.
|
||||
.Xr rsh 1
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
.Nm rcp
|
||||
command appeared in
|
||||
.Bx 4.2 .
|
||||
The version of
|
||||
.Nm
|
||||
.Nm rcp
|
||||
described here
|
||||
has been reimplemented with Kerberos in
|
||||
.Bx 4.3 Reno .
|
||||
@@ -150,4 +157,4 @@ The destination user and hostname may have to be specified as
|
||||
``rhost.rname'' when the destination machine is running the
|
||||
.Bx 4.2
|
||||
version of
|
||||
.Nm Ns .
|
||||
.Nm rcp .
|
||||
+13
-26
@@ -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.8.2.4 1998/02/18 11:38:37 markm Exp $
|
||||
* $Id: rcp.c,v 1.8.2.2 1997/06/06 16:11:15 charnier Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -70,7 +70,9 @@ static char const sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
|
||||
|
||||
#ifdef KERBEROS
|
||||
#include <des.h>
|
||||
#include <krb.h>
|
||||
#include <kerberosIV/krb.h>
|
||||
|
||||
#include "../../usr.bin/rlogin/krb.h"
|
||||
|
||||
char dst_realm_buf[REALM_SZ];
|
||||
char *dest_realm = NULL;
|
||||
@@ -94,9 +96,6 @@ uid_t userid;
|
||||
int errs, rem;
|
||||
int pflag, iamremote, iamrecursive, targetshouldbedirectory;
|
||||
|
||||
static int argc_copy;
|
||||
static char **argv_copy;
|
||||
|
||||
#define CMDNEEDS 64
|
||||
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
|
||||
|
||||
@@ -120,24 +119,6 @@ main(argc, argv)
|
||||
struct servent *sp;
|
||||
int ch, fflag, tflag;
|
||||
char *targ, *shell;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Prepare for execing ourselves.
|
||||
*/
|
||||
|
||||
argc_copy = argc + 1;
|
||||
argv_copy = malloc((argc_copy + 1) * sizeof(*argv_copy));
|
||||
if (argv_copy == NULL)
|
||||
err(1, "malloc");
|
||||
argv_copy[0] = argv[0];
|
||||
argv_copy[1] = "-K";
|
||||
for(i = 1; i < argc; ++i) {
|
||||
argv_copy[i + 1] = strdup(argv[i]);
|
||||
if (argv_copy[i + 1] == NULL)
|
||||
errx(1, "strdup: out of memory");
|
||||
}
|
||||
argv_copy[argc + 1] = NULL;
|
||||
|
||||
fflag = tflag = 0;
|
||||
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
|
||||
@@ -363,7 +344,7 @@ tolocal(argc, argv)
|
||||
if (!(bp = malloc(len)))
|
||||
err(1, NULL);
|
||||
(void)snprintf(bp, len, "exec %s%s%s %s %s", _PATH_CP,
|
||||
iamrecursive ? " -PR" : "", pflag ? " -p" : "",
|
||||
iamrecursive ? " -r" : "", pflag ? " -p" : "",
|
||||
argv[i], argv[argc - 1]);
|
||||
if (susystem(bp, userid))
|
||||
++errs;
|
||||
@@ -793,8 +774,10 @@ int
|
||||
kerberos(host, bp, locuser, user)
|
||||
char **host, *bp, *locuser, *user;
|
||||
{
|
||||
struct servent *sp;
|
||||
|
||||
again:
|
||||
if (use_kerberos) {
|
||||
setuid(getuid());
|
||||
rem = KSUCCESS;
|
||||
errno = 0;
|
||||
if (dest_realm == NULL)
|
||||
@@ -808,11 +791,15 @@ kerberos(host, bp, locuser, user)
|
||||
krcmd(host, port, user, bp, 0, dest_realm);
|
||||
|
||||
if (rem < 0) {
|
||||
use_kerberos = 0;
|
||||
if ((sp = getservbyname("shell", "tcp")) == NULL)
|
||||
errx(1, "unknown service shell/tcp");
|
||||
if (errno == ECONNREFUSED)
|
||||
oldw("remote host doesn't support Kerberos");
|
||||
else if (errno == ENOENT)
|
||||
oldw("can't provide Kerberos authentication data");
|
||||
execv(_PATH_RCP, argv_copy);
|
||||
port = sp->s_port;
|
||||
goto again;
|
||||
}
|
||||
} else {
|
||||
#ifdef CRYPT
|
||||
|
||||
+8
-13
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)rm.1 8.2 (Berkeley) 4/18/94
|
||||
.\" $Id: rm.1,v 1.4.2.2 1997/04/09 05:05:46 mpp Exp $
|
||||
.\" $Id: rm.1,v 1.4.2.1 1997/04/08 20:43:37 mpp Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt RM 1
|
||||
@@ -44,11 +44,11 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm rm
|
||||
.Op Fl f | Fl i
|
||||
.Op Fl dPRrW
|
||||
.Op Fl dPRr
|
||||
.Ar file ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm rm
|
||||
utility attempts to remove the non-directory type files specified on the
|
||||
command line.
|
||||
If the permissions of the file do not permit writing, and the standard
|
||||
@@ -100,27 +100,23 @@ that directory is skipped.
|
||||
.It Fl r
|
||||
Equivalent to
|
||||
.Fl R .
|
||||
.It Fl W
|
||||
Attempt to undelete the named files.
|
||||
Currently, this option can only be used to recover
|
||||
files covered by whiteouts.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm rm
|
||||
utility removes symbolic links, not the files referenced by the links.
|
||||
.Pp
|
||||
It is an error to attempt to remove the files ``.'' and ``..''.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm rm
|
||||
utility exits 0 if all of the named files or file hierarchies were removed,
|
||||
or if the
|
||||
.Fl f
|
||||
option was specified and all of the existing files or file hierarchies were
|
||||
removed.
|
||||
If an error occurs,
|
||||
.Nm
|
||||
.Nm rm
|
||||
exits with a value >0.
|
||||
.Sh NOTE
|
||||
The
|
||||
@@ -145,7 +141,6 @@ This is useful for commands that do not use
|
||||
to parse the command line arguments.
|
||||
.Sh SEE ALSO
|
||||
.Xr rmdir 1 ,
|
||||
.Xr undelete 2 ,
|
||||
.Xr unlink 2 ,
|
||||
.Xr fts 3 ,
|
||||
.Xr getopt 3 ,
|
||||
@@ -160,7 +155,7 @@ In addition, only regular files are overwritten, other types of files
|
||||
are not.
|
||||
.Sh COMPATIBILITY
|
||||
The
|
||||
.Nm
|
||||
.Nm rm
|
||||
utility differs from historical implementations in that the
|
||||
.Fl f
|
||||
option only masks attempts to remove non-existent files instead of
|
||||
@@ -172,7 +167,7 @@ implementations prompted on the standard output,
|
||||
not the standard error output.
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm rm
|
||||
command is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+19
-23
@@ -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.11.2.1 1997/12/03 05:40:08 imp Exp $
|
||||
* $Id: rm.c,v 1.10 1996/02/19 05:57:22 pst Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -81,8 +81,8 @@ main(argc, argv)
|
||||
{
|
||||
int ch, rflag;
|
||||
|
||||
Pflag = rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "dfiPRr")) != -1)
|
||||
rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "dfiPRr")) != EOF)
|
||||
switch(ch) {
|
||||
case 'd':
|
||||
dflag = 1;
|
||||
@@ -112,17 +112,16 @@ main(argc, argv)
|
||||
usage();
|
||||
|
||||
checkdot(argv);
|
||||
if (!*argv)
|
||||
exit (eval);
|
||||
|
||||
stdin_ok = isatty(STDIN_FILENO);
|
||||
uid = geteuid();
|
||||
|
||||
if (*argv) {
|
||||
stdin_ok = isatty(STDIN_FILENO);
|
||||
|
||||
if (rflag)
|
||||
rm_tree(argv);
|
||||
else
|
||||
rm_file(argv);
|
||||
}
|
||||
|
||||
if (rflag)
|
||||
rm_tree(argv);
|
||||
else
|
||||
rm_file(argv);
|
||||
exit (eval);
|
||||
}
|
||||
|
||||
@@ -133,14 +132,13 @@ rm_tree(argv)
|
||||
FTS *fts;
|
||||
FTSENT *p;
|
||||
int needstat;
|
||||
int flags;
|
||||
int rval;
|
||||
|
||||
/*
|
||||
* Remove a file hierarchy. If forcing removal (-f), or interactive
|
||||
* (-i) or can't ask anyway (stdin_ok), don't stat the file.
|
||||
*/
|
||||
needstat = !uid || (!fflag && !iflag && stdin_ok);
|
||||
needstat = !uid || !fflag && !iflag && stdin_ok;
|
||||
|
||||
/*
|
||||
* If the -i option is specified, the user can skip on the pre-order
|
||||
@@ -178,7 +176,7 @@ rm_tree(argv)
|
||||
continue;
|
||||
case FTS_D:
|
||||
/* Pre-order: give user chance to skip. */
|
||||
if (!fflag && !check(p->fts_path, p->fts_accpath,
|
||||
if (iflag && !check(p->fts_path, p->fts_accpath,
|
||||
p->fts_statp)) {
|
||||
(void)fts_set(fts, p, FTS_SKIP);
|
||||
p->fts_number = SKIPPED;
|
||||
@@ -195,11 +193,10 @@ rm_tree(argv)
|
||||
if (p->fts_number == SKIPPED)
|
||||
continue;
|
||||
break;
|
||||
default:
|
||||
if (!fflag &&
|
||||
!check(p->fts_path, p->fts_accpath, p->fts_statp))
|
||||
continue;
|
||||
}
|
||||
if (!fflag &&
|
||||
!check(p->fts_path, p->fts_accpath, p->fts_statp))
|
||||
continue;
|
||||
|
||||
rval = 0;
|
||||
if (!uid &&
|
||||
@@ -360,9 +357,9 @@ check(path, name, sp)
|
||||
* first because we may not have stat'ed the file.
|
||||
*/
|
||||
if (!stdin_ok || S_ISLNK(sp->st_mode) ||
|
||||
(!access(name, W_OK) &&
|
||||
!access(name, W_OK) &&
|
||||
!(sp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
|
||||
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid)))
|
||||
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid))
|
||||
return (1);
|
||||
strmode(sp->st_mode, modep);
|
||||
strcpy(flagsp, flags_to_string(sp->st_flags, NULL));
|
||||
@@ -401,8 +398,7 @@ checkdot(argv)
|
||||
if (!complained++)
|
||||
warnx("\".\" and \"..\" may not be removed");
|
||||
eval = 1;
|
||||
for (save = t; (t[0] = t[1]) != NULL; ++t)
|
||||
continue;
|
||||
for (save = t; (t[0] = t[1]) != NULL; ++t);
|
||||
t = save;
|
||||
} else
|
||||
++t;
|
||||
|
||||
+6
-6
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)rmail.8 6.10 (Berkeley) 4/29/93
|
||||
.\" $Id: rmail.8,v 1.2.8.2 1998/06/30 06:43:18 charnier Exp $
|
||||
.\" $Id: rmail.8,v 1.5 1997/02/22 14:05:30 peter Exp $
|
||||
.\"
|
||||
.Dd April 29, 1993
|
||||
.Dt RMAIL 8
|
||||
@@ -42,7 +42,7 @@
|
||||
.Nm rmail
|
||||
.Ar user ...
|
||||
.Sh DESCRIPTION
|
||||
.Nm Rmail
|
||||
.Nm
|
||||
interprets incoming mail received via
|
||||
.Xr uucp 1 ,
|
||||
collapsing ``From'' lines in the form generated
|
||||
@@ -52,18 +52,18 @@ into a single line of the form ``return-path!sender'',
|
||||
and passing the processed mail on to
|
||||
.Xr sendmail 8 .
|
||||
.Pp
|
||||
.Nm Rmail
|
||||
.Nm
|
||||
is explicitly designed for use with
|
||||
.Xr uucp 1
|
||||
.Xr uucp
|
||||
and
|
||||
.Xr sendmail 8 .
|
||||
.Xr sendmail .
|
||||
.Sh SEE ALSO
|
||||
.Xr uucp 1 ,
|
||||
.Xr mail.local 8 ,
|
||||
.Xr sendmail 8
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
.Nm rmail
|
||||
program appeared in
|
||||
.Bx 4.2 .
|
||||
.Sh BUGS
|
||||
|
||||
+6
-8
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)rmdir.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: rmdir.1,v 1.3.2.2 1998/06/30 06:42:35 charnier Exp $
|
||||
.\" $Id: rmdir.1,v 1.3 1996/08/29 18:06:08 wosch Exp $
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt RMDIR 1
|
||||
@@ -46,9 +46,7 @@
|
||||
.Op Fl p
|
||||
.Ar directory ...
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
utility removes the directory entry specified by
|
||||
The rmdir utility removes the directory entry specified by
|
||||
each
|
||||
.Ar directory
|
||||
argument, provided it is empty.
|
||||
@@ -58,11 +56,11 @@ In order to remove both a parent directory and a subdirectory
|
||||
of that parent, the subdirectory
|
||||
must be specified first so the parent directory
|
||||
is empty when
|
||||
.Nm
|
||||
.Nm rmdir
|
||||
tries to remove it.
|
||||
.Pp
|
||||
The following option is available:
|
||||
.Bl -tag -width indent
|
||||
.Bl -tag -width Ds
|
||||
.It Fl p
|
||||
Each
|
||||
.Ar directory
|
||||
@@ -75,7 +73,7 @@ for fully non-discriminant recursive removal.)
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm rmdir
|
||||
utility exits with one of the following values:
|
||||
.Bl -tag -width Ds
|
||||
.It Li \&0
|
||||
@@ -89,7 +87,7 @@ An error occurred.
|
||||
.Xr rm 1
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm rmdir
|
||||
command is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
||||
+10
-6
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rmdir.c,v 1.2.8.1 1997/08/25 08:43:06 jkh Exp $
|
||||
* $Id: rmdir.c,v 1.2 1994/09/24 02:57:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -40,11 +40,7 @@ static char const copyright[] =
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
static char const sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
@@ -82,6 +78,14 @@ main(argc, argv)
|
||||
usage();
|
||||
|
||||
for (errors = 0; *argv; argv++) {
|
||||
char *p;
|
||||
|
||||
/* Delete trailing slashes, per POSIX. */
|
||||
p = *argv + strlen(*argv);
|
||||
while (--p > *argv && *p == '/')
|
||||
;
|
||||
*++p = '\0';
|
||||
|
||||
if (rmdir(*argv) < 0) {
|
||||
warn("%s", *argv);
|
||||
errors = 1;
|
||||
|
||||
+6
-9
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.4 (Berkeley) 5/5/95
|
||||
# $Id: Makefile,v 1.15.2.2 1997/08/25 21:16:13 jkh Exp $
|
||||
# $Id: Makefile,v 1.15.2.1 1997/08/25 09:09:28 jkh Exp $
|
||||
|
||||
PROG= sh
|
||||
SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \
|
||||
@@ -7,8 +7,7 @@ SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \
|
||||
mystring.c options.c output.c parser.c printf.c redir.c show.c \
|
||||
trap.c var.c
|
||||
GENSRCS= arith.c arith_lex.c builtins.c init.c nodes.c syntax.c
|
||||
GENHDRS= builtins.h nodes.h syntax.h token.h
|
||||
SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
|
||||
SRCS= ${SHSRCS} ${GENSRCS}
|
||||
|
||||
DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
|
||||
LDADD+= -ll -ledit -ltermcap
|
||||
@@ -20,13 +19,13 @@ CFLAGS+=-DSHELL -I. -I${.CURDIR}
|
||||
|
||||
.PATH: ${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
|
||||
|
||||
CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
|
||||
CLEANFILES+= builtins.h mkinit mkinit.o mknodes mknodes.o \
|
||||
mksyntax mksyntax.o \
|
||||
y.tab.h
|
||||
CLEANFILES+= ${GENSRCS} ${GENHDRS}
|
||||
nodes.h syntax.h token.h y.tab.h
|
||||
CLEANFILES+= ${GENSRCS}
|
||||
|
||||
beforedepend: builtins.h nodes.h syntax.h token.h
|
||||
|
||||
.ORDER: builtins.c builtins.h
|
||||
builtins.c builtins.h: mkbuiltins builtins.def
|
||||
cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
|
||||
|
||||
@@ -46,11 +45,9 @@ mknodes.o: mknodes.c # XXX and many headers
|
||||
mksyntax: mksyntax.o
|
||||
mksyntax.o: mksyntax.c # XXX and many headers
|
||||
|
||||
.ORDER: nodes.c nodes.h
|
||||
nodes.c nodes.h: mknodes nodetypes nodes.c.pat
|
||||
./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
|
||||
|
||||
.ORDER: syntax.c syntax.h
|
||||
syntax.c syntax.h: mksyntax
|
||||
./mksyntax
|
||||
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
char *getpwd __P((void));
|
||||
+2
-5
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: eval.c,v 1.7.2.3 1997/08/25 09:09:42 jkh Exp $
|
||||
* $Id: eval.c,v 1.7.2.2 1997/05/13 19:18:56 steve Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -764,10 +764,7 @@ evalcommand(cmd, flags, backcmd)
|
||||
for (sp = varlist.list ; sp ; sp = sp->next)
|
||||
mklocal(sp->text);
|
||||
funcnest++;
|
||||
if (flags & EV_TESTED)
|
||||
evaltree(cmdentry.u.func, EV_TESTED);
|
||||
else
|
||||
evaltree(cmdentry.u.func, 0);
|
||||
evaltree(cmdentry.u.func, 0);
|
||||
funcnest--;
|
||||
INTOFF;
|
||||
poplocalvars();
|
||||
|
||||
+2
-1
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: jobs.c,v 1.8.2.3 1997/08/25 09:10:00 jkh Exp $
|
||||
* $Id: jobs.c,v 1.8.2.2 1997/08/17 14:47:33 joerg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -45,6 +45,7 @@ static char const sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#ifdef BSD
|
||||
#include <sys/wait.h>
|
||||
|
||||
+4
-63
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: miscbltin.c,v 1.8.2.1 1997/08/25 09:10:10 jkh Exp $
|
||||
* $Id: miscbltin.c,v 1.8 1996/09/03 14:24:44 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -52,7 +52,6 @@ static char const sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "shell.h"
|
||||
#include "options.h"
|
||||
@@ -89,43 +88,14 @@ readcmd(argc, argv)
|
||||
int startword;
|
||||
int status;
|
||||
int i;
|
||||
struct timeval tv;
|
||||
char *tvptr;
|
||||
fd_set ifds;
|
||||
struct termios told, tnew;
|
||||
int tsaved;
|
||||
|
||||
eflag = 0;
|
||||
prompt = NULL;
|
||||
tv.tv_sec = -1;
|
||||
tv.tv_usec = 0;
|
||||
while ((i = nextopt("ep:t:")) != '\0') {
|
||||
switch(i) {
|
||||
case 'p':
|
||||
while ((i = nextopt("ep:")) != '\0') {
|
||||
if (i == 'p')
|
||||
prompt = optarg;
|
||||
break;
|
||||
case 'e':
|
||||
else
|
||||
eflag = 1;
|
||||
break;
|
||||
case 't':
|
||||
tv.tv_sec = strtol(optarg, &tvptr, 0);
|
||||
if (tvptr == optarg)
|
||||
error("timeout value");
|
||||
switch(*tvptr) {
|
||||
case 0:
|
||||
case 's':
|
||||
break;
|
||||
case 'h':
|
||||
tv.tv_sec *= 60;
|
||||
/* FALLTHROUGH */
|
||||
case 'm':
|
||||
tv.tv_sec *= 60;
|
||||
break;
|
||||
default:
|
||||
error("timeout unit");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (prompt && isatty(0)) {
|
||||
out2str(prompt);
|
||||
@@ -135,35 +105,6 @@ readcmd(argc, argv)
|
||||
error("arg count");
|
||||
if ((ifs = bltinlookup("IFS", 1)) == NULL)
|
||||
ifs = nullstr;
|
||||
|
||||
if (tv.tv_sec >= 0) {
|
||||
/*
|
||||
* See if we can disable input processing; this will
|
||||
* not give the desired result if we are in a pipeline
|
||||
* and someone upstream is still in line-by-line mode.
|
||||
*/
|
||||
tsaved = 0;
|
||||
if (tcgetattr(0, &told) == 0) {
|
||||
memcpy(&tnew, &told, sizeof(told));
|
||||
cfmakeraw(&tnew);
|
||||
tcsetattr(0, TCSANOW, &tnew);
|
||||
tsaved = 1;
|
||||
}
|
||||
/*
|
||||
* Wait for something to become available.
|
||||
*/
|
||||
FD_ZERO(&ifds);
|
||||
FD_SET(0, &ifds);
|
||||
status = select(1, &ifds, NULL, NULL, &tv);
|
||||
if (tsaved)
|
||||
tcsetattr(0, TCSANOW, &told);
|
||||
/*
|
||||
* If there's nothing ready, return an error.
|
||||
*/
|
||||
if (status <= 0)
|
||||
return(1);
|
||||
}
|
||||
|
||||
status = 0;
|
||||
startword = 1;
|
||||
backslash = 0;
|
||||
|
||||
+5
-25
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
||||
.\" $Id: sh.1,v 1.9.2.8 1998/02/15 11:32:26 jkh Exp $
|
||||
.\" $Id: sh.1,v 1.9.2.3 1997/08/25 21:22:27 jkh Exp $
|
||||
.\"
|
||||
.Dd May 5, 1995
|
||||
.Dt SH 1
|
||||
@@ -48,7 +48,7 @@
|
||||
.Op Fl c Ar string
|
||||
.Op Ar arg ...
|
||||
.Sh DESCRIPTION
|
||||
.Nm Sh
|
||||
.Nm sh
|
||||
is the standard command interpreter for the system.
|
||||
The current version of
|
||||
.Nm
|
||||
@@ -453,10 +453,6 @@ error, or a false indication. The man page for each command
|
||||
should indicate the various exit codes and what they mean.
|
||||
Additionally, the builtin commands return exit codes, as does
|
||||
an executed shell function.
|
||||
.Pp
|
||||
If a command is terminated by a signal, its exit status is 128 plus
|
||||
the signal number. Signal numbers are defined in the header file
|
||||
.Aq Pa sys/signal.h .
|
||||
.Ss Complex Commands
|
||||
Complex commands are combinations of simple commands
|
||||
with control operators or reserved words, together creating a larger complex
|
||||
@@ -627,7 +623,7 @@ slightly more efficient.
|
||||
Grouping commands together this way allows you to
|
||||
redirect their output as though they were one program:
|
||||
.Bd -literal -offset indent
|
||||
{ echo -n "hello"; echo " world"; } > greeting
|
||||
{ echo -n "hello"; echo " world" } > greeting
|
||||
.Ed
|
||||
.Ss Functions
|
||||
The syntax of a function definition is
|
||||
@@ -974,15 +970,6 @@ etc).
|
||||
A null command that returns a 0 (true) exit value.
|
||||
.It \&. file
|
||||
The commands in the specified file are read and executed by the shell.
|
||||
If
|
||||
.Ar file
|
||||
contains any
|
||||
.Ql /
|
||||
characters, it is used as is. Otherwise, the shell searches the
|
||||
.Ev PATH
|
||||
for the file. If it is not found in the
|
||||
.Ev PATH ,
|
||||
it is sought in the current working directory.
|
||||
.It alias [ name[=string] ... ]
|
||||
If name=string is specified, the shell defines the
|
||||
alias ``name'' with value ``string''. If just ``name''
|
||||
@@ -1092,7 +1079,7 @@ The following environment variables affect the execution of fc:
|
||||
.It Va FCEDIT
|
||||
Name of the editor to use.
|
||||
.It Va HISTSIZE
|
||||
The number of previous commands that are accessible.
|
||||
The number of previous commands that are accessable.
|
||||
.El
|
||||
.It fg [ job ]
|
||||
Move the specified job or the current job to the
|
||||
@@ -1136,7 +1123,7 @@ is rather than recomputing it each time. This makes
|
||||
it faster. However, if the current directory is
|
||||
renamed, the builtin version of pwd will continue to
|
||||
print the old name for the directory.
|
||||
.It Li "read [ -p prompt ] [ -t timeout ] [ -e ] variable ...
|
||||
.It read [ -p prompt ] [ -e ] variable ...
|
||||
The prompt is printed if the -p option is specified
|
||||
and the standard input is a terminal. Then a line is
|
||||
read from the standard input. The trailing newline
|
||||
@@ -1149,13 +1136,6 @@ separated them) are assigned to the last variable.
|
||||
If there are more variables than pieces, the remaining
|
||||
variables are assigned the null string.
|
||||
.Pp
|
||||
If the -t option is specified the timeout elapses
|
||||
before any input is supplied, the read command will
|
||||
return without assigning any values. The timeout value
|
||||
may optionally be followed by one of 's', 'm' or 'h' to
|
||||
explicitly specify seconds, minutes or or hours. If none
|
||||
is supplied, 's' is assumed.
|
||||
.Pp
|
||||
The -e option causes any backslashes in the input to
|
||||
be treated specially. If a backslash is followed by
|
||||
a newline, the backslash and the newline will be
|
||||
|
||||
+6
-12
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: trap.c,v 1.4.2.1 1997/08/25 09:10:46 jkh Exp $
|
||||
* $Id: trap.c,v 1.4 1996/09/01 10:21:47 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -205,12 +205,12 @@ clear_traps()
|
||||
* Set the signal handler for the specified signal. The routine figures
|
||||
* out what it should be set to.
|
||||
*/
|
||||
void
|
||||
long
|
||||
setsignal(signo)
|
||||
int signo;
|
||||
{
|
||||
int action;
|
||||
sig_t sig, sigact = SIG_DFL;
|
||||
sig_t sigact = SIG_DFL;
|
||||
char *t;
|
||||
|
||||
if ((t = trap[signo]) == NULL)
|
||||
@@ -260,7 +260,7 @@ setsignal(signo)
|
||||
* here, but other shells don't. We don't alter
|
||||
* sigmode, so that we retry every time.
|
||||
*/
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
if (sigact == SIG_IGN) {
|
||||
if (mflag && (signo == SIGTSTP ||
|
||||
@@ -273,18 +273,14 @@ setsignal(signo)
|
||||
}
|
||||
}
|
||||
if (*t == S_HARD_IGN || *t == action)
|
||||
return;
|
||||
return 0;
|
||||
switch (action) {
|
||||
case S_DFL: sigact = SIG_DFL; break;
|
||||
case S_CATCH: sigact = onsig; break;
|
||||
case S_IGN: sigact = SIG_IGN; break;
|
||||
}
|
||||
*t = action;
|
||||
sig = signal(signo, sigact);
|
||||
#ifdef BSD
|
||||
if (sig != SIG_ERR && action == S_CATCH)
|
||||
siginterrupt(signo, 1);
|
||||
#endif
|
||||
return (long)signal(signo, sigact);
|
||||
}
|
||||
|
||||
|
||||
@@ -344,9 +340,7 @@ onsig(signo)
|
||||
int signo;
|
||||
{
|
||||
|
||||
#ifndef BSD
|
||||
signal(signo, onsig);
|
||||
#endif
|
||||
if (signo == SIGINT && trap[SIGINT] == NULL) {
|
||||
onint();
|
||||
return;
|
||||
|
||||
+2
-2
@@ -34,14 +34,14 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)trap.h 8.3 (Berkeley) 6/5/95
|
||||
* $Id: trap.h,v 1.3.2.1 1997/08/25 09:10:48 jkh Exp $
|
||||
* $Id: trap.h,v 1.3 1996/09/01 10:21:50 peter Exp $
|
||||
*/
|
||||
|
||||
extern int pendingsigs;
|
||||
|
||||
int trapcmd __P((int, char **));
|
||||
void clear_traps __P((void));
|
||||
void setsignal __P((int));
|
||||
long setsignal __P((int));
|
||||
void ignoresig __P((int));
|
||||
void onsig __P((int));
|
||||
void dotrap __P((void));
|
||||
|
||||
+5
-5
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)sleep.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: sleep.1,v 1.2.8.3 1998/06/30 06:43:08 charnier Exp $
|
||||
.\" $Id: sleep.1,v 1.2.8.1 1997/02/28 07:54:48 mpp Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt SLEEP 1
|
||||
@@ -46,17 +46,17 @@
|
||||
.Ar seconds
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm sleep
|
||||
command
|
||||
suspends execution for a minimum of
|
||||
.Ar seconds .
|
||||
.Nm Sleep
|
||||
.Nm
|
||||
is used to schedule the execution of other commands (see
|
||||
.Sx EXAMPLES
|
||||
below).
|
||||
.Pp
|
||||
If the
|
||||
.Nm
|
||||
.Nm sleep
|
||||
command
|
||||
receives a SIGALRM signal, it terminates normally with a zero exit status,
|
||||
for any other signal it takes the standard action.
|
||||
@@ -117,7 +117,7 @@ awk job.
|
||||
.Xr sleep 3
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm sleep
|
||||
command is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
+3
-5
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: gfmt.c,v 1.4.6.1 1997/08/25 09:24:02 jkh Exp $
|
||||
* $Id: gfmt.c,v 1.4 1995/05/30 00:07:26 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -65,12 +65,10 @@ gprint(tp, wp, ldisc)
|
||||
struct cchar *cp;
|
||||
|
||||
(void)printf("gfmt1:cflag=%lx:iflag=%lx:lflag=%lx:oflag=%lx:",
|
||||
(u_long)tp->c_cflag, (u_long)tp->c_iflag, (u_long)tp->c_lflag,
|
||||
(u_long)tp->c_oflag);
|
||||
tp->c_cflag, tp->c_iflag, tp->c_lflag, tp->c_oflag);
|
||||
for (cp = cchars1; cp->name; ++cp)
|
||||
(void)printf("%s=%x:", cp->name, tp->c_cc[cp->sub]);
|
||||
(void)printf("ispeed=%lu:ospeed=%lu\n",
|
||||
(u_long)cfgetispeed(tp), (u_long)cfgetospeed(tp));
|
||||
(void)printf("ispeed=%ld:ospeed=%ld\n", cfgetispeed(tp), cfgetospeed(tp));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: key.c,v 1.4.6.2 1997/08/25 09:24:04 jkh Exp $
|
||||
* $Id: key.c,v 1.4.6.1 1996/12/10 16:40:37 joerg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -286,7 +286,7 @@ f_speed(ip)
|
||||
struct info *ip;
|
||||
{
|
||||
|
||||
(void)printf("%lu\n", (u_long)cfgetospeed(&ip->t));
|
||||
(void)printf("%ld\n", cfgetospeed(&ip->t));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+3
-5
@@ -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.5.6.1 1997/08/25 09:24:08 jkh Exp $
|
||||
* $Id: print.c,v 1.5 1995/05/30 00:07:27 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -205,10 +205,8 @@ print(tp, wp, ldisc, fmt)
|
||||
if (fmt != BSD && cc[p->sub] == p->def)
|
||||
continue;
|
||||
#define WD "%-8s"
|
||||
(void)snprintf(buf1 + cnt * 8, sizeof(buf1) - cnt * 8,
|
||||
WD, p->name);
|
||||
(void)snprintf(buf2 + cnt * 8, sizeof(buf2) - cnt * 8,
|
||||
WD, ccval(p, cc[p->sub]));
|
||||
(void)sprintf(buf1 + cnt * 8, WD, p->name);
|
||||
(void)sprintf(buf2 + cnt * 8, WD, ccval(p, cc[p->sub]));
|
||||
if (++cnt == LINELENGTH / 8) {
|
||||
cnt = 0;
|
||||
(void)printf("%s\n", buf1);
|
||||
|
||||
+8
-10
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)stty.1 8.4 (Berkeley) 4/18/94
|
||||
.\" $Id: stty.1,v 1.4.2.4 1998/06/30 06:43:23 charnier Exp $
|
||||
.\" $Id: stty.1,v 1.4.2.1 1997/03/12 16:00:05 mpp Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt STTY 1
|
||||
@@ -48,7 +48,7 @@
|
||||
.Op operands
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
.Nm stty
|
||||
utility sets or reports on terminal
|
||||
characteristics for the device that is its standard input.
|
||||
If no options or operands are specified, it reports the settings of a subset
|
||||
@@ -60,7 +60,7 @@ Some combinations of arguments are mutually
|
||||
exclusive on some terminal types.
|
||||
.Pp
|
||||
The following options are available:
|
||||
.Bl -tag -width indent
|
||||
.Bl -tag -width Ds
|
||||
.It Fl a
|
||||
Display all the current settings for the terminal to standard output
|
||||
as per
|
||||
@@ -84,7 +84,7 @@ block on the open.
|
||||
.It Fl g
|
||||
Display all the current settings for the terminal to standard output
|
||||
in a form that may be used as an argument to a subsequent invocation of
|
||||
.Nm
|
||||
.Nm stty
|
||||
to restore the current terminal state as per
|
||||
.St -p1003.2 .
|
||||
.El
|
||||
@@ -146,7 +146,7 @@ Enable (disable) the receiver.
|
||||
Assume a line without (with) modem
|
||||
control.
|
||||
.It Cm crtscts Pq Fl crtscts
|
||||
Enable (disable) RTS/CTS flow control.
|
||||
Enable RTS/CTS flow control.
|
||||
.El
|
||||
.Ss Input Modes:
|
||||
This corresponds to the c_iflag in the termios structure.
|
||||
@@ -493,9 +493,7 @@ first rows, then columns.
|
||||
.Ss Compatibility Modes:
|
||||
.Pp
|
||||
These modes remain for compatibility with the previous version of
|
||||
the
|
||||
.Nm
|
||||
command.
|
||||
the stty command.
|
||||
.Bl -tag -width Fl
|
||||
.It Cm all
|
||||
Reports all the terminal modes as with
|
||||
@@ -566,13 +564,13 @@ Same as the control character
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
.Nm stty
|
||||
utility exits with a value of 0 if successful, and >0 if an error occurs.
|
||||
.Sh SEE ALSO
|
||||
.Xr termios 4
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
.Nm stty
|
||||
function is expected to be
|
||||
.St -p1003.2
|
||||
compatible. The flags
|
||||
|
||||
+5
-5
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)sync.8 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: sync.8,v 1.3.2.2 1998/06/30 06:42:40 charnier Exp $
|
||||
.\" $Id: sync.8,v 1.3 1996/02/12 00:45:47 mpp Exp $
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt SYNC 8
|
||||
@@ -48,14 +48,14 @@ processor is halted in a way not suitably done by
|
||||
or
|
||||
.Xr halt 8 .
|
||||
Generally, it is preferable to use
|
||||
.Xr reboot 8
|
||||
.Xr reboot
|
||||
or
|
||||
.Xr halt 8
|
||||
.Xr halt
|
||||
to shut down the system,
|
||||
as they may perform additional actions
|
||||
such as resynchronizing the hardware clock
|
||||
and flushing internal caches before performing a final
|
||||
.Nm Ns .
|
||||
.Nm sync .
|
||||
.Pp
|
||||
.Nm Sync
|
||||
utilizes the
|
||||
@@ -69,6 +69,6 @@ function call.
|
||||
.Xr reboot 8
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm
|
||||
.Nm sync
|
||||
command appeared in
|
||||
.At v6 .
|
||||
Loaded 100 of 3578 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user