From f5c4671bfbad96bf346bd7e9a21fc4317b4959df Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 3 Dec 2022 17:00:20 +0530 Subject: Adds most of the tools --- .../5.3.0/coreutils-5.3.0-GnuWin32.README | 151 + .../coreutils/5.3.0/coreutils-5.3.0-src/ABOUT-NLS | 716 + .../coreutils/5.3.0/coreutils-5.3.0-src/AUTHORS | 92 + .../coreutils/5.3.0/coreutils-5.3.0-src/COPYING | 340 + .../coreutils/5.3.0/coreutils-5.3.0-src/ChangeLog | 8597 +++++++ .../coreutils/5.3.0/coreutils-5.3.0-src/INSTALL | 229 + .../coreutils/5.3.0/coreutils-5.3.0-src/NEWS | 1024 + .../coreutils/5.3.0/coreutils-5.3.0-src/README | 167 + .../coreutils/5.3.0/coreutils-5.3.0-src/THANKS | 471 + .../coreutils/5.3.0/coreutils-5.3.0-src/TODO | 203 + .../5.3.0/coreutils-5.3.0-src/config/ChangeLog | 94 + .../5.3.0/coreutils-5.3.0-src/doc/ChangeLog | 1219 + .../5.3.0/coreutils-5.3.0-src/doc/coreutils.info | 14780 +++++++++++ .../5.3.0/coreutils-5.3.0-src/lib/ChangeLog | 5709 +++++ .../coreutils/5.3.0/coreutils-5.3.0-src/lib/README | 3 + .../coreutils/5.3.0/coreutils-5.3.0-src/lib/TODO | 32 + .../5.3.0/coreutils-5.3.0-src/m4/ChangeLog | 3417 +++ .../coreutils-5.3.0-src/old/fileutils/ChangeLog | 8382 +++++++ .../5.3.0/coreutils-5.3.0-src/old/fileutils/NEWS | 748 + .../coreutils-5.3.0-src/old/sh-utils/ChangeLog | 4850 ++++ .../5.3.0/coreutils-5.3.0-src/old/sh-utils/NEWS | 272 + .../coreutils-5.3.0-src/old/textutils/ChangeLog | 8738 +++++++ .../5.3.0/coreutils-5.3.0-src/old/textutils/NEWS | 457 + .../5.3.0/coreutils-5.3.0-src/po/ChangeLog | 104 + .../5.3.0/coreutils-5.3.0-src/tests/README | 3 + .../5.3.0/coreutils-5.3.0-src/tests/join/TODO | 2 + .../5.3.0/coreutils-5.3.0-src/tests/tr/TODO | 1 + .../coreutils/5.3.0/coreutils-5.3.0/check.log | 3311 +++ .../contrib/coreutils/5.3.0/depends-GnuWin32.lst | 14 + .../gawk/3.1.6/gawk-3.1.6-1-GnuWin32.README | 49 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/ABOUT-NLS | 1101 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/AUTHORS | 13 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/COPYING | 674 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/INSTALL | 234 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/NEWS | 2486 ++ .../contrib/gawk/3.1.6/gawk-3.1.6-src/PROBLEMS | 15 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/README | 113 + .../gawk-3.1.6-src/README_d/OBSOLETE/README.FIRST | 21 + .../gawk-3.1.6-src/README_d/OBSOLETE/README.linux | 21 + .../gawk-3.1.6-src/README_d/OBSOLETE/README.sco | 67 + .../gawk-3.1.6-src/README_d/OBSOLETE/README.sony | 12 + .../gawk-3.1.6-src/README_d/OBSOLETE/README.ultrix | 46 + .../gawk-3.1.6-src/README_d/OBSOLETE/README.yacc | 10 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.VMS | 81 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.aix | 6 + .../3.1.6/gawk-3.1.6-src/README_d/README.atari | 26 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.beos | 86 + .../gawk-3.1.6-src/README_d/README.cygwin-dynamic | 88 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.hpux | 78 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.ia64 | 30 + .../3.1.6/gawk-3.1.6-src/README_d/README.macos | 32 + .../3.1.6/gawk-3.1.6-src/README_d/README.multibyte | 29 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.pc | 378 + .../3.1.6/gawk-3.1.6-src/README_d/README.pcdynamic | 93 + .../gawk/3.1.6/gawk-3.1.6-src/README_d/README.sgi | 20 + .../3.1.6/gawk-3.1.6-src/README_d/README.solaris | 138 + .../3.1.6/gawk-3.1.6-src/README_d/README.sunos4 | 24 + .../3.1.6/gawk-3.1.6-src/README_d/README.tandem | 33 + .../3.1.6/gawk-3.1.6-src/README_d/README.tests | 45 + .../gawk/3.1.6/gawk-3.1.6-src/doc/README.card | 19 + .../gawk/3.1.6/gawk-3.1.6-src/doc/gawk.info | 24684 +++++++++++++++++++ .../gawk/3.1.6/gawk-3.1.6-src/doc/gawkinet.info | 4404 ++++ .../gawk/3.1.6/gawk-3.1.6-src/missing_d/README | 14 + .../contrib/gawk/3.1.6/gawk-3.1.6-src/test/README | 18 + .../gawk-3.1.6-src/unsupported/atari/README.1st | 5 + .../contrib/gawk/3.1.6/gawk-3.1.6/check.log | 1296 + .../contrib/sed/4.2.1/sed-4.2.1-GnuWin.README | 59 + .../contrib/sed/4.2.1/sed-4.2.1-GnuWin32.README | 59 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ABOUT-NLS | 1111 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/AUTHORS | 5 + .../contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/BUGS | 133 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/COPYING | 676 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ChangeLog | 3185 +++ .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/INSTALL | 236 + .../contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/NEWS | 502 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README | 13 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README-alpha | 8 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README.boot | 23 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/THANKS | 54 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/doc/sed.info | 2558 ++ .../sed/4.2.1/sed-4.2.1/sed-4.2.1-src/po/ChangeLog | 53 + .../sed-4.2.1-src/testsuite/bug-regex10.c | 65 + .../sed-4.2.1-src/testsuite/bug-regex11.c | 143 + .../sed-4.2.1-src/testsuite/bug-regex12.c | 81 + .../sed-4.2.1-src/testsuite/bug-regex13.c | 111 + .../sed-4.2.1-src/testsuite/bug-regex14.c | 62 + .../sed-4.2.1-src/testsuite/bug-regex15.c | 53 + .../sed-4.2.1-src/testsuite/bug-regex16.c | 39 + .../sed-4.2.1-src/testsuite/bug-regex21.c | 53 + .../sed-4.2.1-src/testsuite/bug-regex27.c | 65 + .../sed-4.2.1-src/testsuite/bug-regex28.c | 76 + .../sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex7.c | 96 + .../sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex8.c | 88 + .../sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex9.c | 75 + .../sed/4.2.1/sed-4.2.1/sed-4.2.1/check.log | 104 + 95 files changed, 110401 insertions(+) create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-GnuWin32.README create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ABOUT-NLS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/AUTHORS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/COPYING create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/INSTALL create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/NEWS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/README create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/THANKS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/TODO create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/config/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/coreutils.info create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/README create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/TODO create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/m4/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/NEWS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/NEWS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/NEWS create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/po/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/README create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/join/TODO create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/tr/TODO create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0/check.log create mode 100644 coreutils-5.3.0-bin/contrib/coreutils/5.3.0/depends-GnuWin32.lst create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-1-GnuWin32.README create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/ABOUT-NLS create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/AUTHORS create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/COPYING create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/INSTALL create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/NEWS create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/PROBLEMS create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.FIRST create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.linux create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sco create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sony create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.ultrix create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.yacc create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.VMS create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.aix create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.atari create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.beos create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.cygwin-dynamic create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.hpux create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.ia64 create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.macos create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.multibyte create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pc create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pcdynamic create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sgi create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.solaris create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sunos4 create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tandem create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tests create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/README.card create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawk.info create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawkinet.info create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/missing_d/README create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/test/README create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/unsupported/atari/README.1st create mode 100644 coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6/check.log create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin.README create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin32.README create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ABOUT-NLS create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/AUTHORS create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/BUGS create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/COPYING create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/INSTALL create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/NEWS create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README-alpha create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README.boot create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/THANKS create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/doc/sed.info create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/po/ChangeLog create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex10.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex11.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex12.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex13.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex14.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex15.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex16.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex21.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex27.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex28.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex7.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex8.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex9.c create mode 100644 coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1/check.log (limited to 'coreutils-5.3.0-bin/contrib') diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-GnuWin32.README b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-GnuWin32.README new file mode 100644 index 0000000..cd2b84e --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-GnuWin32.README @@ -0,0 +1,151 @@ +* CoreUtils-5.3.0 for Windows * +=============================== + +What is it? +----------- +CoreUtils: collection of basic file, shell and text manipulation utilities + +Description +----------- +The GNU Core Utilities are the basic file, shell and text manipulation utilities +of the GNU operating system. These are the core utilities which are expected to +exist on every operating system. + +File utilities: + +- chgrp: Changes file group ownership. +- chown: Changes file ownership. +- chmod: Changes file permissions. +- cp: Copies files. +- dd: Copies and converts a file. +- df: Shows disk free space on filesystems. +- dir: Gives a brief directory listing. +- dircolors: Setup program for the color output of GNU ls. +- du: Shows disk usage on filesystems. +- install: Copies file and sets its permissions. +- ln: Creates file links. +- ls: Lists directory contents. +- mkdir: Creates directories. +- mkfifo: Creates FIFOs (named pipes). +- mknod: Creates special files. +- mv: Moves files. +- rm: Removes (deletes) files. +- rmdir: Removes empty directories. +- shred: Destroy data in files. +- sync: Synchronizes filesystem buffers and disk. +- touch: Changes file timestamps. +- vdir: Long directory listing. + + +Text utilities: + +- cat: concatenates and prints files on the standard output +- cksum: checksum and count the bytes in a file +- comm: compares two sorted files line by line +- csplit: splits a file into sections determined by context lines +- cut: remove sections from each line of files +- expand: convert tabs to spaces +- fmt: simple optimal text formatter +- fold: wrap each input line to fit in specified width +- head: output the first part of files +- join: join lines of two files on a common field +- md5sum: compute and check MD5 messsage digest +- nl: number lines of files +- od: dump files in octal and other formats +- paste: merge lines of files +- ptx: produce a permuted index of file contents +- pr: convert text files for printing +- shasum: compute and check SHA1 message digest +- sort: sort lines of text files +- split: split a file into pieces +- sum: checksum and count the blocks in a file +- tac: concatenates and prints files in reverse +- tail: outputs the last part of files +- tr: translates or deletes characters +- tsort: perform topological sort +- unexpand: convert spaces to tabs +- uniq: remove duplicate lines from a sorted file +- wc: prints the number of bytes, words, and lines in files + + +Shell utilities: + +- [ - Check file types and compare values +- basename - Removes the path prefix from a given pathname. +- chroot - Changes the root directory. +- date - Prints/sets the system date and time. +- dirname - Removes the last level or filename from a given pathname. +- echo - Prints a line of text. +- env - Displays/modifies the environment. +- expr - Evaluates expressions. +- factor - Prints prime factors. +- false - Returns an unsuccessful exit status. +- groups - Print the groups that the user is a member of. +- hostid - Print the numeric identifier for the current host +- hostname - Print or set the machine name. +- id - Print real/effective uid/gid. +- logname - Print current login name. +- nice - Modify scheduling priority. +- nohup - Allows a command to continue running after logging out. +- pathchk - Check file name portability. +- pinky - Lightweight finger +- printenv - Prints environment variables. +- printf - Formats and prints data. +- pwd - Print the current working directory. +- seq - Print numeric sequences. +- sleep - Suspends execution for a specified time. +- stty - Print/change terminal settings. +- su - Allows you to adopt the id of another user or superuser. +- tee - Sends output to multiple files. +- test - Evaluates an expression. +- true - Returns a successful exit status. +- tty - Print terminal name. +- uname - Print system information. +- users - Print current user names. +- who - Print a list of all users currently logged in. +- whoami - Print effective user id. +- yes - Print a string repeatedly. + +Homepage +-------- +http://www.gnu.org/software/coreutils + +System +------ +- MS-Windows 95 / 98 / ME / NT / 2000 / XP with msvcrt.dll +- if msvcrt.dll is not in your Windows/System folder, get it from + Microsoft + or by installing Internet Explorer 4.0 or higher + +- libintl-2 +- libiconv-2 + +Notes +----- +- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net + +Package Availability +-------------------- +- in: http://gnuwin32.sourceforge.net +Installation +------------ +The MS-Windows version of ln implements soft links as MS-Windows +shortcuts. If necessary, it adds the extension .lnk +Hard links are implemented as copies on MS-Windows-95 / 98 / ME, +and as hard linls on MS-Windows-NT / 2000 / XP. + +Sources +------- +- coreutils-5.3.0-src.zip + +Compilation +----------- +The package has been compiled with GNU auto-tools, GNU make, and Mingw +(GCC for MS-Windows). Any differences from the original sources are given +in coreutils-5.3.0-GnuWin32.diffs in coreutils-5.3.0-src.zip. Libraries needed +for compilation can be found at the lines starting with 'LIBS = ' in the +Makefiles. Usually, these are standard libraries provided with Mingw, or +libraries from the package itself; 'gw32c' refers to the libgw32c package, +which provides MS-Windows substitutes or stubs for functions normally found in +Unix. For more information, see: http://gnuwin32.sourceforge.net/compile.html +and http://gnuwin32.sourceforge.net/packages/libgw32c.htm. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ABOUT-NLS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ABOUT-NLS new file mode 100644 index 0000000..8ffb467 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ABOUT-NLS @@ -0,0 +1,716 @@ +Notes on the Free Translation Project +************************************* + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that will gradually become able to speak many languages. +A few packages already provide translations for their messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work at translations should contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +Quick configuration advice +========================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +INSTALL Matters +=============== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the GNU `gettext' own +library will be used. This library is wholly contained within this +package, usually in the `intl/' subdirectory, so prior installation of +the GNU `gettext' package is _not_ required. Installers may use +special options at configuration time for changing the default +behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will respectively bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might be not what is desirable. You +should use the more recent version of the GNU `gettext' library. I.e. +if the file `intl/VERSION' shows that the library which comes with this +package is more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +Using This Package +================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your country by running the command +`locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +Translating Teams +================= + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +Available Packages +================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of December +2003. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files am az be bg ca cs da de el en en_GB eo es + +-------------------------------------------+ + a2ps | [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | | + ap-utils | | + bash | [] [] [] [] | + batchelor | | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bluez-pin | [] [] | + clisp | | + clisp | [] [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + darkstat | [] () [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] () [] [] [] [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] [] | + flex | [] [] [] [] | + fslint | | + gas | [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gettext-examples | [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] [] [] [] | + gliv | | + glunarclock | [] [] | + gnubiff | [] | + gnucash | [] () [] [] | + gnucash-glossary | [] () [] | + gnupg | [] () [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] [] | + gpe-edit | [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] [] | + gprof | [] [] [] | + gpsdrive | () () () | + gramadoir | [] | + grep | [] [] [] [] [] [] | + gretl | [] | + gtick | () | + hello | [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + jpilot | [] [] [] | + jtag | | + jwhois | [] | + kbd | [] [] [] [] [] | + latrine | () | + ld | [] [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] | + libiconv | [] [] [] [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lingoteach_lessons | () () | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] | + man-db | [] () [] [] () | + minicom | [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] | + nano_1_0 | [] () [] [] [] | + opcodes | [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] | + sed | [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | | + sharutils | [] [] [] [] [] [] | + silky | () | + skencil | [] () [] | + sketch | [] () [] | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] [] | + tin | () () | + tuxpaint | [] [] [] [] [] [] [] | + util-linux | [] [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] [] [] [] [] | + xchat | [] [] [] [] | + xfree86_xkb_xml | [] | + xpad | [] | + +-------------------------------------------+ + am az be bg ca cs da de el en en_GB eo es + 0 0 8 3 37 38 56 73 15 1 5 12 64 + + et fa fi fr ga gl he hr hu id is it ja + +----------------------------------------+ + a2ps | [] [] [] () | + aegis | | + ant-phone | | + anubis | [] | + ap-utils | [] | + bash | [] [] | + batchelor | [] | + bfd | [] | + binutils | [] [] | + bison | [] [] [] [] | + bluez-pin | [] [] [] [] [] | + clisp | | + clisp | [] | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + darkstat | () [] [] [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] [] [] | + flex | [] [] | + fslint | | + gas | [] | + gawk | [] [] [] | + gbiff | | + gcal | [] | + gcc | [] | + gettext | [] [] | + gettext-examples | [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] | + gliv | () | + glunarclock | [] [] [] [] | + gnubiff | | + gnucash | () [] | + gnucash-glossary | [] | + gnupg | [] [] [] [] [] [] [] | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] [] [] | + gpe-clock | [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] | + gpe-su | [] | + gpe-taskmanager | [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] | + gprof | [] [] | + gpsdrive | () [] () () | + gramadoir | [] | + grep | [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] | + gtick | [] [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + indent | [] [] [] [] [] [] [] [] [] | + jpilot | [] () | + jtag | | + jwhois | [] [] [] [] | + kbd | [] | + latrine | | + ld | [] | + libc | [] [] [] [] [] | + libgpewidget | [] [] [] [] | + libiconv | [] [] [] [] [] [] [] [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] | + lingoteach_lessons | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] [] [] [] | + man-db | () () | + minicom | [] [] [] [] | + mysecretdiary | [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | | + screem | | + scrollkeeper | [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] | + sharutils | [] [] [] [] [] | + silky | [] () | + skencil | [] | + sketch | [] | + soundtracker | [] [] [] [] | + sp | [] () | + tar | [] [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + tuxpaint | [] [] [] [] [] [] [] [] | + util-linux | [] [] [] [] () [] | + vorbis-tools | [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] | + xchat | [] [] [] | + xfree86_xkb_xml | | + xpad | [] | + +----------------------------------------+ + et fa fi fr ga gl he hr hu id is it ja + 21 1 25 86 24 24 8 10 38 31 1 23 32 + + ko lg lt lv ms nb nl nn no pl pt pt_BR ro + +-------------------------------------------+ + a2ps | () [] [] () () [] [] | + aegis | () () | + ant-phone | [] [] | + anubis | [] [] [] [] [] | + ap-utils | [] () [] | + bash | [] [] | + batchelor | [] | + bfd | [] | + binutils | | + bison | [] [] [] [] | + bluez-pin | [] [] [] | + clisp | | + clisp | [] | + coreutils | [] | + cpio | [] [] [] [] [] | + darkstat | [] [] [] [] | + diffutils | [] [] [] [] | + e2fsprogs | [] | + enscript | [] [] [] | + error | [] [] [] | + fetchmail | [] [] () | + fileutils | [] [] | + findutils | [] [] [] [] [] | + flex | [] [] [] [] | + fslint | [] [] | + gas | | + gawk | [] [] [] | + gbiff | [] [] | + gcal | | + gcc | | + gettext | [] [] [] | + gettext-examples | [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] | + gliv | [] [] [] | + glunarclock | [] [] [] | + gnubiff | | + gnucash | [] [] () | + gnucash-glossary | [] [] | + gnupg | [] | + gpe-aerial | [] [] [] | + gpe-beam | [] [] [] | + gpe-calendar | [] [] [] | + gpe-clock | [] [] [] | + gpe-conf | [] [] [] | + gpe-contacts | [] [] [] | + gpe-edit | [] [] [] | + gpe-go | [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] [] [] | + gpe-su | [] [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] [] | + gpe-todo | [] [] [] | + gphoto2 | [] | + gprof | [] [] | + gpsdrive | () () () [] | + gramadoir | [] | + grep | [] [] [] [] | + gretl | | + gtick | [] [] | + hello | [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] | + indent | [] [] [] | + jpilot | () () | + jtag | | + jwhois | [] [] [] [] | + kbd | [] [] [] | + latrine | [] | + ld | | + libc | [] [] [] [] [] | + libgpewidget | [] [] [] | + libiconv | [] [] [] [] | + lifelines | | + lilypond | | + lingoteach | | + lingoteach_lessons | | + lynx | [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] [] | + man-db | [] | + minicom | [] [] [] | + mysecretdiary | [] [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | [] | + recode | [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] | + sed | [] [] [] | + sh-utils | [] | + shared-mime-info | [] | + sharutils | [] | + silky | | + skencil | [] [] | + sketch | [] [] | + soundtracker | | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] [] [] | + textutils | [] [] | + tin | | + tuxpaint | [] [] [] [] [] [] [] [] [] | + util-linux | [] [] | + vorbis-tools | [] [] | + wastesedge | | + wdiff | [] [] [] [] | + wget | [] [] | + xchat | [] [] | + xfree86_xkb_xml | [] | + xpad | [] [] | + +-------------------------------------------+ + ko lg lt lv ms nb nl nn no pl pt pt_BR ro + 12 0 1 2 12 10 60 4 4 38 25 35 76 + + ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW + +-------------------------------------------+ + a2ps | [] [] [] [] [] | 16 + aegis | () | 0 + ant-phone | | 2 + anubis | [] [] [] | 9 + ap-utils | () | 3 + bash | [] | 9 + batchelor | | 2 + bfd | [] [] | 6 + binutils | [] [] [] | 7 + bison | [] [] [] | 14 + bluez-pin | [] [] [] | 13 + clisp | | 0 + clisp | | 5 + coreutils | [] [] [] [] [] | 16 + cpio | [] [] [] | 14 + darkstat | [] [] [] () () | 12 + diffutils | [] [] [] [] | 22 + e2fsprogs | [] [] | 5 + enscript | [] [] [] | 12 + error | [] [] [] | 15 + fetchmail | [] [] [] | 11 + fileutils | [] [] [] [] [] [] | 17 + findutils | [] [] [] [] [] [] [] | 29 + flex | [] [] [] | 13 + fslint | | 2 + gas | [] | 3 + gawk | [] [] | 12 + gbiff | | 3 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] [] | 16 + gettext-examples | [] [] [] [] | 11 + gettext-runtime | [] [] [] [] [] [] [] [] [] | 21 + gettext-tools | [] [] [] [] [] [] | 14 + gimp-print | [] [] | 10 + gliv | | 3 + glunarclock | [] [] [] [] | 13 + gnubiff | | 1 + gnucash | [] [] [] | 9 + gnucash-glossary | [] [] [] | 8 + gnupg | [] [] [] [] | 17 + gpe-aerial | [] [] | 7 + gpe-beam | [] [] | 8 + gpe-calendar | [] [] [] [] [] | 13 + gpe-clock | [] [] [] [] | 10 + gpe-conf | [] [] [] | 9 + gpe-contacts | [] [] [] [] | 11 + gpe-edit | [] [] [] [] [] [] | 12 + gpe-go | [] | 5 + gpe-login | [] [] [] [] [] [] | 13 + gpe-ownerinfo | [] [] [] [] [] | 13 + gpe-sketchbook | [] [] [] | 9 + gpe-su | [] [] [] [] | 10 + gpe-taskmanager | [] [] [] [] | 10 + gpe-timesheet | [] [] [] [] [] | 12 + gpe-today | [] [] [] [] [] [] | 13 + gpe-todo | [] [] [] [] [] | 12 + gphoto2 | [] [] [] | 11 + gprof | [] [] | 9 + gpsdrive | [] [] | 4 + gramadoir | | 3 + grep | [] [] [] [] [] | 26 + gretl | | 2 + gtick | [] | 5 + hello | [] [] [] [] [] | 33 + id-utils | [] [] [] | 12 + indent | [] [] [] [] [] | 21 + jpilot | [] [] [] [] [] | 9 + jtag | [] | 1 + jwhois | () () [] [] | 11 + kbd | [] [] | 11 + latrine | | 1 + ld | [] [] | 5 + libc | [] [] [] [] | 20 + libgpewidget | [] [] [] [] | 13 + libiconv | [] [] [] [] [] [] [] [] [] | 27 + lifelines | [] | 2 + lilypond | [] | 3 + lingoteach | | 2 + lingoteach_lessons | () | 0 + lynx | [] [] [] [] | 14 + m4 | [] [] [] | 15 + mailutils | [] | 5 + make | [] [] [] [] | 16 + man-db | [] | 5 + minicom | [] | 11 + mysecretdiary | [] [] | 10 + nano | [] [] [] [] [] | 17 + nano_1_0 | [] [] [] [] | 17 + opcodes | [] [] | 6 + parted | [] [] [] | 15 + ptx | [] [] [] | 22 + python | | 0 + radius | [] | 4 + recode | [] [] [] [] | 20 + rpm | [] [] [] | 7 + screem | [] [] | 2 + scrollkeeper | [] [] [] [] | 15 + sed | [] [] [] [] [] [] | 23 + sh-utils | [] [] [] | 14 + shared-mime-info | [] [] | 4 + sharutils | [] [] [] [] [] | 17 + silky | () | 2 + skencil | [] | 6 + sketch | [] | 6 + soundtracker | [] [] | 9 + sp | [] | 3 + tar | [] [] [] [] [] | 24 + texinfo | [] [] [] [] | 14 + textutils | [] [] [] [] [] | 16 + tin | | 1 + tuxpaint | [] [] [] [] [] | 29 + util-linux | [] [] [] | 15 + vorbis-tools | [] | 8 + wastesedge | | 0 + wdiff | [] [] [] [] | 18 + wget | [] [] [] [] [] [] [] [] | 23 + xchat | [] [] [] [] [] | 14 + xfree86_xkb_xml | [] [] [] [] [] [] | 8 + xpad | | 4 + +-------------------------------------------+ + 51 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW + 120 domains 59 42 16 25 81 0 56 12 1 10 21 22 1260 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If December 2003 seems to be old, you may fetch a more recent copy +of this `ABOUT-NLS' file on most GNU archive sites. The most +up-to-date matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +Using `gettext' in new packages +=============================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/AUTHORS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/AUTHORS new file mode 100644 index 0000000..8239da0 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/AUTHORS @@ -0,0 +1,92 @@ +Here are the names of the programs in this package, +each followed by the name(s) of its author(s). + +basename: FIXME unknown +cat: Torbjorn Granlund, Richard M. Stallman +chgrp: David MacKenzie, Jim Meyering +chmod: David MacKenzie, Jim Meyering +chown: David MacKenzie, Jim Meyering +chroot: Roland McGrath +cksum: Q. Frank Xia +comm: Richard Stallman, David MacKenzie +cp: Torbjorn Granlund, David MacKenzie, Jim Meyering +csplit: Stuart Kemp, David MacKenzie +cut: David Ihnat, David MacKenzie, Jim Meyering +date: David MacKenzie +dd: Paul Rubin, David MacKenzie, Stuart Kemp +df: Torbjorn Granlund, David MacKenzie, Paul Eggert +dir: Richard Stallman, David MacKenzie +dircolors: H. Peter Anvin +dirname: David MacKenzie, Jim Meyering +du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering +echo: FIXME unknown +env: Richard Mlynarik, David MacKenzie +expand: David MacKenzie +expr: Mike Parker +factor: Paul Rubin +false: Jim Meyering +fmt: Ross Paterson +fold: David MacKenzie +ginstall: David MacKenzie +groups: David MacKenzie +head: David MacKenzie, Jim Meyering +hostid: Jim Meyering +hostname: Jim Meyering +id: Arnold Robbins, David MacKenzie +join: Mike Haertel +kill: Paul Eggert +link: Michael Stone +ln: Mike Parker, David MacKenzie +logname: FIXME: unknown +ls: Richard Stallman, David MacKenzie +md5sum: Ulrich Drepper, Scott Miller +mkdir: David MacKenzie +mkfifo: David MacKenzie +mknod: David MacKenzie +mv: Mike Parker, David MacKenzie, Jim Meyering +nice: David MacKenzie +nl: Scott Bartram, David MacKenzie +nohup: Jim Meyering +od: Jim Meyering +paste: David M. Ihnat, David MacKenzie +pathchk: Paul Eggert, David MacKenzie, Jim Meyering +pinky: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi +pr: Pete TerMaat, Roland Huebner +printenv: David MacKenzie, Richard Mlynarik +printf: David MacKenzie +ptx: F. Pinard +pwd: Jim Meyering +readlink: Dmitry V. Levin +rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering +rmdir: David MacKenzie +seq: Ulrich Drepper +sha1sum: Ulrich Drepper, Scott Miller +shred: Colin Plumb +sleep: Jim Meyering, Paul Eggert +sort: Mike Haertel, Paul Eggert +split: Torbjorn Granlund, Richard M. Stallman +stat: Michael Meskes +stty: David MacKenzie +su: David MacKenzie +sum: Kayvan Aghaiepour, David MacKenzie +sync: Jim Meyering +tac: Jay Lepreau, David MacKenzie +tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering +tee: Mike Parker, Richard M. Stallman, David MacKenzie +test: Kevin Braunsdorf, Matthew Bradburn +touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith +tr: Jim Meyering +true: Jim Meyering +tsort: Mark Kettenis +tty: David MacKenzie +uname: David MacKenzie +unexpand: David MacKenzie +uniq: Richard Stallman, David MacKenzie +unlink: Michael Stone +uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi +users: Joseph Arceneaux, David MacKenzie +vdir: Richard Stallman, David MacKenzie +wc: Paul Rubin, David MacKenzie +who: Joseph Arceneaux, David MacKenzie, Michael Stone +whoami: Richard Mlynarik +yes: David MacKenzie diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/COPYING b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ChangeLog new file mode 100644 index 0000000..19f78f2 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/ChangeLog @@ -0,0 +1,8597 @@ +2005-01-08 Jim Meyering + + * Version 5.3.0. + + `pr --columns=N' was not equivalent to `pr -N' when also using + either -s or -w. + + * src/pr.c (main): Set `explicit_columns' for --columns=N, + not just for -N. This bug has existed since the introduction + of the --columns=N option on 1998-08-15. + * NEWS: Document this. + * tests/pr/Test.pm (test_vector): For each -N test, automatically + create a new test vector using --columns=N. + +2005-01-07 Paul Eggert + + * src/pr.c (main): Check for column count overflow with + usages like "pr -2147483648". + +2005-01-07 Jim Meyering + + * src/pr.c (init_fps): Use xnmalloc, rather than xmalloc. + +2005-01-06 Jim Meyering + + * README: List the precise HP-UX version numbers that are affected. + Suggestion from Bob Proulx. + + * Makefile.maint (sc_changelog): Specify find's `-maxdepth 2' + predicate before `-name ChangeLog' to avoid a harmless warning + from find-4.2.10. + +2005-01-05 Jim Meyering + + * tests/help-version: Punt on the uptime test, since it fails when + it can't get boot time, and I don't want that to stop `make check'. + + * src/du.c (process_file): Evaluate exclusion rules against + the entire file name, not just the last component. + Reported by Robert Lindgren. + * tests/du/exclude: Test for this. + * NEWS: Document this. + + Ensure that tests/Makefile.am's check-root actions stay up to date. + * Makefile.maint (sc_root_tests): New rule. + (syntax-check-rules): Add it to the list. + +2005-01-04 Jim Meyering + + * man/shred.x: Change one-line summary to reflect that shred does + not remove files by default. Suggestion from Helen Faulkner in + http://bugs.debian.org/288552 + + * README: Request VERBOSE=yes output when reporting test failures. + Other minor changes. + + * tests/Makefile.am (check-root): Update. + +2005-01-03 Paul Eggert + + * src/system.h: Undo previous change; we now use Autoconf. + +2005-01-03 Jim Meyering + + * tests/stty/row-col-1: Don't set rows or columns to zero, to avoid + a bug in the TIOCGWINSZ ioctl on at least Solaris5.9 systems. Setting + either (or both) to zero would succeed, but subsequent `stty size' + would say `no size information for this device' due to the ioctl + failing with EINVAL. + + * src/system.h: If PRIdMAX, PRIoMAX, PRIuMAX, and PRIxMAX are + not all defined and either ULONG_MAX or ULLONG_MAX is not defined, + then fail at compile-time rather than let tools like od produce + invalid results at run time. + +2004-12-21 Jim Meyering + + * src/csplit.c (usage): Say the default names are `xx00, xx01, ...', + not `xx01, xx02, ...'. + Reported by Matt Kraai in http://bugs.debian.org/286605 + + * tests/misc/split-fail: Avoid spurious failure on x86 Solaris5.9 + when using c89. + +2004-12-20 Paul Eggert + + * src/split.c (usage): Mention default size. Suggested by Dan Jacobson. + +2004-12-19 Paul Eggert + + * NEWS: Mention that one should eval "`dircolors`" rather than + `dircolors`. + +2004-12-17 Jim Meyering + + * tests/mv/hard-link-1: Rearrange to use newer trap-handling code, + so temporary directories aren't left behind upon e.g., interrupt. + +2004-12-16 Paul Eggert + + * src/ls.c (print_dir): Use "%s: not listing already-listed + directory", not "not listing already-listed directory: %s", to + format already-listed directories, to be consistent with other + diagnostics involving file names and colons. + +2004-12-15 Jim Meyering + + * src/Makefile.am (__LDADD): Define, so that building `[' on + Solaris still uses the -lgen library that it requires in order + to get a definition of eaccess. + +2004-12-14 Jim Meyering + + tac would exit immediately upon I/O or temp-file creation failure. + Now it continues on, processing any remaining command line arguments. + + * src/tac.c: Include quotearg.h. + Use quotearg_colon in most diagnostics. + (copy_to_temp): Rewrite not to exit upon I/O or temp-file-creation + failure. Before, this command (with /full/tmp being a full partition) + TMPDIR=/full/tmp ./tac /proc/modules tac.c + would exit immediately upon the write error while trying to copy + non-seekable /proc/modules to the full partition. Now it still + reports the failure but continues on with the remaining file. + (tac_nonseekable): Return false also if copy_to_temp fails. + [DONT_UNLINK_WHILE_OPEN]: Add a FIXME comment explaining that + using atexit like this is wrong. + * NEWS: Document this. + * tests/misc/tac-continue: New test for this. + * tests/misc/Makefile.am (TESTS): Add tac-continue. + + * tests/chown/basic: Add a few more tests. + +2004-12-13 Paul Eggert + + * src/ls.c (gobble_file): Change arg name to be command_line_arg + rather than explicit_arg, for consistency with copy.c. + (extract_dirs_from_files): Remove ignore_dot_and_dot_dot arg, since + it is deducible from dirname arg. All callers changed. + (extract_dirs_from_files, print_dir, queue_directory): + Add command_line_arg arg. All callers changed. + (struct pending): Add command_line_arg member. + (main): Use NULL rather than 0 when appropriate. + (set_exit_status, file_failure): New functions. + (queue_directory): Store command_line_arg into new structure. + (print_dir, gobble_file, get_link_name): + Use file_failure to report problems in accessing files, + so that the exit status is set consistently. + (print_dir): Simplify readdir failure code yet again. + If closedir fails, report "closing directory" rather than "reading + directory" failure. + (xstrcoll): Use set_exit_status to set status on failure. + * tests/ls-2/tests (no-a-isdir-b): This now exits with status 2, + not status 1. + +2004-12-11 Jim Meyering + + Avoid a race condition vulnerability in chown, when used with + --from=O:G and without the (-h) --no-dereference option. + * src/chown-core.c (restricted_chown): New function. + (change_file_owner): Call it. + Reported by Ulrich Drepper. + * NEWS: Mention this. + +2004-12-09 Paul Eggert + + * ls now exits with status 1 on minor problems, 2 if serious trouble. + * NEWS: Document this. + * src/ls.c (LS_MINOR_PROBLEM, LS_FAILURE): New constants. + All uses of EXIT_FAILURE replaced with LS_FAILURE, unless + specified below. + (main): Initialize exit failure to LS_FAILURE. + (print_dir, gobble_file, get_link_name, xstrcoll): + Set exit status to LS_MINOR_PROBLEM if the failure is minor. + (print_dir): Do not give up on entire directory merely because readdir + returns EOVERFLOW. + (usage): Explain exit status. + * tests/help-version: ls and variants now exit with status 2 + on serious trouble. + +2004-12-08 Paul Eggert + + * NEWS: Document new UTC+HH:MM date syntax, and put date changes + together. + +2004-12-07 Paul Eggert + + * src/factor.c (factor): Don't list 1 as a factor of 1. + Problem reported by Thomas Folz-Donahue. + +2004-12-06 Jim Meyering + + * tests/du/files0-from: Sanitize environment. + Otherwise, e.g., BLOCKSIZE=k would cause a failure, and that + setting is the default (exported from /etc/profile) on at least one + NetBSD 1.6 system. + * tests/du/no-deref: Likewise. + * tests/cp/symlink-slash: Likewise. + * tests/ls/symlink-slash: Likewise + +2004-12-05 Jim Meyering + + * tests/tail/Test.pm (err-6) ["tail -c"]: Avoid test failure when + _POSIX2_VERSION=199209 is in the environment, or when building on + e.g., OpenBSD 3.2. + +2004-12-04 Jim Meyering + + * NEWS: Mention cut's new --complement option. + +2004-10-01 Paolo Bonzini + + * cut.c (complement, COMPLEMENT_OPTION): New. + (longopts): Add --complement. + (usage): Say not that -b, -c, and -f `print' fields, + but rather that they `select' fields for printing. + Describe the new --complement option. + (mark_range_start): Extracted from set_fields. + (print_kth): Support --complement. + (compare_ranges): New function. + (set_fields): Rewrite the part that populates range_start_ht, + merging it with the part that populates printable_field. + (main): Handle --complement. + +2004-12-03 Paul Eggert + + * src/tail.c (tail_file): Set errnum to -1 if the initial "tail" + failed. This works around an assertion failure reported by + Roberto Nibali in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-12/msg00012.html + +2004-12-02 Jim Meyering + + With using --color and with LS_COLORS saying not to color + executables, don't stat every file. + * src/ls.c (is_colored): New function. + (gobble_file): Use it. + (main): Use it here, in place of too-strict tests against NULL: + if either ORPHAN or MISSING was set to 0 from LS_COLORS, the + old test would fail. + +2004-12-01 Paul Eggert + + * src/comm.c (compare_files): Assume setlocale exists. + * src/join.c (keycmp): Likewise. + * src/seq.c (decimal_point): Treat like sort. Now char. + All uses changed. + (main): Assume localeconv exists. Use same code as sort. + * src/sort.c (C_DECIMAL_POINT): Remove. Use changed to '.'. + Assume setlocale exists. + (thousands_sep): Renamed from th_sep. + (IS_THOUSANDS_SEP): Remove. All uses replaced by comparisons. + (NONZERO): Parenthesize use of arg. + (numcompare): Avoid duplicate loads. Use ISDIGIT as boolean, for + consistency. Avoid unnecessary negation by reversing + fraccompare args. + (main): Rewrite localeconv call to match seq.c. + * src/system.h: Assume locale.h exists. + (HAVE_SETLOCALE): Remove. + * src/uniq.c (different): Assume setlocale exists. + + * src/ls.c (sort_files): Minor cleanup. Remove an unnecessary + 'volatile' on a local variable. Rewrite to avoid unnecessary + double-assignment to 'func' in the usual case where strcoll does + not fail. + +2004-11-30 Paul Eggert + + * src/pinky.c (gethostname): Remove decl. + (scan_entries): Use IS_USER_PROCESS instead of by-hand code. + * src/uptime.c (print_uptime): Use IS_USER_PROCESS and + UT_TYPE_BOOT_TIME instead of by-hand code. + * src/users.c (list_entries_users): Use IS_USER_PROCESS + instead of by-hand code. + * src/who.c (USER_PROCESS, RUN_LVL, INIT_PROCESS, LOGIN_PROCESS, + DEAD_PROCESS, BOOT_TIME, NEW_TIME, UT_TYPE_UNDEF, UT_TYPE): Remove. + (IS_USER_PROCESS): Move to ../lib/readutmp.h. + (UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS, UT_TYPE_LOGIN_PROCESS, + UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME): New macros. + (gethostname): Remove decl. + (list_entries_who, scan_entries): Use the new macros defined above, + for consistency with pinky, uptime, and users. + +2004-11-25 Paul Eggert + + Fix problem reported by Scott S. Tinsley for HP-UX 11.11 using + HP's ANSI C compiler. Declaring int functions causes warnings on + some modern systems and shouldn't be needed to compile on ancient + ones. + * src/copy.h (stat, lstat, rename): Remove decls. + * src/install.c (stat): Remove decl. + * src/ln.c (link, symlink): Remove decls. + +2004-11-25 Jim Meyering + + * man/help2man: Import help2man-1.35.1. + * man/Makefile.am (.x.1): Remove now-unnecessary use of + locally-added --program-name=NAME option. Now, help2man gets + the name from the [NAME] section (i.e. from our .x file). + * man/install.x: Use `install', not `ginstall' in the one-line + description. Reported by Brendan O'Dea. + * man/sha1sum.x: Use `sha1sum', not `shasum'. + +2004-11-24 Jim Meyering + + Since the changes of 2004-05-22, the u.saved_cwd member at + the bottom of the active-directory stack was no longer + strictly necessary. This change removes that member and uses + the newer cwd_state parameter for the final restore_cwd. + + * src/remove.c (struct AD_ent) [u]: Remove now-unnecessary union. + [dev_ino]: Rename from `a'. + (AD_pop_and_chdir): Add a parameter to play the role of just-removed + bottom-of-stack cwd-state member. + (AD_pop_and_chdir): No longer return boolean. Adjust caller. + (AD_push_initial): Remove CWD parameter. Adjust caller. + +2004-11-23 Paul Eggert + + Minor performance improvements and cleanups for "touch". + * src/touch.c (posix_date): Remove; not needed as a static var. + All uses rewritten. + (touch): Use new futimens function to operate more efficiently + in some cases. Don't stat/fstat existing file when + (!amtime_now && change_times == (CH_ATIME | CH_MTIME)); the + old time stamps aren't needed in that case. + (main): change_times is int, not bool. Simplify test for + change_times. + +2004-11-20 Paul Eggert + + * src/install.c (usage): Avoid usage that runs afoul of Docbook + translation. Problem reported by Eric S. Raymond. + + Restore dd's noctty flag, reverting the change of 2004-04-08. + POSIX does not allow "dd" to use O_NOCTTY by default. + * NEWS: Add noctty flag to dd. + * doc/coreutils.texi (dd invocation): Likewise. + * src/dd.c (flags, usage, main): Likewise. + +2004-11-19 Alfred M. Szmidt + + * src/ls.c (usage): Clarified description of --no-group (-G), + --human-readable (-h), --inode (-i), --size (-s), --time, + and --time-style. + +2004-11-19 Jim Meyering + + * src/ls.c (usage): Clarify description of --author. + Tweak indentation so that help2man creates better nroff. + Reported by Dan Jacobson. + + * src/uniq.c (check_file): Don't check stdout for errors here. + + * src/pwd.c (find_dir_entry): Update comment to match reality. + +2004-11-18 Jim Meyering + + * src/pwd.c (robust_getcwd): Correct the comment: this function + constructs the directory name. The caller prints it. + +2004-11-16 Paul Eggert + + * src/stat.c (STATFS): New macro, for portability to Solaris 9. + (do_statfs): Use it. + + * src/basename.c, src/chroot.c, src/cksum.c, src/dd.c, src/dirname.c, + src/factor.c, src/hostid.c, src/hostname.c, src/link.c, src/logname.c, + src/nohup.c, src/printenv.c, src/pwd.c, src/setuidgid.c, src/sleep.c, + src/sync.c, src/tsort.c, src/unlink.c, src/uptime.c, src/users.c, + src/whoami.c, src/yes.c (main): Use getopt_long rather than getopt. + * src/readlink.c (main): argv is not const. + + * src/cut.c (usage): Improve documentation along the lines suggested + by Debian 5.2.1-2. + * src/echo.c (usage): Likewise. + * src/expr.c (usage): Likewise. + + * src/dircolors.hin: Add putty, screen-bce. + + * src/pinky.c (print_entry): Fix memory leak. + * src/who.c (print_user): Likewise. + +2004-11-15 Paul Eggert + + * NEWS: New dd operand "status=noxfer". + * src/dd.c (C_ASCII, C_EBCDIC, C_IBM, C_BLOCK, C_UNBLOCK, + C_LCASE, C_UCASE, C_SWAB, C_NOERROR, C_NOTRUNC, C_SYNC, C_TWOBUFS, + C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): Now constants, not + macros. + (STATUS_NOXFER, statuses): New constants. + (usage, print_stats, scanargs): Add support for status=noxfer. + (usage): Update status output to match new behavior. + (print_stats): Always output complete byte count. + Put space between numbers and units, as SI requires. + Use ngettext so that i18n can use plurals for "byte" and "second". + Don't multiply by 1e-9 (inexact); divide by 1e9 (which is exact). + (iflag_error_msgid, oflag_error_msgid): Remove; replace uses by + the string. + * tests/dd/skip-seek (@Tests): Use status=noxfer to avoid + problems with regression testing. + +2004-11-14 Paul Eggert + + * NEWS: dd now outputs total bytes, seconds, and bytes per second. + * src/Makefile.am (dd_LDADD): Add $(LIB_CLOCK_GETTIME). + * src/dd.c: Include "human.h". + (w_bytes, start_time): New vars. + (usage): Document new I/O statistics output + (print_stats): Output new I/O statistics. + (cleanup): Do statistics after closing stdin and stdout, so that + the times are more accurate. + (write_output, dd_copy): Count output bytes. + (main): Get initial value of clock. + +2004-11-14 Jim Meyering + + Backslash-escape `-'s in email addresses, so that they are + rendered properly in UTF-locales. + * man/help2man (escape_hyphens): New function. + (main): Call it on email addresses. + + * src/sort.c (zaptemp): Mark new diagnostic for translation. + + * tests/misc/close-stdout: New file. Test today's closeout.c change. + * tests/misc/Makefile.am (TESTS): Add close-stdout. + +2004-11-13 Jim Meyering + + * src/test.c (usage): Put the description of `[-n] STRING' + on two lines, one for `-n STRING' and one for `STRING' so that + help2man properly escapes the `-'. Otherwise, the hyphen is + rendered inappropriately in UTF-8 locales. + Reported by Uwe Zeisberger in http://bugs.debian.org/281069. + +2004-11-12 Paul Eggert + + * NEWS: Document the following changes. + + * src/sort.c: Avoid O(N**2) behavior when there are many temporary + files. + (temptail): New variable, so that we can easily append to list. + (create_temp_file): Create new files at end of list, so that + searching the list has O(N*NMERGE) behavior instead of O(N**2). + (zaptemp): Update temptail if needed. + (mergefps, merge): Accept new arg that counts temp files, and keep it + up to date as we create and remove temporaries. This is for + efficiency, so that we don't call zaptemp so often. + All callers changed. + (sort): Don't create array in reverse order, since the list of + temporaries is now in the correct order. + + (zaptemp): Protect against race condition: if 'sort' is + interrupted in the middle of zaptemp, it might unlink the + temporary file twice, and the second time this happens the file + might already have been created by some other process. + + (zaptemp): Warn if a temporary file is not removed. + + (create_temp_file): Use offsetof for clarity. + (die): Move it up earlier, to clean up the code a bit. + + * src/pr.c (strtoumax): Declare if not declared. + (skip_to_page, first_page_number, last_page_number, page_number, + first_last_page, print_header): + Use uintmax_t for page numbers. + (first_last_page): Remove unnecessary forward declaration. + Do not modify arg (it is now a const pointer). + Return a true if successful, false (without print a diagnostic) + otherwise. + (main): If +XXX does not specify a valid page range, treat it + as a file name. This follows the response to Open Group XCU ERN 41 + , + which says the behavior is allowed. + (skip_to_page): When starting page number exceeds page count, + print both numbers in the diagnostic. + (print_header): Detect page number overflow. + +2004-11-07 Jim Meyering + + * src/uname.c [__APPLE__]: Include and . + (main) [__APPLE__]: Get the processor type via syscall rather than + hard-coding "powerpc". From Toby Peterson. + + * src/sort.c (merge): Remove declarations of now-unused variables. + +2004-11-06 Paul Eggert + + * src/sort.c (first_same_file): Remove. Move most of the code to.... + (avoid_trashing_input): New function. + (merge): Avoid some silly merges, e.g., copying a single file to + a temporary file when there are exactly 17 input files to merge. + Take a count of temporary files rather than a max_merge arg. + All uses changed. + +2004-11-06 Jim Meyering + + * src/sort.c (xfclose): Don't close stdout here (just flush it), + since close_stdout now closes stdout unconditionally. + +2004-11-05 Paul Eggert + + * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps, + first_same_file, merge, sort, main): Use size_t for indexes to arrays. + This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX + temporary files). + (getmonth, keycompare, compare): Rewrite to avoid need for alloca, + thus avoiding unchecked stack overflow in some cases. As a side + effect this improve the performance of "sort -M" by a factor of 4 + on my benchmarks. + +2004-11-03 Paul Eggert + + * src/stty.c: Include "vasprintf.h" since we use vasprintf now. + + * src/Makefile.am (check-AUTHORS): Don't assume \? works in a sed + expression; it's not portable. Problem reported by Albert Chin. + Don't invoke a program more than once. + * src/groups.sh (version): New variable, containing author info, + for benefit of AUTHORS check. Use it when acting on --version option. + * AUTHORS: Remove duplicate lines. Remove bogus "chroot:" + in groups line. + + * src/system.h: Don't #define and #undef getopt around , + as this breaks the new regime that does "#define getopt rpl_getopt". + Problem reported by Albert Chin for Solaris 9 with Sun cc in: + http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00019.html + I suppose this may cause problems on ancient hosts with + incompatible getopt declarations, but we'll cross that bridge if + the problem gets reported to us by someone who can test the fix. + +2004-11-03 Jim Meyering + + * src/tac.c: quote(...) file names in diagnostics. + +2004-10-29 Paul Eggert + + * NEWS: Document getdate changes. + +2004-10-29 Jim Meyering + + * src/tac.c (tac_file): Remove temporary prototype and move this + function `down' so that it precedes definition of tac_nonseekable. + + `tac /proc/modules' would print nothing + Reported by Harald Dunkel in http://bugs.debian.org/278604. + + * src/tac.c (copy_to_temp): Renamed from save_stdin, since + now it copies a general file descriptor, not just stdin. + (tac_nonseekable): Renamed/adapted from tac_stdin. + (tac_file): Get fd via `open' directly rather than via fopen/fileno, + since we never used the stream. Perform "-" to stdin mapping here + rather than in main. Determine whether a file is seekable, + by trying to `lseek' to its end, and dispatch to tac_seekable or + tac_nonseekable accordingly. + (main): Rewrite argument handling now that it uses only tac_file. + * NEWS: Mention it here. + +2004-10-21 Jim Meyering + + * tests/mv/leak-fd: New file. + * tests/mv/Makefile.am (TESTS): Add it. + * tests/rm/dot-rel: New file. + * tests/rm/Makefile.am (TESTS): Add it. + + Correct my patch of 2004-10-18. + * src/remove.c (rm): Destroy the saved_cwd here (via cwd_state), + if necessary, not in remove_dir. Otherwise, removing multiple + `.'-relative nonempty directories no longer worked. + +2004-10-20 Paul Eggert + + * src/fmt.c (usage): Improve description of --prefix. + Problem reported by Edward Welbourne. + + * man/uniq.x: Change summary so that it doesn't imply that + uniq writes to its input file. Problem reported by + Dan Jacobson. + +2004-10-18 Jim Meyering + + Plug a leak that would cause a cross-device mv to fail when + operating on too many command-line-specified nonempty directories. + * src/remove.c (remove_dir): Destroy the `struct saved_cwd' on the + top of the stack before returning. This usually closes the file + descriptor that was used to return to the original working directory. + Reported by Cyril Bouthors in + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/3048 + * NEWS: Mention it here. + + * src/pathchk.c (validate_file_name): Give a more descriptive + diagnostic when pathconf fails. This also avoids an unwarranted + warning from gcc-3.3.5 about a format not being a string literal. + + * src/sleep.c (main): Remove declaration of unused local, c. + * src/printenv.c (main): Likewise. + * src/logname.c (main): Likewise. + * src/uptime.c (main): Likewise, for optc. + * src/tsort.c (main): Likewise, for opt. + +2004-10-17 Paul Eggert + + * AUTHORS: Add self to pathchk. + * src/pathchk.c (AUTHORS): Add self. + Change "path" to "file name" whenever possible. + Remove usage comment, as it was a duplication of the code or doc. + Include if available. + (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define. + (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX, + pathconf_wrapper, portable_chars, dir_ok): Remove. + (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros. + (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent. + (portable_chars_only): New arg FILELEN. + Don't assume ASCII; we might be on an EBCDIC host. + Don't assume unibyte locale in diagnostic. + (component_start, component_len): New functions. + (validate_file_name): Renamed from validate_path. All uses changed. + Pretty much a complete rewrite. + Don't make copy of file arg. Always append trailing slash to + pathconf arg, just in case it's a symlink (this is pure paranoia; + we don't know of any hosts where the trailing slash is required). + Use size_t instead of long int when possible. + Avoid need to call pathconf in most practical cases. + Don't use euidaccess several times to test searchability; + just use lstat once. Reword diagnostic to put the (often very long) + file names last. + +2004-10-15 Paul Eggert + + * src/printf.c (usage): Mention Unicode, and use H for hex digits. + +2004-10-13 Jim Meyering + + * NEWS: Mention today's fts.c fix. + +2004-10-13 Paul Eggert + + * tests/stty/row-col-1: Set LC_ALL=C. + +2004-10-12 Jim Meyering + + * src/dircolors.hin: Add .flac and .mpc as audio suffixes. + From Jesus Climent in http://bugs.debian.org/276149. + +2004-10-05 Paul Eggert + + * src/ls.c (ignore_mode): Renamed from ignore, to avoid shadowing + problems. All uses changed. + +2004-10-05 Jim Meyering + + * .x-sc_trailing_blank: Add an exclusion for config/texinfo.tex, + since Karl says its trailing blanks are there to stay :-) + +2004-10-04 Paul Eggert + + * src/expr.c (NEW, OLD): Remove, partly to avoid + reference to obsolescent macro XMALLOC. + All uses replaced by xmalloc and free. + +2004-09-28 Jim Meyering + + * src/tail.c (usage): Clarify: --retry works only with --follow=name. + Reported by Nik A. Melchior in http://bugs.debian.org/273781. + +2004-09-27 Paul Eggert + + * src/od.c (format_address_paren): c is optional, so don't output + it if it's '\0'. + +2004-09-26 Paul Eggert + + Add support for ls --hide. Idea suggested by Bardur Arantsson. + * NEWS: Document this. + * src/ls.c (file_ignored): Renamed from file_interesting, with + inverted return value. Accept the file name, not a struct dirent *. + All uses changed. Avoid the expense of calling fnmatch if the + file is ignorable due to leading '.'. + (all_files, really_all_files): Removed; replaced by: + (ignore): New variable. All uses changed. + (IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION): + New constants. + (hide_patterns): New variable. + (long_options, decode_switches, file_ignored, usage): + Add support for --hide. + (patterns_match): New function. + (usage): Replace "hide" with "ignore" in explanation, to avoid + confusion. + +2004-09-25 Paul Eggert + + * src/ls.c (gobble_file, print_long_format): Don't assume that + human-readable output has a byte count equal to its column width; + this isn't always true in locales where the radix character is not + '.' or ','. + (format_user_or_group): Revamp code to match the above fix; + this avoids the (very faint) possibility of integer overflow. + +2004-09-24 Paul Eggert + + * NEWS: Mention that "chmod -r -w x" now works as expected. + * src/chmod.c (main): Revamp option processing to support this. + * tests/chmod/Makefile.am (TESTS): Add 'usage'. + * tests/chmod/usage: New set of tests for usage like that. + +2004-09-24 Jim Meyering + + * Makefile.maint (CVS_LIST): Use --types=AFGM option so that + it lists only cvs-controlled regular files. + + * src/csplit.c (xalloc_die): Declare to be `extern', not `static' + to avoid a warning from gcc-3.4.1. Reported by Paul Eggert. + +2004-09-23 Paul Eggert + + * Makefile.maint (CVS_LIST): New macro. + (sc_space_tab, sc_prohibit_atoi_atof, sc_file_system, + sc_prohibit_jm_in_m4, sc_system_h_headers, sc_sun_os_names, + sc_trailing_blank, po-check): Use it instead of the + nonstandard "cvsu --list". + + * src/tail.c (parse_obsolete_option): Bring back support + for obsolete option followed by non-obsolete, or by more + than one file. When obsolete, conform to SUSv2 rather than + original POSIX 1003.2-1992, as SUSv2 corrected the case of + "tail -c". Add support for the SUSv2 "b" modifier. + * NEWS: Mention the above. + * tests/tail/Test.pm: New test case obs-b to check the above. + err-[134] no longer need _POSIX2_VERSION=199209. + Fix comments to match revised behavior. + +2004-09-22 Jim Meyering + + * Use automake-1.9.2. Regenerate dependent files. + + * src/remove.c (struct dirstack_state) [current_arg_jumpbuf]: + Improve the comment. + + Clean up scoping etc. so that some make `distcheck' tests pass. + * src/csplit.c (xalloc_die): Declare to be static. + * src/chown-core.c (chown_files): Declare as `extern'. + * src/cp-hash.c (remember_created): Likewise. + * src/copy.c (copy): Likewise. + * src/checksum.h (enum) [ALG_MD5]: Define to be 1, not 0. + + * src/id.c, src/nl.c, src/expand.c: Remove trailing blanks. + * src/unexpand.c: Likewise. + + * src/Makefile.am (check-AUTHORS): New rule. + (check): Depend on it. + * AUTHORS: Update. + + * Makefile.maint (syntax-check-rules): Remove duplicate sc_tight_scope. + (sc_system_h_headers): Also exclude copy.h; it includes . + +2004-09-22 Paul Eggert + + * src/ls.c (decode_switches): Don't compare a short value + to SIZE_MAX: GCC sometimes complains. + +2004-09-21 Paul Eggert + + * NEWS: The following commands now reject unknown options: + basename dirname factor hostname link nohup sync unlink yes + Also, pathchk no longer accepts trailing options. + + * src/basename.c: Include . + * src/chroot.c: Likewise. + * src/dirname.c: Likewise. + * src/factor.c: Likewise. + * src/hostid.c: Likewise. + * src/hostname.c: Likewise. + * src/nohup.c: Likewise. + * src/pwd.c: Likewise. + * src/setuidgid.c: Likewise. + * src/sync.c: Likewise. + + * src/basename.c (main): Reject unknown options. + * src/dirname.c (main): Likewise. + * src/factor.c (main): Likewise. + * src/hostid.c (main): Likewise. + * src/hostname.c (main): Likewise. + * src/link.c (main): Likewise. + * src/nohup.c (main): Likewise. + * src/pwd.c (main): Likewise. + * src/setuidgid.c (main): Likewise. + * src/sync.c (main): Likewise. + * src/unlink.c (main): Likewise. + * src/yes.c (main): Likewise. + + * src/cat.c (main): Remove unused "case 0". + * src/chgrp.c (main): Likewise. + * src/chmod.c (main): Likewise. + * src/chown.c (main): Likewise. + * src/comm.c (main): Likewise. + * src/cp.c (main): Likewise. + * src/csplit.c (main): Likewise. + * src/cut.c (main): Likewise. + * src/date.c (main): Likewise. + * src/df.c (main): Likewise. + * src/du.c (main): Likewise. + * src/env.c (main): Likewise. + * src/expand.c (main): Likewise. + * src/fold.c (main): Likewise. + * src/head.c (main): Likewise. + * src/id.c (main): Likewise. + * src/install.c (main): Likewise. + * src/join.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/ls.c (decode_switches): Likewise. + * src/mkdir.c (main): Likewise. + * src/mkfifo.c (main): Likewise. + * src/mknode.c (main): Likewise. + * src/mv.c (main): Likewise. + * src/nl.c (main): Likewise. + * src/paste.c (main): Likewise. + * src/pinky.c (main): Likewise. + * src/pr.c (main): Likewise. + * src/ptx.c (main): Likewise. + * src/readlink.c (main): Likewise. + * src/rm.c (main): Likewise. + * src/rmdir.c (main): Likewise. + * src/seq.c (main): Likewise. + * src/shred.c (main): Likewise. + * src/split.c (main): Likewise. + * src/sum.c (main): Likewise. + * src/tac.c (main): Likewise. + * src/tail.c (main): Likewise. + * src/tee.c (main): Likewise. + * src/touch.c (main): Likewise. + * src/tr.c (main): Likewise. + * src/tty.c (main): Likewise. + * src/uname.c (main): Likewise. + * src/unexpand.c (main): Likewise. + * src/wc.c (main): Likewise. + * src/who.c (main): Likewise. + + * src/chroot.c (main): Use getopt where it suffices, not getopt_long. + * src/cksum.c (main): Likewise. + * src/dd.c (main): Likewise. + * src/logname.c (main): Likewise. + * src/printenv.c (main): Likewise. + * src/sleep.c (main): Likewise. + * src/tsort.c (main): Likewise. + * src/uptime.c (main): Likewise. + * src/users.c (main): Likewise. + * src/whoami.c (main): Likewise. + + * src/du.c (long_options): Standardize on NULL vs 0. + * src/rm.c (long_opts): Likewise. + + * src/logname.c (long_options): Remove. + * src/printenv.c (long_options): Likewise. + * src/sleep.c (long_options): Likewise. + * src/tsort.c (long_options): Likewise. + * src/uptime.c (longopts): Likewise. + * src/users.c (longopts): Likewise. + * src/whoami.c (long_options): Likewise. + + * src/pathchk.c (longopts): Add --help, --version. + (main): Use longopts rather than parse_long_options. + * src/stty.c (longpts, main): Likewise. + + * src/pathchk.c (main): Don't reorder arguments, so that + we can check weird file names. + + * src/readlink.c: Don't include "long-options.h". + * src/sort.c: Likewise. + * src/stty.c: Likewise. + + * src/split.c (verbose): Now bool, not int. + (VERBOSE_OPTION): New enum. + (longopts, main): Use it. + + * tests/factor/basic: Adjust to new wording in diagnostic + that results from the above changes. + +2004-09-21 Jim Meyering + + * man/rm.x: Say "the response is affirmative" rather than "the + response begins with y or Y", so that the documentation is + accurate in non-English locales. Problem reported by Munzir Taha. + +2004-09-19 Paul Eggert + + * src/echo.c (main): Don't pass NULL to strcmp when + POSIXLY_CORRECT and given no arguments. + + * src/md5sum.c (STRING_OPTION): Remove. + (long_options, main): Remove support for undocumented and + obsolete --string option, as suggested in the 1996-09-26 patch. + * NEWS: Document this. + + * tests/rm/fail-eperm: Don't try to remove writeable files in a + sticky /tmp directory, as SVR4-like systems (e.g., Solaris 9) let + you remove such files. Problem reported by Bert Fischer in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00074.html + +2004-09-18 Paul Eggert + + * src/md5sum.c (STATUS_OPTION, STRING_OPTION): New enums. + (long_options, main): Use them instead of magic numbers 2 and 1. + For --string, optarg can't possibly be NULL. + + * src/dd.c (usage): Distinguish between options and operands. + (scanargs): Don't mess with argc, argv; getopt_long handles this now. + Say "operands" for operands, not "options". + (main): Use getopt_long, so that "dd --" works as POSIX requires. + * tests/dd/misc: Check for "dd --". + + * src/chroot.c (main): Reject unknown options instead of + interpreting them as a directory to chroot to. + + * src/cksum.c: Remove obsolete comment about POSIX 1003.2/D11.2. + The current standard (POSIX 1003.1-2004) is correct. + (crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid + collision with builtin function. + (main) [defined CRCTAB]: Output in lowercase hexadecimal, and + output the first 0 as 8 digits, to make it easier to compare to + the text of the standard. Output crctab to be a const array. + (crctab): Use result of above changes. + (long_options): Remove; not needed if empty. + (main): getopt_long can't return 0 here, so simplify the code. + +2004-09-13 Jim Meyering + + * src/Makefile.am (localedir.h): Don't redirect directly to target. + +2004-09-13 Paul Eggert + + * src/id.c (print_full_info): Don't exit with failure status simply + because a user or group number can't be turned into a name. + Problem reported by Felipe Kellermann in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00081.html + +2004-09-12 Jim Meyering + + * Makefile.maint (my-distcheck): When building with -Werror, also + require -Wshadow. + +2004-09-10 Paul Eggert + + * NEWS: "tail" now handles obscure POSIX 1003.2-1992 cases better. + * src/tail.c (parse_obsolete_option): Renamed from + parse_obsolescent_option, since the options are obsolete now. + Remove bool *arg; just exit if there's an error. Revamp to follow + POSIX 1003.2-1992 more precisely, to handle cases like "tail - + file" and "tail -10 -- file" correctly when we are conforming to + the older standard. + (main): Adjust to this change. + * tests/tail/Test.pm (test_vector): minus-* requires + _POSIX2_VERSION=199209 now, to work correctly if there is + an input file. err-1 and err-3 no longer errors if there + is another file. + +2004-09-09 Paul Eggert + + * src/test.c (usage): Document -r, -w, -x more carefully. + +2004-09-08 Paul Eggert + + * src/test.c (usage): Document "test" (with no args) and "[ ]". + Document that -h and -L don't dereference. + + * NEWS: Document that "tr xy -z" now works as per POSIX. + Sort the descriptions. + * src/tr.c (main): Don't reorder options. + * tests/tr/Test.pm (fowler-1): New test case. + +2004-09-06 Paul Eggert + + * src/touch.c (main): Fix POSIX-conformance bug: "touch -- + MMDDhhmm file" must be treated like "touch MMDDhhmm file" when + conforming to pre-2001 POSIX. + * NEWS: Document this. + * tests/touch/obsolescent: Test for this bug. Also, set + _POSIX2_VERSION=199209 and POSIXLY_CORRECT=1 so that it's + a better test for obsolescent features. + + * src/sort.c (main): Emulate Solaris 8 and 9 "sort -y", so that + "sort -y abc" is like "sort abc" whereas "sort -y 100" is like + plain "sort". + + * src/od.c: Several changes for POSIX and FreeBSD compatibility. + (COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X. + (long_options, main): --strings is now -S, not -s. + (usage): Reflect the usage changes. + (parse_old_offset): Do not issue a diagnostic on failure; + callers now do this as necessary. + (main): Support POSIX syntax. Remove unused case 0 from getopt_long. + Add support for new short options (many undocumented) for + compatibility with FreeBSD. Remove FIXME for -s; it's now + POSIX-compatible. Default format is now oS, not o2. + * NEWS: Describe the above. + +2004-09-05 Paul Eggert + + * src/stty.c (valid_options): Remove. + (main): Fix some bugs in handling invalid option-combinations + like "stty -F". + (recover_mode): Arg is now char const *, not char *. + (main): Use STDIN_FILENO, not 0. + Simplify option-parsing code a tad. + * tests/stty/basic-1: Check for the fixed bugs. + +2004-09-03 Paul Eggert + + * src/stat.c (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented + it from ever being nonzero. Reported by Pozsar Balazs in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html + (human_fstype): Add ramfs, squashfs, sysfs. + Reported by Pozsar Balazs in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html + (human_fstype): Return char const *, not char *. + Simplify internals a bit, and avoid casts. + + * src/dd.c (usage): "alternated EBCDIC" -> "alternate EBCDIC". + (bit_count): Remove. All uses changed to.... + (multiple_bits_set): New function. + (scanargs): Use it, and check separately for each set of + incompatible options, to improve diagnostics. + (MX): Remove. + (apply_translations): Move checks for incompatible options + to scanargs, so that they're done consistently. + +2004-09-02 Paul Eggert + + Output correct errno-related diagnostic on "paste" I/O errors. + * src/paste.c (write_error, xputchar): New functions. + (paste_parallel): Use correct errno value after input error. + (paste_parallel, paste_serial): Report errno value after output error. + + Port to diet libc. Problem reported by Felix von Leitner in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html + * src/paste.c (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove; + it's not portable C to assume FILE is a complete type. + (paste_parallel): Use index test instead of ENDLIST, and NULL + instead of CLOSED. + +2004-08-24 Paul Eggert + + POSIX-conformance fixes for "expand" and "unexpand". + Also, consistently use "tab stop" rather than "tabstop". + * NEWS: Document fixes. + * src/expand.c: Revamp to resemble the new unexpand.c better. + (usage): -i does not convert tabs after non-tabs. + (add_tab_stop): Renamed from add_tabstop. All uses changed. + (parse_tab_stop): Renamed from parse_tabstop. All uses changed. + (validate_tab_stop): Renamed from validate_tabstop. All uses changed. + (next_file, main): Check fclose against 0, not EOF. + (expand): Remove unnecessary casts. + Add another loop nesting level, for lines, so that per-line variables + are initialized cleanly. + Revamp tab checking. Check for write error immediately, rather + than just once at the end of the program. + * src/unexpand.c: Lkewise (for the expand.c changes). + (TAB_STOP_SENTINEL): Remove. + (tab_size): Now size_t, not uintmax_t, since we need to store + the sequences of blanks. + (max_column_width): New var. + (usage): Say "blank" where POSIX requires this. + (add_tab_stop): Calculate maximum column width. + (unexpand): Store the pending blanks, instead of merely counting them. + Follow POSIX's rules about -a requiring two blanks before a tab stop. + Get rid of internal label and goto. + * tests/unexpand/basic-1: Fix infloop-3 to match POSIX. + Add blanks-1 through blanks-13. + +2004-08-19 Paul Eggert + + * NEWS: "chown : file", "chown '' file", and "chgrp '' file" now + succeed without changing the uid and gid, like FreeBSD. + * src/chgrp.c (parse_group): Return gid_t rather than storing it + through a pointer. Treat "chgrp '' file" as a no-op change, + as FreeBSD does. + (main): Set chopt.group_name to NULL if the group is the empty + string. + * src/chown-core.c (describe_change): Describe changes to -1:-1 + without using "to OWNERSHIP" phrase. + * src/chown.c (usage): "chown '' file" is now allowed. + (main): Do not set user name to the empty string if the group + name is null. + * tests/chgrp/basic: Test "chgrp '' file". + * tests/chown/Makefile.am (TESTS): Add separator. + * tests/chown/separator: New file, partly taken from + Dmitry V. Levin's suggestion in + + +2004-08-11 Paul Eggert + + * tests/install/basic-1: Test for the -d regression. + +2004-08-11 Dmitry V. Levin + + * src/install.c (main): Fix -d regression introduced with + --target-directory support at 2004-06-25. + +2004-08-11 Paul Eggert + + * src/copy.c (copy_internal): When preserving links, unlink + a destination with link count greater than one. This is so + that commands like "cp -a" don't get confused when copying into + a destination that already contains many hard links. Problem + reported by Tim Waugh in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00053.html + +2004-08-10 Paul Eggert + + Convert all files to UTF-8. + * tests/fmt/basic (8-bit-pfx): Use UTF-8, not Latin-1. + * tests/sort/Test.pm (16a): Likewise. + * tests/uniq/Test.pm (8): Likewise. + * tests/misc/printf-hex: Use ASCII, not Latin-1. + + * NEWS: Document "sort -o -" and "tee -" POSIX-conformance fixes. + * src/shred.c (usage): "-" is an operand, not an option. + * src/sort.c (die, xfopen, mergefps, first_same_file, merge): + A null file arg means standard output. + (main): "-o -" means to write to a file named "-", + not to standard output. + * src/tee.c (usage, tee): "tee -" writes to standard output, not + to a file named "-". + +2004-08-10 Dmitry V. Levin + + * src/install.c (change_timestamps): Fix int->bool conversion + bugs introduced on 2004-07-29. + +2004-08-09 Paul Eggert + + * src/shred.c (wipename): Work even if the directory is writeable + and not readable. Prefer write access, since this should work + better with fdatasync. + + * src/csplit.c (xalloc_die): New function. + (main): Remove now-obsolete initialization of xalloc_fail_func. + + * src/md5sum.c: Adjust to sha->sha1 renaming. + +2004-08-08 Dmitry V. Levin + + Minor code cleanup. + * src/readlink.c (canonicalize_fname): Remove unneeded proxy function. + (can_mode): Make variable local. + +2004-08-07 Paul Eggert + + * src/system.h (O_BINARY) [!O_BINARY && defined O_BINARY]: + Do not define, to avoid annoying compiler messages on QNX 6.3. + Problem reported by Johan in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00050.html + +2004-08-04 Paul Eggert + + * src/system.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): + Define to a concatenation of string literals, not to an expression; + needed for concatenation contexts. + (INTMAX_MAX, INTMAX_MIN): New macros. + + * src/stat.c (print_stat): Don't assume st_ino / st_dev fits in + unsigned long; this isn't true for st_ino on Solaris 9. + +2004-08-03 Paul Eggert + + * src/uname.c: Do not depend on HAVE_SYSCTL when deciding + whether to include files. Include if + HAVE_SYS_PARAM_H (not HAVE_SYSCTL). + (main) [defined __POWERPC__]: Add a kludge to work around a + Mac OS X bug, so that uname -p defaults to "powerpc" if + sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0) + fails. Problem reported by Petter Reinholdtsen in: + http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html + + * src/uniq.c (hard_LC_COLLATE, ignore_case, different, check_file, + main): Use bool for booleans. + (writeline, check_file): Use uintmax_t for line counts. + (check_file): Check for and report line number overflow, + when that matters. + * src/wc.c (iswspace, wc): Use to_uchar rather than a cast. + (print_lines, print_words, print_chars, print_bytes, print_linelength, + have_read_stdin, wc, wc_file, main): + Use bool for booleans. + (exit_status): Remove. + (wc, wc_file): Return bool status. All callers changed. + * src/who.c (scan_entries): 0 -> STDIN_FILENO. + * src/whoami.c (main): Print uids using unsigned long int, not + unsigned int. + + * src/unexpand.c: Int cleanup and minor reorganization to be more + like src/expand.c. + Include quote.h, xstrndup.h. + (TAB_STOP_SENTINEL): Increase from INT_MAX to INTMAX_MAX. + (convert_entire_line, have_read_stdin, parse_tabstops, next_file, + unexpand, main): + Use bool for booleans. + (tab_size, tab_list, add_tabstop, validate_tabstops, unexpand): + Use uintmax_t for column counts. + (first_free_tab, validate_tabstops, unexpand): Use size_t for sizes. + (add_tabstop, parse_tabstops, main): Don't reserve UINTMAX_MAX + as a tab stop. + (parse_tabstops): Don't use ISBLANK on possibly-signed char. + Detect overflow in tab stop string. + (next_file, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0. + (unexpand): Concatenate input files the same way expand does. + + * src/touch.c (no_create, use_ref, posix_date, amtime_now, + touch, main): Use bool for booleans. + (main): Avoid integer overflow when given more than INT_MAX + options. + * src/tsort.c (struct item, n_strings): Use size_t for sizes. + (have_read_stdin, count_items, scan_zeros, detect_loop, + recurse_tree, walk_tree, tsort, main): + Use bool for booleans. + (exit_status): Remove. + (tsort): Return a success flag instead of storing into a global. + (main): Use it. + * src/tty.c (silent, main): Use bool for booleans. + (main): 0 -> STDIN_FILENO. + * src/uname.c (print_element): Use bool for booleans. + + * src/test.c (TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND): + Remove. All uses replaced by C99 boolean primitives. + (TEST_TRUE, TEST_FALSE): New constants, for readability. + (test_unop, binop, unary_operator, binary_operator, two_arguments, + three_arguments, posixtest, expr, term, and, or, is_int, age_of, + one_argument, main): Use bool for booleans. + (advance, unary_advance): Now inline procedures rather than a macros. + (is_int): Renamed from isint, to avoid namespace clash with ctype.h. + (term, and, or): When it's easy, loop instead of recursing. + (term): Avoid integer overflow if there are INT_MAX-3 args (!). + (binary_operator, unary_operator): Simplify by systematically rewriting + true==FOO to FOO (where FOO is a boolean). + (unary_operator): Don't consider a file to be a regular file + merely because its mode&S_IFMT is zero. Just use S_ISREG. + Remove unnecessary casts. Remove ifdefs for things like + S_ISSOCK that are no longer needed, since stat-macros.h always + defines them now. + + * src/tac-pipe.c (buf_init_from_stdin, find_bol, tac_mem): + Use bool for booleans. + (buf_init_from_stdin, buf_free, find_bol, print_line): + Use size_t for sizes. + * src/tac.c (separator_ends_record, tac_seekable, tac_file, + tac_stdin, tac_stdin_to_mem, main): Use bool for booleans. + (match_length, G_buffer_size, tac_seekable, main): Use size_t for sizes. + (tac_seekable): Use ptrdiff_t for pointer subtraction. + Report an error if the result is out of range. + (tac_seekable, main): Check for integer overflow in buffer size + calculations. + (main): Remove unnecessary casts. + + * src/su.c (run_shell): Pass a new n_additional_args arg, so that + the callee doesn't have to count 'em. All callers changed. + Don't allocate more space for the arg vector than we'll need. + Use memcpy to copy the args rather than rolling our own loop. + Use size_t for sizes. + (fast_startup, simulate_login, change_environment, log_su, + correct_password, restricted_shell, main): Use bool for booleans. + (longopts): Don't assume change_environment is an int. + Use NULL, not 0, for pointers. + (xsetenv): New function, replacing xputenv and concat. + All callers changed. + (elements): Remove; no longer needed. + (log_su, correct_passwd, main): Prefer !x to x==NULL. + (log_su): 2 -> STDERR_FILENO. + (modify_environment, main): Don't assume that getenv's returned value + has an indefinite lifetime. + (modify_environment): Allocate a larger environ. + (main): Remove an impossible 'case 0'; if it happens now, it'll + get diagnosed. Don't assume getpwnam results outlive endpwent. + Check for null or empty pw_name, pw_dir and for null pw_passwd. + + * src/stty.c (VA_START): Remove. All callers now use va_start. + (_POSIX_VDISABLE): Remove unnecessary cast. + (struct control_info, visible): Use cc_t for control chars. + (struct control_info): Use size_t for sizes. + (recover_mode, set_mode, display_speed, display_window_size, + valid_options, main, display_changed): + Use bool for booleans. + (integer_arg): Return unsigned long int, not long int. + Accept new max arg; all callers changed, to specify a maximum + value for integer parameters instead of silently overflowing. + (wrap): Do not overrun the stack buffer if the output contains + more than 1024 bytes. Instead, malloc a buffer. + (main): Remove a "what is this?!?" FIXME. Nobody knows what it is. + Remove unnecessary casts. + (set_control_char): Allow int values only up to cc_t range. + (screen_columns): Don't reject INT_MAX. + (display_changed, display_all, display_speed, recover_mode): + Don't assume cc_t fits in int. + + * src/remove.h: Add copyright notice. + (struct rm_options): Use bool for booleans. + * src/rmdir.c (empty_paths, ignore_fail_on_non_empty, verbose, + errno_rmdir_non_empty, remove_parents, main): Likewise. + * src/sum.c (have_read_stdin, bsd_sum_file, sysv_sum_file, + main): Likewise. + (main): Don't dump core if invoked with argv[0]==NULL. + * src/tee.c (tee, append, ignore_interrupts, main, tee): + Use bool for booleans. + (tee): Use ssize_t for read returns. + + * src/ptx.c: Add a FIXME mentioning that there are many + unchecked integer overflows in this file. + (gnu_extensions, auto_reference, input_reference, right_reference, + ignore_case, initialize_regex, fix_output_parameters, + output_one_roff_line, output_one_text_line, output_one_dumb_line, main): + Use bool for booleans. + (SKIP_SOMETHING, compare_words, digest_break_file, + find_occurs_in_text, fix_output_parameters): + Use to_uchar instead of a caset. + (print_field): Rewrite to avoid cast. + + * src/printf.c (posixly_correct): Use bool for booleans. + (verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0. + (STRTOX): Rewrite to avoid casts. + (print_esc_char): Arg is char, not int. + * src/readlink.c (canonicalize): Remove. All uses now merely inspect + can_mode. + (no_newline, verbose): Use bool for booleans. + (can_mode): Now of type int; use -1 to denote otherwise-uninitialized. + * src/shred.c (struct Options, main): Use bool for booleans. + (isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts. + * src/split.c (cwrite, bytes_split, lines_split, line_bytes_split): + Use bool for booleans. + * src/stat.c (G_fail): Remove. + (print_statfs): Print various gotta-be-nonnegative values using + unsigned long int, not long int or int. + (do_statfs, do_stat): Return a boolean success flag. + (do_stat, main): Use bool for booleans. + + * src/pr.c: Add a FIXME mentioning that there are many + unchecked integer overflows in this file. + (TRUE, FALSE): Remove. All uses replaced by true and false. + (struct COLUMN, read_line, print_page, print_stored, open_file, + skip_to_page, init_fps, parallel_files, align_empty_cols, + empty_line, FF_only, explicit_columns, extremities, keep_FF, + print_a_FF, print_a_header, use_form_feed, have_read_stdin, + print_across_flag, storing_columns, balance_columns, + truncate_lines, join_lines, untabify_input, failed_opens, + numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix, + double_space, ignore_failed_opens, use_col_separator, + pad_vertically, last_line, main, init_parameters, skip_read, + read_line, print_stored): + Use bool for booleans. + (struct COLUMN, char_to_clump, store_char, print_char): + Use char for chars. + (clump_buff, print_clump): Use char[], not int[], for an array whose + elements are always chars. + (first_last_page, main, getoptarg, balance, add_line_number, + char_to_uclump): Remove unnecessary casts. + (init_parameters): Allocate chars, not ints, for clump_buff. + (print_char): Use to_uchar before invoking ISPRINT. + (char_to_clump): Convert to unsigned char before invoking ISPRINT. + + * src/nohup.c (main): Use bool for booleans. + * src/paste.c (paste_parallel, paste_serial, main): Likewise. + * src/pathchk.c (validate-path, main, portable_chars_only): Likewise. + (portable_chars_only): Use to_uchar rather than a cast. + * src/printenv.c (main): Use bool for booleans. + Do not assume that the environ has at most one matching entry + for each option (integer overflow was possible otherwise). + + * src/od.c (FMT_BYTES_ALLOCATED): Now an enum, not a decimal + constant. Do not assume PRIdMAX etc. are strings of length 3 or + less. + (struct tspec): Use it. fmt_string is now an array, not + a pointer, as there's little point to the indirection here. + (struct tspec, flag_dump_strings, + traditional, flag_pseudo_start, limit_bytes_to_format, + abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul, + decode_one_format, open_next_file, check_and_close, + decode_format_string, skip, write_block, read_char, read_block, + parse_old_offset, dump, dump_strings, main): + Use bool for booleans. + (struct tspec): Use void *, not char *, for generic pointers. + (bytes_to_oct_digits, bytes_to_signed_dec_digits, + bytes_to_unsigned_dec_digits, bytes_to_hex_digits): + Use char, not unsigned int, since char suffices. + (print_s_char, print_char, print_s_short, print_short, + print_int, print_long, print_long_long, print_float, + print_double, print_long_double): Rewrite to avoid casts. + These now take void * arguments, instead of char *. + Use the same body for all functions, except for the choice + of type. Assume C89 to simplify handling of signed char. + (dump_hexl_mode_trailer, print_named_ascii, print_ascii): + Rewrite to avoid casts. + (print_named_ascii, print_ascii): Now takes void *, not char *. + (decode_one_format): Use int for printf field widths, not + unsigned int. Pass void * to subsidiary printers, + not char *. Simplify handling of floating-point formats + by factoring out common code dealing with precision and field width. + (decode_format_string): Avoid need for temporary copy of + each decoded struct tspec. + (get_lcm): Remove unnecessary cast. + (main): Fix bug where more than INT_MAX failed decodes were ignored. + +2004-08-02 Paul Eggert + + * src/nl.c (TRUE, FALSE): Remove; all uses changed to true, false. + (enum number_format): Remove. + (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings, + not enum values. + (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro. + (section_del): Now const. + (print_fmt): Remove. + (starting_line_number, page_incr, blank_join, line_no, + print_lineno, proc_text, main): + Use intmax_t for line numbers. + (reset_numbers, have_read_stdin, build_type_arg, nl_file, main): + Use bool for booleans. + (lineno_format): Now a string, not an enum value. + (build_print_fmt): Remove. All calls removed. This work is + now done within print_lineno. + (build_type_arg): Use size_t for sizes. + (print_lineno): Check for line number overflow. + (proc_text, main): Remove unnecessary cast. + + * src/ln.c (symbolic_link, interactive, remove_existing_files, + verbose, hard_dir_link, dereference_dest_dir_symlinks, + do_link, main): Use bool for booleans. + + * src/ls.c (struct fileinfo, file_interesting, + extract_dirs_from_files, color_symlink_as_referent, + FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group, + numeric_ids, print_block_size, dired, print_with_color, + check_symlink_color, print_inode, recursive, immediate_dirs, + all_files, really_all_files, qmark_funny_chars, + print_dir_name, format_needs_stat, format_needs_type, visit_dir, + main, decode_switches, parse_ls_color, print_dir, file_interesting, + gobble_file, make_link_path, basename_is_dot_or_dotdot, + extract_dirs_from_files, print_long_format): + Use bool for booleans. + (dir_defaulted): Remove; no longer needed. + (main): Use int to count files, since it suffices for argv. + Rewrite to avoid need for dir_defaulted. + (main, print_dir, gobble_file, get_link_name, + xstrcoll): + Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1. + (decode_switches): Put back check for ws.ws_col <= SIZE_MAX. + Remove unnecessary cast to int. Use int instead of unsigned + int to count from 0 to 1. + (get_funky_string, print_type_indicator): Use char for bytes, not int. + (make_link_path): Use NULL for null pointers. + (quote_name): Use to_uchar instead of cast. + + * src/id.c (use_name, main, print_user, xgetgroups, print_group_list, + print_full_info): Use bool for booleans. + (problems): Remove, replacing with.... + (ok): New var (inverted from old sense). + (print_user, print_group, print_full_info): + Print uids/gids with %lu, not %u. + (xgetgroups): Don't run out of memory if getgroups or getugroups + returns -1. + * src/setuidgid.c (main): Print uids/gids with %lu, not %ld. + + * src/factor.c (wheel_tab): Use unsigned char instead of unsigned + int, since it suffices. + (factor, print_factors): Use size_t for sizes. + (print_factors, do_stdin, main): Use bool for booleans. + * src/fold.c (TAB_WIDTH): New macro; use it instead of "8". + (fold_file, main): Use bool for booleans. + (fold_file, main): Use size_t for sizes. + (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead + of prohibiting widths greater than INT_MAX. + * src/head.c (presume_input_pipe, print_headers, have_read_stdin, + write_header, elide_tail_bytes_pipe, elide_tail_bytes_file, + elide_tail_lines_pipe, elide_tail_lines_seekable, + elide_tail_lines_file, head_bytes, head_lines, head, head_file, + string_to_integer, main): + Use bool for booleans. + (main): Rewrite to avoid cast. + + * src/csplit.c (struct line): Use size_t for sizes. + (main): Remove unnecessary cast. + * src/cut.c (cut_fields): Use to_uchar rather than a cast. + * src/cut.c (cut_file, main): Use bool for booleans. + * src/date.c (show_date, rfc_format, batch_convert, main): Likewise. + * src/env.c (main): Likewise. + * src/expr.c (nextarg): Likewise. + * src/env.c (main): Remove unused and nonstandard envp arg. + + * src/fmt.c (COST, MAXWORDS): Add a comment describing some of + fmt's arbitrary limits. + (TRUE, FALSE): Remove; all uses changed to (true, false). + (main): Use bool for booleans. + Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol, + to parse width. + (copy_rest): Remove unnecessary cast. + (get_prefix): Rewrite to avoid cast. + (check_punctuation): Use char *, not unsigned char *; C89 requires + this. Avoid off-by-one buffer read overrun when line is empty. + (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX. + Remove unnecessary casts. + * tests/fmt/basic (wide-1, wide-2, bad-suffix): Adjust to above + changes. + + * src/expand.c (convert_entire_line, have_read_stdin, parse_tabstops, + next_file, expand, main): + Use bool for booleans. + (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops, + expand, main): + Use uintmax_t for column counts. + (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value. + All callers changed. + (parse_tabstops): Don't pass a negative char to isblank. + Avoid memory leak with large tab stops. + (validate_tabstops, expand): Don't assume number of tab stops is + <= INT_MAX. + (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when + storing values into exit_status. + (expand): Use same pattern as unexpand for reading chars. + Report an error when input line is too long, instead of silently + screwing up. Do not mishandle tab stops when backspacing left + over start of line. + + * src/dircolors.c (have_read_stdin, append_quoted, + dc_parse_stream, dc_parse_file, main): Use bool for booleans. + (dc_parse_stream): Use enum for state, rather than int. + Use ssize_t to store getline result. + + * src/dd.c (translation_needed, parse_integer, scanargs, + apply_translations, char_is_saved, swab_buffer, skip_via_lseek): + Use bool for booleans. + (translate_buffer): Use to_uchar rather than a cast. + (swab_buffer, copy_simple, copy_with_unblock): + Use size_t for sizes. + + * src/seq.c (equal_width, valid_format, main): Use bool for booleans. + * src/sleep.c (apply_suffix): Likewise. + * src/tail.c (struct File_spec, reopen_inaccessible_files, count_lines, + forever, from_start, print_headers, have_read_stdin, valid_file_spec, + write_header, file_lines, pipe_lines, pipe_bytes, recheck, + tail_forever, tail_bytes, tail_lines, tail, tail_file, + parse_obsolescent_option, parse_options, main): Likewise. + * src/sleep.c (apply_suffix): Invert sense of result. + Use int (not unsigned int) for multiplier, as this generates better + code with some compilers. Simplify code a bit. + * src/tail.c (struct File_spec, max_n_unchanged_stats_between_opens, + parse_options): Use uintmax_t, not unsigned int or unsigned long int, + for state counters. + (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to + make it a bit clearer. + + * src/hostname.c: Include "xgethostname.h". + (xgethostname): Remove decl; xgethostname.h has it. + (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO) + && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use + prototypes rather than K&R form. Assume any negative value from + sysinfo denotes failure, not just -1. + (main): Simplify use of sethostname. + + * src/pinky.c (include_idle, include_heading, include_fullname, + include_project, include_plan, include_home_and_shell, do_short_format, + include_where, main): Use bool for booleans. + (count_ampersands, create_fullname, scan_entries, short_pinky): + Use size_t for sizes. + (create_fullname): Check for overflow in size calculations. + (idle_string): Don't assume that the number of idle days + is less than 10**8 and/or INT_MAX/(24*60*60). + (main): No need to pass a non-NULL last arg to getopt_long. + * src/uptime.c (print_uptime, uptime): Use size_t for sizes. + (print_uptime): Remove unused local variable. + (main): No need to pass a non-NULL last arg to getopt_long. + * src/users.c (list_entries_users, users): Use size_t for sizes. + (list_entries_users): Use char for bytes. + (main): No need to pass a non-NULL last arg to getopt_long. + * src/who.c (do_lookup, short_list, short_output, include_idle, + include_heading, include_mesg, include_exit, need_boottime, + need_deadprocs, need_login, need_initspawn, need_clockchange, + need_runlevel, need_users, my_line_only, main): Use bool for booleans. + (print_runlevel): Use unsigned char for bytes. + (list_entries_who, scan_entries, who): Use size_t for sizes. + (main): No need to pass a non-NULL last arg to getopt_long. + + * src/install.c (isdir): Remove decl. + (install_file_to_path): Rely on make_path to fail if the destination + is not a directory, by passing preserve_existing==true to it. + Hence we no longer need to call isdir. + Free dest_dir immediately when it's no longer needed, rather than + waiting until the end of the function. + (copy_file): Don't bother calling isdir, as copy will do the + right thing if the destination is a directory. + + * src/du.c (fts_debug, opt_all, apparent_size, opt_count_all, + print_grand_total, opt_separate_dirs, hash_ins, process_file, main): + Use bool for booleans. + (max_depth): Now size_t, not int, to avoid an arbitrary limit + of INT_MAX on depth. + (G_fail): Remove: no longer needed, now that the relevant + functions return bool. + (process_file): Use return value to signal success rather than + setting a global. Remove first_call static var; not needed, since + we can look at n_alloc. Use size_t for depths. Remove FIXME + about size_t casts, as it's now fixed. Use xnrealloc rather + than the obsolescent XREALLOC. Don't bother to check whether + reallocation is needed unless level > prev_level. + (du_files): Invert sense of result, for consistency with + other coreutils code. All callers changed. + (main): Allow --max-depth values up to SIZE_MAX. + + * src/df.c (inode_format, show_all_fs, show_local_fs, + show_listed_fs, posix_format, require_sync, print_type, + selected_fstype, excluded_fstype, show_dev, show_point, main): + Use bool for booleans. + (df_readable, show_dev): Use UINTMAX_MAX instead of -1. + (show_dev, show_point, main): + Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1. + Don't assume disk name lengths are <= INT_MAX. + Rewrite pct calculation to avoid cast. + (show_point): Don't assume resolved length is <= SSIZE_MAX. + + * src/cut.c (hash_int) [!defined UINTPTR_MAX]: Use size_t + instead of uintptr_t. + * src/shred.c (UINT_MAX_32_BITS): Remove. + (word32): Remove. All uses changed to uint32_t. + (isaac_seed_data): Remove unnecessary cast. + * src/system.h (ptr_align): Use size_t; in practice, this is just as + good as uintptr_t in checking for alignments, and has fewer + configuration hassles. + + * src/Makefile.am (localedir.h): Make it readonly; this + undoes part of the 2004-07-27 patch. + +2004-07-30 Paul Eggert + + * src/sort.c (UCHAR): Remove; all uses changed to to_uchar. + (IS_THOUSANDS_SEP): Use bool when appropriate. + (numcompare, main): Use char, not int, when the value is always a char. + (numcompare): Remove "register"; compilers are smart enough these days. + * src/system.h (errno, CHAR_BIT): Remove decls; + no longer needed now we assume C89 or better. + Include before , as it's the + Autoconf-recommended pattern. + (to_uchar): New inline function, moved here from tr.c. + Use full names for int types, e.g. "long int" rather than "long". + * src/tr.c (to_uchar): Remove; now in system.h. + (is_char_class_member): Use bool when appropriate. + + * src/mkdir.c (create_parents, main): Use bool when appropriate. + (main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1. + +2004-07-29 Paul Eggert + + * src/mkfifo.c (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1. + + * src/chmod.c (recurse, force_silent, process_file, process_files, + main): Use bool when appropriate. + * src/cksum.c (cksum, main): Likewise. + * src/comm.c (hard_LC_COLLATE, only_file_1, only_file_2, both, + compare_files, main): Likewise. + + * src/copy.h (struct cp_options): Likewise. + * src/copy.c (copy_internal, is_ancestor, copy_dir, copy_reg, + same_file_ok, seen_file, copy_internal, valid_options, copy): Likewise. + * src/cp-hash.h (remember_created): Likewise. + * src/cp-hash.c (remember_created): Likewise. + * src/cp.c (struct dir_attr, flag_path, remove_trailing_slashes, + re_protect, make_path_private, target_directory_operand, do_copy, + cp_option_init, decode_preserve_arg, main): Likewise. + * src/install.c (isdir, change_timestamps, change_attributes, + copy_file, install_file_to_path, install_file_in_dir, + install_file_in_file, strip_files, dir_arg, cp_option_init, main, + change_attributes, change_timestamps): Likewise. + * src/mv.c (remove_trailing_slashes, rm_option_init, + cp_option_init, do_move, movefile, main): Likewise. + * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir, + AD_push, prompt, remove_dir): Likewise. + * src/rm.c (rm_option_init, main): Likewise. + + * src/remove.c (top_dir, pop_dir, full_filename_): + Use size_t for sizes. + * src/cp.c (target_directory_operand): Do not clear *NEW_DST if stat + succeeds. It's not necessary in that case, as *NEW_DST is always + false already. + (do_copy): Rewrite slightly to avoid need for "unreachable" comment. + (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1. + * src/rm.c (main): Likewise. + + md5sum, sha1sum integer cleanups. + + * src/checksum.h: Don't include config.h, sys/types.h, stdio.h: + not needed. + (ALG_UNSPECIFIED): Remove. + (ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary. + * src/md5.c: Don't include any files other than checksum.h. + * src/sha1sum.c: Likewise. + * src/md5sum.c (OPENOPTS, have_read_stdin, status_only, warn, + bsd_split_3, split_3, hex_digits, digest_file, digest_check, main): + Use bool when appropriate. + (digest_check): Increase limit of number of input lines to + UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter. + Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals. + +2004-07-28 Paul Eggert + + * src/cat.c (exit_status): Remove. Now done by passing a boolean + 'ok' flag around. + (simple_cat, cat): Return true if successful. All callers changed. + (simple_cat, cat, main): Use bool for booleans. + (simple_cat): Use size_t for sizes. + (cat, main): Use the same names for parameters that we use for + long options, to avoid confusion. This inverts the sense of the + show_tabs (formerly output_tabs) and number_nonblank + (formerly numbers_at_empty_lines) variables. + (main): Don't mess up (due to integer overflow) if we are given + INT_MAX - INT_MIN + 1 options. + [O_BINARY]: Don't invoke isatty unless the other options require it. + (main): When deciding whether to use simple_cat, don't worry + about binary option; it's irrelevant. + + * src/dcgen: Remove comments, trailing white space, and empty + lines from the output strings, to save space. + Use a narrower type like 'unsigned char' for line lengths, if + that will do. + Make the output variables static, not extern. + + * src/chgrp.c (parse_group): Require base 10 when parsing + groups as integers. + (main): int -> bool when appropriate. + * src/chown.c (main): Likewise. + * src/chown-core.c: Include inttostr.h. + (UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove. + (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr + instead of uint_to_string). + (describe_change): Instead of an int flag, use a char * + auxiliary; this avoids the need for casts. + Assume free (NULL) works. + (change_file_owner): Return true/false, not 0/-1, since + we don't set errno. All callers changed. + Use bool when appropriate. + (chown_files): Likewise. + * src/chown-core.h (chown_files): Likewise. + + * tests/chown/basic: Test for proper handling of uids like + "010", which must be parsed as decimal. + + * tests/misc/pwd: Don't assume that Perl's getpwd agrees with our + pwd when there are multiple names for the working directory + (which can happen with an automounter, sigh). + + * src/Makefile.am ($(SCRIPTS)): Don't depend on Makefile; + this causes Solaris 8 'make' to refuse to build "groups". + (localedir.h): Don't depend on Makefile: this causes Solaris + 8 'make' to build localedir.h unnecessarily. The dependence + on Makefile is ineffective anyway, since $(localedir) might + change even if Makefile hasn't. + + * src/remove.c (remove_dir): If we can't save the state of the + working directory, pretend we started from "/", not ".". + This avoids a bug on hosts like Solaris that don't let you + remove the working directory. + +2004-07-27 Paul Eggert + + * src/printf.c (strtiomax, strtoumax): Declare if not already + declared: this fixes a portability bug with Solaris 8 + GCC. + (STRTOX): Parenthesize use of macro arg as expression. + (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary + parentheses. + * configure.ac: Check for declaration of strtoumax, for + src/printf.c. + + * src/Makefile.am (cp_LDADD, ginstall_LDADD, mv_LDADD, + pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess. + + * tests/readlink/can-e: Don't assume that we can remove the + working directory: this isn't possible under Solaris 8, say. + * tests/readlink/can-f: Likewise. + * tests/readlink/can-m: Likewise. + + * src/copy.c (copy_internal): find_backup_file_name no longer + returns NULL, so don't bother to check for this. + * src/cp.c (do_copy): Likewise. + * src/ln.c (do_link): Likewise. + +2004-07-25 Paul Eggert + + * src/nice.c (GET_NICE_VALUE): Renamed from GET_PRIORITY. + All uses changed. + (NZERO): New macro, if system doesn't define it already. + (usage): Distinguish priorities from nice values. + Don't assume NZERO is 20. + (main): Use bool instead of int where appropriate. + If user specifies an adjustment out of range, always truncate it + to an inrange value instead of sometimes giving an error message + and sometimes not. + Do not assume that -1 is an error return from "nice" or + "getpriority", as it might be the current nice value minus NZERO. + If nice/setpriority fails with errno == EPERM, go ahead and run + the command anyway; POSIX requires this. + + * src/pathchk.c: Include euidaccess.h. + (dir_ok): Use euidaccess, not access. + * src/test.c (R_OK, W_OK, X_OK, FOK): Remove; system.h defines them. + (eaccess): Remove. All users changed to use euidaccess instead. + +2004-07-24 Paul Eggert + + * src/uptime.c (print_uptime) [defined BOOT_MSG]: + Don't assume ut_line is null-terminated. + * src/who.c (print_line): New arguments USERLEN and LINELEN, + since USER and LINE might not be null terminated. All callers + changed. + +2004-07-23 Paul Eggert + + Fix bug with "tail -f" reported by Rob Holland in + . + Also, remove the undocumented and unsupported-since-2000 + --max-consecutive-size-changes options. Fix another related bug: + "tail" got confused if stdin, stdout, or stderr were closed. + Also, use output buffering even with "tail -f". + + * NEWS: Document this, plus yesterday's patch. + * doc/coreutils.texi (tail invocation): "size has remained the same" + -> "file has not changed", which is more accurate for fifos. + * src/tail.c: Include fcntl-safer.h. + (COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong). + (COPY_A_BUFFER): New macro. + (struct File_spec): New members mtime, mode, blocking. + Remove member n_consecutive_size_changes. + (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES, + max_n_consecutive_size_changes_between_opens, + MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove. + (long_options, tail_forever, parse_options): + Remove (non-)support for --max-consecutive-size-changes. + (record_open_fd): New function. + (recheck, tail_file): Use it. Don't assume that stdin is open. + (dump_remainder): Add support for new COPY_A_BUFFER special value. + Treat errno==EAGAIN like EOF, since it might be a nonblocking read. + (recheck): New arg BLOCKING, specifying whether to use blocking reads. + All uses changed. + (n_live_files): Remove, replacing with... + (any_live_files): New function. All uses changed. + (tail_forever): Use nonblocking I/O unless we know that blocking I/O + is safe; this avoids some hangs when reading from a fifo. + Avoid invoking fstat or sleep when using blocking I/O. + Do not check for changes to size if the file is not a regular file, + as the size is undefined in that case. + Check for changes to mtime or mode, too; this works for non-regular + files. + (tail_forever, main): Redo fflush strategy to work even when input + is nonblocking. Don't use unbuffered output; just flush when needed. + +2004-07-22 Paul Eggert + + * src/tail.c (main): Ignore -f if no file operand is specified + and standard input is a pipe. + * doc/coreutils.texi (tail invocation): Do not ignore -f for + all pipes, just for when standard input is a pipe and no + file operand is specified. + * tests/tail/Test.pm: Reinstate f-1 test, since we now pass. + Add a new commented-out f-2 test, which we still fail. + (test_vector): All f-* tests are special cases, not just f-1. + +2004-07-12 Paul Eggert + + * src/uptime.c: Include c-strtod.h. + (print_uptime): Use c_strtod instead of setlocale and sscanf. + Use long int rather than int to count days (for 64-bit hosts), + and check for arithmetic overflow when converting double to time_t. + +2004-07-11 Paul Eggert + + * src/printf.c (vstrtold): Renamed from vstrtod. + Now returns long double. All uses changed. + (print_direc): Use "L" length modifier when printing floating point + numbers, since we're now printing long double. + +2004-07-06 Paul Eggert + + printf cleanup, to avoid undefined behavior, to add support for + formats that Bash supports, and to support wide integers like + Bash does. + + * NEWS: Document this. + * src/printf.c (UNSPECIFIED): Remove. All uses now replaced by + booleans, so that we don't reserve any values for precision or + width (like Bash). + (STRTOX): Use prototype, not K&R-style definition. + (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol + in ../lib), with type change to intmax_t. + All uses changed. + (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t. + All uses changed. + (vstrtod): Renamed from xstrtod. All uses changed. + (print_direc): Use boolean arg instead of special value to indicate + a missing precision or width. LENGTH no longer includes + length modifiers or conversion character. New arg CONVERSION + now specifies conversion character. + Use intmax_t-width formatting for integers (like Bash). + Add support for C99 %a, %A, %F (like Bash). + Add support for field width with %c (POSIX requires this). + Add a FIXME for lack of support for field width and precision + for %b. + Add support for '\'', '0' flags. + Check for invalid combinations of flags, field width, precision, + and conversion, to prevent use of undefined behavior. + Allow multiple length modifiers, for formats like "%lld" (like Bash). + Add support for C99 'j', 't', 'z' length modifiers (like Bash). + In error message, output entire invalid conversion specification, + instead of merely outputting % followed by the conversion char. + * tests/misc/printf: Add tests for the above. + +2004-04-03 Dmitry V. Levin + + Change "readlink -f" to be more compatible with prior implementations. + Add more canonicalize options, -e and -m. + Add comprehensive tests for all readlink modes. + + * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME): + Do not add canonicalize.c here. + + * src/readlink.c (longopts): Add new options. + (usage): Document them. + (canonicalize_fname): New proxy function. + (main): Handle new options. + * doc/coreutils.texi (readlink invocation): Document new + "readlink -f" behaviour and new canonicalize options, -e and -m. + + * configure.ac (AC_CONFIG_FILES): Add tests/readlink/Makefile. + * tests/Makefile.am (SUBDIRS): Add readlink. + * tests/readlink/Makefile.am: New file. + * tests/readlink/{rl-1,can-e,can-f,can-m}: New readlink tests. + * tests/misc/Makefile.am (TESTS): Remove basic readlink test. + * tests/misc/readlink: Remove file. + +2004-07-04 Jim Meyering + + * src/copy.c (copy_internal): Add a FIXME comment. + +2004-07-02 Paul Eggert + + * src/copy.c (copy_dir): Assume path_concat returns non-NULL. + * src/cp.c (do_copy): Likewise. + * src/mv.c (movefile): Likewise. + + * src/cp.c (make_path_private): 2nd arg is now size_t, not int, + to avoid problem when path_concat dir name is longer than 2 GiB (!). + + * src/nohup.c (main): Don't pass NULL first argument to path_concat. + This cleans up the semantics a bit, as we no longer try to open the + same file twice. + +2004-07-01 Paul Eggert + + * NEWS: Add short names -t and -T for --target-directory + and --no-target-directory options, respectively. + + * src/cp.c (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION): + Remove. All uses changed to 'T' and 't', respectively. + * src/install.c, src/ln.c, src/mv.c: Likewise. + + * src/cp.c (long_opts, usage, do_copy, main): Add -t and -T as + aliases for --target-directory and --no-target-directory, + respectively. + * src/install.c (long_options, main, usage): Likewise. + * src/ln.c, src/mv.c: Likewise. + +2004-07-01 Jim Meyering + + * Makefile.maint (sc_file_system): New target. + (syntax-check-rules): Add it. + .x-sc_file_system: New file. + * Makefile.am (EXTRA_DIST): Add it. + + * man/sync.x: Use "file system" rather than "filesystem". + * man/stat.x, man/df.x: Likewise. + +2004-06-30 Paul Eggert + + * src/df.c (usage, main): Output "file system" rather than + "filesystem". + * src/du.c (usage): Likewise. + * src/shred.c (usage): Likewise. + * src/stat.c (usage): Likewise. + * src/stat.c (long_options, usage): Rename "--filesystem" to + "--file-system". But keep the old name around, for compatibility + reasons. + +2004-06-29 Paul Eggert + + Add support for --no-target-directory option. + + * NEWS: Document it. + * doc/coreutils.texi (Common options, Target directory, cp + invocation, install invocation, mv invocation, ln invocation): + Likewise. + (link invocation): Explain how to rewrite link using ln now + that we have --no-target-directory. + (ln invocation): Explain that --no-target-directory subsumes + --no-dereference. + (unlink invocation): Modify wording to match new wording in + link invocation. + + * src/cp.c (NO_TARGET_DIRECTORY_OPTION): New constant. + (long_opts, usage, do_copy, main): Add support for + --no-target-directory, + * src/install.c (NO_TARGET_DIRECTORY_OPTION, long_options, main, + usage): Likewise. + * src/ln.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage, + main): Likewise. + * src/mv.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage, + main): Likewise. + * src/mv.c (enum): Sort values. + +2004-06-29 Jim Meyering + + Don't let verbose-mode output from a subshell obscure actual differences. + * tests/rm/inaccessible: Turn off command-echoing just before + invoking subshell, then turn it back on if VERBOSE=yes afterward. + +2004-06-25 Paul Eggert + + Add support for 'install --target-directory', an option + that has been documented for years but not implemented (!). + * doc/coreutils.texi (install invocation): Document + --target-directory in synopsis, too. + * src/install.c (TARGET_DIRECTORY_OPTION): New var. + (long_options, main, usage): Add --target-directory. + (target_directory_operand): New function, stolen from mv.c. + (main): Use it. Check for -d and --target-directory. + Alter wording of diagnostics to match other programs. + +2004-06-28 Jim Meyering + + * src/cp.c (usage): Fix copy+paste error in description of + --target-directory: s/move/copy/. From Paul Jarc. + +2004-06-27 Paul Eggert + + Use more-consistent rules among cp, ln, and mv when dealing with + last operands that are (or look like) directories. + + * src/cp.c (target_directory_operand): New, nearly-common function, + It reports an error if the destination appears to be a directory + (e.g., because it has a trailing slash) but is not. + * src/ln.c, src/mv.c: Likewise. + * src/cp.c (do_copy): Use it. + * src/ln.c (main): Likewise. + * src/mv.c (main): Likewise. + + * src/cp.c (do_copy): Don't assume argc is positive. + Don't bother to lstat dest, since copy() will do that for us. + Use "const" to avoid the need for cast. + + * src/cp.c (do_copy): Don't output a usage message because of file + problems (e.g., an operand is not a directory). Use it only for + syntax. Standardize on "target %s is not a directory" for the + diagnostic. + * src/ln.c (main): Likewise. + * src/mv.c (main): Likewise. + + * src/cp.c (do_copy): Remove test for trailing slash, since + target_directory_operand now does this. + * src/ln.c (main): Likewise. + * src/mv.c (movefile): Likewise. + + * src/cp.c (main): Reject multiple target directories. + Check whether a specified target is a directory when parsing the + options, using stat. This gives more-accurate diagnostics. + * src/ln.c (main): Likewise. + + * src/ln.c (isdir): Remove decl; no longer needed. + * src/mv.c (isdir, lstat): Likewise. + + * src/ln.c (do_link): New arg dest_is_dir. All uses changed. + Don't check the destination ourself; rely on dest_is_dir. + This way we can avoid lstatting the destination in the + usual case, and in the worst case we lstat 1, not 3 times. + Don't bother to unlink unless link failed; this saves a syscall. + Remove unnecessary backup_succeeded flag; + it was identical to "dest_backup != NULL". + + * src/ln.c (main): Use int to count to argc, not unsigned int. + This handles negative operand counts. + * src/mv.c (main): Likewise. + + * src/mv.c (do_move): Don't call hash_init; expect the caller to + do it, for consistency with cp.c and ln.c. All callers changed. + (movefile): dest_is_dir parameter is now bool, not int. + (main): Standardize on "missing destination file operand after %s" + for the diagnostic, for consistency with cp.c. + + * tests/mv/diag: Don't assume "mv --target=nonexistentdir" + will complain about the arg count. + Adjust to new (briefer) diagnostics. + * tests/cp/fail-perm: Add a test to verify that we get the new + diagnostic when failing to copy through a symlink-to-inaccessible-dir. + +2004-06-27 Paul Eggert + + Fix a bug: formerly, if d/x was a directory and x a file, "ln x + d/" incorrectly created a link d/x/x. It also saves some system + calls. + + * NEWS: Document the fix. + + * src/ln.c (main): Don't append basename to dest if this + results in an existing directory name. + * tests/ln/misc: See whether a trailing slash is followed too far. + +2004-06-26 Jim Meyering + + * src/printf.c (main): When given no arguments, print the standard + "missing operand\nTry printf --help..." message -- to be consistent. + +2004-06-26 Jim Meyering + + * src/mknod.c (main): Add \n at the end of message output via fprintf. + +2004-06-25 Jim Meyering + + * tests/ln/misc: Add test for ln subscript error. + +2004-06-23 Paul Eggert + + * src/ln.c (do_link): Remove unnecessary call to lstat. + (main): Avoid subscript error when the destination is "". + +2004-06-23 Jim Meyering + + * tests/*: Replace all occurrences of `(exit N); exit' with + `(exit N); exit N'. Otherwise, those many tests could exit with + improper exit status when exiting via e.g., a trapped interrupt. + Thanks to a report from Bob Proulx. + +2004-06-22 Paul Eggert + + * src/who.c (idle_string, print_user): New arg boottime, + specifying the most recent boot time. All uses changed. + (idle_string) Consider a line to be "old" if it hasn't been used + since the last boot time. Watch out for overflow when computing + times, and for times in the future. + (idle_string): Record latest boot time. + +2004-06-22 Jim Meyering + + * src/test.c (usage): Correct description of `-t FD'. The file + descriptor, FD, is no longer optional. Reported by Ton Nijkes. + +2004-06-21 Paul Eggert + + The 2004-06-19 fix for who and pinky was incomplete, as ctime + has undefined behavior if the year precedes -999 or follows 9999. + Since we have to stop using ctime anyway, we might as well use + strftime and fix the FIXME, and support internationalized dates. + + * NEWS: Document the new behavior. + * src/who.c: Include "hard-locale.h". + (time_format, time_format_width): New vars. + (time_string, print_line): Use them. + (main): Set them. + (time_string): Use localtime + strftime instead of + ctime, to avoid problems with years before -999 or after 9999. + * src/pinky.c: Likewise. + +2004-06-21 Paul Eggert + + Fix bug: GNU 'ls' didn't count columns correctly if user or group + names contained multibyte characters where the column count + differed from the byte count. This patch also corrects + some comments. + + * src/ls.c (format_user_or_group): New function, which counts + columns correctly. + (format_user, format_group): Use it. + (format_user_or_group_width): New function, which counts columns + correctly. + (format_user_width, format_group_width): Use it. + +2004-06-21 Jim Meyering + + * tests/priv-check: Quote "$PATH" in PATH=$PATH. + Suggestion from Andreas Schwab. + + * tests/priv-check: When running as root, be sure to propagate + PATH through to the process we exec as non-root. + Reported by michael@aplatform.com. + + * src/mknod.c (main): Don't segfault when calculating the + expected number of operands for `mknod NAME'. + +2004-06-20 Jim Meyering + + * src/dd.c (input_seek_errno): Declare file-scoped variable as static. + +2004-06-20 Paul Eggert + + * src/basename.c (main): + Standardize on the diagnostics given when someone gives + too few operands ("missing operand after `xxx'") or + too many operands ("extra operand `xxx'"). + Include "quote.h" and/or "error.h" if it wasn't already being included. + * src/chgrp.c (main): Likewise. + * src/chmod.c (main): Likewise. + * src/chown.c (main): Likewise. + * src/chroot.c (main): Likewise. + * src/comm.c (main): Likewise. + * src/cp.c (do_copy): Likewise. + * src/csplit.c (main): Likewise. + * src/date.c (main): Likewise. + * src/dircolors.c (main): Likewise. + * src/dirname.c (main): Likewise. + * src/du.c (main): Likewise. + * src/expr.c (main): Likewise. + * src/hostid.c (main): Likewise. + * src/hostname.c (main): Likewise. + * src/id.c (main): Likewise. + * src/install.c (main): Likewise. + * src/join.c (add_file_name, main): Likewise. + * src/link.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/logname.c (main): Likewise. + * src/md5sum.c (main): Likewise. + * src/mkdir.c (main): Likewise. + * src/mkfifo.c (main): Likewise. + * src/mknod.c (main): Likewise. + * src/mv.c (main): Likewise. + * src/nohup.c (main): Likewise. + * src/od.c (main): Likewise. + * src/pathchk.c (main): Likewise. + * src/ptx.c (main): Likewise. + * src/readlink.c (main): Likewise. + * src/rm.c (main): Likewise. + * src/rmdir.c (main): Likewise. + * src/seq.c (main): Likewise. + * src/setuidgid.c (main): Likewise. + * src/shred.c (main): Likewise. + * src/sleep.c (main): Likewise. + * src/sort.c (main): Likewise. + * src/split.c (main): Likewise. + * src/stat.c (main): Likewise. + * src/test.c (beyond, main): Likewise. + * src/touch.c (main): Likewise. + * src/tr.c (main): Likewise. + * src/tsort.c (main): Likewise. + * src/tty.c (main): Likewise. + * src/uname.c (main): Likewise. + * src/uniq.c (main): Likewise. + * src/unlink.c (main): Likewise. + * src/uptime.c (main): Likewise. + * src/users.c (main): Likewise. + * src/who.c (main): Likewise. + * src/whoami.c (main): Likewise. + + * tests/basename/basic: Adjust to new diagnostics. + * tests/du/files0-from: Likewise. + * tests/expr/basic: Likewise. + * tests/mv/diag: Likewise. + * tests/tsort/basic-1: Likewise. + +2004-06-20 Jim Meyering + + * src/ln.c: Remove declaration of yesno. + Instead, include yesno.h. + * src/copy.c: Likewise. + + * src/remove.c: Remove declaration of yesno. + Instead, include yesno.h. + (top_dir): Remove now-unnecessary cast of obstack_base. + (pop_dir): Likewise. + (full_filename_): Likewise. + +2004-06-19 Paul Eggert + + Don't dump core if ctime returns NULL; this is possible on + hosts with 64-bit time_t and 32-bit int. + * src/who.c: Include "inttostr.h". + (time_string): If ctime fails, print the raw time as an integer + instead of dumping core. + * src/pinky.c: Likewise, as follows: + Include "inttostr.h". + (time_string): New function, copied from who.c. + (print_entry): Use it. + +2004-06-19 Paul Eggert + + * src/who.c (print_line): Don't truncate user names at 8 bytes. + Problem reported by Guido Leenders in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html + * NEWS: document this. + +2004-06-19 Jim Meyering + + * src/system.h (case_GETOPT_VERSION_CHAR): Switch back to + using GNU_PACKAGE (from PACKAGE) once again. This restores + `GNU' to the parenthesized package name in --version output. + Before, the first argument from AC_INIT, `GNU coreutils', would + be propagated to the PACKAGE variable. Now, `GNU ' is trimmed. + Reported by Richard Stallman. + +2004-06-17 Jim Meyering + + * src/tr.c (to_uchar): Rename function from `uchar'. The latter + would clash with a typedef in Tru64's . From Albert Chin. + +2004-06-15 Paul Eggert + + * NEWS: Remove more special cases for POSIXLY_CORRECT when POSIX + allows the GNU behavior. "--" is now supported by chroot, hostid, + hosname, pwd, sync, yes. + * doc/coreutils.texi (yes invocation, false invocation, + true invocation): Document this. + * src/chroot.c (main): Handle "--". + * src/hostid.c (main): Likewise. + * src/hostname.c (main): Likewise. + * src/pwd.c (main): Likewise. + * src/sync.c (main): Likewise. + * src/yes.c (main): Likewise. + * src/true.c (main): Recognize --help and --version even if + POSIXLY_CORRECT is set. + * src/yes.c (main): Likewise. + +2004-06-09 Paul Eggert + + * NEWS: Remove special cases for POSIXLY_CORRECT when POSIX allows + the GNU behavior. + * doc/coreutils.texi (pr invocation, unlink invocation): Document this. + * src/ls.c (decode_switches): Pay attention to TABSIZE even if + POSIXLY_CORRECT is set. POSIX reserves upper-case environment + variables to the implementation, so it's OK for ls to depend on + TABSIZE. + * src/pr.c: Include "hard-locale.h". + (main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since + POSIX specifies the behavior only in the POSIX locale. + * src/printf.c (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT, + since POSIX says the behavior is unspecified here. + * src/tail.c (parse_obsolescent_option): Support multiple file operands + even if POSIXLY_CORRECT, since POSIX does not require a diagnostic. + * src/printf.c (main): Recognize --help, --version even if + POSIXLY_CORRECT. POSIX does not specify any options, but it + does not prohibit options either, so "printf" is like "expr" here. + * src/unlink.c (main): Likewise. + * tests/misc/printf: Adjust to the new semantics for \x if + POSIXLY_CORRECT. + +2004-06-14 Jim Meyering + + * tests/misc/pwd: New test, for fix of 2004-04-19. + * tests/misc/Makefile.am (TESTS): Add pwd. + (BUILD_SRC_DIR): Define BUILD_SRC_DIR. + + * src/copy.c: Remove declaration of euidaccess. + Instead, include "euidaccess.h". + +2004-06-13 Paul Eggert + + * src/who.c (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int. + (UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment, + as (sizeof "??") reliably returns 3. + (print_line): Guard against idle and pid being too long + (which is possible when printing headers). + (print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN. + Avoid unnecessary cast of sizeof to int. + (make_id_equals_comment): Do not assume that UT_ID returns + a string; it might return a non-null-terminated array. + Use strncat instead. It's not very often where strncat is + exactly what you want, but this is one of those rare cases. + +2004-06-11 Paul Eggert + + * src/who.c (list_entries_who): Don't output a trailing space. + +2004-06-09 Jim Meyering + + * src/touch.c (usage): Improve wording in description of the + --time=WORD option. Reported by Dan Jacobson. + + * src/chown-core.c (change_file_owner): Change names of parameters + old_uid and old_gid to required_uid and required_gid respectively. + + * src/chmod.c (mode_changed): Return false, not 0, now that the + function returns `bool'. + +2004-06-08 Paul Eggert + + Adjust chmod and chown to be similar if -c or -v are given. In + particular, a no-op chown is no longer reported as a change; this + reverts to previous behavior. Also, fix both commands so that -v + report failures even if the failure is not due to the chmod or + chown syscalls. + + * src/chmod.c (CH_NOT_APPLIED): New constant. + (describe_change): Handle it. + (process_file): Use it, if a symlink wasn't changed. + (mode_changed): Return bool, not int. Accept new argument + NEW_MODE; all callers changed. This lets us avoid statting the + file unless the new mode has unusual bits. + (process_file): Return -1 on error. With -v, report all errors + verbosely, not just some. + + * src/chown-core.c (change_file_owner): Return -1 on error, not + 1 sometimes and -1 on others. Our caller ORs together our results, + and (-1 | 1) == 0 on ones-complement hosts. + With -v report all errors verbosely, not just some. + Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent: + file_stats wasn't set properly in that case. + + * tests/chgrp/basic: Adjust to above changes. + +2004-05-20 Paul Eggert + + * tests/chgrp/basic: Test that chgrp -h does not fail on + symlinks, even on hosts where that's not supported. + Test that if -R is specified without -H or L, -h is assumed. + Test that chown() is not optimized away. + +2004-05-18 Paul Eggert + + Several fixes to chgrp and chown for compatibility with POSIX and BSD: + + Check for incompatible options. When -R and --dereference are + both used, then either -H or -L must also be used. When -R and -h + are both used, then -P must be in effect. + + -H, -L, and -P have no effect unless -R is also specified. + If -P and -R are both specified, -h is assumed. + + Do not optimize away the chown() system call when the file's owner + and group already have the desired value. This optimization was + incorrect, as it failed to updated the last-changed time and reset + special permission bits, as POSIX requires. + + Do not report an error if the owner or group of a + recursively-encountered symbolic link cannot be updated because + the file system does not support it. + + * NEWS: Document the above. + + * src/chgrp.c (main): Check for incompatible options. -R --dereference + requires either -H or -L, and -R -h requires -P. If -H, specify + FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this + file as much like chown.c as possible. + * src/chown.c (main): Likewise. + + * src/chown-core.c (change_file_owner): Use ent->fts_statp only if + needed. Chown a directory only after chowning its children; this + avoids problems if the new directory ownership doesn't permit + access to the children. Dereference symlinks before doing + ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /. + Do not optimize away the chown() system call when the file's owner + and group already have the desired value. POSIX does not permit + this optimization. Rely on chown and lchown to do the right + thing with symlinks and/or -1 arguments, now that we have wrappers + to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP + errors, not just command-line errors. + (chown_files): Pass FTS_NOSTAT to xfts_open if we don't need file status. + + * src/system.h (ENOTSUP): Remove. + + * tests/chgrp/basic: Use chown --from to discover whether the + group changed, since chgrp now changes unconditionally. This + complicates the sed script a bit. Do not specify --dereference, + since it's the default (and we want to test this). Adjust output + to match the fact that chgrp no longer optimizes the case of + changing a file's group to the same value as before. + * tests/chgrp/posix-H: Do not attempt to combine -h and -H; these + options are incompatible, and their behavior is undefined with POSIX. + (changed, not_changed): Adjust to match the fact that -h is no longer + specified. Sort names. + * tests/chown/deref: Adjust error-diagnostic spelling to match new + behavior. + +2004-06-07 Paul Eggert + + * src/uname.c (main): Fix typo introduced on 2003-05-10 that + prevented a diagnostic of any operands. + +2004-06-08 Jim Meyering + + * src/shred.c (direct_mode): Turn it on/off with directio, too. + +2004-06-07 Jim Meyering + + Enable direct-mode I/O (bypassing the buffer cache), if possible. + Prompted by a suggestion from Kalle Olavi Niemitalo + in http://bugs.debian.org/207035. + * src/shred.c (direct_mode): New function. + (do_wipefd): Turn on direct-mode I/O. + (dopass): If a file's first write fails with EINVAL, + turn off direct-mode I/O and retry the write. + +2004-06-05 Paul Eggert + + * src/tr.c (main): "tr -d a b" is now a fatal error even if + POSIXLY_CORRECT is set. The POSIX SYNOPSIS does not allow this + option combination. + +2004-06-04 Paul Eggert + + * src/shred.c (dopass): Don't subtract 1 from the offset after + a write error. Problem reported by Jon Peatfield in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html + +2004-06-02 Paul Eggert + + Fix bug reported by Buciuman Adrian in + + where 'dd' created a file that was too large. The bug was that dd + assumed that the input file offset does not advance after a failed + read; but POSIX says that the input file offset is undefined after + a failed read. + + * src/dd.c (MAX_BLOCKSIZE): New macro. + (input_seekable, input_seek_errno, input_offset, + input_offset_overflow): New vars. + (scanargs): Reject block sizes greater than MAX_BLOCKSIZE. + (advance_input_offset): New function. + (skip_via_lseek): Set errno to zero when reporting our failure, + so that we don't report based on garbage errno. + (skip): If fdesc is standard input, advance the input offset. + Do not quit if reading, and if noerror was specified; + POSIX seems to require this. + If read fails on output file, report the earlier lseek failure + instead; this fixes a FIXME in dd_copy. + (advance_input_after_read_error): New function. + (dd_copy): Use it, instead of assuming that failed reads + do not advance the file pointer. Advance input offset + after nonfailed reads. Advance only a partial block if + the previous read (before the failed read) succeeded, and + do not generate an output block of zeros in this case. + (main): Determine initial input offset, seekability of input, + and error if it wasn't seekable. + +2004-06-02 Jim Meyering + + rm (without -f) could hang unnecessarily when attempting to + remove a symlink to a file on an off-line NFS-mounted partition. + Reported by David Howells in https://bugzilla.redhat.com/124699. + * src/remove.c (write_protected_non_symlink): New function. + Don't invoke euidaccess on symlinks. + (prompt): Use write_protected_non_symlink rather than using + euidaccess directly, being careful not to call lstat twice for a file. + + Fix a bug in how the --output-delimiter=D option works with + abutting byte or character ranges. Reported by David Krider in + http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00132.html + * src/cut.c (print_kth): Remove special case for open-ended range. + (set_fields): Record the range start index for an interval even + when it abuts another interval on its low side. + Also record the range start index of the longest right-open-interval. + * tests/cut/Test.pm: Add tests of --output-delimiter=S with + abutting and overlapping byte ranges. + +2004-06-01 Paul Eggert + + Some POSIX-conformance cleanups for tr. + + * src/tr.c (posix_pedantic): Remove; no longer needed since + we need to test this in just one place now. + (usage): Mention -C. + (unquote): Note that \055, \n, etc are escaped. + Do not worry about POSIXLY_CORRECT when warning about ambiguous + escape sequences. + \ at end of string stands for itself. + Do not diagnose invalid backslash escapes: POSIX says the behavior + is unspecified in this case, so we don't need to diagnose it. + (main): Add support for -C (currently an alias for -c). + Do not diagnose 'tr [:upper:] [:upper:], as POSIX does not require + a diagnostic here. + * tests/tr/Test.pm: New tests bs-055, bs-at-end, repeat-Compl. + Fix comment for range-a-a. + +2004-05-25 Paul Eggert + + Improve the efficiency (and in one case, correctness) of code + that reads symlinks. + + * src/copy.c (copy_internal): Don't use alloca, as it can mess up + royally if the link length is long (e.g., GNU/Hurd). Use + xreadlink instead, it's safer. Don't bother to read the link if + it's the wrong size. Add a FIXME because this area is a bit murky + and undocumented. + * src/ls.c (get_link_name): Update use of xreadlink. + * src/readlink.c (main): Likewise. + * src/stat.c (print_stat): Likewise. + +2004-06-01 Jim Meyering + + * src/env.c (main): Prefer the notation `STREQ (a, b)' + over `!strcmp (a, b)'. + * src/sort.c (main, sort_buffer_size): Prefer the notation + `STREQ (a, b)' over `strcmp (a, b) == 0'. + * src/date.c (batch_convert): Likewise. + * src/expr.c (nextarg): Likewise. + * src/su.c (correct_password, restricted_shell, main): Likewise. + * src/ptx.c (swallow_file_in_memory, main): Likewise. + * src/test.c (binary_operator, and, or, main): Likewise. + +2004-05-13 Paul Eggert + + * NEWS: echo compatibility cleanup. + * doc/coreutils.texi (echo invocation): Document the changes. + * src/echo.c (V9_ECHO): Remove; always enabled. + (DEFAULT_ECHO_TO_XPG): Renamed from V9_DEFAULT, so that + we use the same naming convention as bash. Now an enum, + not a macro. + (usage): Reword to mention -e/-E more accurately. + Mention \0NNN (the POSIX syntax) rather than \NNN (nonstandard). + (hextobin): New function. + (main): Use bool rather than int for local vars when appropriate. + Do not allow options if POSIXLY_CORRECT, unless we are using + BSD semantics and the first argument is "-n". + Don't pass unnecessary extra arg to parse_long_options. + do_v9 now defaults to DEFAULT_ECHO_TO_XPG, not to allow_options. + Do not look for options if !allow_options. + Use size_t rather than int when appropriate. + Open-code option test rather than using strrchr. + Use faster test for "-". + Avoid redundant argc test. + Add support for \x, for Bash compatibility. + Use e.g. '\a' rather than '\007', for portability to EBCDIC hosts. + When '\c' is encountered, stop printing immediately, as POSIX + requires. + Add support for \xhh syntax. + Add support for \0ooo syntax; POSIX requires this. + +2004-06-01 Jim Meyering + + * Use automake-1.8b. Regenerate dependent files. + +2004-05-31 Jim Meyering + + * tests/Makefile.am.in (TESTS_ENVIRONMENT): Define PATH to include + the build src/ directory -- at the front. + ($(srcdir)/$x-tests): Depend on Makefile.am. + Use $x as the program name, except when it would be `test' (test is + the sole program tested via mk-script that is also a shell built-in). + In that case, use the old ../../src/$x. + +2004-05-30 Jim Meyering + + Work around HPUX /bin/cc compiler bug that is exposed, now that + sets are arrays of type `bool'. More details here: + http://lists.gnu.org/archive/html/bug-gnulib/2004-05/msg00094.html + FIXME: verify that the above URL points to the right message + + * src/tr.c (card_of_complement): Use cleaner `sizeof in_set' + rather than `N_CHARS * sizeof(in_set[0])'. Using HPUX's /bin/cc + (aC++/ANSI C B3910B A.05.55 [Dec 04 2003]) on an ia64-hp-hpux11.22 + system, those two expressions are not the same (256 vs. 1024). + The effect of this problem was that `tr -c x y' would fail: + tr: when not truncating set1, string2 must be non-empty + (set_initialize): Remove unnecessary initialization of the `in_set' + buffer; that initialization triggered the same compiler bug as above. + +2004-05-29 Paul Eggert + + tr cleanup, mostly having to do with integer type ranges. + Remove all casts. + + * tests/tr/Test.pm: Add a few tests for the below. Alas, most of + the test cases wouldn't be portable, or would take too much CPU + time, or both. + + * src/tr.c (N_CHARS, N_CHAR_CLASSES): Now an enum, not a macro. + This is safe since the code already assumes N_CHARS fits in int. + (Filter): Remove: we want to prototype everything. + (ORD, CHR): Remove. All uses removed. Some replaced with: + (uchar): New function. All places where a char must be converted + to an unsigned char are now done this way, not by ad-hoc methods. + (count): New type. Use it whenever counts or states are needed. + (BEGIN_STATE): Increase from INT_MAX - 1 (which was bogus, anyway, + since we used it in an unsigned int context) to UINTMAX_MAX - 1. + (REPEAT_COUNT_MAXIMUM): New macro. Use it in place of BEGIN_STATE + whenever appropriate. + (NOT_A_CHAR): Remove global macro; now a local enum. + (UL_LOWER, UL_UPPER, UL_NONE): No longer specify values, since + the rest of the code no longer depends on them. + (class_ok): Remove; all uses changed to use inline comparisons. + (RE_NO_TYPE): Remove; wasn't used or needed. + (struct List_element): normal_char and equiv_code are now unsigned + char, not int. + first_char, last_char, and the_repeated_char are now unsigned char, + not unsigned int. repeat_count is now count, not size_t. + All uses changed. + (struct Spec_list): state is now count, not unsigned int. + lengthis now count, not size_t. + n_indefinite_repeats is now size_t, not int. + has_equiv_class, has_char_class, and has_restricted_char_class + are now bool, not int. All uses changed. + (struct E_string): s is now char *, not unsigned char *. + escaped is now bool *, not int *. All uses changed. + (ES_MATCH): Remove macro, replacing with: + (es_match): New inline function. All uses changed. + (squeeze_repeats, complement, posix_pedantic, truncate_set1, + translating): Now bool, not int. + (io_buf): Now char array, not unsigned char. + (SET_TYPE): Remove. All uses replaced with bool. + (is_equiv_class_member, unquote, append_range, append_char_class, + append_equiv_class, find_closing_delim, star_digits_closebracket, + build_spec_list, parse_str, homogeneous_spec_list): + Now returns bool, not int. All uses changed. + (is_equiv_class_member): Now inline. + (is_equiv_class_member, is_char_class_member, make_printable_str, + append_normal_char, append_range, append_repeated_char, + get_s2_spec_stats): + Args are now of proper integer type. + (unquote, look_up_char_class, make_printable_str, + append_equiv_class, build_spec_list, squeeze_filter): + Avoid unsigned char *p; gently convert *p to unsigned char instead. + (unquote, get_spec_stats): Do not jump past declarations and then + use them; C doesn't allow this in portable programs. + (make_printable_str): Check for overflow in size calculations. + (xmemdup): Remove. All uses rewritten. + (find_bracketed_repeat): Args are now of proper pointer-to-integer + type. Do not reject [c*0]. Use xstrtoumax, not xstrtoul. + (find_bracketed_repeat, star_digits_closebracket): Check that the + digits are not escaped. + (build_spec_list): Don't bother to copy opnd_str; not needed. + (build_spec_list, get_next): Simplify internal logic a bit. + (card_of_complement): Fix bug due to char overflow. + (get_spec_stats): Don't assume len fits into int. + Check for integer overflow. Use abort() rather than assert(0). + (string2_extend): Fix subscript error: is_char_class_member (..., 255) + was being invoked. + (squeeze_filter): READER is never null now; simplify code. + READER arg now has a simpler type. Remove unnecessary casts. + (squeeze_filter, main): Calls to fwrite improperly checked result + against zero, rather than against requested size. + (plain_read): New function. + (read_and_delete, read_and_xlate): + Remove unused filter arg, and don't worry about hit_eof. + Simplify by using plain_read. + (set_initialize): Args are bool and bool *, not int and SET_TYPE *. + (main): Always pass a non-null procedure to squeeze_filter. + Rewrite so that class_ok isn't needed. + +2004-05-29 Paul Eggert + + * src/shred.c (dosync): Ignore EBADF errors, as IRIX 6.5 + fdatasync reports EBADF when syncing (unwritable) directories. + Problem reported by Albert Chin-A-Young in: + http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html + +2004-05-29 Jim Meyering + + * tests/chown/deref: Fix typo: use ls -ldo, not ls -ldg. + Patch from Albert Chin. + + * src/ptx.c (text_buffer_maxend): Remove declaration of unused variable. + + * src/remove.c (push_dir): Merge declaration and adjacent assignment + into a single statement. + +2004-05-28 Jim Meyering + + * src/remove.c (AD_mark_helper): Eliminate an unnecessary comparison. + +2004-05-22 Jim Meyering + + rm -r would get a failed assertion when run from an inaccessible + directory and with two or more command line arguments including an + absolute-named directory followed by a relative-named directory. + + * src/remove.h (struct rm_options) [require_restore_cwd]: New member. + * src/remove.c (struct cwd_state): Define. + (AD_pop_and_chdir): Redesign interface so that a restore_cwd failure + can be detected by the caller. Instead of returning a malloc'd + directory name, communicate it to caller via a new parameter, and + return an indication of whether restore_cwd failed. Update caller. + Eliminate an unnecessary call to AC_stack_top. + (remove_dir): Change type of cwd_state parameter to `struct cwd_state' + so we can now communicate to caller whether/how functions like + restore_cwd have failed. Update caller. + (rm_1): Fail if we've failed to restore the working directory + and the name of the next file to remove is `.'-relative. + (rm): Fail if the require_restore_cwd flag is true and we've + failed to restore the working directory. + * src/mv.c (rm_option_init): Initialize new member, + x->require_restore_cwd. + * src/rm.c (rm_option_init): Likewise. + +2004-05-21 Jim Meyering + + * tests/rm/inaccessible: New test for the above fix. + * tests/rm/Makefile.am (TESTS): Add inaccessible. + + * src/remove.c (rm): Use free rather than XFREE. + (remove_dir): Use xmalloc, not XMALLOC. + (ds_init): Likewise. + +2004-05-20 Jim Meyering + + * Makefile.maint (sc_unmarked_diagnostics): Now that the unmarked + diagnostics in shred.c have been fixed, don't exempt shred.c from + this check. + + * src/shred.c: Use translatable diagnostics, e.g. + change "%s: remove" to _("%s: failed to remove") and + change "%s: close" to _("%s: failed to close"). + +2004-05-17 Paul Eggert + + * src/shred.c (names): Bring back lower-case letters, "_", and + ".". But continue to omit +, =, %, @, #, as they're either + shell metacharacters (for some shells) or are not in some + character sets, or (in the case of '%') must be a + metacharacter somewhere. + +2004-05-16 Paul Eggert + + * src/cut.c (cut_fields): Adjust to new signature of getndelim2. + +2004-05-17 Jim Meyering + + * src/shred.c (incname): Decrement `len' only once per loop iteration. + + chgrp and chown now dereference symlinks by default, per POSIX. + Reported by Michal Politowski as http://bugs.debian.org/249177. + + * src/chown-core.c (chopt_init): Affect each symlink referent by default. + * src/chown.c (usage): Update to reflect this. + * src/chgrp.c (usage): Likewise. + * NEWS: Describe the change. + Adapt tests accordingly. + * tests/chgrp/basic: Use -h where necessary to retain semantics. + * tests/chgrp/deref: Likewise. + * tests/chgrp/posix-H: Likewise. + +2004-05-15 Paul Eggert + + In shred, check for errors from fdatasync more carefully. If + fdatasync fails with errno==EINVAL, it means this implementation + does not support synchronized I/O for this file. Do not report + this as an error, as (for example) AIX 5.2 fdatasync reports it + for raw disk devices. Problem reported by Albert Chin in + . + + Check for write errors, though: the old code ignored them. + Improve error checking in a few other cases, too (e.g., close of a + directory). + + Also, change several 'int' values to 'bool', so that the error + checking is a bit clearer. Similarly, change unsigned values + to size_t where appropriate. + + * src/shred.c: Include "dirname.h". + (datasync) [!HAVE_FDATASYNC]: Remove. + (dosync): New function. + (dopass): Use it. Return 1 on write error, -1 on other error. + All callers changed. Report write error if dosync does. + (do_wipefd, wipefd, wipename, wipefile): Return bool (true/false), + not int (0/-1). All callers changed. Return false if there's a + write error. + (incname): Return bool (true/false), not int (0/1). Accept + size_t length, not unsigned. All callers changed. Do not + bother checking for non-digits; it can't happen. Replace + recursion with iteration. + (wipename): Use dir_name, base_name, etc. instead of assuming + Unix file names. Use size_t for length, not unsigned. + Report error if unlink or close fails. + (wipename, main): Use bool for booleans. + + (names): Use only digits and uppercase letters, for greater + portability. + +2004-05-16 Jim Meyering + + * tests/chown/deref: New test for the yesterday's change. + * tests/chown/Makefile.am (TESTS): Add deref. + +2004-05-15 Jim Meyering + + chown --dereference did nothing when the owner/group of a + symlink matched the desired owner/group. Reported by David Malone. + Also reported in 1999 as http://bugs.debian.org/39642. + + * src/chown-core.c (change_file_owner): When --dereference has + been specified, and when processing a symlink, stat it to get the + owner and group of the referent. + +2004-05-14 Jim Meyering + + * man/pwd.x, man/echo.x, man/printf.x: Fix typo: + s/supercede/supersede/ reported by Andrew Fabbro. + +2004-05-13 Paul Eggert + + Improve performance of `sort -m' on large files, at the cost of + making some contrived examples unsafe. POSIX allows this + optimization. Performance problem reported by Jonathan Baker in + . + + * src/sort.c (first_same_file): Do not treat input pipes + differently from other files. + * doc/coreutils.texi (sort invocation): Document that "sort -m -o F" + might write F before reading all the input. + * NEWS: Likewise. + +2004-05-12 Paul Eggert + + * src/od.c (print_ascii, dump_strings): Use e.g. '\a' rather than + '\007', for portability to EBCDIC hosts. + * src/printf.c (print_esc_char): Likewise. + * src/tr.c (unquote, make_printable_str): Likewise. + +2004-05-12 Jim Meyering + + * src/remove.c (AD_pop_and_chdir): Move lstat-`.' into if-block + where the result is used. This avoids one unnecessary lstat call + per command line argument. + +2004-05-12 Paul Eggert + + Don't assume that "make -C" works; Solaris "make" doesn't have -C. + + * src/Makefile.am (all_programs.list): New rule, copied from + man/Makefile.am and tests/Makefile.am, except that we use the + system tr rather than ./tr and we don't use tr -s. + * tests/Makefile.am (all_programs): Use it. + * man/Makefile.am (all_programs): Likewise. Renamed from programs, + for consistency. All uses changed. + +2004-05-11 Jim Meyering + + * tests/rm/unread3: New test, for the above fix and today's + lib/save-cwd.c improvement. + * tests/rm/Makefile.am (TESTS): Add unread3. + + * src/rm.c: Don't include "save-cwd.h". It's no longer used. + +2004-05-10 Jim Meyering + + * tests/install/trap: New file. Test for bug fix of 2004-04-18. + * tests/install/Makefile.am (TESTS): Add trap. + + * src/remove.c (AD_push): Don't use errno in diagnostic about + `changed dev/ino'. + + Remove these generated files from CVS. + * tests/cut/cut-tests, tests/date/date-tests, tests/join/join-tests: + * tests/ls/ls-tests, tests/pr/pr-tests, tests/tac/tac-tests: + * tests/tail/tail-tests, tests/test/test-tests, tests/tr/range-tests: + * tests/tr/tr-tests, tests/wc/wc-tests: + +2004-05-09 Jim Meyering + + * src/tr.c (unquote): Use xcalloc rather than xmalloc and + a loop initializing the just-allocated memory to zero. + +2004-05-08 Jim Meyering + + * tests/rm/no-give-up: New file; check for today's fix. + * tests/rm/Makefile.am (TESTS): Add no-give-up. + +2004-05-08 Paul Eggert + + Fix bug where "rm" gave up too easily, reported by Dan Jacobsen in + . + + * src/remove.c (remove_entry): Check for errno values like ENOENT + that show the file cannot be directory, instead of for errno + values like EPERM that show the file might be a directory. This + is necessary because, when a single unlink() call has multiple + reasons to fail, it can set errno to any of those reasons; it's + only the rare errno value like ENOENT that excludes all the other + possible reasons to fail even when the file is a directory. + (remove_cwd_entries): Don't attempt chdir if the file is known + to not be a directory. + (remove_dir): Use the same method that remove_cwd_entries uses + (for some reason they differed). Don't assert that saved_errno + must be EPERM; it might be just about anything. + +2004-05-06 Jim Meyering + + * src/id.c (xgetgroups): Use xnmalloc, rather than xmalloc. + Don't add `1' to the buffer size (it was to protect against malloc + implementations that fail to allocate a buffer of size zero). + That is no longer necessary, since we use a malloc wrapper + on such systems. + + * src/wc.c (get_input_fstatus): Use xnmalloc, rather than xmalloc. + * src/head.c (elide_tail_bytes_pipe): Likewise. + * src/df.c (main): Likewise. + * src/shred.c (do_wipefd): Likewise. + * src/users.c (list_entries_users): Likewise. + * src/tail.c (main): Likewise. + * src/md5sum.c (main): Likewise. + +2004-04-29 Paul Eggert + + * src/df.c (show_disk, show_point): If several filesystems are + mounted on the same mount point, prefer the last one, not the first. + Problem reported by Christian Jones in + . + (show_disk): Remove unused statp arg. Return bool, not int. + (show_point): Rewrite to avoid gotos. Use the same algorithm + for lofs and dummies for each pass through the mount table, + rather than subtly different algorithms (which are probably + inadvertent). + +2004-05-03 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add m4/ChangeLog, now that we no longer + have m4/Makefile*. + +2004-05-01 Jim Meyering + + When chown or chgrp is modifying the referent of a symlink, + use the chown(2) function, if possible. + * src/chown-core.c (change_file_owner): Don't hard-code the + open/fchown/close kludge here. Use `chown' instead. + The chown function works just fine on conforming systems. + Other systems now go through the new chown wrapper that + resorts to the old kludge. + + * src/chown-core.c (change_file_owner): Add a comment. + +2004-04-27 Jim Meyering + + * src/ptx.c: Make over 40 global extern variables `static'. + (syntax_table, re_syntax_table): Remove declarations of two unused + variables (they were exposed by the above change). + + * src/du.c (G_fail, opt_nul_terminate_output): Declare `static'. + * src/ln.c (backup_type): Likewise. + + * src/remove.c (rm): Add `extern' keyword. + * src/cp-hash.c (forget_created, remember_created) + (src_to_dest_lookup, remember_copied, hash_init, forget_all): Likewise. + * src/copy.c (dest_info_init, src_info_init, copy): Likewise. + * src/chown-core.c (chopt_init, chopt_free, gid_to_name) + (uid_to_name, chown_files): Likewise. + + * src/Makefile.am (sc_tight_scope): New rule. + * Makefile.maint (sc_tight_scope): New rule. + (syntax-check-rules): Add it. + +2004-04-26 Jim Meyering + + * Use automake-1.8.4. Regenerate dependent files. + + * src/sort.c (limfield): Make a comment clearer. + +2004-04-25 Paul Eggert + + Fix POSIX-conformance bug: "sort -k 3,3.5b" is supposed to skip + leading blanks when computing the location of the field end; + it is not supposed to skip trailing blanks. Solaris 8 "sort" + does conform to POSIX. Also fix the documentation to clarify + this and related issues. + + * doc/coreutils.texi (sort invocation): Mention -k earlier, so + that the options are in alphabetical order. Describe how -b works + more-accurately; this involves fixing some examples, too. Mention + what happens if the start field falls after an end field or after + a line end. Warn about using -k without -b, -g, -M, -n, or -t. + Add an example of how to sort IPv4 addresses and Apache Common + Log Format dates. Remove a duplicate example. + (Putting the tools together): Use separate options rather + than agglomerating them. + * src/sort.c (limfield): Use skipeblanks, not skipsblanks, to + decode whether to skip leading blanks. + (trailing_blanks): Remove. + (fillbuf, getmonth, keycompare): Don't trim trailing blanks. + + * tests/pr/Test.pm: Fix typo in env_default comment. + * tests/sort/Test.pm: Likewise. + (18c, 18d): Reverse the order of output lines, so that the + test cases conform to POSIX. + +2004-04-22 Paul Eggert + + More signal-handling cleanup for ls.c. Do not allow signals to + happen between arbitrary output bytes, as the + restore-default-color sequence can bollix up multibyte chars or + color-change sequences in the ordinary output. Instead, process + signals only between printing a file name and changing the color + back to non_filename_text color. That way, if the signal handler + changes the color (to the default), 'ls' will change it back when + 'ls' continues (after being suspended). + + Also, do not bother with signal-handling unless stdout is a + controlling terminal; this lets stdio buffer better when "ls + --color" is piped or sent to a file. + + * src/ls.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros. + Do not include "full-write.h"; no longer needed. + (tcgetpgrp) [! HAVE_TCGETPGRP]: New macro. + (put_indicator_direct): Remove. All callers changed to use + put_indicator. + (caught_signals, interrupt_signal, stop_signal_count): New vars. + (restore_default_color): Don't bother checking for put_indicator + failure. + (sighandler): Don't handle SIGTSTP; that's another handler now. + Simply set interrupt_signal to the signal, then exit. + (stophandler, process_signals): New functions. + (main): Don't output any color changes until _after_ the signal + handlers are set up. This fixes a race condition where 'ls' + could be interrupted while initializing colors, and leaving the + terminal in an undesirable state. + Don't mess with signal-handling if standard output is not a + controlling terminal. + When exiting, restore the default color, then restore the + default signal handling, then act on any signals that weren't + acted on yet. + Do not print //DIRED// etc. in colors; this avoids the need + to catch signals when printing them. + (print_name_with_quoting): Process signals just before switching + color back to non_filename_text. + +2004-04-23 Jim Meyering + + Avoid segfault on systems for which SIZE_MAX != (size_t) -1. + * src/ls.c (quote_name): Use SIZE_MAX, not -1, in calls + of quotearg_buffer. Patch by Mikulas Patocka. + +2004-04-18 Paul Eggert + + tee ignored SIGPIPE, but POSIX doesn't allow this. + + * src/tee.c (main): Do not ignore SIGPIPE, as POSIX 1003.1-2001 + does not allow this. This undoes the 1996-10-24 patch. + +2004-04-18 Paul Eggert + + Signal-handling cleanup for coreutils. Here are the highlights: + + - csplit sometimes failed to remove files when interrupted. + - csplit didn't clean up if two signals arrived nearly simultaneously. + - install -s would infloop on System V if SIGCHLD was ignored. + - ls could incorrectly restore color if multiple signals + arrived nearly simultaneously. + + * src/csplit.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: + Define. + (filename_space, prefix, suffix, digits, files_created, remove_files): + Now volatile. + (caught_signals): New var. + (cleanup): Block signals while deleting all files. + (cleanup_fatal, handle_line_error, regexp_error): + Mark with ATTRIBUTE_NORETURN. + (create_output_file, close_output_file, interrupt_handler): + Block signals while changing the number of output files, + to fix some race conditions. + (delete_all_files): Do nothing if remove_files is zero. + Clear files_created. + (main): Don't mess with signals until after argument processing + is done. + + * src/csplit.c (main): Rewrite signal-catching code to make it + similar to other coreutils programs. When processing signals, + block all signals that we catch, but do not block signals that we + don't catch. Avoid problems with unsigned int warnings. + * src/ls.c (main): Likewise. + * src/sort.c (main): Likewise. + + * src/csplit.c (interrupt_handler): + Use void, not (obsolete) RETSIGTYPE. + * src/shred.c (sigill_handler, isaac_seed_machdep): Likewise. + + * src/csplit.c (interrupt_handler) [defined SA_NOCLDSTOP]: + Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent. + * src/ls.c (sighandler) [defined SA_NOCLDSTOP]: Likewise. + * src/sort.c (sighandler) [defined SA_NOCLDSTOP]: Likewise. + * src/nohup.c (main) [!defined _POSIX_SOURCE]: Likewise, except + for SIG_IGN. + * src/tee.c (main) [!defined _POSIX_SOURCE]: Likewise. + + * src/install.c: Include . + (main) [defined SIGCHLD]: Set SIGCHLD handler to the default, if -s is + given, since System V fork+wait does not work if SIGCHLD is ignored. + + * src/ls.c (sighandler) [!defined SA_NOCLDSTOP]: Reset signal + handler to self, not to SIG_IGN, since SIGTSTP can be received + more than once. + (main): Use SA_RESTART, as that is simpler than checking for EINTR + failures all over the place. + +2004-04-20 Jim Meyering + + * src/remove.c (is_empty_dir): Clarify comment. + + * man/help2man: Accept new option: --program-name=NAME, so that we + can override the one in --version output. This is needed solely + so that test.1 doesn't refer to `[' as the program name. + Reported by Benjamin Cutler as http://bugs.debian.org/205251. + * man/Makefile.am (.x.1): Use help2man's new --program-name option. + + * src/pwd.c: Don't include pathmax.h; system.h already does it. + + * src/cut.c (cut_fields): Free buffer upon getndelim2 failure. + +2004-04-19 Jim Meyering + + * src/shred.c (isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]: + Initialize a buffer to avoid warnings from tools like valgrind. + + * Makefile.maint (sc_trailing_blank): New rule. + (syntax-check-rules): Add it. + * .x-sc_trailing_blank: New file. + + Make pwd work even if the resulting name is so long that getcwd fails. + * src/pwd.c: (path_free, path_init, path_prepend): New functions. + (nth_parent, find_dir_entry, robust_getcwd): New functions. + (main): First try getcwd, then, upon failure, robust_getcwd. + +2004-04-18 Jim Meyering + + * src/who.c (print_user): Use xrealloc here, rather than + unchecked realloc. Remove anachronistic casts. + + * src/remove.c (full_filename_): Don't leak upon failed realloc. + + * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function, + from remove.c. + * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h, + renaming it. Update uses. + +2004-04-17 Jim Meyering + + * configure.ac: Depend on automake-1.8.3. + + * src/join.c (add_file_name): Declare function to be `static'. + (string_to_join_field): Likewise. + * src/remove.c (ds_init, ds_free): Likewise. + + * Makefile.maint (sc_prohibit_jm_in_m4): New rule. + (syntax-check-rules): Add to the list. + +2004-04-13 Paul Eggert + + Use page-aligned buffers whenever we bother to do I/O using buffer + sizes that are tailored for the files. + + * src/cat.c: Include getpagesize.h. + * src/copy.c: Likewise. + * src/shred.c: Likewise. + * src/split.c: Likewise. + * src/cat.c (main): Align I/O buffers to page boundaries. + * src/copy.c (copy_reg): Likewise. + * src/shred.c (dopass): Likewise. + * src/split.c (main): Likewise. + * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove. + All uses replaced by ptr_align. + * src/od.c (gcd, lcm): Remove; now in system.h. + * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c. + +2004-04-14 Jim Meyering + + Remove m4/Makefile.am: it's no longer needed, with newer automake + * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list. + * Makefile.am (SUBDIRS): Remove `m4' from the list. + +2004-04-13 Jim Meyering + + * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'. + +2004-03-27 Paul Eggert + + * NEWS: cp -pu and mv -u (when copying) now take the destination + file system time stamp resolution into account. + * doc/coreutils.texi (mv invocation): Document this. + (cp invocation): Document -u (it was missing!) with new behavior. + + * src/copy.c: Include "utimecmp.h". + (copy_internal): Compare time stamps using utimecmp rather than + MTIME_CMP. + +2004-04-09 Jim Meyering + + * Makefile.maint (.re-list): New rule/file, to replace + hard-coded list of header file names. + (sc_system_h_headers): Use the new file. + Don't look for sys2.h anymore. + + * src/system.h: Include new "stat-macros.h" rather than hard-coding + all of its macro definitions -- the list was slightly out of date. + Suggestion from Dmitry V. Levin. + +2004-04-08 Paul Eggert + + * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin. + * doc/coreutils.texi (dd invocation): Likewise. + * src/shred.c (O_NOCTTY): Remove redundant decl. + * src/dd.c (flags, usage): Remove noctty flag. + (main): Always use O_NOCTTY when opening files. + +2004-04-08 Jim Meyering + + * src/dd.c (dd_copy): Mark two diagnostics for translations. + (set_fd_flags): Undo part of today's change: it's a little + cleaner -- and more efficient in the common case -- to go + ahead and OR in the -1 when fcntl fails. + + * Makefile.maint (sc_dd_max_sym_length): New target. + (syntax-check-rules): Add it. + + * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]: + Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum. + + * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails. + Rename parameter, flags, to avoid shadowing global. + (LONGEST_SYMBOL): Tweak comment. + +2004-04-07 Paul Eggert + + * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync, + and new dd options iflag= and oflag=. + * src/dd.c (usage): Likewise. + * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib. + * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro. + (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros. + (input_flags, output_flags): New vars. + (LONGEST_SYMBOL): New macro. + (struct symbol_value): Renamed from struct conversion. Members + symbol and value renamed from convname and conversion. The + symbol value is now an array instead of a pointer; this saves + a bit of space and time in practice. All uses changed. + (conversions): Add nocreat, excl, fdatasync, fsync. Now const. + (flags): New constant array. + (iflag_error_msgid, oflag_error_msgid): New constants. + (parse_symbols): Renamed from parse_conversion and generalized + to handle either conversion or flag symbols. + (scanargs): Adjust uses of parse_symbols accodingly. Add + support for iflag= and oflag=. Reject attempts to use + both excl and nocreat. + (set_fd_flags): New function. + (dd_copy): Just return X rather than calling quit (X), since our + caller invokes quit with the returned value. Add support for + fdatasync and fsync. + (main): Add support for iflag=, oflag=, and new conv= symbols. + * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW, + O_RSYNC, O_SYNC): Define to 0 if not already defined. + + * NEWS: Remove duplicate mention of BLOCKSIZE. + +2004-04-02 Andreas Schwab + + * src/stty.c: Add support for IUTF8 input flag. + +2004-04-06 Jim Meyering + + * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev. + Interix spells it `mkdev'. Reported by Mark Funkenhauser. + +2004-04-04 Jim Meyering + + A specified format is no longer automatically newline terminated. + If you want a newline at the end of your format, use `\n'. + * src/stat.c (print_it): Don't print a newline at the end of + every format. + (do_statfs): Add a newline at end of each default format string. + +2004-03-30 Paul Eggert + + * src/nohup.c (main): Adjust to new calling convention + for set_cloexec_flag. + +2004-03-31 Jim Meyering + + * tests/Fetish.pm (run_tests): Remove `.orig' file. + Remove debugging diagnostic. + + Specifying an invalid --width=N (-w) or --gap-size=N (-g) + would not elicit an error. + * src/ptx.c: Include "xstrtol.h" and "quotearg.h". + (main): Don't use atoi. Use xstrtoul instead. + +2004-03-30 Jim Meyering + + * Makefile.maint (sc_prohibit_atoi_atof): New rule. + (syntax-check-rules): Add it. + * .x-sc_prohibit_atoi_atof: New file. + +2004-03-29 Jim Meyering + + * tests/du/files0-from: Use new OUT_SUBST directive, so that this + test is not sensitive to system-dependent block size differences. + Prompted by a report of Solaris 8 differences from Paul Eggert. + + * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST. + Rename `%tmp' to `%actual'. Reverse order of last two args to + _compare_files (to $actual, $expected) so as to match declaration. + +2004-03-28 Paul Eggert + + Fix some gotchas encountered when porting to Solaris 8, using + the Forte 6u2 compiler. + + * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]: + Declare sethostname, since no Solaris header does it. + * src/who.c: Include "vasprintf.h", for asprintf. + +2004-03-28 Jim Meyering + + Minor optimization: + * src/du.c (process_file): Don't record dev/inode for directories. + + Under some circumstances, without -c, du would mistakenly count the + space of hard-linked files, not just the first one it encountered. + Reported by Anthony Thyssen. + * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes. + + * src/du.c: Rename global `print_totals' to `print_grand_total'. + + * src/du.c (main): Rearrange filtering loop to be a tiny bit + more efficient. + + * src/chown-core.c: Don't include savedir.h -- no longer needed. + * src/chmod.c: Likewise. + +2004-03-25 Jim Meyering + + * src/du.c (main): Remove now-unused declaration of `i'. + +2004-03-24 Paul Eggert + + * src/du.c (main): Filter out file names of length zero before + invoking fts, so that they don't cause fatal errors. + +2004-03-25 Jim Meyering + + * tests/du/files0-from (zero-len): Add a test for the above. + +2004-02-25 Paul Eggert + + * NEWS: New environment var BLOCKSIZE. + * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE. + * tests/envvar-check: Test for it. Factor the code to simplify it. + +2004-03-23 Paul Eggert + + * NEWS: Shorten the du --files0-from announcement, and say + "NUL-terminated" rather than "NUL-separated". + * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES): + Remove: not used. + (usage): Say "NUL-terminated", not "NUL-separated". + (main): Check for I/O error when istream is closed. + Allow --files0-from=F even if F is empty; this specifies no files. + (du_files): Now that we allow the list of files to be empty, + handle that case. + * tests/du/files0-from: Adjust to above changes to src/du.c. + +2004-03-24 Jim Meyering + + * tests/tail-2/assert: Avoid race condition that could cause + spurious failure. Based on a patch from Andreas Schwab. + +2004-03-23 Jim Meyering + + * src/du.c (main): Free the hash table, too. + +2004-03-22 Jim Meyering + + * man/Makefile.am (.x.1): Remove --info-page= option, reverting + the change of 2004-01-22. I can no longer reproduce the problem + that prompted that change, and `info coreutils pr' would display the + `printing text' section of the manual, not the one on `pr invocation'. + + * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics + to match corrected output. + + * src/du.c: Include "readtokens0.h" rather than "readtokens.h". + (main): Use readtoken0 functions rather than readtokens. + Don't use errno when diagnosing readtokens0 failure. + Fix off-by-one error in the token number reported in a diagnostic. + (du_files): Return bool, rather than int. + (main): Call readtokens0_free. + +2004-03-21 Jim Meyering + + * src/remove.c (ds_free): Plug a small leak. + + * tests/Fetish.pm: Fix typo in comment. + +2004-03-07 Jim Meyering + + * NEWS: du accepts a new option --files0-from=FILE, where FILE + contains a list of NUL-separated file names. + + * src/du.c: Include "readtokens.h". + (usage): Describe the new option, and adjust the `Usage': + with this option, no FILE may be specified on the command line. + (main): Handle the new option. + + * tests/du/files0-from: New tests, for the above. + * tests/du/Makefile.am (TESTS): Add files0-from. + + * src/factor.c (do_stdin): Reflect changes in use of readtoken. + * src/tsort.c (tsort): Likewise. + +2004-02-29 Paul Eggert + + * NEWS: Add support for a new notation @N to get_date to represent + the time stamp with numeric value N. Improve support for + fractional time stamps. date's -d and -f options now accept them. + Likewise for touch -t. date has a new option --iso-8601=ns. + + * doc/coreutils.texi (touch invocation): + Describe use of fractional seconds. + (date invocation, Options for date): Likewise. + * doc/getdate.texi (General date syntax, Time of day items): Likewise. + * doc/coreutils.texi (date invocation): Mention effect of LC_TIME. + (Options for date): Describe new --iso-8601=ns option. + + * doc/getdate.texi: Add copyright notice. Change getdate to + get_date when talking about the function name. + (Seconds since the Epoch): New section, containing the time_t + info moved from Date input formats section, along with new + info about the @ syntax. Mention negative time stamps, + fractional time stamps, and leap seconds. + (General date syntax): Modernize examples a bit to reflect new + features. + (General date syntax, Relative items in date strings): + Use ' rather than " to quote formats. + (Time of day items): Add an example with fractional seconds. + Describe fractional-second syntax. + + * src/Makefile.am (touch_LDADD): New macro, since `touch' now + needs clock_gettime. + + * src/date.c (enum Time_spec): New enum TIME_SPEC_NS. + (time_spec_string, time_spec, show_date): Support it. + (usage): Remove description of -ITIMESPEC, as it's obsolete and + confusing. Mention --iso-8601=ns. + (batch_convert): getline returns ssize_t, not int. + + * src/touch.c (newtime): Now an array of two timespecs, one + for access and one for modification. + (ref_stats): Remove. + (get_reldate): Use get_date's parameter profile. + (touch, main): Adjust to above changes. + (main): Work even if tm_year == INT_MAX (so long as long int is wider). + Use gettime instead of gettimeofday, for new get_date signature. + + * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32, + ns-relative. + +2004-03-15 Jim Meyering + + * Makefile.maint (alpha beta major): `Make' the emit_upload_commands + target before updating $(prev_version_file). + + * tests/misc/date-sec: New file, to test for just-fixed bug in date. + See today's change in lib/getdate.y. + * tests/misc/Makefile.am (TESTS): Add date-sec. + +2004-03-14 Jim Meyering + + * announce-gen (print_changelog_deltas): Use `.sig' suffix for + signature files, not `.asc'. Reported by angico@yahoo.com. + +2004-03-13 Jim Meyering + + * src/cp.c (do_copy): Tweak wording in a diagnostic. + Suggestion from Karl Berry. + Include "quoatearg.h". + (do_copy): Use quotearg_colon (not quote) for diagnostics + that begin with `"%s:'. + + * src/nl.c (usage): Specify that nl uses _basic_ regular expressions. + Suggestion from Dan Jacobson. + +2004-03-12 Jim Meyering + + * Version 5.2.1. + + Sometimes, when source and destination partition are different, + mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki. + + * src/copy.c: When moving a set of N hard-linked files between + partitions, via two or more command line arguments where the + command line argument containing the Nth link contains no other + link to that same file, mv would mistakenly copy the file, rather + than hard-linking it to the other(s). That happens because when the + final link is processed, its link count has been reduced to 1 since + the other links have been `copied' to the destination partition + and the source links have been removed. + (copy_internal): When in move mode, use the source dev/inode + pair to look up destination name even when st_nlink == 1. + * src/cp-hash.c (src_to_dest_lookup): New function. + * src/cp-hash.h (src_to_dest_lookup): Add prototype. + * tests/mv/part-hardlink: New file. Test for the above fix. + * tests/mv/Makefile.am (TESTS): Add part-hardlink. + + * announce-gen: Sync with autoconf. + + * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test. + This was triggered on a Linux-2.2.19 system using a file system + NFS-mounted from some sort of Sun. + +2004-03-11 Jim Meyering + + * Use automake-1.8.3. Regenerate dependent files. + +2004-03-10 Jim Meyering + + * tests/du/deref-args: Also convert sizes in the 70-79 kB range, + so that this test works with SELinux-enabled systems. + Based on a patch from Tim Waugh. + + `join -1 x' would give a misleading diagnostic + * src/join.c (string_to_join_field): Report that a non-numeric field + number is invalid, rather than `so large that it is not representable'. + * tests/join/Test.pm (invalid-j): New partial test for the above fix. + +2004-03-06 Jim Meyering + + cp --sparse=always sparse-image-file.img /dev/hda1 could + produce an invalid copy on the destination device. + + * src/copy.c (copy_reg): Even with --sparse=always, try to + make `holes' only if the destination is a regular file. + Reported by Szakacsits Szabolcs. + +2004-03-03 Paul Eggert + + * src/nohup.c (main): Don't invoke set_cloexec_flag with + a file descriptor of -1. + +2004-03-02 Dmitry V. Levin + + * src/nohup.c: Include "cloexec.h". + (main): Set the copy of stderr to close on exec. + +2004-03-01 Paul Eggert + + * configure.ac: Include when checking for strsignal, + sys_siglist, and friends. Problem reported by Tony Leneis in + . + +2004-02-25 Paul Eggert + + * tests/du/deref-args, tests/du/exclude, tests/du/slash: + * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE + etc. are set. + +2004-02-23 Paul Eggert + + * NEWS: Document how chown's USER.GROUP argument is now parsed. + +2004-02-23 Jim Meyering + + * src/seq.c (usage): Remove stray space after \n in --help output. + +2004-02-22 Jim Meyering + + * src/du.c (usage): Separate -H and --si. Say that the meaning + of -H will soon change to that of --dereference-args (-D). + +2004-02-21 Jim Meyering + + * src/comm.c (usage): Tell what comm does when there are no options. + Reword in terms of FILE1 and FILE2 rather than `left file' and + `right file'. Suggestion from Dan Jacobson. + +2004-02-15 Paul Eggert + + Fix some POSIX-conformance bugs in expr. + + * NEWS: document the following changes to src/expr.c. + * doc/coreutils.texi (expr invocation): Likewise. + Document what forms integers may take, and say "integer" + consistently instead of "number". Warn about operands + that "expr" can misinterpret, and how to work around the + problem. + * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1): + Accept a bool argument specifying whether to evaluate the + expression. This is to allow short-circuit evaluation. All + callers changed. + (null): Report that a string is zero even if it has + a form like "-0" or "00". + (eval1, eval): Use short-circuit evaluation for | and &. + (eval): Return 0 if both arguments are null or zero, instead + of returning the first argument. + * tests/expr/basic: Add some tests for the above. + +2004-02-17 Jim Meyering + + * Version 5.2.0. + + `make check' from a build inside a chroot environment would fail + * tests/help-version: Specify an argument (`/') for df, in the + unusual event that there is no valid entry in /etc/mtab. + Likewise for id: add the -u option, so we don't get spurious + failures when there are no user or group names. + Patch by Tim Waugh. + + * src/sort.c (usage) [-u]: Add punctuation so that the description in + the help2man-generated (line-joined) man page is more readable. + Reported by Tim Waugh. + [-T]: Add a semicolon, for the same reason. + +2004-02-15 Jim Meyering + + * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix. + +2004-02-11 Jim Meyering + + * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable + $(srcdir)/../Makefile.am.in, rather than $<. + Suggestion from Michael Elizabeth Chastain. + +2004-02-10 Jim Meyering + + * config/install-sh: Make this script executable. + * Makefile.am (dist-hook): New target, to ensure that config/install-sh + is executable. Otherwise, on systems that lack a suitable install + binary, `make install' would fail, because of the way this script + is invoked (without `$SHELL ' prefix). + Reported by Bob Proulx. + +2004-02-08 Jim Meyering + + * Version 5.1.3. + + * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed + that would cause an unwarranted test failure. + * tests/rm/rm3: Likewise. + +2004-02-07 Jim Meyering + + Remove xstat function pointer member. The way it was used was not + portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static + inline `stat' and `lstat' functions, thus making the tests of + `xstat == lstat' in copy.c always fail. + * src/copy.h (struct cp_options) [xstat]: Remove member. + (XSTAT): New macro. + * src/copy.c (copy_dir): Set `.dereference' member, not .xstat. + (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'. + Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'. + (valid_options): Remove now-obsolete FIXME comments. + + * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of + `*(x->xstat) (...)'. + (do_copy): Declare/use local xstat rather than x->xstat. + (main): Remove code that set x.xstat. + * src/mv.c (cp_option_init): Don't initialize xstat member. + * src/install.c (cp_option_init): Likewise. + + * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix, + so that emit_upload_commands can use these variables, too. + +2004-02-06 Jim Meyering + + * tests/rm/deep-1: Remove `du' stack space test. + Apparently, `ulimit -s N' isn't portable enough. + This test will be restored (with a guard against losing ulimit) + in its own file later. + + * tests/rm/deep-1 (deep): Remove progress-style diagnostics, + since this test doesn't take long enough to merit them. + Run du on $tmp (the containing dir), not $deep, the full path to leaf. + + * Makefile.maint (signatures): Remove definition. + Now, automake's gnupload handles this. + (%.sig: %): Remove now-unused rule. + (rel-files): Use automake's $(DIST_ARCHIVES), rather than + `$(distdir).tar.bz2 $(distdir).tar.gz'. + (emit-upload-commands): Adjust to use gnupload. + +2004-02-05 Jim Meyering + + * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions. + (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise. + Now, those are all defined in timespec.h. + Include timespec.h. + + * src/date.c: Don't include timespec.h, now that system.h does it. + +2004-02-02 Paul Eggert + + Don't dump core if localtime returns NULL (possible on + hosts with 64-bit time_t and 32-bit int). + * src/date.c: Include "inttostr.h". + (batch_convert, main): + If time conversion fails, exit with nonzero status. + (show_date): Return int to report conversion failure. + Print the time as an int if localtime fails. + * src/uptime.c: Print "??" if the current clock can't + be converted by localtime. This won't happen until the year + 2*31 + 1900, but we don't want to dump core even if the current + clock has the wrong value. + + * src/stat.c: Include "inttostr.h". + (human_time): Print the date/time as a number of seconds since the + epoch if it can't be converted by localtime. This is better than + just saying "invalid", and is consistent with what "ls" does. + Don't dump core if the year has more than 48 digits; this isn't + possible on any contemporary host, but we might as well do it right. + +2004-01-31 Paul Eggert + + * src/stat.c (human_time): Accept time rather than + pointer-to-const-time parameter, for clarity. All callers changed. + +2004-02-02 Jim Meyering + + * src/stat.c (do_stat): Remove extra trailing newline from + default formats. Reported by Nelson H. F. Beebe. + + Print actual fractional seconds in time stamps, not just `.00000000'. + * src/stat.c (human_time): Add and use new parameter, t_ns. + (print_stat): Update callers. + * src/ls.c (TIMESPEC_NS): Remove definition. + * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c + also uses this macro. + Nelson H. F. Beebe noticed that ls --full-time printed nonzero + fractional seconds for files on an XFS file system, but that stat's + fractional seconds were always zero. + +2004-01-28 Paul Eggert + + * src/seq.c (print_numbers): Use 'double' for loop index, not + 'int', to avoid problems with integer overflow. On almost all + machines 'double' works in every case where 'int' works, and + it works on other cases besides. + +2004-01-27 Jim Meyering + + * src/seq.c (usage): Mention that if INCREMENT is omitted, + it defaults to 1, even when FIRST is larger than LAST. + Reword so as not to exclude the possibility that INCREMENT be zero. + +2004-01-25 Jim Meyering + + * Version 5.1.2. + + * Makefile.maint (signatures): Comment out definition. + +2004-01-23 Jim Meyering + + * Makefile.maint (header_regexp): Add exitfail. + + * man/Makefile.am (EXTRA_DIST): Add help2man. + Reported by Nelson H. F. Beebe. + + * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --' + so it works on systems with Perl installed somewhere other than in + /usr/bin. + + * src/paste.c (paste_parallel): Declare local, chr, to be of type + `int', not `char', since it must hold EOF. This bug would make + paste infloop on some systems. Test failures reported by + Nelson H. F. Beebe and Christian Krackowizer. + +2004-01-22 Jim Meyering + + * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug. + * tests/rmdir/Makefile.am (TESTS): Add fail-perm. + + * man/help2man: Fix it so using --info-page='coreutils PROG' works. + * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man. + Use --info-page='coreutils PROG' option. + Now, readlink.1 refers the user to `info coreutils readlink' + rather than to `info readlink'. Reported by Matt Swift. + +2004-01-21 Paul Eggert + + Exit status cleanup. + + * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity. + * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c, + * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c, + * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c, + * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c, + * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c, + * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c, + * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c, + * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c, + * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c, + * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c, + * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, + * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c, + * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c, + * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c, + * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c, + * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise. + + * src/cat.c (usage): Don't bother normalizing exit status + since the arg is already the correct exit status now. + * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c, + * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c, + * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, + * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c, + * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise. + + * src/chown.c (main): Removed unused local 'fail'. + + * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): + Remove. + + * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL. + * src/env.c, src/nice.c, src/su.c: Likewise. + * src/nohup.c (main): Likewise, to NOHUP_FAILURE. + * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE. + * src/expr.c (main): Use initialize_exit_failure rather than + setting exit_failure directly; this optimizes away redundant + assignments. + * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise. + + * src/chroot.c (main): Exit with status 1 rather than 127 + if chroot itself fails, as per documentation. + + * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE + rather than roll-your-own symbols or integers. + * src/env.c (main): Likewise. + * src/nohup.c (main): Likewise. + * src/su.c (run_shell): Likewise. + + * src/cp.c (exit_status): Remove static var.... + (main): Making it local here instead. Use =, not |=, to set it. + + * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE, + not 2, on errors. + * src/date.c (batch_convert, main): Likewise. + * src/dd.c (dd_copy): Likewise. + * src/pr.c (first_last_page, main, getoptarg): Likewise. + * src/tr.c (main): Likewise. + * src/date.c (main): Don't assume EXIT_FAILURE == 1, as + POSIX doesn't require it. + * src/dd.c (write_output, skip, dd_copy): Likewise. + * src/df.c (main): Likewise. + * src/id.c (main): Likewise. + * src/install.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/ls.c (main): Likewise. + * src/mv.c (main): Likewise. + * src/shred.c (main): Likewise. + + * src/env.c (main): Exit with status 1, not 2, on errors detected + by env proper. + * src/hostname.c (main): Likewise. + * src/nl.c (main): Likewise. + * src/stty.c (main): Likewise. + + * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for + consistency with the other programs' naming conventions. + All uses changed. + + * src/factor.c (main): Do not report a usage error simply + because stdin has bad numbers. + + * src/id.c (problems): Now a boolean int, not a counter, + so that we don't have to worry about int overflow. All uses changed. + * src/touch.c (err): Likewise. + + * src/md5sum.c (main): Use int, not size_t, to store boolean int. + + * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented. + * src/mknod.c: Likewise. + + * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE, + on error; this is in case EXIT_FAILURE is unusual. + * src/su.c (main): Likewise. + + * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses + changed to EXIT_CANNOT_INVOKE. + + * src/printenv.c (PRINTENV_FAILURE): New constant. + (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on + command-line syntax problems. + + * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number. + (main): Avoid integer overflow when seeing whether errors occurred. + + * src/seq.c (print_numbers): Now returns void, not (zero) int. + All callers changed. + (main): Remove unused local variable 'errs'. Always exit successfully + if we reach the end. + + * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS, + for consistency with other programs here. All uses changed. + (main): Use 'error' to exit rather than invoking 'exit' here. + + * src/sort.c: Don't include . + (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros. + (usage): Don't use 'assert'. + (main): Remove redundant assignment to exit_failure. + + * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT): + New enum values. + (initialize_exit_failure): New inline function. + Include exitfail.h here, since we refer to exit_failure. + All callers changed to not include exitfail.h. + + * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values; + substitute them for the corresponding integer constants. + + * tests/help-version (expected_failure_status_date): Remove, as + 'date' is now normal. + (expected_failure_status_nohup): New var. + +2004-01-21 Jim Meyering + + * tests/touch/relative: Remove `command' syntax. + Thanks to Nelson H. F. Beebe and Paul Eggert. + + * tests/touch/relative: Test only year/month/day, not hours/min/sec, + so as to avoid problems with systems using TAI clocks. + Although it's no longer necessary, set TZ=UTC0 also for the + initial touch command. Reported by Paul Jarc here: + http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504 + +2004-01-20 Diego Biurrun + + * src/dircolors.hin: Add .mov to the list of media files. + +2004-01-19 Paul Eggert + + * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't + portable). Problem reported by Christian Krackowizer. Also, use + +0000 rather than +0 to specify a time zone, as the documentation + requires four digits. + +2004-01-19 Jim Meyering + + * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set. + * tests/mv/backup-is-src: Likewise. + Problem reported by Peter Horst + +2004-01-17 Jim Meyering + + * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc. + + * Version 5.1.1. + +2003-12-15 Paul Eggert + + * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified, + with -r specifying the origin for -d. + * src/touch.c (flexible_date): Remove static var. + (get_reldate): New function. + (main): Use it, to implement this new behavior. + +2004-01-16 Jim Meyering + + * tests/touch/relative: New test for the above. + * tests/touch/Makefile.am (TESTS): Add relative. + +2004-01-13 Jim Meyering + + * src/system.h: Include contents of sys2.h. + * src/sys2.h: Remove file. + * src/Makefile.am (noinst_HEADERS): Remove sys2.h. + + * Use automake-1.8.2. Regenerate dependent files. + + * Update to gettext-0.13.1. + * configure.ac: Use gettext-0.13.1. + * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions. + +2004-01-12 Jim Meyering + + * Makefile.maint (%.sig): Use .sig suffix rather than .asc. + + * Makefile.maint (po-check): Ensure that cvsu works before using it. + Reported by Alexandre Duret-Lutz. + + * src/tail.c (main): Warn about following stdin only when it's a tty. + + * configure.ac: Use gl_DEFAULT_POSIX2_VERSION. + +2004-01-10 Jim Meyering + + * tests/misc/stat-fmt: Use backticks, not `$()' notation. + +2004-01-09 Jim Meyering + + * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning. + +2004-01-08 Jim Meyering + + * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'. + From Andreas Schwab. + + * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test + remnant) from PATH component. That would cause tests in this directory + not to run the just-built binaries, but rather whatever happened + to be in one's PATH. Reported by Christian Krackowizer. + +2004-01-04 Jim Meyering + + * src/csplit.c (new_control_record): Use x2nrealloc + rather than xrealloc. + + * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than + alloca and strcpy. + (make_path_private): Likewise. + +2004-01-03 Jim Meyering + + * src/paste.c: Use `bool' (not int) as the type for a few + global variables. + (collapse_escapes): Rewrite to set globals rather than modifying + its parameter. + Use size_t (not int) for all counters and related index variables. + (paste_parallel): Remove needless complexity of + using xrealloc in the loop; just allocate the buffers up front. + Free the two temporary buffers. + Move declarations of locals `down' into scope where used. + (paste_serial): Remove `register' attributes. + (main): Simplify delim-related code. + Free `delims', now that it's malloc'd. + +2004-01-02 Jim Meyering + + * src/chroot.c: Include "quote.h". + (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define. + (main): Exit with status of 127, not 1, for too-few-args, + chroot failure, or chdir failure. + Give a better diagnostic upon execvp failure. + + * src/du.c (usage): Mention that, with its current meaning, + -H is deprecated. + + * src/tail.c (main): Warn about following stdin when it's a tty. + Fail when following by name but no names are specified. + +2003-12-30 Jim Meyering + + * src/fold.c (main): Use memcpy, not strcpy. + + * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than + alloca and strcpy. + +2003-12-28 Jim Meyering + + * src/unexpand.c (n_tabs_allocated): New global. + (add_tabstop): Use x2nrealloc rather than xrealloc. + * src/expand.c: Likewise. + + * tests/misc/expand: New file. + * tests/misc/Makefile.am (TESTS): Add expand. + + * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc. + (fillbuf): Use x2nrealloc rather than xrealloc. + (sort): Use xnmalloc rather than xmalloc. + (main): Likewise. + +2003-12-27 Jim Meyering + + * src/tee.c (tee): Use xnmalloc rather than xmalloc. + +2003-12-29 Paul Eggert + + * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1 + LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX. + + * doc/coreutils.texi (join invocation): Remove documentation + accordingly. Document that -t makes all separators significant. + + * src/join.c: Include posixver.h. + (obsolete_usage): New var. + (longopts): Put obsolete options first. + (OBSOLETE_LONG_OPTIONS): New constant. + (get_option, add_file_name): New functions. + (main): Use them to support new behavior. + (usage): Remove documentation for -j1 FIELD and -j2 FIELD. + Do not mark -j FIELD as obsolescent; it is longstanding + UNIX tradition and is a valid extension to POSIX. + + * tests/join/Test.pm (tv): Avoid obsolete -o usage. + +2003-12-28 Paul Eggert + + * src/join.c (add_field_list): Don't use alloca with unbounded + size; just modify the argument, which is no longer const *. + + Various other minor cleanups, mostly to avoid the need for casts. + + (extract_field): Renamed from ADD_FIELD, as it's now a function. + + (struct field.beg): Now char *, not unsigned char const *. All + uses changed. It shouldn't be const since xmemcoll writes on its + arguments. + (extract_field): Likewise, for 2nd arg. + (keycmp): Remove now-unnecessary cast of xmemcoll args. + + (is_blank): New function, to avoid need to cast arg to unsigned char. + (extract_field): Use it. + + (xfields): Rewrite pretty much from scratch. + + (hard_LC_COLLATE): Now bool, not int. + (get_line, getseq, add_field_list): Now returns bool, not int. + (decode_field_spec, add_field_list): Return true on success (not + false), for consistency with the rest of the code. All uses changed. + + (tab): Now char, not unsigned char. This wasn't 100% necessary + but is slightly cleaner. + (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler. + + (empty_filler): Now const *. + + (make_blank): Remove; wasn't needed. Remove all calls. + (main): Don't set uni_blank.nfields; zero is fine. + +2003-12-27 Jim Meyering + + * src/join.c: Include "quote.h". + (min, max): Remove definitions. + Make a few function parameters and corresponding + locals `const'. Use bool for boolean variables. + Use size_t (not int) for all counters and related index variables. + (prjoin): Remove now-useless assertion. + (string_to_join_field): New function. + (main): Accept join fields as large as SIZE_MAX. + (keycmp): Rename `min' to MIN and max to MAX. + +2003-12-26 Jim Meyering + + fold -s didn't work on e.g., alpha-based systems. + * src/fold.c (fold_file): Adjust types (int->size_t) so that using + x2nrealloc works properly on systems with differing sizes for int + and size_t. Reported by Nelson Beebe. + + * src/fold.c: Use `bool' (not int) as the type for a few + global variables. + +2003-12-23 Paul Eggert + + * src/ls.c (length_of_file_names_and_frills): + Remove forward decl; not needed. + (print_file_name_and_frills, length_of_file_name_and_frills): + With -m, don't output spaces before inum or size. + (print_with_commas): Don't output space just before newline. + +2003-12-24 Jim Meyering + + * tests/ls/Makefile.am (TESTS): Add m-option. + * tests/ls/m-option: New file. Test for above fixes. + +2003-12-20 Jim Meyering + + * Version 5.1.0. + + * src/pr.c: Change type of global, buff_allocated, to size_t. + + * src/join.c [struct seq]: Change types of members count and alloc + from `int' to `size_t'. + + * tests/Makefile.am (root-hint): Tweak wording. + + * src/du.c: Accept new option (-0, --null) that makes it so each + output line is NUL-terminated rather than newline-terminated. + + * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync. + Reported by Volker Paul. + * tests/dd/Makefile.am (TESTS): Add unblock-sync. + * tests/dd/unblock-sync: New test for the above. + +2003-12-19 Jim Meyering + + * tests/misc/nohup: Double quote back-ticked expression, + in case it ends up having an unexpected value. + + * tests/ls/no-arg: Use ls's -1 option in both runs. + + * src/du.c (fts_debug): New global. + (FTS_CROSS_CHECK, DEBUG_OPT): Define. + (main): Make fts use FTS_TIGHT_CYCLE_CHECK. + (main) [DU_DEBUG]: Accept -d option. + +2003-12-18 Jim Meyering + + * src/ls.c (format_user): Increment dired_pos via two statements, + `dired_pos += width; dired_pos++;' rather than one, + `dired_pos += width + 1;' since the latter could conceivably overflow. + (format_group): Likewise. + From Paul Eggert. + + * configure.ac: Require automake-1.8. + +2003-12-12 Jim Meyering + + * Use automake-1.8. Regenerate dependent files. + +2003-12-08 Jim Meyering + + * Makefile.maint (news-date-check): New rule. + (alpha beta major): Depend on it. + +2003-12-03 Paul Eggert + + * NEWS: ls -l (and similar options) now adjust all columns to + fit the data. Generalized from a suggestion by Leah Q for file sizes. + * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove. + (format_user_width, format_group_width, unsigned_file_size, + format_group): New functions. + (block_size_width): Renamed from block_size_size. + (inode_number_width, nlink_width, owner_width, group_width, + author_width, major_device_number_width, minor_device_number_width, + file_size_width): New vars. + (clear_files): Initialize them. + (gobble_file): Set them. Don't ceiling block_size_width to 7. + (print_long_file): Use them. + (gobble_file): Use a new local variable 'f' to make the code + smaller and more consistent with other functions. + (format_user): Output to stdout, not to a buffer, so that we + don't have to worry about buffer overrun. Update dired_pos. + (print_long_file): Don't put owner, group, author into buffer; + just print them directly. Don't assume link counts and + major and minor numbers fit into unsigned long int. + * tests/cp/same-file, tests/mv/part-symlink: Don't assume that + 'ls' output is fixed-width. + +2003-12-02 Jim Meyering + + * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h. + +2003-11-27 Jim Meyering + + * Use automake-1.7f. Regenerate dependent files. + +2003-11-24 Paul Eggert + + Parse floating-point operands and options in the C locale. + POSIX requires this for printf, and we might as well be + consistent elsewhere (tail, sleep, seq). + + * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer + needed now that we assume C89. Include "c-strtod.h". + (xstrtod): Call c_strtod, not strtod. + * src/sleep.c: Include "c-strtod.h". + (main): Update xstrtod call to include new argument, c_strtod. + * src/seq.c (scan_double_arg): Likewise. + * src/tail.c (parse_options): Likewise. + +2003-11-24 Jim Meyering + + * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM). + Reported by Mark Conty. + +2003-11-22 Jim Meyering + + * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by... + (sc_system_h_headers): Do this test only if sys2.h exists. + +2003-11-20 Jim Meyering + + * tests/help-version: Ensure that the bug-reporting address is + included in the --help output for every program. + * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT. + + * src/ptx.c (usage): Output bug-reporting address. + Reported by Dan Jacobson. + +2003-11-19 Jim Meyering + + * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted + on the join fields. Suggestion from Bruce Robertson. + +2003-11-18 Jim Meyering + + `od -c -w9999999' could segfault + * src/od.c (dump): Use xnmalloc/free, not alloca. + +2003-11-16 Jim Meyering + + * Use autoconf-2.59. Regenerate dependent files. + + * tests/du/hard-link: Minor tweak: use mkdir -p. + + Fix read-from-free'd-buffer error detected by valgrind. + * src/csplit.c (remove_line): Don't return a pointer to data in + a freed buffer. Instead, arrange to free the buffer on the + subsequent call. + + * tests/misc/csplit: New test for above fix. + +2003-11-11 Jim Meyering + + * src/ls.c (extract_dirs_from_files): Avoid useless copy operations. + This avoids a warning from valgrind about memcpy with overlapping + source and destination. + + * configure.ac: Require automake-1.7.8. + +2003-11-09 Jim Meyering + + * Use automake-1.7.9. Regenerate dependent files. + + * src/rm.c: Support new options: --preserve-root and --no-preserve-root. + * src/chown.c: Likewise. + + * src/chown-core.c: Include "root-dev-ino.h". + (chopt_init): Initialize new member. + (change_file_owner): Support rm's new --preserve-root option. + + * src/remove.c: Include "root-dev-ino.h". + (remove_cwd_entries): Remove now-obsolete FIXME comment. + (remove_dir): Support rm's new --preserve-root option. + + * src/chown.c: Include "root-dev-ino.h". + Add new options: --preserve-root and --no-preserve-root. + + * src/chmod.c: Include "root-dev-ino.h". + (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and + ROOT_DEV_INO_WARN macros. + (get_root_dev_ino): Remove function definition, now that it's + been moved to a separate file. + (usage): Describe new options. + + * src/mv.c (rm_option_init): Initialized new member. + + * src/remove.h: Include "dev-ino.h". + (struct rm_options): Add new member: root_dev_ino. + * src/chown-core.h: Include "dev-ino.h". + (struct Chown_option): Add new member: root_dev_ino. + +2003-11-06 Jim Meyering + + * src/paste.c (paste_parallel): Use `sizeof *var' rather than + hard-coding `sizeof FILE*'. + +2003-11-05 Dennis Smit + + * src/wc.c (main): Free `fstatus' so there is no confusion about + whether it's leaked or not. + * src/who.c (who): Likewise for `utmp_buf'. + +2003-11-05 Paul Eggert + + Fix 'cut' problems with size_t overflow and unsigned int. + More generally, resize integer variables to fit use more precisely. + * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens. + (struct range_pair): Make members to be of type size_t, not unsigned. + (max_range_endpoint, eol_range_start): Now size_t, not unsigned. + (suppress_non_delimited, output_delimiter_specified, + have_read_stdin, print_kth, set_fields): Now bool, nt int. + (delim): Now unsigned char, not int. + (mark_printable_field, is_printable_field, is_range_start_index, + set_fields, set_fields, cut_bytes, cut_fields): + Use size_t, not unsigned, for field and byte counts. + (hash_int): Use uintptr_t, not unsigned, for pointers converted + to integers. This squeezes more info out of them. + (set_fields, cut_bytes, cut_fields, main): + Use bool, not int, for booleans. + (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc. + +2003-11-05 Paul Eggert + + * man/Makefile.am (check-programs-vs-x): + Work even if $(programs) contains '$'. + Work even if 'missing=1' in environment. + Don't report an error simply because $(programs) outputs nothing. + +2003-11-05 Jim Meyering + + * Use autoconf-2.58. Regenerate dependent files. + + * src/tr.c (spec_init): Fix typo in last change. + + * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in + call to variadic version_etc function, so that it works even on systems + for which sizeof char* != sizeof int. + * src/true.c (main): Likewise. + * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c: + * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c: + * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c: + * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c: + Similarly, cast NULL to `(char *)' in call to variadic function, + parse_long_options, so that it works even on systems for which + sizeof char* != sizeof int. + A similar problem was reported by Harti Brandt in + http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html. + + * src/users.c (users): Free `utmp_buf' explicitly so that people + don't mistake this for a real leak. + Patch by Dennis Smit + + * README: Document _POSIX2_VERSION. + +2003-11-04 Jim Meyering + + * src/tac.c (memrchr): Remove #if-0'd function. + (tac_stdin_to_mem): Clean up #if-0'd code. + + * src/od.c (decode_format_string): Remove unnecessary casts. + Use more maintainable `sizeof *var'. + (main): Call decode_format_string rather than decode_one_format, + now that `spec' may be NULL. + + * src/chmod.c (AUTHORS): Add my name. + + * src/split.c (next_file_name): Use `sizeof *var' rather than + hard-coding `sizeof size_t'. + + * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...). + + * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc, + to avoid potential overflow in pointer arithmetic. + (set_fields): Use not `1', but rather `sizeof *printable_field' as + second argument to xcalloc. + * src/od.c (decode_format_string, dump_strings): Use x2nrealloc + rather than xrealloc. + * src/date.c (show_date): Likewise. + * src/join.c (ADD_FIELD, initseq, getseq): Likewise. + * src/pr.c (store_char): Likewise. + * src/fold.c (fold_file): Likewise. + + * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect + type changes (unsigned int -> size_t) in hash.c. + * src/cp-hash.c (src_to_dest_hash): Likewise. + * src/du.c (entry_hash): Likewise. + * src/ls.c (dev_ino_hash): Likewise. + * src/cut.c (hash_int): Likewise. Declare function as static. + +2003-11-03 Jim Meyering + + * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION. + * tests/misc/fold: Fail the test immediately if we're not running + the expected version of fold. + +2003-11-02 Jim Meyering + + * src/tr.c (append_normal_char, append_range, append_char_class) + (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var' + rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable + and usually shorter. + * src/copy.c (copy_internal): Likewise. + * src/join.c (initseq, add_field, make_blank): Likewise. + * src/od.c (main): Likewise. + * src/cp.c (make_path_private): Likewise. + * src/tsort.c (new_item, record_relation): Likewise. + + * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise. + (main): Also remove anachronistic cast of xmalloc return value. + * src/ptx.c (alloc_and_compile_regex, main): Likewise. + (main): Also remove anachronistic cast of xmalloc return value. + * src/sort.c (inittables): Likewise. + (sort): Also Split a long line. + +2003-10-25 Jim Meyering + + * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect + type changes (unsigned int -> size_t) in hash.c. + * src/cp-hash.c (src_to_dest_hash): Likewise. + * src/du.c (entry_hash): Likewise. + * src/ls.c (dev_ino_hash): Likewise. + * src/cut.c (hash_int): Likewise. Declare function as static. + +2003-10-21 Jim Meyering + + Don't fail when run with VERBOSE=yes. + * tests/chgrp/basic: Do `set +x' before starting the subshell + from which we invoke chgrp. Otherwise, the output from the + VERBOSE=yes-induced `set -x' would result in spurious differences. + Reported by Russel Coker via Michael Stone. + +2003-10-19 Jim Meyering + + chmod now uses fts to perform a directory traversal when -R is + specified. Before, it operated on full path names, and as such + would encounter the PATH_MAX (often 4096) limit. + + * src/chmod.c: Include "xfts.h". + (process_file): Rename from change_file_mode. + Adapt to be used with fts. + (process_files): New function. + +2003-10-18 Jim Meyering + + * tests/du/deref-args: Ensure that du -D now dereferences all + symlinks specified on the command line, not just those that + reference directories. + + * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c: + * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c: + * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c: + * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c: + * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c: + * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c: + * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c: + * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change + of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. + Update the call to parse_long_options so that `AUTHORS, NULL' are the + last parameters. + * src/true.c (main): Append NULL to version_etc argument list. + * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise. + +2003-10-17 Andreas Schwab + + * tests/mk-script: Get $srcdir from first parameter instead of + hardcoding it. + (main): Update usage. + + * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as + first argument of mk-script. + ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target. + +2003-10-17 Jim Meyering + + * src/mv.c (usage): Tweak descriptions of -i and -f so that the + generated `man' page is more readable. Suggestion from Dan Jacobson. + + * src/chown-core.c (change_file_owner): Handle the cases in + which fts_info indicates an error with the given entry. + + * src/du.c (main): Simply assign to bit_flags. + Don't bother with bit arithmetic. + + * tests/chmod/no-x: New file. + * tests/chgrp/no-x: New file. + * tests/chmod/Makefile.am (TESTS): Add no-x. + * tests/chgrp/Makefile.am (TESTS): Likewise. + + * src/du.c: Include "xfts.h". + (du_files): Use xfts_open, rather than fts_open. + * src/chown-core.c (chown_files): Likewise. + +2003-10-16 Jim Meyering + + * src/chgrp.c (main): Simply assign to bit_flags. + Don't bother with bit arithmetic. + * src/chown.c (main): Likewise. + Rename a couple of local variables. + Remove unnecessary casts. + + * src/tail.c (start_bytes): Rename local, remainder, to avoid + gcc's warning about shadowing a global. + +2003-10-15 Jim Meyering + + chown and chgrp now accept POSIX-mandated -H, -L, -P options and + use fts to perform a directory traversal when -R is specified. + Before, they operated on full path names, and as such would + encounter the PATH_MAX (often 4096) limit. + They are more efficient. For example, before, chgrp -R would + take almost 5 seconds to change about 2000 directories and fail + (with `File name too long'), while now it succeeds on a hierarchy + of depth 20,000 in 1/10 the time. + + * src/chown.c: Include "userspec.h" and "fts_.h". + (WRITTEN_BY): Add my name. + (getpwnam, getgrnam, getgrgid): Remove declarations. + (endpwent): Remove definition. + (usage): Update. + (main): Handle new options. + Call new function, chown_files rather than change_file_owner. + + * src/chgrp.c: Include "fts_.h". + (WRITTEN_BY): Add my name. + (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of + the latter. + (usage): Update. + (main): Handle new options. + Call new function, chown_files rather than change_file_owner. + + Rewrite to iterate through hierarchies using fts rather than + via explicit recursion. + * src/chown-core.c: Include "fts_.h" + (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate + on a single file at a time. + (chown_files): New function. + * src/chown-core.h [enum Dereference_symlink]: Remove declaration. + [struct Chown_option] (recurse, force_silent): Change type to `bool'. + [struct Chown_option] (dereference): Remove member with ambiguous name. + [struct Chown_option] (affect_symlink_referent): New member. + (chown_files): New prototype. + + * tests/chgrp/recurse: Update tests accordingly. + * tests/chgrp/posix-H: New tests for the above. + * tests/chgrp/Makefile.am (TESTS): Add posix-H. + + * src/ln.c (usage): Clarify that --directory, -d, -F probably won't + work even for superuser. Suggestion from Dan Jacobson. + +2003-10-14 Paul Eggert + + Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't + properly diagnosed. + * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h, + lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib. + * src/sort.c (parse_field_count): Handle the case where overflow + and invalid suffix char are both reported. + +2003-10-14 Jim Meyering + + * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the + warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always + true on Linux. + +2003-10-13 Paul Eggert + + Fix to avoid a denial-of-service attack if the display width is + enormous. Also, clean up the code a bit by removing duplicate code. + + * src/ls.c (init_column_info): Remove forward decl; no longer needed. + (calculate_columns): New function, that contains code that used + to be common to print_many_per_line and print_horizontal. + (print_many_per_line, print_horizontal): Use it. + (decode_switches): Set max_idx here, not in calculate_columns. + (print_current_files): Don't call init_column_info; calculate_columns + now does that. + (init_column_info): Don't allocate a lot more space than is needed + to represent the current set of files. Allocate all the new + size_t cells in one call to xnmalloc, rather than a row at a time. + +2003-10-13 Jim Meyering + + * src/ls.c (init_column_info): Add another FIXME comment. + +2003-10-13 Paul Eggert + + Fix address-arithmetic bug in 'ls', reported by Georgi Guninski. + Remove several arbitrary limits on hosts where int cannot represent + all size_t values. + + * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent, + nfiles, files_index, tabsize, line_length, struct column_info.line_len, + struct column_info.col_arr[0], max_idx): + Now size_t, not int. + (get_funky_string): Return bool indicating success, instead of + a negative count to indicate failure. Store number of columns + through new parameter OUTPUT_COUNT; that way, they can never + go negative. Change equals_end from int to bool. All uses + changed. + (struct column_info.valid_len): Now bool, not int. All uses changed. + (dired_dump_obstack, get_funky_string, clear_files, + extract_dirs_from_files, print_current_files, + print_many_per_line, print_horizontal, init_column_info, + put_indicator, length_of_file_name_and_frills, + print_with_commas): Use size_t, not int, for local variables + that count sizes. + (decode_switches): Decode sizes using xstrtoul, not xstrtol. + Check for TIOCGWINSZ returing negative values (or values greater + than SIZE_MAX!). + (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern, + init_column_info): + Use xmalloc and xnmalloc, not XMALLOC. + (gobble_file): Use xnrealloc, not XREALLOC. + (print_color_indicator): Remove now-unnecessary cast to size_t. + +2003-10-12 Paul Eggert + + * tests/du/no-x: Change wording of diagnostic to match latest du.c. + * tests/sort/sort-tests: Remove from CVS; assume that people + brave enough to check coreutils out from CVS can rebuild it. + +2003-10-12 Jim Meyering + + New options: --preserve-root and --no-preserve-root. + * src/chmod.c (change_file_mode): Honor new option. + (change_file_mode): Strip trailing slashes on directory + argument passed to change_dir_mode. + (get_root_dev_ino): New function. + (main): Initialize global, root_dev_ino. + + * src/copy.c (copy_internal): Don't #ifdef-out simple uses of + S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined + via system.h. + * src/chmod.c (change_file_mode): Likewise. + +2003-10-08 Jim Meyering + + * src/csplit.c (main): Remove obsolete FIXME. + +2003-10-07 Jim Meyering + + * Use automake-1.7.8. Regenerate dependent files. + +2003-09-29 Paul Eggert + + csplit cleanup. + + * doc/coreutils.texi (csplit invocation): + The regexp offset need not have a sign; POSIX requires support + for signless offets. + + Be more careful about int widths. For example, remove some + arbitrary limits by replacing 'unsigned' with 'size_t', + 'uintmax_t', etc. Use standard bool rather than a homegrown type. + * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c. + * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed + to usage. + (struct control): offset is now intmax_t, not int. + repeat_forever is now bool, not int. + (struct cstring): len is now size_t, not unsigned int. + (struct buffer_record): bytes_alloc, bytes_used, num_lines are now + size_t, not unsigned. start_line, first_available are now + uintmax_t, not unsigned. + (hold_count, control_used): Now size_t, not unsigned. + (last_line_number, current_line, bytes_written): + Now uintmax_t, not unsigned. + (save_to_hold_area, red_input, keep_new_line, record_line_starts, + create_new_buffer, get_new_buffer, load_buffer, find_line, + process_regexp, split_file, new_control_record, extract_regexp, + get_format_width, get_format_prec, max_out): + size args, locals, and returned values are now size_t, not unsigned + or int. + (get_first_line_in_buffer, find_line, write_to_file, + handle_line_error, process_line_count, regexp_error, process_regexp, + split_file): + File line, byte, and repetition counts are now uintmax_t, not unsigned. + (check_for_offset): Don't require a sign before the offset. + Use xstrtoimax to do the real work. + (extract_regexp): Remove harmful cast of size to unsigned. + 256 -> 1< + + * src/chown-core.c (change_file_owner): Remove set-but-not-used local. + + * src/du.c (du_files): Mark diagnostic for translation. + +2003-10-04 Jim Meyering + + * src/du.c (du_files): Ignore any failure of fts_close. + Give better diagnostics for failed fts_open. + + * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition. + + Deprecate existing use of -H (aka --si). + * src/du.c (enum) [HUMAN_SI_OPTION]: New member. + [long_options]: Use HUMAN_SI_OPTION, not 'H'. + (main): Warn that the meaning of -H will soon change to be + POSIX compliant. + +2003-10-03 Jim Meyering + + * src/du.c: Accept --no-dereference (-P). + +2003-10-02 Jim Meyering + + * tests/du/trailing-slash: Adjust for slightly different output. + + Rewrite du.c to use fts. + * src/du.c: Include "fts_.h", not ftw.h. + (opt_dereference_arguments, arg_length, suffix_length): Remove globals. + (IS_FTW_DIR_TYPE): Remove definition. + (IS_DIR_TYPE): Define. + (is_symlink_to_dir): Remove now-unnecessary function. + (process_file, du_files): Rewrite to use fts. + + * tests/du/inaccessible-cwd: Ensure that even when run from an + inaccessible directory, du can still operate on accessible + directories elsewhere. + * tests/du/Makefile.am (TESTS): Add inaccessible-cwd. + + * tests/rm/deep-1: Ensure that du can process a hierarchy + of depth 400 while using no more than 50KB of stack space. + +2003-10-01 Akim Demaille + + * announce-gen (print_news_deltas): New function, extracted from main. + (main): Make `news_file' an array. + Use '...=s' => \@var for --news and --url-directory specs. + Before there were a couple of portability problems. + +2003-09-28 Jim Meyering + + * Makefile.maint (sc_cast_of_alloca_return_value): New rule. + (syntax-check-rules): Add it. + + * src/copy.c: Remove unnecessary cast of alloca, since now it's + guaranteed to be (void *). + * src/cp.c: Likewise. + * src/join.c: Likewise. + * src/ln.c: Likewise. + * src/ls.c: Likewise. + * src/od.c: Likewise. + * src/sys2.h (ASSIGN_STRDUPA): Likewise. + +2003-09-27 Jim Meyering + + Don't exhaust virtual memory when processing large inputs. + Fix this by removing csplit's internal free-list management; + instead rely on malloc for that. + + * src/csplit.c (free_list): Remove global. + (clear_all_line_control): Remove function. + (get_new_buffer): Always use create_new_buffer to obtain a + new buffer, rather than searching free_list. + (free_buffer): Just call free. + Reported by Nikola Milutinovic. + +2003-09-26 Jim Meyering + + * man/rm.x: Also list `chattr' in SEE ALSO section. + Suggestion from Mark Hubbart. + +2003-09-25 Jim Meyering + + * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now + that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them. + + * Use autoconf-2.57d. Regenerate dependent files. + +2003-09-24 Jim Meyering + + Minor efficiency tweak. + * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy. + (do_link): Likewise. + +2003-09-23 Jim Meyering + + * src/paste.c (paste_serial): Save errno after input error, + to report proper errno value. + Based on a patch from Paul Eggert. + + * src/tee.c (tee): Adjust fwrite arguments so that the return + value is the number of bytes written. + +2003-09-16 Paul Eggert + + Don't assume ferror sets errno. Bug reported by Bruno Haible. + + * src/comm.c (compare_files): Save errno after input error, + to report proper errno value. + * src/fold.c (fold_file): Likewise. + * src/od.c (check_and_close, skip, read_char, read_block): Likewise. + * src/unexpand.c (unexpand): Likewise. + + * src/csplit.c (close_output_file): Don't report bogus errno value + after ferror discovers an output error. We don't know the proper + errno value, since it might have been caused by any of a whole + bunch of calls, and it might have been trashed in the meantime. + Fixing this problem will require much more extensive changes; + in the meantime just say "write error". + * src/od.c (check_and_close, dump, dump_strings): Likewise. + * src/uniq.c (check_file): Likewise. + + * src/join.c (get_line): Report error right away if I/O fails, + so that the proper errno value is used. + * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise. + * src/tee.c (tee): Likewise. + * src/uniq.c (check_file): Likewise. + + * src/od.c (skip): If a read fails, don't retry it later, so + that we report the proper errno. + + * src/tac.c (tac_mem): Don't return a value; nobody uses it. + + * src/tee.c (tee): Once a write failure has occurred, don't bother + writing anything more to that stream. + + * src/uniq.c (check_file): Check for ferror (stdout) even if + ostream == stdout. + + * src/yes.c (UNROLL): Remove. + (main): Exit immediately when write failure is detected. + Simplify code by assigning to argv when argc == 1. + +2003-09-21 Paul Eggert + + * src/ptx.c: Switch encoding from Latin-1 to UTF-8. + (WRITTEN_BY): Change "Franc,ois" (actually using + c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as + xgettext requires. + +2003-09-19 Jim Meyering + + `du -D symlink-to-dir' would mistakenly omit the slash in + lines like this: 24 symlink-to-dir/subdir + * src/du.c (process_file): Fix offset calculation. + Reported by Jeff Sheinberg as Debian bug #211591; + http://bugs.debian.org/205251 + + * tests/du/deref-args: New file/test for the above. + * tests/du/Makefile.am (TESTS): Add deref-args. + + * src/du.c (process_file): Remove useless disjunct. + + * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors, + to Written_by. + * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS. + Begin each WRITTEN_BY string with `Written by ' and end it with `.'. + Mark each WRITTEN_BY string as translatable. + + * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c: + * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c: + * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c: + * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c: + * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c: + * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c: + * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c: + * who.c, whoami.c, yes.c: Revert yesterday's changes. + Instead, a subsequent change will embed `Written by ' in + each string along with the author names. + + * src/true.c: Revert yesterday's changes. + * src/sys2.h: Likewise. + +2003-09-18 Jim Meyering + + * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c: + * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c: + * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c: + * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c: + * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c: + * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c: + * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c: + * who.c, whoami.c, yes.c: Update AUTHORS definition to be a + comma-separated list of strings and/or update the call to + parse_long_options so that `AUTHORS, NULL' are the last parameters. + * src/true.c (main): Append NULL to version_etc argument list. + * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise. + + * src/sort.c (numcompare): Rename local, logb, to log_b to avoid + shadowing the math function name. Also rename loga to log_a. + +2003-09-14 Jim Meyering + + * src/factor.c (print_factors): Give a separate diagnostic + for numbers that are too large, but otherwise valid. + Reported by Dániel Varga. + +2003-09-10 Jim Meyering + + * Use automake-1.7.7. Regenerate dependent files. + + * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place + of `fmt -1'. Using the just-built tr is a little cleaner. + Christian Krackowizer reported that HPUX 10.20 doesn't have fmt. + * man/Makefile.am (programs, check-x-vs-1): Likewise. + +2003-09-09 Jim Meyering + + * src/copy.c: Alphabetize includes. + Remove duplicate inclusion of "same.h". + +2003-09-08 Jim Meyering + + * Makefile.maint (GZIP_ENV): Remove --rsyncable. + Didn't give enough of a benefit, mainly because it's not yet + in wide enough use. + + * Version 5.0.91. + + * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src. + (check-programs-vs-x): Fail if $(programs) is empty. + + * src/remove.c: Add a comment. + +2003-09-07 Jim Meyering + + * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]: + Don't define. These symbols are no longer used. + + * tests/misc/tty-eof: Write ^D as \cD. + Complete the change of 2003-08-02. + + * Makefile.maint (po-check): Use cvsu, so that a temporary source + file in lib/ or src/ doesn't induce an unwarranted failure. + Add a kludge to filter out the sole generated source file that + also has translatable messages: src/false.c. + +2003-09-06 Jim Meyering + + * src/tail.c (enum): Add ALLOW_MISSING_OPTION. + (parse_options): Give a diagnostic for (but still accept) the + deprecated --allow-missing option. + +2003-09-04 Paul Eggert + + Don't ignore -S if input is a pipe. Bug report by Michael McFarland in + . + + * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the + size_bound ourselves. if an input file is a pipe and the user + specified a size, use that size instead of trying to guess the + pipe size. This has the beneficial side effect of avoiding the + overhead of default_sort_size in that case. All callers changed. + (sort): Remove static var size; now done by sort_buffer_size. + +2003-09-05 Jim Meyering + + * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files. + + * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process + to start, rather than just .1. Upon failure, print unexpected state. + +2003-09-04 Paul Eggert + + * src/head.c (elide_tail_lines_pipe): Don't assign 0 or + SAFE_READ_ERROR to tmp->nbytes. + * src/tail.c (pipe_lines, pipe_bytes): Likewise. + + * src/head.c (struct linebuffer): Change nbytes and nlines + from unsigned int to size_t. unsigned int is safe (after the + 2003-09-03 patch) but size_t is cleaner. + * src/tail.c (struct linebuffer, struct charbuffer): Likewise. + (pipe_bytes): Likewise for local variable 'i', which was 'int'. + + Standardize on BUFSIZ as opposed to other macro names and values. + * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ. + * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove. + stdio.h has always defined it, + and other code already assumes it's defined. + * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise. + (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf. + (io_buf): IO_BUF_SIZE -> BUFSIZ. + +2003-09-04 Paul Eggert + + * src/seq.c (step): Default to 1. + (print_numbers): Allow the output to be empty. + (main): The default step is 1, even if LAST < FIRST; + as per documentation. + * tests/seq/basic (onearg-2): Output should be empty. + +2003-09-05 Jim Meyering + + * Makefile.cfg (wget_files): Temporarily disable, until master + versions are restored to ftp.gnu.org. + + * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6. + + Make seq's --width (-w) option work properly even when the + endpoint requiring the larger width is negative and smaller than + the other endpoint. + * src/seq.c (get_width_format): Include `-' in the set of bytes + allowed in a `simple' number (no decimal point, no exponent). + Reported by Patrick Mauritz. + +2003-09-02 Paul Eggert + + * NEWS: sort -t '\0' now uses a NUL tab. + sort option order no longer matters, unless POSIX requires it. + * src/sort.c (usage): Say "blanks" instead of "whitespace", + Similar fixes for many comments. + (TAB_DEFAULT): New constant, so that we can support NUL as + the field separator. + (tab): Now int, not char. Initialize to TAB_DEFAULT. + (specify_sort_size): If multiple sizes are specified, use the largest. + (begfield, limfield): Support NUL tab char. + (set_ordering): Do not let -i override -d. + (main): Report an error if incompatible -o or -t options are given. + Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab. + +2003-09-05 Jim Meyering + + * tests/sort/Test.pm [o2, nul-tab]: New tests for the above. + +2003-09-03 Andreas Schwab + + Bug report and patch here: + + * src/tail.c (pipe_lines): Don't truncate return value from safe_read. + * src/head.c (elide_tail_lines_pipe): Likewise. + +2003-09-03 Jim Meyering + + * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively + small amount of code from him was first moved to lib/human.c, and was + subsequently rewritten entirely. + * src/df.c (AUTHORS): Likewise. + +2003-08-22 Lawrence Teo + + * src/md5sum.c (split_3): Accept the BSD format for generic + message digest modes. Currently works with BSD's MD5 and SHA1 + formats since these are the two algorithms presently used in + coreutils. Updated comments to reflect this change. + (bsd_split_3): Updated comments. + + * tests/md5sum/basic-1: New test to make sure that + `md5sum --check' doesn't accept the BSD SHA1 format (adapted + from `check-bsd' test in tests/sha1sum/basic-1). + + * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for + --check exit status and BSD SHA1 format (adapted from tests + in tests/md5sum/basic-1). + +2003-08-30 Jim Meyering + + * src/ln.c (do_link): Use SAME_INODE rather than open-coding it. + + When source and destination arguments refer to the same file, reside + on a partition (e.g. VFAT) on which distinct names may refer to the + same directory entry (often due to variations in case), and when the + link count for the file is 1, mv no longer unlinks the file. Instead, + it gives the expected diagnostic that the source and destination are + the same. WARNING: this is an incomplete fix. If the file happens + to have a link count of 2 or greater, such an erroneous mv command + will still unlink it. + Although that is not possible on vfat or umsdos, it is possible on + other file system types, e.g., ntfs, and hpfs. + * src/copy.c (same_file_ok): Invoke same_name (which might still + return false for names that refer to the same directory entry) + only if the link count is 2 or more. + * tests/mv/vfat: Show how to demonstrate the above problem. + This test is not run. + * tests/mv/Makefile.am (EXTRA_DIST): Add vfat. + +2003-08-27 Jim Meyering + + * src/who.c: Change meaning of -l from --lookup to --login, per POSIX. + who's -l option has been eliciting an unconditional warning about + this impending change since sh-utils-2.0.12 (April 2002). + + * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'. + This would happen for nonempty files not ending with a newline. + Reported by Dan Jacobson. + * tests/misc/paste-no-nl: New file. Test for above-fixed bug. + * tests/misc/Makefile.am (TESTS): Add paste-no-nl. + + * src/stat.c (print_it): Avoid buffer overrun that would + occur when the user-specified format string ends with `%'. + Patch by Tommi Kyntola. + * tests/misc/stat-fmt: New file. Test for above-fixed bug. + * tests/misc/Makefile.am (TESTS): Add stat-fmt. + +2003-08-26 Jim Meyering + + Apply changes from bison. + * GNUmakefile (SHELL): Define to `sh', if necessary. + Add copyright. + * Makefile.maint (WGETFLAGS): Define to `-C off'. + Update all uses of $(WGET). + +2003-08-22 Akim Demaille + + * Makefile.cfg (local-checks-to-skip): New. + * Makefile.maint (local-check): Rename as... + (local-checks-available): this. + (local-check): New. + +2003-08-26 Akim Demaille + + * announce-gen (print_changelog_deltas): Neutralize "<#" as + "<\#" to avoid magic from Gnus when posting parts of this script. + +2003-08-25 Jim Meyering + + * src/stat.c (main): Warn about use of deprecated `-l' option. + +2003-08-22 Jim Meyering + + * src/stat.c (do_stat): For link count at end of line, use %h format, + instead of %-5h. The latter would make stat emit trailing spaces. + Reported by Dan Jacobson. + +2003-08-20 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names + +2003-08-19 Jim Meyering + + * src/system.h: Include stdlib.h unconditionally, + as we're now assuming that part of hosted C89. + +2003-08-18 Jim Meyering + + * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away, + to avoid warnings from gcc. + +2003-08-17 Jim Meyering + + Avoid unnecessary and sometimes time-consuming hostname lookups. + * src/who.c (print_user): Use strchr, not strrchr. + * src/pinky.c (print_entry): Likewise. + Patch by Michael Stone. + This fixes a typo I introduced in who-users.c on 1996-02-23. + + * Makefile.maint (makefile-check): Add 0-9 to the range of characters + disallowed between `@...@'. + +2003-08-16 Paul Eggert + + * configure.ac (fu_cv_sys_truncating_statfs): Remove; now + done by gnulib .m4 files. + (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP. + * src/sys2.h (strtoull): Remove unused declaration. + +2003-08-16 Jim Meyering + + * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files + are read-only. + + * src/tail.c (tail_lines): Fix a potential (but very hard to exercise) + race condition bug. The bug would be triggered when tailing a file + with file pointer not at beginning of file, and where the file was + truncated to have a length of less than the initial offset at just + the right moment (between the two lseek calls in this function). + + An invalid initial value for *read_pos would result in + `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a + busy-wait rather than sleeping between iterations. The bug manifests + itself only when tailing regular files that are initially nonempty. + * src/tail.c (tail_bytes): Set *read_pos to new file offset after + each xlseek call. + (tail_lines): Likewise, after lseek calls. + Reported by Nick Estes. See http://bugs.debian.org/205251 for details. + * tests/tail-2/tail-n0f: New file. Test for above fix. + * tests/tail-2/Makefile.am (TESTS): Add tail-n0f. + +2003-08-15 Jim Meyering + + * Makefile.maint (sc_space_tab): Use exclusion list in separate file. + (sc_sun_os_names): Likewise. + * .x-sc_space_tab, .x-sc_sun_os_names: New files. + + * man/help2man: Remove some SPACEs before TAB. + +2003-08-14 Paul Eggert + + * Makefile.maint (LC_ALL): Set to C. + * man/Makefile.am (ASSORT): New var. + (check-x-vs-1, programs): Use it. + * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise. + * tests/Makefile.am (ASSORT, all_programs): Likewise. + +2003-08-11 Jim Meyering + + fold -s -wN would infloop for N < 8 with TABs in the input. + E.g., this would not terminate: printf 'a\tb' | fold -w2 -s + * src/fold.c (fold_file): Move contents of `else'-block + out of conditional so it's used also for --spaces (-s). + * tests/misc/fold: Test for the above fix. + * tests/misc/Makefile.am (TESTS): Add fold. + +2003-08-10 Jim Meyering + + * src/nice.c [!NICE_PRIORITY]: Include after + system.h so the types from time.h and sys/time.h are available. + It appears that this is necessary for OpenBSD, NetBSD, and + Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe. + +2003-08-06 Paul Eggert + + * NEWS: Add support for setting file timestamps to microsecond + resolution, on hosts that support this. + * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h. + * src/copy.c (copy_internal): + Set file timestamps with utimens, not utime. + * src/cp.c (re_protect): Likewise. + * src/install.c (change_timestamps): Likewise. + * src/touch.c (newtime, touch, main): Likewise. + +2003-08-09 Jim Meyering + + * Makefile.maint (sc_sun_os_names): New rule based on a regexp + from Paul Eggert. + (syntax-check-rules): Add it. + + * src/tail.c (main): Tweak Solaris OS version number in comment. + * src/wc.c (wc): Likewise + * tests/tail-2/fflush: Likewise. + + * src/tail.c: Add new undocumented option, --presume-input-pipe. + (pipe_lines): Use memchr to skip lines, rather than an explicit loop. + +2003-08-08 Paul Eggert + + Use new gnulib 'extensions' module. + * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of + AC_GNU_SOURCE. + +2003-08-08 Paul Eggert + + * tests/du/basic: Ensure that a/b/F has at least 65 bytes too. + +2003-08-09 Jim Meyering + + * tests/misc/split-fail: Reflect that `split -a 0' is now accepted. + For tests of obsolete behavior, don't presume that unsetting + _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209. + +2003-08-07 Paul Eggert + + * doc/coreutils.texi (split invocation): + Add -d or --numeric-suffixes option to 'split'. + From a suggestion by Jesse Kornblum. + * src/split.c (suffix_alphabet): New var. + (longopts, usage, next_file_name, main): Support -d. + (next_file_name, main): Allow -a0, as POSIX requires. + (next_file_name): Don't assume ASCII-like encoding; + 'a' through 'z' are not contiguous in EBCDIC. + +2003-08-05 Paul Eggert + + Merge getline from gnulib. + * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib. + * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4: + New files, from gnulib. + * lib/getdelim2.c, lib/getdelim2.h: Remove. + * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and + getdelim2.h to getndelim2.c and getndelim2.h. + * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than + checking for getdelim. + (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather + than rolling our own. + * src/cut.c: Include getndelim2.h rather than getdelim2.h. + (cut_fields): Invoke getndelim2 rather than getdelim2. + +2003-08-04 Jim Meyering + + * src/sort.c (main): Use unsigned int instead of int for `nsigs' + and for the indices to iterate through nsigs. + +2003-08-02 Paul Eggert + + * src/sort.c: Minor code cleanups, mostly to use more accurate + types and to remove unnecessary casts. + (min, max): Remove. All uses changed to MIN and MAX. + (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct + keyfield.skipsblanks, struct keyfield.skipeblanks, struct + keyfield.numeric, struct keyfield.general_numeric, struct + keyfield.month, struct keyfield.reverse, reverse, unique, + have_read_stdin): Now bool, not int. All uses changed. + (eolchar): Now char, not int. + (struct keyfield.ignore): Now bool const *, not int *. + (struct keyfield.translate): Now char const *, not char *. + (struct month.name): Likewise. + (blanks, nonprinting, nondictionary): Now bool[], not int[]. + (cleanup, inittables, keycompare, check, mergefps, first_same_file, + check, sort, main): Use const * pointers when possible. + (month_cmp): Rewrite to avoid casts. + (inittables): Initialize tables unconditionally, to avoid branches. + (fillbuf): Return bool, not int. All uses changed. + (fillbuf, keycompare, new_key, main): + Use SIZE_MAX rather than (size_t) -1. + (trailing_blanks): Renamed from trim_trailing_blanks. + Return the number of blanks to trim. All uses changed. + (getmonth): Use trailing_blanks rather than open code. + (keycompare): Do not cast char * to unsigned char *; not needed. + CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it + ourselves. + (compare, main): Use | rather than || to avoid jumps. + Replace "diff = NONZERO (alen)" with "diff = 1", since alen must + be nonzero there. + (check, first_same_file, sort, main): + Use bool instead of int local vars when possible. + (check): Merge the old 'checkfp' and 'check' into a single function, + that returns a boolean (true if the file was ordered). + All uses changed. + (main): Use int instead of unsigned for iterating through nsigs. + Rename local var "posix_pedantic" to "posixly_correct". + +2003-08-02 Jim Meyering + + * src/nice.c [!NICE_PRIORITY]: Include before + to avoid compilation error on Ultrix. Reported by Christian Krackowizer. + + * src/cut.c (cut_fields): Don't read again after encountering an + initial EOF. E.g., `cut -f2' would do so. + * tests/misc/tty-eof: Add a test for the above fix. + + * src/sort.c (sortlines): Add description and references. + From Paul Eggert. + + * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that + the tests in help-version will use the just-built binaries. + Reported by Christian Krackowizer. + +2003-07-31 Paul Eggert + + * NEWS: Add --rfc-2822 option to GNU date. + * doc/coreutils.texi (Time directives, Options for date, Examples + of date): Likewise. + * src/date.c (long_options, usage, main): Likewise. + * doc/getdate.texi (General date syntax): Likewise. + * doc/coreutils.texi (Options for date): Fix a typo in format: + it's now %d not %_d. Add URLs. + +2003-08-01 Jim Meyering + + * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'. + Otherwise, with at least the /bin/sh from HPUX 10.20, + the trap code would end up converting that to exit 1 and thus an + unexpected test failure. Reported by Christian Krackowizer. + +2003-07-31 Paul Eggert + + * src/ptx.c: Do not include bumpalloc.h. + (WORD_TABLE): New member alloc. + (ALLOC_NEW_WORD): Remove. + (occurs_alloc): New var. + (digest_word_file, find_occurs_in_text): Check for arithmetic + overflow when computing table size. Use xrealloc rather than + bumpalloc primitives. + +2003-07-29 Jim Meyering + + * Version 5.0.90. + + * README: When running tests as root, suggest using + sudo with NON_ROOT_USERNAME=$USER. + + * tests/Makefile.am (all_programs): Makefile is in ../src, not + $(srcdir)/../src. + +2003-07-28 Jim Meyering + + * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option. + +2003-07-28 Paul Eggert + + * lib/stdbool.hin (_Bool): Make it signed char, instead of + an enum type, so that it's guaranteed to promote to int. + * src/sort.c (sortlines_temp): Undo previous change. + +2003-07-28 Jim Meyering + + * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not + `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4) + would cause lines[-1 - swap] (with swap = false) to evaluate to + lines[4294967295]. + +2003-07-27 Jim Meyering + + * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]', + since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'. + + * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable + directories, as required by POSIX. Reported by Karl Berry. + * tests/rm/dir-no-w: New file. Test for the above fix. + * tests/rm/Makefile.am (TESTS): Add dir-no-w. + + * tests/mk-script: Emit `$xx', not its expansion. + +2003-07-27 Paul Eggert + + This change was inspired by a similar proposal by Stepan Kasal. + * src/sort.c (mergelines, sortlines_temp): New functions. + (sortlines): Use them, to reduce the number of times that + we need to copy 'struct line' values. This improved CPU + performance by about 30% on one 18 MB test. + (sort): Don't invoke sortlines unless we have 2 or more lines. + +2003-07-26 Stepan Kasal + + * src/sort.c (sort): Don't require two `struct line's per text line, + the new sort algorithm requires just 1.5. + +2003-07-27 Jim Meyering + + * src/pathchk.c (validate_path): Use %lu, not %ld. + From Paul Eggert. + * src/cut.c (is_printable_field): Simplify bit arithmetic. + From Paul Eggert. + * src/ls.c (sort_files): Put `volatile' in the right place. + From Paul Eggert. + +2003-07-26 Jim Meyering + + Use only one bit per field/offset in array, not one `int'. + * src/cut.c (printable_field): Change type to `unsigned char'. + (mark_printable_field, is_printable_field): New functions. + Use them in place of all direct accesses of `printable_field'. + + * src/expand.c (parse_tabstops): Detect overflow properly. + * src/cut.c (set_fields): Likewise. + + * src/rm.c: Include "dirname.h". + (usage): Use base_name (program_name) in body of --help output. + This lets me... + * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22. + Idea from Brendan O'Dea, who suggested using + `program_name = basename (argv[0]);' everywhere -- + can't do that, but using base_name works just fine here. + + * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test. + +2003-07-24 Paul Eggert + + Fix some POSIX-compliance problems with 'test'. This makes + 'test' more compatible with Bash. + + * NEWS, doc/coreutils.texi: Document the following. + * src/test.c: Include exitfail.h. + (TEST_FAILURE): New constant, used for exit status if 'test' fails. + (test-syntax_error): Use it. + (binary_operator): Now takes bool arg specifying whether left operand + is -l ARG, so that caller determines this rather than us. + All uses changed. + (term): Use posixtest to evaluate parenthesized subexpressions. + (unary_operator, one_argument): Remove support for -t without operand. + (one_argument): Take argument from argv[pos]. + (one_argument, two_arguments, three_arguments): Advance pos. + All callers changed. + (three_arguments): Look for binary ops before "!". Then look + for parenthesized one_argument expressions, instead of trusting + expr () to do the right thing. + (posixtest): Now takes number of args. All callers changed. + Treat "( A B )" like "A B". + (main): Set exit_failure to TEST_FAILURE. Don't depend on + POSIXLY_CORRECT, as we now conform to POSIX by default. + (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless. + * tests/test/Test.pm (test_vector): Add several tests to check + the above. Syntax errors now exit with status 2, not 1. + * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1. + +2003-07-26 Jim Meyering + + * tests/help-version: Adjust for above change in test behavior: + `[' exits with 2, not 1, and test doesn't accept --help or --version. + + * Makefile.maint (ME): Don't use trick suggested in Make manual. + It doesn't work for make-3.79.1. Reported by Christian Krackowizer. + + * Makefile.maint (sc_system_h_headers): Another syntax check. + (syntax-check-rules): Add it to the list. + + * src/pathchk.c (validate_path): Cast strlen value to `unsigned long' + so it matches `%ld' format even on 32-bit systems. + + * src/fmt.c (flush_paragraph): Cast field width to `int' to + avoid warning on 64-bit systems. + + * src/ls.c (sort_files): Make `func' volatile, so it can't be + clobbered by a `longjmp' into this function. + +2003-07-25 Jim Meyering + + * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t + value. + + * tests/misc/split-fail: Disable the --line-bytes=$_4gb test, + because it'd evoke spurious failure on 64-bit systems. + +2003-07-24 Jim Meyering + + * src/dd.c (usage): Document the fact that SIGUSR1 makes dd + output its current record counts. Reported by Jurriaan. + + * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running + `wc' with no options. This goes along with the change of 2003-07-20. + +2003-07-23 Jim Meyering + + Don't include headers already included by system.h: + * src/tr.c: Don't include errno.h. + * src/true.c: Don't include version-etc.h. + * src/test.c: Don't include limits.h or error.h. + * src/stat.c: Don't include unistd.h or time.h. + * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h. + * src/pr.c: Don't include time.h. + * src/pathchk.c: Don't include errno.h. + * src/nice.c: Don't include sys/time.h. + * src/ls.c: Don't include stdlib.h. + + * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c: + * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c: + * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c: + * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c: + * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c: + * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c: + * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c: + * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c: + Don't include closeout.h. + + * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME + can access the required version of rm. + * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION. + + * tests/cut/Test.pm (out-delim3a): New test. + + * man/help2man: Update to version 1.33. + + * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes. + + * src/dircolors.c: Include xstrndup.h. + (xstrndup): Remove function, now that it's been factored out into + it's own file. + +2003-07-22 Paul Eggert + + * src/wc.c (wc): Fix typo in computation of file from file_x, + which caused the former to be used uninitialized if file_x was + nonzero. + +2003-07-22 Jim Meyering + + * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset. + + * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of + help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by + Thomas Luzat. See http://bugs.debian.org/202413 for details. + + * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning. + + * src/hostid.c: Don't include . system.h already does that. + + * src/cut.c (set_fields): Mark all selected indices before trying to + determine range endpoints. + * tests/cut/Test.pm: New test for the above fix. + + Begin to address this comment: What if someone wants to + extract the 1,000,000-th field of some huge input file? + The first step is to rearrange things so that the values + in the printable_field array are all 0/1 rather than 0/1/2. + * src/cut.c (RANGE_START_SENTINEL): Remove. + Store range-start indices in a hash table, rather than + overloading the `printable_field' array. + (range_start_ht): New global. + (hash_int, hash_compare_ints, is_range_start_index): New functions. + (print_kth): Use is_range_start_index; don't test printable_field. + (set_fields): Detect overflow. + (set_fields): Insert each range-start index into range_start_ht. + (main): Call set_fields only once, and only after + output_delimiter_specified and (if required) range_start_ht have + been defined. + +2003-07-20 Paul Eggert + + * src/wc.c (get_input_fstatus): Fix typo: `stat' was being + invoked with a null pointer when there were no file arguments. + +2003-07-20 Jim Meyering + + * Makefile.maint (sc_changelog): Add another nit-picky check. + + * src/wc.c (write_counts): Add a comment. + (wc): Rename `file' parameter. + Set new local, `file', to be the file name, or (when it's NULL) + _("standard output") so that all uses of `file' use the proper value. + Use STREQ, not strcmp. + +2003-07-20 Paul Eggert + + wc count field widths now are heuristically adjusted depending + on the input size, if known. If only one count is printed, it + is guaranteed to be printed without leading spaces. + + Previously, wc did not align the count fields if + POSIXLY_CORRECT was set, but POSIX did not actually require + this undesirable behavior, so it has been removed. + + * NEWS: Document this. + * doc/coreutils.texi (wc invocation): Likewise. + + * src/wc.c (number_width): New var. + (posixly_correct): Remove. + (struct fstatus): New struct. + (write_counts): Output fields of width number_width. + Do not worry about POSIXLY_CORRECT. + Use null file, not empty-string file, to denote stdin, + since "" is a valid file name on some hosts. + (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat + if possible. + (wc): Avoid problems if end_pos - current_pos overflows. + Do not print odd message if stdin has a read error. + (get_input_fstatus, compute_number_width): New functions. + (main): Use them to implement the new behavior. + Ignore POSIXLY_CORRECT. + + * tests/wc/Test.pm: Adjust to the new output widths. + +2003-07-19 Jim Meyering + + * tests/rm/fail-eperm: Don't create temporary directory -- + we don't use it. + + * tests/shred/remove: Don't open-code test for UID != 0. + Use priv-check's require-non-root instead. + Update to use newer framework. + + * tests/help-version (expected_failure_status_expr): Record that + expr exits with status of 3 for e.g., a write error. + + * tests/priv-check: Use `id -u' to see if we're running as root, + rather than trying go write to an write-protected file. + When running as root, ensure $NON_ROOT_USERNAME is valid. + When running as root with `require-non-root', ensure that `.' + is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID + to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test. + + * src/printenv.c: Include "exitfail.h". + (main): Set exit_failure rather than calling close_stdout_set_status. + * src/date.c: Likewise. + * src/sort.c: Likewise. + * src/tty.c: Likewise. + +2003-07-18 Jim Meyering + + * tests/touch/not-owner: Update to use newer framework. + + * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary + directory, and remove Perl-coded `you may not run as root' test. + * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than + hard-coding something not quite equivalent. + Paul Jarc reported the inconsistent diagnostics. + + * src/sort.c (main): Use close_stdout via atexit. + Now `sort --version' and `sort --help' fail, as they should + when their output is redirected to /dev/full. + + * src/su.c (usage): Don't call close_stdout here. + (main): Use close_stdout via atexit. + Now `su --version > /dev/full' fails, as it should. + Somehow, the change of 2000-05-07 that purports to fix this + was not checked in. + + * tests/help-version (--help/--version vs. /dev/full): Special-case + `[' to protect it from expected_failure_status-`eval'. + + * src/uniq.c (writeline): Use a SPACE, not a TAB between the + count and the corresponding line, as required by POSIX. + Reported by Clement Wang. + * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly. + + * tests/expr/basic: Add tests for when exit status is 2. + + * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE): + Use an anonymous `enum', rather than #define. + +2003-07-17 Paul Eggert + + * src/expr.c: Include "exitfail.h", "quotearg.h". + (EXPR_INVALID, EXPR_ERROR): New constants. + (nomoreargs, null, toarith, nextarg): Return bool, not int. + (syntax_error): New function, exiting with status 2. Use it + insteading of printing "syntax error" ourselves. + (main): Initialize exit_failure to EXPR_ERROR. + Exit with EXPR_INVALID on syntax error (too few arguments). + (nextarg): Use strcmp, not strcoll; strcoll might return + an undesirable 0, or might fail. + (docolon, eval4, eval3): Exit with status 3 on invalid argument type + or other such error. + (eval2): Report an error if strcoll fails in a string comparison. + * src/sort.c: Include "exitfail.h". + (main): Set exit_failure, not xalloc_exit_failure and + xmemcoll_exit_failure. + * tests/expr/basic: Invalid value exits with status 3, not 2. + +2003-07-16 Jim Meyering + + * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2, + per GNU maintainer guidelines. The next non-beta release will be 5.1. + + This script would have caught at least two recent bugs: + those in [ and kill. + * tests/help-version: Revive this script. + It wasn't doing anything useful, since $all_programs wasn't being + defined by the invoking Makefile.am. + Reflect that nohup is no longer a script, so don't exclude it. + Add framework to handle the programs added since it was last run: + kill, stat, unlink, [, link, readlink. + Fix path-related problems deriving from the move of this script + from src/ to its present location. + * tests/Makefile.am (all_programs): Define. + (TESTS_ENVIRONMENT): Use it. + + * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1) + whereby kill would always attempt to operate on argv[0] and fail. + + * src/test.c (integer_expected_error): Improve diagnostic -- now, + it also matches the one from bash's builtin test. + (binary_operator): Add \n at end of diagnostic. + + * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ... + * tests/priv-check: Move setuidgid-related and + NON_ROOT_USERNAME-checking code to this file. + + * README: Update section on testing as `root'. + Suggestion from Paul Jarc. + + * src/test.c (AUTHORS): Replace 3-letter usernames with the actual + names of authors that I just found in bash's builtins/test.def. + + Running `[' with no arguments would evoke a segfault. + * src/test.c (main) [LBRACKET]: Move initialization of argv to + precede potential use via test_syntax_error. + + * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid + warning from automake -Wall. + +2003-07-15 Jim Meyering + + * Version 5.0.1. + + * Makefile.maint (%.asc): Remove target first, so gpg doesn't + prompt us about it. + + * announce-gen (print_changelog_deltas): Relax tests for matching + version-number line in NEWS. + Change the .sig suffix to .asc here, too. + +2003-07-14 Jim Meyering + + * Makefile.maint (%.asc): Renamed from %.sig. + Generate and use ascii-armored signatures. + Use gpg's -o option. + +2003-07-13 Jim Meyering + + * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define. + (main): Use them. + + * Makefile.maint (syntax-check): Move each individual check into + its own target. + (syntax-check-rules): This is the list of syntax-check targets. + (sc_unmarked_diagnostics, sc_cast_of_argument_to_free): + (sc_cast_of_x_alloc_return_value, sc_space_tab): + (sc_error_exit_success, sc_xalloc_h_in_src): New targets. + +2003-07-12 Jim Meyering + + * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last + traces of the nohup script. + + * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed + $(OPTIONAL_BIN_ZCRIPTS). + + * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect + target, not before the `>'. + + * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd, + now that that function no longer calls `error'. + + * src/df.c (find_mount_point): Emit a diagnostic for each + failed syscall, rather than relying on caller to do that. + The caller couldn't do a good job, anyhow -- too many different + ways to fail (each with a different referent). + Give a diagnostic upon failed save_cwd, now that that function + no longer calls `error'. + (show_point): Don't diagnose find_mount_point's errors, now that + it handles them itself. + + * src/df.c (find_mount_point): Don't let free clobber errno upon + failed chdir. + + * src/sys2.h: Remove alloca-related block. + * src/system.h: Include here, instead. + + It appears that the `#pragma alloca' included via "system.h" is + adequate, since join.c uses alloca, yet lacked an in-file #pragma. + * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c: + * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'. + + * src/chown-core.c (change_file_owner): Do not restore any special + permission bits (e.g., set-user-ID, set-group-ID) that are reset + by chown(2) on some systems. Suggestion and insistence :-) from + Michael Stone. + + * tests/input-tty: Also check `test -t 1'. + This is necessary on linux-2.4.21. Otherwise, the stty/basic-1 + test would block when run in the background. + +2003-07-11 Jim Meyering + + * tests/sample-test: Also fail if cat-to-create-expected-output + fails. Otherwise, if both `exp' and `out' were to end up empty + because of e.g., a full disk, they would mistakenly compare equal. + + * src/nohup.c: New file. Rewrite of nohup.sh in C. + This solves a portability problem: on at least Solaris systems, + when nohup.sh used the vendor /bin/sh, it would exit with status + of `1' rather than the required 126 or 127 upon failure to exec + the specified program. + + * src/Makefile.am (EXTRA_SCRIPTS): Remove definition. + (bin_PROGRAMS): Add nohup. + (EXTRA_DIST): Remove nohup.sh. + (all_programs): Remove use of $(EXTRA_SCRIPTS). + * src/nohup.sh: Remove file. + * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh. + + * tests/misc/nohup: Tests for the above. + * tests/misc/Makefile.am (TESTS): Add nohup. + + * src/head.c (diagnose_copy_fd_failure): New function, renamed from + the macro, COPY_FD_DIAGNOSE. + (diagnose_copy_fd_failure): Enclose diagnostic in _(...). + (head_file): Likewise. + + * src/date.c: Include "quote.h". + (batch_convert): Use the quote function rather than using literal `...' + in a diagnostic. + + * src/setuidgid.c (main): Enclose diagnostic in _(...). + * src/fmt.c (main): Likewise. + * src/mknod.c (main): Likewise. + * src/tac.c (tac_seekable): Likewise. + * src/yes.c (main): Likewise. + * src/od.c (main): Likewise. + * src/install.c (change_attributes): Likewise. + +2003-07-10 Jim Meyering + + * src/head.c (usage): Use 1024*1024 in place of 1048576. + * src/tail.c (usage): Likewise. + + * tests/rm/fail-2eperm: Now that we have setuidgid, use it in + place of the kludge in this test. Suggestion from Paul Jarc. + + * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid. + * src/setuidgid.c: New program, solely for testing (not installed). + + * src/chown-core.c (change_file_owner): Don't leak file descriptors + when dereferencing symlinks. + +2003-07-09 Jim Meyering + + * tests/du/slash: New file/test for today's lib/ftw.c fix. + * tests/du/Makefile.am (TESTS): Add slash + + * src/tail.c (xlseek): Avoid warning about ``return without value + from function returning non-void''. + +2003-07-08 Jim Meyering + + * man/help2man: Update to version 1.29. + + * man/help2man: Add END handler to close STDOUT and check for errors. + +2003-06-30 Paul Eggert + + Add support for a "[" that conforms to the GNU coding standards, + i.e., that does not depend on its name. + * src/lbracket.c: New file. + * README: Add "[". + * man/Makefile.am (programs): Ignore "[", since it doesn't have + a separate man page. + * src/Makefile.am (bin_PROGRAMS): Add "[". + (__SOURCES): New var. + * src/test.c (LBRACKET): Define to 0 if not defined. + (main): Use LBRACKET rather than argv[0]. + + * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT. + Reported by Paul Jarc and Dan Jacobson. + + * src/test.c (main): Do not recognize --help or --version if + POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly. + Do not bother testing that margv[margc] is non-null. + +2003-07-04 Jim Meyering + + * src/who.c (print_line): Rewrite to use asprintf, in order to be + able to avoid emitting trailing spaces. Reported by Dan Jacobson. + + * tests/misc/head-elide-tail: Add tests of head's new --lines=-N + option, and perform the +1600 invocations of head IFF the envvar + RUN_EXPENSIVE_TESTS is set. + +2003-07-03 Jim Meyering + + * src/cp.c (do_copy): Give a better diagnostic when failing due + to nonexistent destination directory. Reported by Dmitry Rutsky. + See http://bugs.debian.org/199730 for details. + +2003-06-27 Jim Meyering + + split's --verbose option did nothing [broken in 4.5.10 and 5.0] + * src/split.c (longopts): Use `1', not `0' as the value for + for &verbose. Reported by Keith Thompson. + + Test for the above fix. + * tests/misc/split-a: Also use --verbose and compare stderr + output with what we'd expect. + +2003-06-20 Jim Meyering + + * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]: + Use `error_t' (rather than int) as type for local `err'. + From Alfred M. Szmidt. + +2003-06-19 Marcus Brinkmann + + * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]: + Fix author preservation code. + +2003-06-19 Jim Meyering + + * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0. + (do_link): Don't warn about hard link to symlink. + +2003-06-18 Jim Meyering + + * src/cut.c: Include "getdelim2.h", not "getstr.h". + Reflect renaming: getstr -> getdelim2. + + * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming: + readline -> readlinebuffer. + +2003-06-09 John David Anglin + + * src/readlink.c: Include before system.h (because + the latter includes ). Required on Ultrix 4.3. + +2003-06-17 Jim Meyering + + * src/system.h (initialize_main): Define. + Use it in every `main'. Applied via this: + p='initialize_main (&argc, &argv);' + perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \ + $(grep -l program_name.=.argv.0 *.c) + test.c uses margc/margv, so I made the change manually for that file. + Based on a patch from Bernard Giroud. + +2003-06-09 John David Anglin + + Fix for build failure on Ultrix 4.3. + * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h. + Include sys/param.h and sys/mount.h on ultrix. + +2003-06-16 Jim Meyering + + * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove + definitions. + * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define + them here instead, but with one change: define EISDIR to -1, not 0. + + * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's + guaranteed to be defined. + * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined. + + * README: Mention the CVS repository. + Encourage addition of test cases. + +2003-06-12 Jim Meyering + + * src/touch.c (touch): Call close only if necessary. + From Bruno Haible. + + * src/wc.c (usage): Correct wording: wc prints counts in the order + `newline, word, byte'. Reported by Keith M. Briggs. + * man/wc.x: Fix it here, too. And change `lines' to `newlines'. + +2003-06-10 Jim Meyering + + * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003. + +2003-06-07 Jim Meyering + + * Makefile.maint (syntax-check): Add commented-out (over-aggressive) + rule. + +2003-06-06 Jim Meyering + + * src/extract-magic (main): Avoid newer 3-arg form of open, + so this script works also with e.g., perl5.005_03. + Patch by John David Anglin. + +2003-06-04 Paul Eggert + + * src/system.h: Include unconditionally. + +2003-06-04 Jim Meyering + + * man/Makefile.am (check-programs-vs-x): Rename target + from check-programs-vs-1. Adjust rule to check for the + primary (.x) file, not the generated one (.1). + +2003-06-03 Tim Mooney + + * man/kill.x: New file. + * man/Makefile.am (dist_man_MANS): Add kill.1. + (kill.1): New rule. + +2003-06-04 Jim Meyering + + Ensure that the .x file for a new program is never forgotten again. + * man/Makefile.am (programs): Define. + (check-programs-vs-1): New phony target. + (check-local): Depend on it. + +2003-06-03 Jim Meyering + + Avoid unnecessary copying of environment. + * src/env.c (main): Rather than clearing the environment and -- + unless told to ignore environment -- copying all settings from + the saved, original environment, clear the environment only when + that is requested. Suggested by Jens Elkner. + +2003-06-02 Jim Meyering + + * src/system.h: Always include , since we assume C89. + Include without checking for HAVE_LIMITS_H. + + * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block. + (STREQ, S_IXUGO): Remove redundant (in system.h) definitions. + +2003-06-01 Jim Meyering + + Avoid a race condition in `tail -f' described by Ken Raeburn in + http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html + * src/tail.c (file_lines): Add new parameter, *read_pos, and set it. + (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise. + (tail_bytes, tail_lines, tail): Likewise. + (tail_file): Use the new `read_pos' value as the size, + rather than stats.st_size from the fstat call. + +2003-05-28 Jim Meyering + + * src/extract-magic: Allow expansion of `$file' in the here- + document corresponding to the comment at the top of fs.h. + +2003-05-26 Jim Meyering + + * src/stat.c: Fix portability problem on FreeBSD5.0: don't include + on systems without HAVE_STRUCT_STATVFS_F_BASETYPE. + Use #if/#elif/... cascade so we get only one set of include files. + Reported by Nelson Beebe. + +2003-05-24 Jim Meyering + + * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode. + * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't + accept the BSD format. + +2003-03-28 Joe Orton + + * src/md5sum.c (bsd_split_3): New function. + (split_3): Detect checksums from BSD 'md5' command and handle them + using bsd_split_3. + + * tests/md5sum/basic-1: New tests for --check exit status, and for + BSD-style checksum files. + +2003-05-21 Jim Meyering + + * src/head.c (elide_tail_lines_pipe): Fix a thinko. + This sort of thing is why it'd be *Really Good* to factor + out the common code used here and in tail.c. + +2003-05-14 Jim Meyering + + * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N. + + * tests/du/slink: Skip this test if `.' is on an XFS file system. + + * tests/du/fd-leak: New file. Test for the bug in du that + was fixed by the 2003-05-12 change to lib/ftw.c. + * tests/du/Makefile.am (TESTS): Add fd-leak. + + * src/head.c (AUTHORS): Enclose string in N_(...), now that it + includes a translatable word, `and'. + + * src/dd.c (usage): Don't use `,' as the thousands separator + in e.g. 1,000,000 and 1,048,576. Instead, do this: + `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...' + * src/df.c (usage): Likewise. + * src/du.c (usage): Likewise. + * src/ls.c (usage): Likewise. + + * Makefile.maint (syntax-check): Add another check. + +2003-05-13 Paul Eggert + + Fix uniq to conform to POSIX, which requires that "uniq -d -u" + must output nothing. Problem reported by Josh Hyman. + + * src/uniq.c (enum output_mode, mode): Remove, replacing with: + (output_unique, output_first_repeated, output_later_repeated): + New vars. All uses of "mode" changed to use these variables, + which are not mutually exclusive as "mode" was. + (writeline): New arg "match", used to control whether to + obey output_first_repeated or output_later_repeated. + All callers changed. + (check_file, main): Adjust to above changes. + + * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing. + +2003-05-14 Jim Meyering + + * tests/rm/rm3: Use tr's \n notation rather than \012. + This package can afford to do that, since its tests are guaranteed use + GNU tr, which has accepted the more modern notation for 10 years. + * tests/rm/rm5: Likewise. + * tests/cp/same-file: Likewise. + * tests/stty/row-col-1: Likewise. + * tests/stty/basic-1: Likewise. + * tests/rm/deep-1: Likewise. + * tests/mv/part-symlink: Likewise. + * tests/mkdir/perm: Likewise. + * tests/misc/nice: Likewise. + +2003-05-13 Jim Meyering + + * src/copy.c (struct F_triple) [name]: Remove const attribute. + (triple_free): Don't apply cast to argument of free. + (seen_file): Add cast here instead. + + * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute. + (src_to_dest_free): Don't apply cast to argument of free. + + * src/sort.c (zaptemp): Don't apply cast to argument of free. + * src/pr.c (init_fps, init_store_cols): Likewise. + * src/join.c (delseq, freeline): Likewise. + * src/expr.c (OLD): Likewise. + * src/sort.c (sort): Likewise. + * src/head.c (elide_tail_lines_pipe): Likewise. + + * src/tail.c: Include "quote.h". + Use quote in diagnostics. Change many error format strings + from just `%s' to e.g., `error reading %s'. + (pipe_lines): Change type of parameter, n_lines, to uintmax_t. + Rewrite newline-counting loop to use memchr. + + * src/head.c (elide_tail_lines_pipe): Use `if', not assert. + Now that assert is no longer used, don't include . + +2003-05-12 Jim Meyering + + * src/head.c: Include . + (AUTHORS): Add my name. + (elide_tail_lines_pipe): New function. + +2003-05-10 Jim Meyering + + * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'. + + * src/readlink.c (main): Set program_name before first use. + Remove that (redundant) first use. + Don't exit successfully just because --verbose was specified. + Pass 0, not EXIT_SUCCESS, as first argument to error; when that + parameter is 0, error does not exit. + + * src/uname.c (main): When failing due to too many arguments, also say + that, rather than just "Try `uname --help' for more information.". + * src/comm.c (main): Likewise, but for too few arguments. + * src/logname.c: Include error.h. + (main): Say why we're failing. + + * src/uniq.c (main): Don't segfault when argc < optind. + * src/who.c (main): Handle argc < optind. + * src/df.c (main): Likewise. + * src/install.c (main): Likewise. + * src/mv.c (main): Likewise. + * src/pwd.c (main): Likewise. + * src/tty.c (main): Likewise. + * src/chroot.c (main): Likewise. + * src/hostname.c: Likewise. + * src/du.c (main): Likewise. + * src/expand.c (main): Likewise. + * src/env.c (main): Likewise. + * src/unexpand.c (main): Likewise. + * src/printenv.c (main): Likewise. + * src/sync.c (main): Handle argc == 0. + * src/expr.c (main): Likewise. + * src/printf.c (main): Likewise. + * src/basename.c (main): Likewise. + * src/ln.c (main): Test for `missing argument' before computing n_files. + * src/tail.c (main): Test for the case of no arguments before + computing n_files. + + * src/kill.c (send_signals): Don't check command line arguments here. + (main): Check them here instead. Handle argc < optind. + + * src/logname.c (main): Use error, rather than fprintf, for the sake + of consistency. + + * src/rm.c (main): Don't overrun array bound if argc is 0. + +2003-05-09 Jim Meyering + + * src/sort.c (main): Don't overrun array bound if argc is 0. + That would happen when invoked via: execl ("/usr/bin/sort", NULL); + Reported by Wartan Hachaturow. + +2003-05-07 Jim Meyering + + Implement support so that `head --lines=-N' works on seekable files. + * src/head.c (enum Copy_fd_status): Define. + (COPY_FD_DIAGNOSE): New macro. + (elide_tail_lines_seekable): New funtion. + (elide_tail_lines_file): Call it here. + +2003-05-06 Jim Meyering + + * src/sys2.h (CHAR_BIT): Remove duplicate definition. + +2003-05-04 Jim Meyering + + * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework + caused the addition of thousands of small files to the tar archive. + * tests/misc/head-elide-tail: New file. Add them here instead. + * tests/misc/Makefile.am (TESTS): Add head-elide-tail. + +2003-05-04 Paul Eggert + + * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined. + (IF_READDIR_NEEDS_REWINDDIR): Remove. + (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR, + which was a bit weird because it couldn't be emulated by a function. + +2003-05-03 Jim Meyering + + Extend head to accept --lines=-N (--bytes=-N) and to print all + but the N lines (bytes) at the end of the file. + * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h. + Use quote() in diagnostics, rather than literal `' marks. + (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file): + New functions. + (elide_tail_lines_pipe, elide_tail_lines_file): New functions. + (head_file): Reorganize so as to call head from only one place. + (main): Likewise, for head_file. + Handle new, undocumented option, --presume-input-pipe. + Handle negative line and byte counts. + * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N. + + * tests/du/8gb: Skip test if the file system of `.' doesn't support + sparse files -- otherwise it'd create a file of size 8GB. + +2003-05-02 Jim Meyering + + * src/fmt.c (usage): Don't mention obsolescent -WIDTH option. + Instead explain about `-' and standard input. + (main): Give a proper diagnostic for e.g., `fmt -c -72'. + Reported by Keith Thompson. + * tests/fmt/basic: Add test for the above fix. + + * src/fmt.c: Include "quote.h". + Use quote() in diagnostics, rather than literal `' marks. + (main): Exit nonzero when unable to open an input file. + * tests/fmt/basic: Add test for the above fix. + + * src/fmt.c (main): Diagnose invalid suffix on obsolescent width + specifications like `-72x'. + * tests/fmt/basic: Add test for the above fix. + + Work around nasty readdir bug on Darwin6.5. + * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define. + [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just + returned NULL and there has been at least one successful unlink or + rmdir call since the opendir or previous rewinddir, then call + rewinddir and reiterate the loop. + + Factor out common code. + * src/remove.c (readdir_ignoring_dotdirs): New function. + (is_empty_dir): Use it here. + (remove_cwd_entries): Use it here. + +2003-05-01 Jim Meyering + + * tests/rm/r-3: Create 500 rather than just 300 files. + There's a bug in Darwin6.5's readdir that shows up only with + 338 or more files. + Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp + has two components. + + * src/tail.c: + Change type of n_units, n_bytes, n_lines to be `uintmax_t'. + (dump_remainder): Move two declarations `down' into the scope + where they are used. + (xlseek): Return the resulting offset. + (file_lines): Rename parameter, file_length, to end_pos. + (pipe_lines): Don't coerce safe_read return value to `int'. + Adapt tests accordingly. + (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int' + to `unsigned int'. + Change type of `total_bytes' from `int' to `size_t', + since the former wouldn't always be wide enough. + Don't coerce safe_read return value to `int', + and adapt tests accordingly. + Now that testing for a read error no longer involves + using `tmp', handle that case *after* freeing `tmp'. + (start_bytes): Clean up. + (tail_bytes): Now that `n_bytes' may be larger than + OFF_T_MAX, test for that condition and, if it's true, don't + use lseek optimizations. + (parse_options): Don't fail just because N_UNITS is larger than + the maximum size of a file -- tail may be applied to an input + stream (e.g., a pipe) with more data than that. + + * Makefile.maint (syntax-check): Rename from alloc-check. + Also check for SPACE-TAB sequences. + Also check for malloc/calloc/realloc casts. + +2003-05-01 Jim Meyering + + * src/tail.c (start_lines): Rewrite to use memchr. Clean up. + +2003-04-28 Jim Meyering + + * tests/misc/tty-eof: Send two tokens, not just one, so we don't + make the now-more-picky tsort fail. + +2003-04-24 Jim Meyering + + * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin. + (main): Minor syntactic clean-up. + + * src/tsort.c (tsort): Fail if the input contains an odd number of + tokens. Reported by junkio@cox.net. + + * tests/tsort/basic-1: Test for the above fix. + +2003-04-21 Jim Meyering + + * tests/misc/printf: Add tests for the printf fixes below. + + * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list. + +2003-04-20 Paul Eggert + + Fix printf POSIX compatibility bug reported by Ben Harris in + . + * doc/coreutils.texi (printf invocation): It's \NNN in the format, + \0NNN in the %b operand. + * src/printf.c (usage): Likewise. + (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN + is desired. All uses changed. Behave like Bash printf if %b + operand uses \NNN where the initial N is not 0. + +2003-04-17 Jim Meyering + + * src/stty.c: Remove uses of PROTOTYPE macro. + +2003-04-15 Jim Meyering + + * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment) + each sequence of spaces before a TAB character. + +2003-04-13 Jim Meyering + + * src/remove.c (is_empty_dir): Don't closedir (NULL). + +2003-04-12 Jim Meyering + + Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h), + --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or + FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic. + * src/nl.c (main): Fix those problems and remove literal quote marks + (e.g., "`%s'") from format string; instead use "%s" in each format + string and `quote (optarg)' as the corresponding argument. + Also, diagnose all invalid command line options before failing. + + * src/nl.c (proc_text): Fix a bug that would make nl output extra + newlines in some cases. Details here: http://bugs.debian.org/177256. + This bug was introduced on 2001-11-10 for textutils-2.0.17. + * tests/misc/nl: Add test for the above-fixed bug. + + * tests/misc/readlink: New file. Test the --canonicalize option. + * tests/misc/Makefile.am (TESTS): Add readlink. + +2003-04-11 Jim Meyering + + Clean up. + * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c: + * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c: + * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to + retain alignment) each sequence of spaces before a TAB character. + + * src/ls.c: Include unconditionally. + + * Makefile.maint (xalloc-check): Rename from header-check. + + * src/yes.c: Include error.h after system.h, not before. + + Clean up. + * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c: + * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c: + * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c: + * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c: + * src/tr.c: * src/unexpand.c, src/users.c: + Remove anachronistic casts of xmalloc, xrealloc, and xcalloc + return values and of xrealloc's first argument. + Fix the former with this: + perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/' + +2003-04-10 Jim Meyering + + * src/stty.c (wrapf): Declare with format attribute. + + The S_MAGIC_... names shouldn't be maintained in two places (prior + to this change, one would have to keep stat.c and fs.h in sync). + This change makes it so those names and the corresponding + hexadecimal constants all reside in stat.c. fs.h is now generated. + * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c. + (BUILT_SOURCES): Add fs.h, now that it's generated. + (EXTRA_DIST): Add extract-magic. + * src/extract-magic: New script to extract fs.h definitions from stat.c. + * src/stat.c (human_fstype) [__linux__]: Append each hex constant from + fs.h in a comment after the corresponding `case S_MAGIC_...:' statement. + + * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a + file with nominal length > 4GB fails. Reported by Michael Deutschmann. + + * man/unexpand.x: Add `SEE ALSO' reference to expand. + * man/expand.x: Add `SEE ALSO' reference to unexpand. + Suggestion from Dan Jacobson. + +2003-04-10 Maciej W. Rozycki + + * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts. + * src/stat.c (human_fstype): Handle Linux's devpts. + +2003-04-09 Paul Eggert + + * src/split.c (line_bytes_split): Arg is of type size_t, since + that's all that is supported for now. + (main): Check for overflow in obsolescent line count option. + +2003-04-09 Jim Meyering + + * tests/misc/split-fail: Add a new test for the above fix. + + * src/split.c (bytes_split): Use size_t temporary (rather than + uintmax_t original) in remaining computations. From Paul Eggert. + + Handle command line option arguments larger than 2^31. + This allows e.g., splitting into files of size 2GB and larger, + and running split --lines=N with N=2^31 or more. + But for --line-bytes=N, the restriction that N <= SIZE_MAX + remains (for now), due to the way it is implemented. + + * src/split.c: Include "inttostr.h". + (bytes_split, lines_split, line_bytes_split, main): + Use uintmax_t, not size_t, for file sizes. + (main): Give a better diagnostic for option arguments == 0. + Use umaxtostr to print file sizes. + Reported by Luke Hassell. + +2003-04-08 Jim Meyering + + * src/rm.c (usage): Mention that --directory (-d) works only + on some systems. Suggestion from Samuel Tardieu. + + * tests/basename/basic: Run $PERL to see if it is available, + rather than testing its value. + * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1: + * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple: + * tests/expr/basic, tests/factor/basic, tests/fmt/basic: + * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1: + * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1: + * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable: + * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec: + * tests/sum/basic-1, tests/seq/basic: Likewise. + + * tests/misc/Makefile.am (TESTS): Add split-fail. + * tests/misc/split-fail: New file. + + * src/split.c: Rename local variables: nchars -> n_bytes. + (lines_split): Rename local, nlines -> n_lines. + (main): Rename local variable: s/accum/n_units/. + (main): Use STDIN_FILENO, not literal `0'. + +2003-04-07 Jim Meyering + + * src/stat.c: Add #include directives for Ultrix 4.4. + Based on a suggested change from Bert Deknuydt. + +2003-04-06 Jim Meyering + + * Makefile.maint (makefile-check): New rule. + (local-check): Add it. + +2003-04-05 Jim Meyering + + * Makefile.am (nearly all of them): + Use $(VAR) rather than @VAR@, now that we can rely on automake to + emit a definition for each substituted variable. + * tests/Makefile.am.in: Likewise. + + * tests/rm/rm5: Add a comment explaining why this test fails when + using Tru64's broken sed. + * tests/rm/rm3: Likewise. + + Make `kill -t' output signal descriptions (not `?') on Tru64. + * src/kill.c (sys_siglist): Also check for __sys_siglist. + Patch by Tony Leneis. + * configure.ac: Also check for declaration of __sys_siglist. + Required for Tru64 4.0D, 4.0F, and 5.1. + Reported by Tony Leneis. + +2003-04-04 Jim Meyering + + * src/Makefile.am (PERL): Remove unnecessary definition. + + Because of inappropriate (but POSIX-mandated) behavior of rename, + `mv a b' would not remove `a' in some unusual cases. Work around + this by unlinking `a' when necessary. + + * src/copy.c (same_file_ok): Add an output parameter. + Set it in the offending case. + (copy_internal): When necessary, unlink SRC_PATH and inform caller. + Reported by Ed Avis. + * tests/mv/hard-4: New test for the above. + * tests/mv/Makefile.am (TESTS): Add hard-4. + + Clean up rules for automatically generated sources: + * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c): + Make each generated file be read-only. + Add each file name to BUILT_SOURCES separately. + (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES). + + Put LOCALEDIR macro definition in new file: localedir.h. + * src/Makefile.am (DEFS): Remove definition. + (localedir.h): New rule. + (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h. + * src/system.h: Include "localedir.h". + +2003-04-02 Jim Meyering + + * Version 5.0. + + * tests/misc/Makefile.am (TESTS): Add false. + + * Makefile.maint (TMPDIR): Make sure it's defined. + (my-distcheck): Build in $(TMPDIR), not `.'. + + * src/Makefile.am (false.c): Change all occurrences of + `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits + unsuccessfully also with --help. Reported by Paul Jarc, + * tests/misc/false: New test for the above. + +2003-03-30 Jim Meyering + + * NEWS: Note the location of older NEWS files. + + * src/remove.c (is_empty_dir): Don't let a failing closedir + clobber errno. Spotted by Arnold Robbins. + + * src/env.c: Fix typo in comment. From Arnold Robbins. + +2003-03-29 Jim Meyering + + * Version 4.5.12. + + * README: Note to expect build problems for stat.c on Ultrix 4.3. + Note that there are some harmless test failures when running + `make check' as root on some systems. + +2003-03-28 Jim Meyering + + * tests/stty/row-col-1: Skip this test if stty can't get window size. + This happens when connecting to sparc-solaris5.7 via ssh from within + emacs. Reported by Karl Berry. + + * tests/du/basic: Use seq, not `yes' to generate 4KB of data. + Otherwise, on systems (DJGPP) that emulate pipes using files, + this test would never complete, waiting for `yes' to terminate. + * tests/du/slink: As above, use seq, not `yes' to generate link target. + * tests/rm/hash: As above, use seq, not `yes' to generate dir name. + Reported by Rich Dawe. + +2003-03-27 Jim Meyering + + * src/id.c: Remove Arnold Robbins' obsolete e-mail address + from `written by...' comment, at his request. + +2003-03-24 Paul Eggert + + Fix buffer overrun problem reported by TAKAI Kousuke, along + with some other POSIX incompatibilities. + + * src/printf.c (print_esc): Do not treat \x specially if + POSIXLY_CORRECT. Avoid buffer overrun if the format ends + in backslash. Treat incomplete escape sequences as strings + of characters, as POSIX requires. + (print_formatted): Allow multiple flags. Avoid buffer overrun + if the format is incomplete. + +2003-03-24 Jim Meyering + + * tests/misc/printf: Add tests for the above fixes and changes. + +2003-03-26 Jim Meyering + + * src/copy.h (struct cp_options): Add a comment. + +2003-03-23 Jim Meyering + + * README: Describe problem with 64-bit mode on HPUX 11.x, + with patch for /usr/include/inttypes.h. + * TODO: Plan to add an autoconf test to work around the bug. + +2003-03-22 Jim Meyering + + * src/stat.c: Don't include . + That is already done via system.h. Otherwise, the multiple + inclusion would evoke redefinition warnings from Cray's /bin/cc, + aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28. + (human_fstype): Factor some directives `up', out of this function. + Cast away `const' to avoid error from Cray's /bin/cc. + +2003-03-20 Jim Meyering + + * announce-gen (print_changelog_deltas): Ensure that a newline + precedes each row of `*'s. + +2003-03-20 Jim Meyering + + * Version 4.5.11. + + * src/seq.c (valid_format): Also accept ` ' and `'' as valid + format flag characters. + Do not require that a field width be specified. + Do not fail when given a field width of `0'. + Reported by Dan Jacobson. + * tests/seq/basic: Add new tests for the above-fixed bug. + + * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su' + (install-root): Likewise. + (install-exec-local): Likewise. + Based on a patch from Richard Dawe. + +2003-03-19 Jim Meyering + + * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s', + because the DJGPP 2.03 port of 'ln -s' doesn't work. + Include $(EXEEXT) in program names. + Since $(LN_S) may degenerate to `cp -p', be careful + to invoke it from the destination directory. + Mostly from Richard Dawe. + * configure.ac: Use AC_PROG_LN_S. + + * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the + CDPATH shell variable set could cause this test to fail. + Reported by Karl Berry. + +2003-03-18 Jim Meyering + + * src/fmt.c [struct Word] (paren, period, punct, final): Change the + type of each member from bool :1 to unsigned int :1. + AIX 5.1's xlc could not compile the former. + Patch by Petter Reinholdtsen. Also reported by Mike Jetzer. + +2003-03-17 Richard Dawe + + * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS' + program names, since automake only adds $(EXEEXT) to programs + in its *_PROGRAMS. + +2003-03-16 Jim Meyering + + * src/remove.c (rm): Put two local variables in static storage, + so they can't be clobbered by the potential longjmp. + +2003-03-15 Jim Meyering + + * Makefile.cfg (gnu_rel_host): Fix code to match the comment + so that a version number with a two-digit component can still count + as an alpha release. Reported by Richard A Downing. + (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead. + +2003-03-14 Jim Meyering + + * src/ansi2knr.c: Remove no-longer-used file. + * src/ansi2knr.1: Likewise. + + * Makefile.maint (prev_version_file): Don't use ?= for this particular + assignment, since it causes trouble with old versions of GNU make + (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here. + http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html + Patch from Alexandre Duret-Lutz. + + * Use patched automake-1.7.3. Regenerate Makefile.in files in + subdirectories so that each includes a definition of ACLOCAL_M4. + + * announce-gen (main): Label the compressed source URLs. + + * Version 4.5.10. + + * tests/du/slink: Relax the test for the `local'ness of a file system, + so that now it works also for tmpfs. + + * tests/du/hard-link: Transform output from first du, so that this + test doesn't fail on file systems like tmpfs that order directory + entries differently. + +2003-03-13 Jim Meyering + + * tests/du/8gb: Work around what appears to be an NFS failure that + would make this test fail on some systems. + +2003-03-11 Jim Meyering + + * tests/du/basic: Make the test file exactly 4k bytes long. + + * src/split.c (longopts): Don't hard-code `2' here. + Instead, just specify `&verbose', and ... + (main): ... remove the `case 2:' block for --verbose. + + * tests/du/basic: Make the test file larger than 64 bytes, so that + we don't immediately disqualify file systems (e.g., NetApp) on which + smaller files take up zero disk blocks. Reported by Vin Shelton. + +2003-03-10 Jim Meyering + + Don't segfault for a negative field width or precision in format string. + Note that this is just a stopgap fix. The longer term solution may + involve adapting bash's builtins/printf.def. + + * src/printf.c: (UNSPECIFIED): Define. + (print_direc): Use the special value, UNSPECIFIED, to indicate + that field_width or precision has not been specified. + (print_formatted): Fail if field_width or precision is the + special value, UNSPECIFIED. + Reported by Oliver Kiddle + + * src/sys2.h (INT_MIN): Define, if necessary. + * tests/misc/printf: Add a test for the above-fixed bug. + +2003-03-09 Jim Meyering + + * src/remove.c (AD_stack_pop): Cast sizeof... to int before + changing its sign. This avoids a warning from gcc on 64-bit systems. + Reported by Bob Proulx. + (pop_dir): Reverse order of sign change and cast, to be consistent + with the above. + +2003-03-08 Jim Meyering + + * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a + shell variable, but only in the environment. With /bin/sh->bash, the + shell variable is set to `y', and that would cause a spurious warning. + Reported by Bob Proulx. + + * tests/Makefile.am (check-root): Remove touch/fifo. + It doesn't appear to have to be run as root. + + * tests/rm/fail-2eperm: Rather than simply using the first non-root + user name, make sure that the selected user name has a usable shell. + Reported by Paul Jarc. + + Before, when using shred on a device, one had to specify --exact, + or be careful to choose a size that would not be rounded up and + exceed the maximum value; that could result in a failure of + the final write. + * src/shred.c (do_wipefd): --exact is now the default for non-regular + files. Suggestion from Ben Elliston. + (usage): Say it. + + * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm. + Old versions of Expect.pm (e.g., 1.07) lack the log_user function. + Patch by Bob Proulx. + + * src/Makefile.am (check-misc): Check for use of `defined' in + #define directives. + Change to $(srcdir) before running grep. + + * src/sleep.c: Remove now-unused #include and #define directives. + + * src/du.c (process_file): If a file's size is not being counted + e.g., because it's a hard link to a file we've already counted, + then don't print a line for it. + + * tests/du/hard-link: New test for the above-fixed bug. + * tests/du/Makefile.am (TESTS): Add hard-link. + + `du -S' didn't work + * src/du.c: Revert most of the `reorganization' change of 2003-02-20, + and make the two-array approach work. + + * tests/du/basic: Correct/add tests for the above fix. + Set LC_ALL, etc., now that we use sort. + Check the block/size of a small file, too. + Correct expected results for simple dir1/dir2/file case. + Add another test of du -S. + +2003-03-07 John David Anglin + + Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR + middle-end/9986). As one of GCC's optimizations, it transforms a + fputs_unlocked call to a fputc_unlocked call when the string is + one character long. However, hpux doesn't have fputc_unlocked. + + * expr.c (usage): Use putchar, not fputs, to output a single character. + * ls.c (dired_dump_obstack): Likewise. + * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise. + * stat.c (print_it): Likewise. + +2003-03-07 Jim Meyering + + * src/cp.c: Remove everything associated with mmap-stack.c. + This reverts the two changes of 2003-02-21. + * src/du.c: Remove everything associated with mmap-stack.c. + This reverts the change of 2003-02-19. + +2003-03-06 Jim Meyering + + * tests/cp/same-file: Unset CDPATH. Otherwise, having the + CDPATH shell variable set could cause this test to fail. + Reported by Karl Berry. + +2003-03-05 Jim Meyering + + * Version 4.5.9. + + * src/printf.c (print_esc): Remove pointless comparison of unsigned + integer with zero, to avoid a warning from Intel's ecc. + Reported by Nelson Beebe. + + * src/du.c (process_file): Sizes must all be of type uintmax_t. + Otherwise, for files or totals that are too big, numbers would + be truncated. Patch mostly by Michael Stone. + Reported by Ingo Saitz as Debian bug #183210. + + * tests/du/8gb: New test for the above-fixed bug. + * tests/du/Makefile.am (TESTS): Add 8gb. + + * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4 + rather than UTILS_OPEN_MAX - 10. + +2003-03-04 Jim Meyering + + * README: Refer new feature discussion to bug-coreutils@gnu.org, + rather than bug-gnu-utils, now that the former is better known. + Suggestion from Göran Uddeborg. + + * src/stat.c (usage): Capitalize consistently. + Reported by Göran Uddeborg. + + * Makefile.maint (rel-files): Include $(signatures), so that + those files are also copied into $(release_archive_dir). + + * src/df.c (find_mount_point): Call error here, now that restore_cwd + no longer does it. + * src/remove.c (AD_pop_and_chdir): Likewise. + + * tests/Makefile.am (check-root): Add fail-2eperm. + +2003-03-03 Jim Meyering + + * src/remove.c (remove_cwd_entries): Include the full filename of + the offending file, not just the basename. + + * tests/misc/tty-eof: Set $ME properly. + + * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP): + Remove now-unused variables. + (tag-prev-version, prev-cvs-tag): Likewise. + + * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an + accurate diagnostic when failing to remove a file owned by some other + user. Reported by Ivo Timmermans via Michael Stone. + This fixes Debian bug# 178471. + + * tests/rm/Makefile.am (TESTS): Add fail-2eperm. + * tests/rm/fail-2eperm: New test, for the above-fixed bug. + Based on a report from Ivo Timmermans. + +2003-03-02 Jim Meyering + + * src/copy.c (copy_internal) [un_backup]: When recovering from a + failure to create a hard link, do not remove the entry associating + the source dev/ino with the destination file name. + * tests/mv/Makefile.am (TESTS): Add hard-3. + * tests/mv/hard-3: New test, for the above-fixed bug. + Inspired by a report from Iida Yosiaki. + +2003-03-01 Jim Meyering + + * src/df.c (print_header): Don't embed spaces in a separate `Type' + header string. Instead, put `Filesystem' and `Type' headers in the + same string, so translators can use horizontal space as needed. + Reported by Jean Charles Delepine. + +2003-02-28 Jim Meyering + + * src/copy.c (copy_internal): When link fails because of an + existing destination file, unlink that file and try again. + Reported by Iida Yosiaki. + + * tests/mv/Makefile.am (TESTS): Add hard-2. + * tests/mv/hard-2: New test for the above-fixed bug. + Based on a test case from Iida Yosiaki. + +2003-02-26 Jim Meyering + + * tests/du/basic: Don't test du's -b option here. Directory byte + counts are smaller (512 rather than 4096) on at least OSF/1 5.1 + and IBM AIX 4.2. Reported by Nelson Beebe. + +2003-02-25 Jim Meyering + + * Makefile.maint (announcement): Now that ChangeLog entries + are output by announce-gen, don't do it here. + * announce-gen (print_changelog_deltas): New function. + (main): Use it. + +2003-02-22 Jim Meyering + + * announce-gen: New option: --release-type=TYPE + * Makefile.maint (beta, major): New targets. Remove `release'. + Put them all together on a line. + Pass the release type (via RELEASE_TYPE envvar) to the MAKE + invocation of `announcement'. + (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE. + + * announce-gen: New option: --news=NEWS_FILE. + Extract NEWS entries here, not via rules in Makefile.maint. + * Makefile.maint (announcement): Now that NEWS entries are + extracted by announce-gen, don't do it here. + (news-r1, news-r2): Remove now-unused definitions. + +2003-02-21 Jim Meyering + + * Version 4.5.8. + + Merge in changes from autoconf's version of this file. + * Makefile.maint (www-gnu): Define. + (standards.texi-url_prefix): Use $(www-gnu). + (make-stds.texi-url_prefix): Likewise. + + * src/cp.c: Include "mmap-stack.h". + (main): Invoke `run' through a macro that (when possible) runs it + with a large, mmap'd stack. + + * src/cp.c (run): New function, preparing for the above. + Exit from this function, not from main + (main): Call run. + + * src/du.c: New option: --apparent-size. + (enum) [APPARENT_SIZE_OPTION]: New member. + (long_options): Add it. + (usage): Describe it. + (main): Handle it. + ['b']: Set apparent_size. + David Eisner reported that the behavior of --bytes had changed. + Paul Eggert proposed the use of a new option, --apparent-size. + + * src/du.c (apparent_size): New global. + (print_only_size): Reflect the fact that we're printing byte counts, + not ST_NBLOCKSIZE-byte-block counts. + (print_size): Call print_only_size rather than duplicating its code. + (process_file): Accumulate byte counts, rather than block counts. + + * src/du.c (process_file): Always reset size_to_propagate_to_parent + for --separate-dirs (-S). + +2003-02-20 Jim Meyering + + * Use automake-1.7.3. Regenerate dependent files. + + * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE). + This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful. + (usage) [%B]: Describe it. + [%b]: Refer to %B. + + * src/du.c (process_file): Reorganize the code to use only + one `sum' array, and change how -S works back to the way it was + before 2003-01-31. Patch by Bruno Haible. + + * tests/du/basic: New test. + * tests/du/Makefile.am (TESTS): Add basic. + + * tests/envvar-check: Add checks for the following: + BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE. + + * tests/Makefile.am: Rename phony target envvar-check to evar-check + so as not to conflict with the distributed file by the same name. + + * src/du.c (process_file): Set info->skip before any possible return. + + Report correct usage for directories, not 0. + * src/du.c (process_file): Return for `file_type == FTW_DPRE' + _before_ recording the dev/ino of a directory. + Reported by Bruno Haible. + + Now, df always displays the device file name corresponding to the + listed mount point under `Filesystem'. Before, for an unmounted + block- or character-special file argument, it would display the + command-line argument instead. + * src/df.c (show_disk): Return a value indicating whether + there was a match. Don't try to find a mount point here. + (show_entry): If show_disk doesn't find a match, call show_point. + +2003-02-19 Jim Meyering + + * src/du.c: Include "mmap-stack.h". + (du_files): Add prototype with ATTRIBUTE_NORETURN. + Exit from this function, not from... + (main): ...here. + Instead, if possible, invoke du_files through a macro that + runs it with a large, mmap'd stack. + + * src/join.c (usage): Change wording in --help output: + use FILENUM instead of `SIDE' and say what FILENUM means. + Reported by Bernhard Gabler. + + * src/df.c (print_header): Rather than using a hard-coded literal + string of spaces matching the length of the English `...Type' header, + output the right number of spaces to match the selected translation. + Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113. + + * src/split.c (bytes_split): Remove unnecessary `else' after break. + (lines_split): Likewise. and correct misleading indentation. + + * src/split.c: Include "full-read.h". + (bytes_split, lines_split, line_bytes_split): Use full_read, + not safe_read. The way split was using the latter, a short read + could cause split to terminate before EOF. + + * tests/misc/tty-eof: Test all programs that can read stdin, + requiring no arguments and that write to standard output. + + * tests/misc/tty-eof: New file. Renamed from ... + * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof. + * tests/misc/Makefile.am (TESTS): Reflect renaming. + +2003-02-18 Jim Meyering + + cksum would perform an extra read after encountering EOF + * src/cksum.c (cksum): Exit the loop upon EOF, too. + Patch by Michael Bacarella. + + Test for the bug fixed today in cksum, md5sum, and sha1sum. + * tests/misc/cat-tty-eof: Generalize, clean-up, and test for + cat, cksum, md5sum, and sha1sum all in the same loop. + +2003-02-14 Jim Meyering + + * src/remove.c: Include "euidaccess.h". + Remove declaration of euidaccess. + +2003-02-12 Jim Meyering + + * src/pathchk.c (portable_chars_only): Remove unnecessary `const' + in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz. + +2003-02-10 Jim Meyering + + * src/test.c: Don't include group-member.h. + Include euidaccess.h. + (eaccess): Rewrite function to set the real uid and gid temporarily + to the effective uid and gid, then invoke 'access', and then set the + real uid and gid back. On systems that lack setreuid or setregid, + fall back on the kludges in euidaccess. Before, it would not work + for e.g., files with ACLs, files that were marked immutable, + or on file systems mounted read-only. Nelson Beebe raised the issue. + Paul Eggert suggested the new implementation. + +2003-02-09 Jim Meyering + + * src/test.c (test_stat): Remove function. It's job is done (only + when necessary) by the wrapper in lib/stat.c. Adjust all uses. + +2003-02-08 Jim Meyering + + * Version 4.5.7. + + * tests/mv/part-symlink: Don't assume that the file owner username + length is less than 9 in ls output: instead, omit that field + altogether. Reported by, and suggested fix from, Ferdinand. + + * tests/du/restore-wd: New test for just-fixed bug in ftw.c. + * tests/du/Makefile.am (TESTS): Add restore-wd. + + * src/rm.c: Correct now-invalid comment about cycle-detection. + +2003-02-06 Jim Meyering + + * NEWS: Add entries from old/*/NEWS + from fileutils-4.1 through 4.1.11 and + from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry. + + * Version 4.5.6. + + * src/du.c (process_file): Don't return early for excluded files + or for files whose dev/inode we've already seen. + +2003-02-05 Jim Meyering + + * tests/du/exclude: New file. + * tests/du/Makefile.am (TESTS): Add exclude. + +2003-02-04 Dmitry V. Levin + + * src/who.c (print_boottime, print_deadprocs, print_runlevel): + Fix memory allocation arithmetic. + +2003-02-04 Jim Meyering + + `df /dev/block-or-char-device-file--not-mounted' now reports + the name of the file system on which the file resides, usually `/'. + Before, it would leave the `Mounted on' field blank. + * src/df.c (show_disk): Move function to precede find_mount_point. + (show_disk): Add parameter: STATP. + If we don't find a matching device name, then resort to calling + find_mount_point. Reported by Bob Proulx. + +2003-02-03 Andreas Schwab + + * tests/rm/cycle: Require non-root. + * tests/rm/isatty: Likewise. + +2003-02-02 Jim Meyering + + * Version 4.5.5. + + * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'. + + Ensure that there are no offending uses of `:'. + * Makefile.maint (makefile_path_separator_check): New rule. + (local-check): Add it to the list. + +2003-02-01 Jim Meyering + + * src/du.c (MAX_N_DESCRIPTORS): Define. + + * src/stat.c (G_fail): New global. + (human_time): Diagnose failed localtime, not failed nstrftime. + (main): Fail if G_fail is set. + +2003-01-31 Richard Dawe + + * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of + hard-coding the path-separator. Also double-quote the new PATH, + to avoid problems when the path-separator is a semi-colon or when + `pwd` contains e.g. a space. + * tests/chgrp/Makefile.am: Likewise. + * tests/chmod/Makefile.am: Likewise. + * tests/chown/Makefile.am: Likewise. + * tests/cp/Makefile.am: Likewise. + * tests/dd/Makefile.am: Likewise. + * tests/dircolors/Makefile.am: Likewise. + * tests/du/Makefile.am: Likewise. + * tests/expr/Makefile.am: Likewise. + * tests/factor/Makefile.am: Likewise. + * tests/fmt/Makefile.am: Likewise. + * tests/install/Makefile.am: Likewise. + * tests/ln/Makefile.am: Likewise. + * tests/ls/Makefile.am: Likewise. + * tests/ls-2/Makefile.am: Likewise. + * tests/md5sum/Makefile.am: Likewise. + * tests/misc/Makefile.am: Likewise. + * tests/mkdir/Makefile.am: Likewise. + * tests/mv/Makefile.am: Likewise. + * tests/od/Makefile.am: Likewise. + * tests/rm/Makefile.am: Likewise. + * tests/rmdir/Makefile.am: Likewise. + * tests/seq/Makefile.am: Likewise. + * tests/sha1sum/Makefile.am: Likewise. + * tests/shred/Makefile.am: Likewise. + * tests/stty/Makefile.am: Likewise. + * tests/sum/Makefile.am: Likewise. + * tests/tail-2/Makefile.am: Likewise. + * tests/touch/Makefile.am: Likewise. + * tests/tsort/Makefile.am: Likewise. + * tests/unexpand/Makefile.am: Likewise. + +2003-01-31 Jim Meyering + + * src/stat.c: Include "file-type.h" + (print_human_type): Remove function. + (human_access): Rename from print_human_access. Return a string. + (human_time): Rename from print_human_time. Return a string. + (print_stat): Arrange so that field width and an alignment specifier + are honored for the %A, %F, %x, %y, and %z formats. + [%F]: Use file_type; this gives slightly different file type strings, + e.g., `directory' instead of `Directory' and `regular file' or + `regular empty file' instead of `Regular file'. + Prompted by a report from Richard Dawe that the uses of + S_IFSOCK and S_IFIFO in print_human_time were not portable + to systems using e.g., DJGPP. + +2003-01-31 Richard Dawe + + * src/stat.c (print_stat): Use S_ISLNK rather than an explicit + test using S_IFMT and S_IFLNK. S_IFLNK may not be defined. + +2003-01-31 Jim Meyering + + * src/du.c (main): Upon processing an invalid option or an invalid + --exclude-from or --max-depth option argument, don't exit right away, + in case there are others. Rather record the failure and exit after + processing other options. + + * GNUmakefile (TAR_OPTIONS): Set and export, in order to make + tar archive easier to reproduce. + + Rewrite to perform directory traversal using nftw. + + * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h". + (AUTHORS): Add self. + (opt_one_file_system): Move global into `main'. + (path, xstat, exit_status): Remove declarations. + (arg_length, suffix_length): New globals. + (G_fail): New global, sort of like the old `exit_status'. + (IS_FTW_DIR_TYPE): Define. + (print_only_size): New function. + (process_file): New function. + (str_init, ensure_space, str_copyc, str_concatc): Remove functions. + (str_trunc, pop_dir, count_entry): Likewise. + (du_files): Rewrite to use nftw. + +2003-01-30 Jim Meyering + + * tests/du/trailing-slash: Ensure that du/ftw follows a command-line + symlink-to-directory with -L, even without the trailing slash. + +2003-01-27 Jim Meyering + + * src/Makefile.am (check-misc): Check for st_blocks, too. + + * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'. + Reported by Richard Dawe. + +2003-01-27 Andreas Schwab + + * src/ls.c (quote_name): Add fourth parameter, width, into which to + store the screen columns, and return the number of bytes instead. + (print_dir): Pass NULL as fourth parameter of quote_name. + (print_name_with_quoting): Likewise. + (length_of_file_name_and_frills): Get the width from the fourth + parameter of quote_name instead of return value. + +2003-01-27 Jim Meyering + + * src/ls.c (decode_switches): If `dired' is set without + `format == long_format', then silently reset dired. This doesn't + change the behavior of ls (all prior uses of dired were protected + by `&& format == long_format'), and lets us... + (DIRED_INDENT): ... remove the `format == long_format' conjunct. + (PUSH_CURRENT_DIRED_POS): Likewise. + (main): Likewise. + +2003-01-22 Jim Meyering + + * tests/du/no-x: New test, for functionality added to lib/ftw.c. + * tests/du/Makefile.am (TESTS): Add no-x. + +2003-01-21 Jim Meyering + + * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS + && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN + it may still be a directory -- or not (e.g., with FreeBSD on an + NFS-mounted file system), so resort to calling lstat to find out. + Based on a patch by Michael van Elst. + + * tests/cp/same-file: Don't assume that the file owner username + length is less than 9 in ls output: instead, omit that field + altogether. Reported by, and suggested fix from, Ferdinand. + +2003-01-20 Jim Meyering + + * tests/date/Test.pm (wide-fmt): New test to demonstrate that + large format widths no longer cause strftime to infloop. + + * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition. + +2003-01-19 Jim Meyering + + * src/readlink.c: Include "canonicalize.h". + +2003-01-18 Jim Meyering + + * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]: + New member. + (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member. + (long_options): Add option --dereference-command-line-symlink-to-dir. + (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default, + rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the + -d, -F, -l options is specified. + (decode_switches): Handle --dereference-command-line-symlink-to-dir. + (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR. + Change --dereference-command-line (-H) to dereference *all* + command line arguments, including broken symlinks. + +2003-01-15 Paul Eggert + + Change ls -H back to the way it was yesterday, since this is + compatible with FreeBSD and the POSIX spec is confusing + and somewhat contradictory. + + * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back + from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses. + (long_options): Change the long option name back. + (usage): Change the usage back. + (gobble_file): When -H is specified, dereference a top-level + arg even if it points to a non-directory. + +2003-01-15 Jim Meyering + + * src/ls.c (gobble_file): Fall back on using lstat when required: + when --dereference (-L) is not specified, and + - when operating on a dangling symlink + - when operating on command-line-symlink-to-directories + This fixes numerous problems. Here are examples: + - `ls dangling-symlink' would fail with `no such file...' + Now it prints `dangling-symlink'. + - `ls -i symlink' would mistakenly print the inode of the referent. + Now it prints the inode of the symlink. Likewise for --size (-s). + Based on a patch from Michael Stone. + Reported by Deepak Goel as Debian bug #173793. + + Rename ls's --dereference-command-line (-H) + option to --dereference-command-line-symlink-to-dir. + * src/ls.c [enum Dereference_symlink] + (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from + DEREF_COMMAND_LINE_ARGUMENTS. Update all uses. + (long_options): Rename the long option. + (usage): Say that --dereference-... changes how ls treats + only symlinks to directories specified on the command line. + +2003-01-14 Jim Meyering + + * tests/ls/dangle: New file/test, for the above fix. + * tests/ls/inode: Another new file/test, for the above fix. + * tests/ls/Makefile.am (TESTS): Add dangle and inode. + + * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it + so that ls --color would no longer highlight the names of files with + the execute bit set when not specified on the command line. + Patch by Michael Stone. Reported by Stephen Depooter as + Debian bug 175135. + + * tests/ls-2/tests (color-exe): New test, for the above fix. + +2003-01-13 Jim Meyering + + * tests/shred/exact: Also test for just fixed bug with --zero. + + * src/shred.c (long_opts): --zero does not require an argument. + Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019. + +2003-01-12 Jim Meyering + + * Makefile.maint (cvs-update): Skip any file with local modifications. + + * src/unexpand.c (usage): Document --first-only and mention that + --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com. + +2002-12-01 Dmitry V. Levin + + * src/df.c: Include "canonicalize.h". + Use canonicalize_file_name unconditionally. + +2003-01-09 Jim Meyering + + * README: Add readlink. + +2002-11-30 Dmitry V. Levin + + * src/df.c: Include "xgetcwd.h". + * src/pwd.c: Likewise. + +2002-11-30 Dmitry V. Levin + + * src/shred.c: Remove declaration of xstrdup. + We already get it via xalloc.h which is included via system.h. + +2002-08-27 Dmitry V. Levin + + New program: readlink. + + * src/Makefile.am (bin_PROGRAMS): Add readlink. + * src/readlink.c: New file. + + * man/readlink.x: New file. + * man/Makefile.am (dist_man_MANS): Add readlink.1. + (readlink.1): New rule. + +2003-01-09 Jim Meyering + + When selecting ranges of byte offsets (as opposed to ranges of fields) + and when --output-delimiter=STRING is specified, output STRING between + ranges of selected bytes. + * src/cut.c (RANGE_START_SENTINEL): Define. + (output_delimiter_specified): New global. + (print_kth): Add parameter. Adjust all callers. + (set_fields): Mark each range-start index with RANGE_START_SENTINEL. + (cut_bytes): When requested, output STRING between ranges of + selected bytes. + (main): Make a diagnostic a little clearer. + Based on a patch from Jan Nieuwenhuizen. + + * tests/cut/Test.pm: New tests for the above. + + * src/cut.c (set_fields): Make code agree with comment: + Don't merge abutting ranges like 4- and 2-3. This makes no + difference currently, but is required to support an upcoming change. + +2003-01-07 Jim Meyering + + * src/cut.c (set_fields): Fix typo in comment. + + * tests/touch/not-owner: New test, mostly extracted from fail-diag. + * tests/touch/Makefile.am (TESTS): Add not-owner. + * tests/touch/fail-diag: Remove the test for non-owner diagnostic. + Now, this tests only the nonexistent-directory diagnostic. + Suggestion from Michael Stone. + + * tests/touch/fail-diag: Fix typo: s/ld/ls/. + +2003-01-04 Jim Meyering + + * src/copy.h: Remove use of PARAMS. + * src/remove.h: Likewise. + * src/chown-core.h: Likewise. + + rm could be tricked into mistakenly reporting a cycle. + * src/remove.c: [cycle_check_state]: New global. + (remove_cwd_entries): Adapt to new semantics of cycle_check. + (rm): Call cycle_check_init and cycle_check_free for each file. + * tests/rm/cycle (rm): New test, for the above fix. + * tests/rm/Makefile.am (TESTS): Add cycle. + + When rm detects a cycle, don't abort the entire command, + but rather just the affected command line argument. + * src/remove.c: Include + (struct dirstack_state) [current_arg_jumpbuf]: New member. + (remove_cwd_entries): Call longjmp if we detect a cycle. + (rm): Call setjmp here. + + * src/remove.c (cycle_check, is_power_of_two): Remove functions. + Instead, include cycle-check.h and use it. + + * src/remove.h (struct dev_ino): Remove declaration. + + * src/remove.c (remove_cwd_entries): Fix typos in comment. + + Don't include trailing /. in diagnostics about directories. + * src/remove.c (full_filename_): When FILENAME is just `.' + and there is a nonempty directory-name part, don't append `/.'. + * tests/rm/unread2: Remove trailing /. from diagnostic. + * tests/rm/rm2: Likewise. + + * src/remove.c (struct dirstack_state): Define. + To be used in place of these file-scoped globals ... + (dir_stack, len_stack, Active_dir): Remove globals. + (ds_init, ds_free): New functions. + (full_filename): Define. + (full_filename_): Rename from full_filename. + + Begin to make AD_* functions more generic. + * src/remove.c (AD_push_initial): Don't set status to RM_OK here. + (AD_push): Likewise. + (AD_INIT_OTHER_MEMBERS): Define. + (remove_dir): Define the `status' member manually after each + call to AD_push or AD_push_initial. + + * src/Makefile.am (check-misc): New rule, to ensure that no more + S_IS* macro definitions sneak into the code. + (check): Depend on check-misc. + + * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h. + * src/du.c (count_entry) [S_ISLNK]: Don't define. + * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define. + +2003-01-03 Jim Meyering + + * src/true.c: Add copyright. + (AUTHORS): I suppose I've written it. + + * src/Makefile.am (false.c): Make the generated file be read-only. + +2003-01-04 Jim Meyering + + * src/ls.c: Include "dev-ino.h". + [struct dev_ino]: Remove declaration. + +2003-01-02 Jim Meyering + + * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one + from mv: s/missing file arguments/missing file argument/. + With --target-directory=DIR, cp and mv work with a single file argument. + Reported by Karl Berry. + + * tests/rm/isatty: Enable this test. + +2002-12-31 Jim Meyering + + * src/remove.c (AD_push_initial): Don't set status to RM_OK here. + (AD_push): Likewise. + (AD_INIT_OTHER_MEMBERS): Define. + (remove_dir): Define the `status' member manually after each + call to AD_push or AD_push_initial. + + * src/ls.c [struct dev_ino]: Remove definition. + Include "dev-ino.h" instead. + +2002-12-28 Jim Meyering + + * tests/du/Makefile.am (TESTS): Add no-deref. + * tests/du/no-deref: New script. + +2002-12-23 Jim Meyering + + * src/remove.c (remove_cwd_entries): Fix typo in comment. + +2002-12-21 Jim Meyering + + * announce-gen: Generate MML-formatted announcement. + This makes it a *lot* harder to send stale MD5/SHA1 signatures. + +2002-12-20 Jim Meyering + + * src/touch.c (touch): Change the wording of a diagnostic so + that it makes sense both when the file exists and when it doesn't. + Suggestion from Michael Stone. + +2002-12-18 Jim Meyering + + * src/stty.c (valid_options): Declare to be static. + +2002-12-15 Jim Meyering + + * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4. + + * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c: + * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c: + * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c: + * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c: + * src/tee.c, src/test.c: Remove all uses of `PARAMS'. + + * src/remove.c (PARAMS): Remove definition. + * src/sys2.h: Likewise. + + * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime. + Include strftime.h instead. + +2002-12-14 Jim Meyering + + * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish. + + * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr. + This is necessary at least for Irix6.5 when using c89. + Reported by Nelson Beebe. + + * tests/misc/Makefile.am (TESTS): Add cat-tty-eof. + + * tests/misc/cat-tty-eof: New test. + + * src/mknod.c (usage): Specify how major and minor mode numbers + are interpreted. Report forwarded by Kristin E Thomas. + * src/mknod.c: Remove now-redundant usage-specifying comment. + +2002-12-13 Jim Meyering + + * Version 4.5.4. + + * tests/du/trailing-slash: Allow for a directory of size `0'. + That happens at least on file systems of type tmpfs on linux-2.4.18. + + * announce-gen: New script to begin replacing the commands + associated with the rule here... + * Makefile.maint (announcement): Invoke announce-gen. + * Makefile.am (EXTRA_DIST): Add announce-gen. + + * tests/cp/preserve-2: New file/test, for latest fix. + * tests/cp/Makefile.am (TESTS): Add preserve-2. + +2002-12-11 TAKAI Kousuke + + Fix a bug whereby cp would fail to parse an option like + --preserve=mode,ownership. + * src/cp.c (decode_preserve_arg): Advance `comma' to + point the character following the comma. + +2002-12-11 Jim Meyering + + * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining, + in case it's already defined. + +2002-12-09 Jim Meyering + + * tests/touch/fail-diag: Don't get a test failure if /no exists. + Instead, evoke a framework failure if /no-$$ exists. + Reported by Michael Stone. + +2002-12-08 Jim Meyering + + * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: + Define to rpl_lstat, so that even on systems like Solaris 5.8, + du honors (per POSIX) the trailing slash on an argument referring + to a symlink-to-directory. + +2002-12-06 Jim Meyering + + * Use autoconf-2.57. Regenerate dependent files. + * Use automake-1.7.2. Regenerate dependent files. + + * src/ls.c (gobble_file): Also stat the file if it's a + regular file and --indicator-style=classify (aka -F). + Thanks to Ed Santiago for opening my eyes. + + * tests/ls/file-type: New file. Test for the above. + A test to contrast ls -F and ls --indicator-style=file-type. + * tests/ls/Makefile.am (TESTS): Add file-type. + +2002-12-04 Jim Meyering + + * tests/ls/follow-slink: Make sure the symlink was created. + Richard Dawe reported that `ln -s link link' succeeds, but creates + no file on systems running some version of the DJGPP libc. + +2002-12-03 Jim Meyering + + * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr) + since this package no longer panders to K&R compilers. + +2002-12-02 Jim Meyering + + * tests/du/slink: Skip this test if `.' is on a non-local file system. + + * tests/Fetish.pm (_at_replace): Do the substitution only if there's + something to replace. + +2002-12-01 Jim Meyering + + * src/stat.c: Don't include or . + That's already done via system.h. + * src/dircolors.c: Don't include . + +2002-11-30 Jim Meyering + + * ls.c (gobble_file): Remove the block of code that caused + `ls --color -F symlink-to-dir' to list the files in + `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just + like `ls -F symlink-to-dir') but with the addition of highlighting. + Similarly, `ls --color -dF symlink-to-dir' would print + `symlink-to-dir/'; now it prints `symlink-to-dir@'. + Reported by Jeff Sheinberg as Debian bug #168203. + * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above. + + ls is now more efficient: with certain options, it no longer needs + to stat each directory entry on systems with valid dirent.d_type. + * src/ls.c (print_dir): Add DT_LNK and DT_REG. + (main): Make --recursive set format_needs_type, not format_needs_stat. + (gobble_file): Remove a FIXME comment, now that it's fixed. + +2002-11-24 Jim Meyering + + * src/du.c (du_files): Don't strip any trailing slash. + Rewrite so that `/' is no longer represented internally as + the empty string. + (count_entry): When appending a file name component, + account for the fact that the current path may end in `/'. + François Pinard reported that `du symlink-to-dir/' was not + equivalent to `du symlink-to-dir/.'. Now it is. + * tests/du/trailing-slash: New file/test, for the above fix. + * tests/du/Makefile.am (TESTS): Add trailing-slash. + +2002-11-23 Jim Meyering + + * src/tac.c (output): Declare some local variables to be of type size_t, + rather than `int' to avoid warnings from gcc. + +2002-11-21 Paul Eggert + + * src/ls.c (decode_switches): Use case-sensitive matching to + decode the QUOTING_STYLE environment variable. This is more + consistent with the documentation, and with --quoting-style. + +2002-11-21 Martin Buck + + * tests/sum/sysv: Export LC_ALL=C, to avoid failure when + run in a UTF locale. Report and suggested fix by Bruno Haible. + * tests/fmt/basic: Likewise. + +2002-11-17 Jim Meyering + + * configure.ac: Update via autoupdate. + Add `AM_GNU_GETTEXT_VERSION(0.11.5)'. + + * src/mv.c (movefile): Don't remove trailing slashes from SOURCE. + Reported by Hans Ginzel. + +2002-11-15 Jim Meyering + + * Makefile.cfg (gnu_rel_host): Define. + (url_dir_list): Choose from (alpha|ftp).gnu.org depending + on whether $(VERSION) looks like a major release number. + + * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'. + (release): Rename from `alpha'. + (alpha): Depend on release. + + * Makefile.maint (signatures): Define with ?=, so it's easy to override. + +2002-11-14 Jim Meyering + + * Makefile.maint (mail_gpg_sign_cookie): Make optional. + (announcement): Use the new variable. + + * Makefile.maint: Sync with Bison, i.e.: + (po-check): Scan .l and .y files instead of the + .c and the .h files that they generate. This fixes the bug + reported by Tim Van Holder in: + + Look for N_ as well as for _. Try to avoid matching #define for + N_ and _. + From Paul Eggert. + +2002-11-12 Jim Meyering + + * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition. + Replace sole use with equivalent `#ifdef S_ISLNK'. + Inconsistency reported by Dmitry V. Levin. + +2002-11-11 Jim Meyering + + * src/stat.c (usage): Transform --help items output via s/ - / /, + so that help2man produces properly formatted man pages. + Reported by Herbert Xu as Debian bug #168400. + +2002-11-10 Jim Meyering + + * src/ls.c (sighandler): Handle SIGTSTP specially. + Based on suggestions from Solar Designer and Dmitry V. Levin. + Add comments. + + * Makefile.cfg (cvs_files): Define. From autoconf. + (local_updates): Likewise. + + * src/ls.c (restore_default_color_handler, sigtstp_handler): + Remove functions. + (sighandler): New function, based on the one in sort.c. + (main): Use sigaction, if possible; otherwise signal. + Handle these signals: + SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP. + Don't register our handler if the signal is already being ignored. + + * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid. + * src/csplit.c (interrupt_handler): Likewise. + * src/sort.c (sighandler): Likewise. + (main): Declare `i' and `nsigs' to be unsigned, not int. + +2002-11-09 Jim Meyering + + ls --color: restore terminal text color upon signal. + * src/ls.c: Include "full-write.h" and . + (restore_default_color, restore_default_color_handler): New functions. + (sigtstp_handler, put_indicator_direct): New functions. + (main) [print_with_color]: Register signal handlers. + Patch mostly by Solar Designer and Stanislav Ievlev. + + Update from autoconf. + * Makefile.maint (AMTAR): Remove definition. + (update, cvs-update, po-update, do-po-update): New rules. + (wget-update): Update (thus renaming to cvs-update). + (automake_repo): Use anoncvs@sources.redhat.com. + +2002-11-06 Jim Meyering + + * tests/misc/Makefile.am (TESTS): Add printf-hex. + + * tests/misc/printf: Be careful to test the code in this package, + not the shell built-in function. + + * src/printf.c (print_esc): A hexadecimal escape sequence has + at most two hex. digits, not three. Reported by Padraig Brady. + (usage): Update description. + * tests/misc/printf-hex: New file/test, for the above fix. + +2002-10-07 Paul Eggert + + Add support for locale-specific size indications (e.g., + thousands-separators) and for explicit size suffixes on output. + + * doc/coreutils.texi (Block size): Say that: + This affects display format as well as block size. + Fractional block counts are rounded up. + ls file size blocksize defaults to 1. + A block size spec preceded by ' generates thousands separators. + A suffix without a preceding integer generates suffixes. + (tail invocation): 32k -> 32 KiB. + (What information is listed): ls -h is now equivalent to + ls --block-size=human, and ls -H is now equivalent to + ls --block-size=si. Displayed file size is now always affected by + --block-size. + + * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c, + lib/umaxtostr.c: New files, taken from GNU tar. + + * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c, + umaxtostr.c. + (EXTRA_DIST): Add inttostr.c. + + * lib/human.c, lib/human.h: Rewrite to support locale-specific + notations like thousands separators. + Specify what includer of include.h must include beforehand. + (human_group_digits, human_suppress_point_zero, human_autoscale, + human_base_1024, human_SI, human_B): New enum values. + (human_readable): Rename from human_readable_inexact; put the + options before the sizes. All uses changed. The old human_readable + function has been removed; use inttostr.h instead. + (human_options): Renamed from human_block_size, with new signature + that allows block sizes up to UINTMAX_MAX. All callers changed. + + * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv, + AC_HEADER_STDBOOL. No need to check for limits.h since it's in + freestanding C89. No need to check for stdlib.h or string.h since + autoconf does this now. + + * src/cksum.c (cksum): Use primitives from inttostr.h, not + human.h, to print large numbers simply. + * src/csplit.c (handle_line_error, parse_patterns): Likewise. + * src/dd.c (print_stats, main): Likewise. + * src/df.c (print_header): Likewise. + * src/factor.c (print_factors): Likewise. + * src/ls.c (print_long_format, print_file_name_and_frills): Likewise. + * src/shred.c (dopass): Likewise. + * src/sort.c (checkfp): Likewise. + * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise. + * src/tail.c (xlseek): Likewise. + * src/wc.c (write_counts, wc): Likewise. + + * src/df.c (human_output_opts): New var. + (output_block_size): Now uintmax_t, not int, to handle larger + block sizes. All uses changed. + * src/du.c: Likewise. + * src/ls.c: Likewise. + + * src/df.c (print_header): In the header line, prefer SI to human + representation if it's shorter; if neither is shorter, try to + intuit what the user would prefer. + + * src/expr.c (inttostr): Remove; use new imaxtostr library + function instead. + + * src/ls.c (file_output_block_size): New var, to distinguish + file sizes from other sizes. + (decode_switches): Set it. + + * src/shred.c (OUTPUT_BLOCK_SIZE): remove. + (dopass): When printing progress, use floor for what has been done + so far (since we should be conservative there), and ceiling for + what needs to be done (since that's what other programs use). + +2002-10-19 Jim Meyering + + * src/pinky.c (print_heading): Align TTY and Name headings. + Reported by Karl Eichwalder. + +2002-10-18 Jim Meyering + + * src/split.c (cwrite): Change type of `bytes' parameter to size_t + Remove now-useless cast. + (stdread): Remove function. + (bytes_split): Use size_t instead of int. + Use safe_read, not stdread. + (lines_split): Likewise. + Use memchr rather than a `while' loop. + (line_bytes_split): Use size_t instead of int. + Use safe_read, not stdread. + (main): Add some FIXME comments to remind me to remove casts. + + * src/system.h (ST_BLKSIZE): Correct comment describing how to + reproduce HPUX-11 cat failure. From Petter Reinholdtsen. + +2002-10-17 Jim Meyering + + Fix a problem that could make e.g., `cat' misbehave on systems which + give invalid (unreasonably large) values for stat.st_blksize. + * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB]. + Reported by Petter Reinholdtsen. + +2002-10-14 Jim Meyering + + Specifying a printf conversion specifer as nl's separator string + could cause nl to segfault. + * src/nl.c (build_print_fmt): Don't include separator string + in the printf format; it might contain `%'. + Use a better bound on the length of the print_fmt buffer. + (print_lineno): Print the separator here instead. + Reported by Doug Coleman. + + * tests/misc/nl: New file/tests, including a test for the above. + * tests/misc/Makefile.am (TESTS): Add nl. + + * tests/misc/split-l: New test, to make sure `split --lines=N' works. + * tests/misc/Makefile.am (TESTS): Add split-l. + +2002-10-13 Jim Meyering + + * Version 4.5.3. + + * src/du.c (usage): Tweak description of --dereference-args/-D. + + * src/du.c (count_entry): Also save cwd when dereferencing (via + --dereference-args, -D) a command-line argument. + Reported by Michal Svec. Based on a patch by Andreas Schwab. + + * src/Makefile.am (../AUTHORS): New target/rule. + +2002-10-12 Jim Meyering + + * src/paste.c (paste_parallel): Declare local, `delims_saved', to be + of type size_t, since that's the way it's used and avoids a warning. + + * src/csplit.c (struct cstring) [len]: Declare to be unsigned int, + since that's how it's always used and avoids a new warning from gcc. + (read_input): Adapt to new safe_read ABI. + + * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes, + to avoid warnings. + + * src/pinky.c (print_long_entry): fread returns size_t. + Declare local `bytes' accordingly, to avoid warning. + + tail -c +N would perform an extra read after encountering EOF + [this change is analogous (bytes vs. lines) to the one of 2002-01-27] + * src/tail.c (start_bytes): Detect EOF, inform caller. + (tail_bytes): Upon EOF in start_bytes, return immediately. + (file_lines): Reorganize to use memrchr rather than an explicit loop. + Adapt to new safe_read ABI. + +2002-10-11 Jim Meyering + + * tests/du/deref: New file/test, for the above fix. + * tests/du/Makefile.am (TESTS): Add deref. + +2002-10-10 Jim Meyering + + * tests/ln/Makefile.am (TESTS): Add target-1. + * tests/ln/target-1: New file/test, for the fix on 2002-10-08. + +2002-10-09 Jim Meyering + + * tests/cp/backup-is-src: Ensure that certain environment variables + are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe. + + * tests/tail-2/big-4gb: Mark this as an expensive test; it would + consume 4GB of disk space on systems without support for sparse files. + Fix a logic error that'd make it `cat err' even though dd didn't fail. + + * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/. + Patch by steven@magelico.net, forwarded by Michael Stone. + + * tests/ls/dired: Ensure that ls produces English messages. + Patch by Alexey Vyskubov, forwarded by Michael Stone. + +2002-10-08 Dmitry V. Levin + + * src/ln.c (main): Fix target_directory parsing when n_files == 1. + +2002-10-08 Jim Meyering + + * tests/tail-2/big-4gb: Use double quotes around diagnostic. + Fix syntax in test: use =, not ==. + Reported by Bob Proulx. + Change all the rest like this: grep -lR "testing framework'" .\ + |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/' + + * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI. + * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise. + * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise. + * src/wc.c (wc): Likewise. + +2002-10-07 Paul Eggert + + * src/cat.c (cat): + Don't advance the write pointer past the end of the write buffer. + * src/sort.c (begfield, limfield): Likewise. + +2002-10-07 Jim Meyering + + * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI. + * src/head.c (head_bytes, head_lines): Likewise. + +2002-10-06 Jim Meyering + + * src/dd.c (scanargs): Ensure that specified block sizes (specified + via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX. + (skip, dd_copy): Adapt to new safe_read ABI. + + * Makefile.maint (signatures): Define. + (%.sig): New rule. + (announcement): Depend on $(signatures). + + * Makefile.maint (announcement): Output all URLs for detached + signatures, not just the last one from the previous loop. + +2002-10-05 Jim Meyering + + * Version 4.5.2. + + * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR', + don't recurse into directory, DIR. Prompted by a report from + Leonardo Milano. + + * tests/rm/i-no-r: New file/test, for the above fix. + * tests/rm/Makefile.am (TESTS): Add i-no-r. + + * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27. + * tests/tail-2/Makefile.am (TESTS): Add big-4gb. + +2002-10-03 Jim Meyering + + * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'. + * src/df.c (AUTHORS): Likewise. + * src/du.c (AUTHORS): Likewise. + * src/tail.c (AUTHORS): Likewise. + * src/touch.c (AUTHORS): Likewise. + +2002-10-02 Jim Meyering + + * Makefile.am (SUBDIRS): Remove `old'. + (EXTRA_DIST): List the files in old/. + * configure.ac (AC_CONFIG_FILES): Remove old/* names. + Suggestion from Akim Demaille. + +2002-10-01 Jim Meyering + + * src/sys2.h (SSIZE_MAX): Define. + +2002-09-30 Jim Meyering + + * src/csplit.c: Don't include stdlib.h here. It's already included + via system.h. + +2002-09-29 Jim Meyering + + * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer + expression to avoid bogus warning from gcc. + + * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings. + (cat): Declare insize and outsize to be of type size_t, not int. + Rearrange pointer/integer expressions to avoid bogus warnings. + (main): Declare insize and outsize to be of type size_t, not int. + + * src/tail.c (parse_options): Give a sensible diagnostic for + an invalid byte or line count. Reported by Mikko Tuumanen. + + * src/touch.c (main): Split a long line. + + * tests/du/Makefile.am (TESTS): Add slink. + * tests/du/slink: New test for system.h change of 2002-08-31. + + In move mode, always first try to rename. Before, upon failure to + rename a directory, this code would never attempt to rename any + other file in that directory, but would thenceforth always copy. + On some systems (e.g., NetApp's OnTap-6.4), renaming a directory + may fail with EXDEV, yet renaming files within that directory to + a newly-created destination directory succeeds. + * src/copy.c (copy_internal): Remove local, move_mode; + use x->move_mode instead. Based on a patch from Tom Haynes. + +2002-09-28 Jim Meyering + + * src/split.c (FAIL_ONLY_ONE_WAY): New macro. + Factor out some duplication. + (main): Use it. + [case 'a']: Use strtoul rather than strtol to avoid compiler warnings. + + * src/sort.c (begfield, limfield): Rearrange comparisons to avoid + compiler warnings. + (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons, + to avoid compiler warnings. + + * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus + compiler warnings. + + Fix things so `mkdir -p' can create very deep directories, e.g., + mkdir -p $(perl -e 'print "a/" x 40000') now works. + * src/mkdir.c (main): For --parents (-p), call make_path with the + entire directory name, so we don't ever require that file operations + like stat or chmod be performed on the entire command line argument. + * makepath.c (make_path): Restore umask *before* creating the final + component. + +2002-09-27 Andreas Schwab + + * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t + to avoid overflow. Reported by Hans Lermen. + +2002-09-26 Jim Meyering + + * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts. + +2002-09-25 Jim Meyering + + * src/test.c (eaccess): Change type of local `euid' from int to uid_t + and add a cast, to avoid a warning about `signed and unsigned type in + conditional expression'. + +2002-09-22 Jim Meyering + + * src/rmdir.c: Include "dirname.h", for declaration of + strip_trailing_slashes. + + * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions. + Now they're defined through system.h. + + * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c, + * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h, + since it's already included from sys2.h via system.h. + + * Use automake-1.6f. Regenerate dependent files. + + * src/Makefile.am (PERL): Remove duplicate definition. + + fmt's -s, -t, -c options didn't work properly for long lines. + Since get_line may end up calling put_paragraph (for long lines), + be sure to set global, `other_indent', before it is used there. + + * src/fmt.c (set_other_indent): New function, factored out of... + (get_paragraph): ... here. Call it. + (get_line): Call set_other_indent before calling flush_paragraph, + which calls fmt_paragraph, which in turn calls put_paragraph, + which uses other_indent. + + * tests/fmt/Makefile.am (TESTS): Add long-line. + * tests/fmt/long-line: New file/test, for the above fix. + +2002-09-21 Jim Meyering + + * src/od.c: No longer include deprecated . + It was required solely for now-removed reference to BITSPERBYTE. + * src/install.c: Likewise. + Suggestion from Bruno Haible. + +2002-09-06 Andreas Schwab + + `rmdir -p dir-specified-with-trailing-slash/' would fail. + * src/rmdir.c (remove_parents): Strip trailing slashes. + +2002-09-20 Jim Meyering + + * tests/rmdir/t-slash: New file/test, for the above fix. + * tests/rmdir/Makefile.am (TESTS): Add t-slash. + + * Makefile.maint (announcement): Arrange to gpg-sign the message. + Add a URL for each detached signature file. + +2002-09-07 Bruno Haible + + * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation. + +2002-09-18 Jim Meyering + + `od -t x8' used the wrong (`l'-prefixed) printf format. + Likewise for the o8 and u8 formats. + * src/od.c (ISPEC_TO_FORMAT): Define macro. + (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG. + Reported by Arun Sharma. + +2002-09-17 Jim Meyering + + * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary. + From gettext's intl/loadmsgcat.c. + + * tests/od/x8: New file/test, for the above fix. + * tests/od/Makefile.am (TESTS): Add x8. + +2002-09-15 Jim Meyering + + * Use autoconf-2.54. Regenerate dependent files. + + * src/csplit.c (get_format_width): Add cast to avoid + warning about `signed and unsigned type in conditional expression'. + +2002-09-14 Jim Meyering + + * src/who.c (print_user): Change type of local to size_t + to avoid warnings about `comparison between signed and unsigned'. + * src/ptx.c (generate_all_output): Likewise. + + * src/dd.c (main, skip): Add casts to avoid warnings about + `comparison between signed and unsigned'. + + * src/id.c (print_full_info, print_group_list): Add casts to avoid + warnings about `signed and unsigned type in conditional expression'. + + * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t + to avoid warnings about `comparison between signed and unsigned'. + (split_3): Change parameter names to be readable and add comment. + Clean up the test for whether a line may be ignored. + +2002-09-13 Jim Meyering + + * src/printf.c (main): Handle leading command line argument of `--'. + Reported by Raul: DervishD + * tests/misc/printf: New file: test for the above. + * tests/misc/Makefile.am (TESTS): Add printf. + + * src/date.c (usage): Explain that %S's range of [0..60] is required -- + rather than 0..59 -- to accommodate the occasional positive leap second. + Reported by Richard Neill. + +2002-09-12 Jim Meyering + + * src/Makefile.am (nanosec_libs): Define. + (sleep_LDADD, tail_LDADD): Use it here. + + Factor nanosleep-related code into ../lib/xnanosleep.c. + * src/sleep.c: Include xnanosleep.h. + Factor out fenv.h-related code. + (timespec_subtract): Remove function. + (main): Remove code that deals with computing start and stop times + as well as the loop around nanosleep. Now that's in xnanosleep.c. + + Allow S (in --sleep-interval=S) to be a floating point value. + * src/tail.c: Include xnanosleep.h and xstrtod.h. + Move declaration of global variable, sleep_interval, to ... + (main): ...here. + (usage): Update description of --sleep-interval option. + (tail_forever): New parameter, sleep_interval. Update caller. + Use xnanosleep, rather than sleep. + (parse_options): New parameter, sleep_interval. Update caller. + Use xstrtod, now that we accept floating point values. + Prompted by a patch from Augey Mikus. + +2002-09-06 Jim Meyering + + * src/remove.c (prompt): Change comment to give a better note to + translators. From Michael Piefel. + +2002-09-02 Jim Meyering + + * README: A good problem report/patch includes diffs against + the most recent test release. + + * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define. + (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set. + + * src/kill.c (print_table_row): Use an unsigned type for widths + to avoid warning about comparison between signed and unsigned. + (list_signals): Likewise. + + * src/od.c (skip): Add a cast to avoid warning about comparison + between signed and unsigned. + * src/install.c (get_ids): Likewise. Also rearrange range-checking + comparisons to make them more readable. + +2002-09-01 Jim Meyering + + * Version 4.5.1. + +2002-08-31 Jim Meyering + + Symlinks were always reported as using 0 blocks. + * src/system.h (ST_NBLOCKS): Don't depend on file type. + This reverts the change of 2000-01-30. + Based on a report and patch from Neil Brown via Michael Stone. + This fixes Debian Bug#156358. + + * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)', + `exit (1)' to `exit (EXIT_FAILURE)', and + `usage (1)' to `usage (EXIT_FAILURE)'. + + * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c, + * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c, + * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c, + * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c, + * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'. + But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since + error never exits successfully. + +2002-08-29 Jim Meyering + + * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR) + when ignoring any return value. + + * src/remove.c (remove_cwd_entries): Detect and diagnose readdir + failures. On some systems (at least EMC Celerra and Solaris5.8), + this appears to be necessary. + (is_empty_dir): Likewise. Also, always close directory handle. + * src/ls.c (print_dir): Likewise. + (print_dir): Rename local variable: reading -> dirp. + Reported by Mike Coleman. + +2002-08-28 Jim Meyering + + * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir. + Give a diagnostic and fail if closedir fails. + +2002-08-26 Jim Meyering + + * Makefile.am (THANKS-to-translators): New rule. + (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in. + * THANKStt.in: New file. + + * src/cat.c (close_stdout_wrapper): New, kludgey, function and + file-scoped global. + (main): Register it with atexit. + Close STDOUT_FILENO, to avoid a problem when writing to + /dev/audio on at least Solaris 5.7 and 5.8 systems. + Reported by Shing-Shong Shei. + +2002-08-25 Jim Meyering + + * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'. + * src/tac.c (main): Likewise. + * src/tail.c (main): Likewise. + * src/tee.c (main): Likewise. + * src/tr.c (main): Likewise. + * src/wc.c (main): Likewise. + +2002-08-20 Jim Meyering + + * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm. + +2002-08-10 Paul Eggert + + * src/nohup.sh: Don't use "exec --"; it's not portable and + shouldn't be needed. + +2002-08-09 Jim Meyering + + * src/pr.c (main): Don't ignore -COLUMN if it's the last option. + (usage): Clarify help text for the -COLUMN option. + Patch by Padraig Brady. + * tests/pr/Test.pm [col-last]: New test for the above. + + * configure.ac: Start with version 4.5.1, chosen so that it's larger + than the latest version numbers of the component packages. + + * man/Makefile.am (check-x-vs-1): Set and export PATH so we use + programs in ../src. + +2002-08-08 Jim Meyering + + * src/date.c: Guard inclusion of with + `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'. + * src/sort.c: Likewise. + Patch by GOTO Masanori. + +2002-08-05 Paul Eggert + + Fix some minor time-related bugs with POSIX time arguments. + Some valid time stamps were being rejected (notably -1, and + time stamps before 1900 on 64-bit hosts). And some invalid + time stamps were being accepted, e.g. September 31. + + * src/date.c (main): Adjust to posixtime signature change. + * src/touch.c (main): Likewise. Remove unnecessary initialization. + Use localtime, not posixtm, to warn about obsolete "touch". + +2002-08-05 Jim Meyering + + * tests/misc/Makefile.am (TESTS): Add nice and pathchk1. + +2002-08-04 Jim Meyering + + * src/Makefile.am (check-README): New target/rule. + (check): Depend on it. + + * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile. + +2002-08-03 Jim Meyering + + * Makefile.am (SUBDIRS): Add old. + * old/: New directory, containing legacy ChangeLog* and NEWS files + from the fileutils, sh-utils, and textutils packages. + + * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false. + +2002-08-02 Paul Eggert + + * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE. + + * src/uniq.c: Include hard-locale.h, xmemcoll.h. + (hard_LC_COLLATE): New var. + (different): Args are now char *, not const char *. + Use xmemcoll instead of memcmp to compare lines, so that + LC_COLLATE has effect. However, use memcmp if it is an + easy locale. + (check_file): Do not include newline in comparison, so that + xmemcoll has a byte to stomp on temporarily. + (main): Set hard_LC_COLLATE. + +2002-07-29 Jim Meyering + + * Makefile.am (SUBDIRS): Remove djgpp, for now. + +2002-07-20 Jim Meyering + + * Makefile.am (false.c): Convert only the final EXIT_SUCCESS + into EXIT_FAILURE. Otherwise, false --help and false --version + would fail. + +2002-07-08 Jim Meyering + + * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@, + rather than the hard-coded `sh-utils'. + +2002-07-01 Jim Meyering + + * configure.ac: Merge the three files from fileutils, + textutils, and sh-utils. + * Makefile.am: Likewise. + * src/Makefile.am: Likewise. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/INSTALL b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/INSTALL new file mode 100644 index 0000000..54caf7c --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/NEWS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/NEWS new file mode 100644 index 0000000..39aa810 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/NEWS @@ -0,0 +1,1024 @@ +GNU coreutils NEWS -*- outline -*- + +* Major changes in release 5.3.0 (2005-01-08) [unstable] + +** Bug fixes + + Several fixes to chgrp and chown for compatibility with POSIX and BSD: + + Do not affect symbolic links by default. + Now, operate on whatever a symbolic points to, instead. + To get the old behavior, use --no-dereference (-h). + + --dereference now works, even when the specified owner + and/or group match those of an affected symlink. + + Check for incompatible options. When -R and --dereference are + both used, then either -H or -L must also be used. When -R and -h + are both used, then -P must be in effect. + + -H, -L, and -P have no effect unless -R is also specified. + If -P and -R are both specified, -h is assumed. + + Do not optimize away the chown() system call when the file's owner + and group already have the desired value. This optimization was + incorrect, as it failed to update the last-changed time and reset + special permission bits, as POSIX requires. + + "chown : file", "chown '' file", and "chgrp '' file" now succeed + without changing the uid or gid, instead of reporting an error. + + Do not report an error if the owner or group of a + recursively-encountered symbolic link cannot be updated because + the file system does not support it. + + chmod now accepts multiple mode-like options, e.g., "chmod -r -w f". + + chown is no longer subject to a race condition vulnerability, when + used with --from=O:G and without the (-h) --no-dereference option. + + cut's --output-delimiter=D option works with abutting byte ranges. + + dircolors's documentation now recommends that shell scripts eval + "`dircolors`" rather than `dircolors`, to avoid shell expansion pitfalls. + + du no longer segfaults when a subdirectory of an operand + directory is removed while du is traversing that subdirectory. + Since the bug was in the underlying fts.c module, it also affected + chown, chmod, and chgrp. + + du's --exclude-from=FILE and --exclude=P options now compare patterns + against the entire name of each file, rather than against just the + final component. + + echo now conforms to POSIX better. It supports the \0ooo syntax for + octal escapes, and \c now terminates printing immediately. If + POSIXLY_CORRECT is set and the first argument is not "-n", echo now + outputs all option-like arguments instead of treating them as options. + + expand and unexpand now conform to POSIX better. They check for + blanks (which can include characters other than space and tab in + non-POSIX locales) instead of spaces and tabs. Unexpand now + preserves some blanks instead of converting them to tabs or spaces. + + "ln x d/" now reports an error if d/x is a directory and x a file, + instead of incorrectly creating a link to d/x/x. + + ls no longer segfaults on systems for which SIZE_MAX != (size_t) -1. + + md5sum and sha1sum now report an error when given so many input + lines that their line counter overflows, instead of silently + reporting incorrect results. + + Fixes for "nice": + + If it fails to lower the nice value due to lack of permissions, + it goes ahead and runs the command anyway, as POSIX requires. + + It no longer incorrectly reports an error if the current nice + value happens to be -1. + + It no longer assumes that nice values range from -20 through 19. + + It now consistently adjusts out-of-range nice values to the + closest values in range; formerly it sometimes reported an error. + + pathchk no longer accepts trailing options, e.g., "pathchk -p foo -b" + now treats -b as a file name to check, not as an invalid option. + + `pr --columns=N' was not equivalent to `pr -N' when also using + either -s or -w. + + pr now supports page numbers up to 2**64 on most hosts, and it + detects page number overflow instead of silently wrapping around. + pr now accepts file names that begin with "+" so long as the rest of + the file name does not look like a page range. + + printf has several changes: + + It now uses 'intmax_t' (not 'long int') to format integers, so it + can now format 64-bit integers on most modern hosts. + + On modern hosts it now supports the C99-inspired %a, %A, %F conversion + specs, the "'" and "0" flags, and the ll, j, t, and z length modifiers + (this is compatible with recent Bash versions). + + The printf command now rejects invalid conversion specifications + like %#d, instead of relying on undefined behavior in the underlying + printf function. + + ptx now diagnoses invalid values for its --width=N (-w) + and --gap-size=N (-g) options. + + mv (when moving between partitions) no longer fails when + operating on too many command-line-specified nonempty directories. + + rm (without -f) no longer hangs when attempting to remove a symlink + to a file on an off-line NFS-mounted partition. + + rm no longer gets a failed assertion under some unusual conditions. + + rm no longer requires read access to the current directory. + + "rm -r" would mistakenly fail to remove files under a directory + for some types of errors (e.g., read-only file system, I/O error) + when first encountering the directory. + + "sort" fixes: + + "sort -o -" now writes to a file named "-" instead of to standard + output; POSIX requires this. + + An unlikely race condition has been fixed where "sort" could have + mistakenly removed a temporary file belonging to some other process. + + "sort" no longer has O(N**2) behavior when it creates many temporary files. + + tac can now handle regular, nonseekable files like Linux's + /proc/modules. Before, it would produce no output for such a file. + + tac would exit immediately upon I/O or temp-file creation failure. + Now it continues on, processing any remaining command line arguments. + + "tail -f" no longer mishandles pipes and fifos. With no operands, + tail now ignores -f if standard input is a pipe, as POSIX requires. + When conforming to POSIX 1003.2-1992, tail now supports the SUSv2 b + modifier (e.g., "tail -10b file") and it handles some obscure cases + more correctly, e.g., "tail +cl" now reads the file "+cl" rather + than reporting an error, "tail -c file" no longer reports an error, + and "tail - file" no longer reads standard input. + + tee now exits when it gets a SIGPIPE signal, as POSIX requires. + To get tee's old behavior, use the shell command "(trap '' PIPE; tee)". + Also, "tee -" now writes to standard output instead of to a file named "-". + + "touch -- MMDDhhmm[yy] file" is now equivalent to + "touch MMDDhhmm[yy] file" even when conforming to pre-2001 POSIX. + + tr no longer mishandles a second operand with leading "-". + + who now prints user names in full instead of truncating them after 8 bytes. + + The following commands now reject unknown options instead of + accepting them as operands, so that users are properly warned that + options may be added later. Formerly they accepted unknown options + as operands; e.g., "basename -a a" acted like "basename -- -a a". + + basename dirname factor hostname link nohup sync unlink yes + +** New features + + For efficiency, `sort -m' no longer copies input to a temporary file + merely because the input happens to come from a pipe. As a result, + some relatively-contrived examples like `cat F | sort -m -o F - G' + are no longer safe, as `sort' might start writing F before `cat' is + done reading it. This problem cannot occur unless `-m' is used. + + When outside the default POSIX locale, the 'who' and 'pinky' + commands now output time stamps like "2004-06-21 13:09" instead of + the traditional "Jun 21 13:09". + + pwd now works even when run from a working directory whose name + is longer than PATH_MAX. + + cp, install, ln, and mv have a new --no-target-directory (-T) option, + and -t is now a short name for their --target-directory option. + + cp -pu and mv -u (when copying) now don't bother to update the + destination if the resulting time stamp would be no newer than the + preexisting time stamp. This saves work in the common case when + copying or moving multiple times to the same destination in a file + system with a coarse time stamp resolution. + + cut accepts a new option, --complement, to complement the set of + selected bytes, characters, or fields. + + dd now also prints the number of bytes transferred, the time, and the + transfer rate. The new "status=noxfer" operand suppresses this change. + + dd has new conversions for the conv= option: + + nocreat do not create the output file + excl fail if the output file already exists + fdatasync physically write output file data before finishing + fsync likewise, but also write metadata + + dd has new iflag= and oflag= options with the following flags: + + append append mode (makes sense for output file only) + direct use direct I/O for data + dsync use synchronized I/O for data + sync likewise, but also for metadata + nonblock use non-blocking I/O + nofollow do not follow symlinks + noctty do not assign controlling terminal from file + + stty now provides support (iutf8) for setting UTF-8 input mode. + + With stat, a specified format is no longer automatically newline terminated. + If you want a newline at the end of your output, append `\n' to the format + string. + + 'df', 'du', and 'ls' now take the default block size from the + BLOCKSIZE environment variable if the BLOCK_SIZE, DF_BLOCK_SIZE, + DU_BLOCK_SIZE, and LS_BLOCK_SIZE environment variables are not set. + Unlike the other variables, though, BLOCKSIZE does not affect + values like 'ls -l' sizes that are normally displayed as bytes. + This new behavior is for compatibility with BSD. + + du accepts a new option --files0-from=FILE, where FILE contains a + list of NUL-terminated file names. + + Date syntax as used by date -d, date -f, and touch -d has been + changed as follows: + + Dates like `January 32' with out-of-range components are now rejected. + + Dates can have fractional time stamps like 2004-02-27 14:19:13.489392193. + + Dates can be entered via integer counts of seconds since 1970 when + prefixed by `@'. For example, `@321' represents 1970-01-01 00:05:21 UTC. + + Time zone corrections can now separate hours and minutes with a colon, + and can follow standard abbreviations like "UTC". For example, + "UTC +0530" and "+05:30" are supported, and are both equivalent to "+0530". + + Date values can now have leading TZ="..." assignments that override + the environment only while that date is being processed. For example, + the following shell command converts from Paris to New York time: + + TZ="America/New_York" date --date='TZ="Europe/Paris" 2004-10-31 06:30' + + `date' has a new option --iso-8601=ns that outputs + nanosecond-resolution time stamps. + + echo -e '\xHH' now outputs a byte whose hexadecimal value is HH, + for compatibility with bash. + + ls now exits with status 1 on minor problems, 2 if serious trouble. + + ls has a new --hide=PATTERN option that behaves like + --ignore=PATTERN, except that it is overridden by -a or -A. + This can be useful for aliases, e.g., if lh is an alias for + "ls --hide='*~'", then "lh -A" lists the file "README~". + + In the following cases POSIX allows the default GNU behavior, + so when POSIXLY_CORRECT is set: + + false, printf, true, unlink, and yes all support --help and --option. + ls supports TABSIZE. + pr no longer depends on LC_TIME for the date format in non-POSIX locales. + printf supports \u, \U, \x. + tail supports two or more files when using the obsolete option syntax. + + The usual `--' operand is now supported by chroot, hostid, hostname, + pwd, sync, and yes. + + `od' now conforms to POSIX better, and is more compatible with BSD: + + The older syntax "od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]" now works + even without --traditional. This is a change in behavior if there + are one or two operands and the last one begins with +, or if + there are two operands and the latter one begins with a digit. + For example, "od foo 10" and "od +10" now treat the last operand as + an offset, not as a file name. + + -h is no longer documented, and may be withdrawn in future versions. + Use -x or -t x2 instead. + + -i is now equivalent to -t dI (not -t d2), and + -l is now equivalent to -t dL (not -t d4). + + -s is now equivalent to -t d2. The old "-s[NUM]" or "-s NUM" + option has been renamed to "-S NUM". + + The default output format is now -t oS, not -t o2, i.e., short int + rather than two-byte int. This makes a difference only on hosts like + Cray systems where the C short int type requires more than two bytes. + + The stat option --filesystem has been renamed to --file-system, for + consistency with POSIX "file system" and with cp and du --one-file-system. + +** Removed features + + md5sum and sha1sum's undocumented --string option has been removed. + + tail's undocumented --max-consecutive-size-changes option has been removed. + +* Major changes in release 5.2.1 (2004-03-12) [stable] + +** Bug fixes + + mv could mistakenly fail to preserve hard links when moving two + or more arguments between partitions. + + `cp --sparse=always F /dev/hdx' no longer tries to use lseek to create + holes in the destination. + + nohup now sets the close-on-exec flag for its copy of the stderr file + descriptor. This avoids some nohup-induced hangs. For example, before + this change, if you ran `ssh localhost', then `nohup sleep 600 /dev/null takes about one hour + on a 1.6 GHz Athlon 2000 XP. Now it can output 2^53-1 numbers before + misbehaving. + +* Major changes in release 5.1.2 (2004-01-25): + +** Bug fixes + + rmdir -p exits with status 1 on error; formerly it sometimes exited + with status 0 when given more than one argument. + + nohup now always exits with status 127 when it finds an error, + as POSIX requires; formerly it sometimes exited with status 1. + + Several programs (including cut, date, dd, env, hostname, nl, pr, + stty, and tr) now always exit with status 1 when they find an error; + formerly they sometimes exited with status 2. + + factor no longer reports a usage error if stdin has the wrong format. + + paste no longer infloops on ppc systems (bug introduced in 5.1.1) + + +* Major changes in release 5.1.1 (2004-01-17): + +** Configuration option + + You can select the default level of POSIX conformance at configure-time, + e.g., by ./configure DEFAULT_POSIX2_VERSION=199209 + +** Bug fixes + + fold -s works once again on systems with differing sizes for int + and size_t (bug introduced in 5.1.0) + +** New features + + touch -r now specifies the origin for any relative times in the -d + operand, if both options are given. For example, "touch -r FOO -d + '-5 seconds' BAR" sets BAR's modification time to be five seconds + before FOO's. + + join: The obsolete options "-j1 FIELD", "-j2 FIELD", and + "-o LIST1 LIST2..." are no longer supported on POSIX 1003.1-2001 systems. + Portable scripts should use "-1 FIELD", "-2 FIELD", and + "-o LIST1,LIST2..." respectively. If join was compiled on a + POSIX 1003.1-2001 system, you may enable the old behavior + by setting _POSIX2_VERSION=199209 in your environment. + + +* Major changes in release 5.1.0 (2003-12-21): + +** New features + + chgrp, chmod, and chown can now process (with -R) hierarchies of virtually + unlimited depth. Before, they would fail to operate on any file they + encountered with a relative name of length PATH_MAX (often 4096) or longer. + + chgrp, chmod, chown, and rm accept the new options: + --preserve-root, --no-preserve-root (default) + + chgrp and chown now accept POSIX-mandated -L, -H, and -P options + + du can now process hierarchies of virtually unlimited depth. + Before, du was limited by the user's stack size and it would get a + stack overflow error (often a segmentation fault) when applied to + a hierarchy of depth around 30,000 or larger. + + du works even when run from an inaccessible directory + + du -D now dereferences all symlinks specified on the command line, + not just the ones that reference directories + + du now accepts -P (--no-dereference), for compatibility with du + of NetBSD and for consistency with e.g., chown and chgrp + + du's -H option will soon have the meaning required by POSIX + (--dereference-args, aka -D) rather then the current meaning of --si. + Now, using -H elicits a warning to that effect. + + When given -l and similar options, ls now adjusts the output column + widths to fit the data, so that output lines are shorter and have + columns that line up better. This may adversely affect shell + scripts that expect fixed-width columns, but such shell scripts were + not portable anyway, even with old GNU ls where the columns became + ragged when a datum was too wide. + + du accepts a new option, -0/--null, to make it produce NUL-terminated + output lines + +** Bug fixes + + printf, seq, tail, and sleep now parse floating-point operands + and options in the C locale. POSIX requires this for printf. + + od -c -w9999999 no longer segfaults + + csplit no longer reads from freed memory (dumping core on some systems) + + csplit would mistakenly exhaust virtual memory in some cases + + ls --width=N (for very large N) is no longer subject to an address + arithmetic bug that could result in bounds violations. + + ls --width=N (with -x or -C) no longer allocates more space + (potentially much more) than necessary for a given directory. + + dd `unblock' and `sync' may now be combined (e.g., dd conv=unblock,sync) + +* Major changes in release 5.0.91 (2003-09-08): + +** New features + + date accepts a new option --rfc-2822, an alias for --rfc-822. + + split accepts a new option -d or --numeric-suffixes. + + cp, install, mv, and touch now preserve microsecond resolution on + file timestamps, on platforms that have the 'utimes' system call. + Unfortunately there is no system call yet to preserve file + timestamps to their full nanosecond resolution; microsecond + resolution is the best we can do right now. + + sort now supports the zero byte (NUL) as a field separator; use -t '\0'. + The -t '' option, which formerly had no effect, is now an error. + + sort option order no longer matters for the options -S, -d, -i, -o, and -t. + Stronger options override weaker, and incompatible options are diagnosed. + + `sha1sum --check' now accepts the BSD format for SHA1 message digests + in addition to the BSD format for MD5 ones. + + who -l now means `who --login', not `who --lookup', per POSIX. + who's -l option has been eliciting an unconditional warning about + this impending change since sh-utils-2.0.12 (April 2002). + +** Bug fixes + + Mistakenly renaming a file onto itself, e.g., via `mv B b' when `B' is + the same directory entry as `b' no longer destroys the directory entry + referenced by both `b' and `B'. Note that this would happen only on + file systems like VFAT where two different names may refer to the same + directory entry, usually due to lower->upper case mapping of file names. + Now, the above can happen only on file systems that perform name mapping and + that support hard links (stat.st_nlink > 1). This mitigates the problem + in two ways: few file systems appear to be affected (hpfs and ntfs are), + when the bug is triggered, mv no longer removes the last hard link to a file. + *** ATTENTION ***: if you know how to distinguish the following two cases + without writing to the file system in question, please let me know: + 1) B and b refer to the same directory entry on a file system like NTFS + (B may well have a link count larger than 1) + 2) B and b are hard links to the same file + + stat no longer overruns a buffer for format strings ending in `%' + + fold -s -wN would infloop for N < 8 with TABs in the input. + E.g., this would not terminate: printf 'a\t' | fold -w2 -s + + `split -a0', although of questionable utility, is accepted once again. + + `df DIR' used to hang under some conditions on OSF/1 5.1. Now it doesn't. + + seq's --width (-w) option now works properly even when the endpoint + requiring the larger width is negative and smaller than the other endpoint. + + seq's default step is 1, even if LAST < FIRST. + + paste no longer mistakenly outputs 0xFF bytes for a nonempty input file + without a trailing newline. + + `tail -n0 -f FILE' and `tail -c0 -f FILE' no longer perform what amounted + to a busy wait, rather than sleeping between iterations. + + tail's long-undocumented --allow-missing option now elicits a warning + + +* Major changes in release 5.0.90 (2003-07-29): + +** New features + + sort is now up to 30% more CPU-efficient in some cases + + `test' is now more compatible with Bash and POSIX: + + `test -t', `test --help', and `test --version' now silently exit + with status 0. To test whether standard output is a terminal, use + `test -t 1'. To get help and version info for `test', use + `[ --help' and `[ --version'. + + `test' now exits with status 2 (not 1) if there is an error. + + wc count field widths now are heuristically adjusted depending on the input + size, if known. If only one count is printed, it is guaranteed to + be printed without leading spaces. + + Previously, wc did not align the count fields if POSIXLY_CORRECT was set, + but POSIX did not actually require this undesirable behavior, so it + has been removed. + +** Bug fixes + + kill no longer tries to operate on argv[0] (introduced in 5.0.1) + Why wasn't this noticed? Although many tests use kill, none of + them made an effort to avoid using the shell's built-in kill. + + `[' invoked with no arguments no longer evokes a segfault + + rm without --recursive (aka -r or -R) no longer prompts regarding + unwritable directories, as required by POSIX. + + uniq -c now uses a SPACE, not a TAB between the count and the + corresponding line, as required by POSIX. + + expr now exits with status 2 if the expression is syntactically valid, + and with status 3 if an error occurred. POSIX requires this. + + expr now reports trouble if string comparison fails due to a collation error. + + split now generates suffixes properly on EBCDIC hosts. + + split -a0 now works, as POSIX requires. + + `sort --version' and `sort --help' fail, as they should + when their output is redirected to /dev/full. + + `su --version > /dev/full' now fails, as it should. + +** Fewer arbitrary limitations + + cut requires 97% less memory when very large field numbers or + byte offsets are specified. + + +* Major changes in release 5.0.1 (2003-07-15): + +** New programs +- new program: `[' (much like `test') + +** New features +- head now accepts --lines=-N (--bytes=-N) to print all but the + N lines (bytes) at the end of the file +- md5sum --check now accepts the output of the BSD md5sum program, e.g., + MD5 (f) = d41d8cd98f00b204e9800998ecf8427e +- date -d DATE can now parse a DATE string like May-23-2003 +- chown: `.' is no longer recognized as a separator in the OWNER:GROUP + specifier on POSIX 1003.1-2001 systems. If chown *was not* compiled + on such a system, then it still accepts `.', by default. If chown + was compiled on a POSIX 1003.1-2001 system, then you may enable the + old behavior by setting _POSIX2_VERSION=199209 in your environment. +- chown no longer tries to preserve set-user-ID and set-group-ID bits; + on some systems, the chown syscall resets those bits, and previous + versions of the chown command would call chmod to restore the original, + pre-chown(2) settings, but that behavior is problematic. + 1) There was a window whereby a malicious user, M, could subvert a + chown command run by some other user and operating on files in a + directory where M has write access. + 2) Before (and even now, on systems with chown(2) that doesn't reset + those bits), an unwary admin. could use chown unwittingly to create e.g., + a set-user-ID root copy of /bin/sh. + +** Bug fixes +- chown --dereference no longer leaks a file descriptor per symlink processed +- `du /' once again prints the `/' on the last line +- split's --verbose option works once again [broken in 4.5.10 and 5.0] +- tail -f is no longer subject to a race condition that could make it + delay displaying the last part of a file that had stopped growing. That + bug could also make tail -f give an unwarranted `file truncated' warning. +- du no longer runs out of file descriptors unnecessarily +- df and `readlink --canonicalize' no longer corrupt the heap on + non-glibc, non-solaris systems +- `env -u UNSET_VARIABLE' no longer dumps core on non-glibc systems +- readlink's --canonicalize option now works on systems like Solaris that + lack the canonicalize_file_name function but do have resolvepath. +- mv now removes `a' in this example on all systems: touch a; ln a b; mv a b + This behavior is contrary to POSIX (which requires that the mv command do + nothing and exit successfully), but I suspect POSIX will change. +- date's %r format directive now honors locale settings +- date's `-' (no-pad) format flag now affects the space-padded-by-default + conversion specifiers, %e, %k, %l +- fmt now diagnoses invalid obsolescent width specifications like `-72x' +- fmt now exits nonzero when unable to open an input file +- tsort now fails when given an odd number of input tokens, + as required by POSIX. Before, it would act as if the final token + appeared one additional time. + +** Fewer arbitrary limitations +- tail's byte and line counts are no longer limited to OFF_T_MAX. + Now the limit is UINTMAX_MAX (usually 2^64). +- split can now handle --bytes=N and --lines=N with N=2^31 or more. + +** Portability +- `kill -t' now prints signal descriptions (rather than `?') on systems + like Tru64 with __sys_siglist but no strsignal function. +- stat.c now compiles on Ultrix systems +- sleep now works on AIX systems that lack support for clock_gettime +- rm now works around Darwin6.5's broken readdir function + Before `rm -rf DIR' would fail to remove all files in DIR + if there were more than 338. + +* Major changes in release 5.0 (2003-04-02): +- false --help now exits nonzero + +[4.5.12] +* printf no longer treats \x specially when POSIXLY_CORRECT is set +* printf avoids buffer overrun with format ending in a backslash and +* printf avoids buffer overrun with incomplete conversion specifier +* printf accepts multiple flags in a single conversion specifier + +[4.5.11] +* seq no longer requires that a field width be specified +* seq no longer fails when given a field width of `0' +* seq now accepts ` ' and `'' as valid format flag characters +* df now shows a HOSTNAME: prefix for each remote-mounted file system on AIX 5.1 +* portability tweaks for HP-UX, AIX 5.1, DJGPP + +[4.5.10] +* printf no longer segfaults for a negative field width or precision +* shred now always enables --exact for non-regular files +* du no longer lists hard-linked files more than once +* du no longer dumps core on some systems due to `infinite' recursion + via nftw's use of the buggy replacement function in getcwd.c +* portability patches for a few vendor compilers and 64-bit systems +* du -S *really* now works like it did before the change in 4.5.5 + +[4.5.9] +* du no longer truncates file sizes or sums to fit in 32-bit size_t +* work around Linux kernel bug in getcwd (fixed in 2.4.21-pre4), so that pwd + now fails if the name of the working directory is so long that getcwd + truncates it. Before it would print the truncated name and exit successfully. +* `df /some/mount-point' no longer hangs on a GNU libc system when another + hard-mounted NFS file system (preceding /some/mount-point in /proc/mounts) + is inaccessible. +* rm -rf now gives an accurate diagnostic when failing to remove a file + under certain unusual conditions +* mv and `cp --preserve=links' now preserve multiple hard links even under + certain unusual conditions where they used to fail + +[4.5.8] +* du -S once again works like it did before the change in 4.5.5 +* stat accepts a new file format, %B, for the size of each block reported by %b +* du accepts new option: --apparent-size +* du --bytes (-b) works the same way it did in fileutils-3.16 and before +* du reports proper sizes for directories (not zero) (broken in 4.5.6 or 4.5.7) +* df now always displays under `Filesystem', the device file name + corresponding to the listed mount point. Before, for a block- or character- + special file command line argument, df would display that argument. E.g., + `df /dev/hda' would list `/dev/hda' as the `Filesystem', rather than say + /dev/hda3 (the device on which `/' is mounted), as it does now. +* test now works properly when invoked from a set user ID or set group ID + context and when testing access to files subject to alternate protection + mechanisms. For example, without this change, a set-UID program that invoked + `test -w F' (to see if F is writable) could mistakenly report that it *was* + writable, even though F was on a read-only file system, or F had an ACL + prohibiting write access, or F was marked as immutable. + +[4.5.7] +* du would fail with more than one DIR argument when any but the last did not + contain a slash (due to a bug in ftw.c) + +[4.5.6] +* du no longer segfaults on Solaris systems (fixed heap-corrupting bug in ftw.c) +* du --exclude=FILE works once again (this was broken by the rewrite for 4.5.5) +* du no longer gets a failed assertion for certain hierarchy lay-outs + involving hard-linked directories +* `who -r' no longer segfaults when using non-C-locale messages +* df now displays a mount point (usually `/') for non-mounted + character-special and block files + +[4.5.5] +* ls --dired produces correct byte offset for file names containing + nonprintable characters in a multibyte locale +* du has been rewritten to use a variant of GNU libc's ftw.c +* du now counts the space associated with a directory's directory entry, + even if it cannot list or chdir into that subdirectory. +* du -S now includes the st_size of each entry corresponding to a subdirectory +* rm on FreeBSD can once again remove directories from NFS-mounted file systems +* ls has a new option --dereference-command-line-symlink-to-dir, which + corresponds to the new default behavior when none of -d, -l -F, -H, -L + has been specified. +* ls dangling-symlink now prints `dangling-symlink'. + Before, it would fail with `no such file or directory'. +* ls -s symlink-to-non-dir and ls -i symlink-to-non-dir now print + attributes of `symlink', rather than attributes of their referents. +* Fix a bug introduced in 4.5.4 that made it so that ls --color would no + longer highlight the names of files with the execute bit set when not + specified on the command line. +* shred's --zero (-z) option no longer gobbles up any following argument. + Before, `shred --zero file' would produce `shred: missing file argument', + and worse, `shred --zero f1 f2 ...' would appear to work, but would leave + the first file untouched. +* readlink: new program +* cut: new feature: when used to select ranges of byte offsets (as opposed + to ranges of fields) and when --output-delimiter=STRING is specified, + output STRING between ranges of selected bytes. +* rm -r can no longer be tricked into mistakenly reporting a cycle. +* when rm detects a directory cycle, it no longer aborts the entire command, + but rather merely stops processing the affected command line argument. + +[4.5.4] +* cp no longer fails to parse options like this: --preserve=mode,ownership +* `ls --color -F symlink-to-dir' works properly +* ls is much more efficient on directories with valid dirent.d_type. +* stty supports all baud rates defined in linux-2.4.19. +* `du symlink-to-dir/' would improperly remove the trailing slash +* `du ""' would evoke a bounds violation. +* In the unlikely event that running `du /' resulted in `stat ("/", ...)' + failing, du would give a diagnostic about `' (empty string) rather than `/'. +* printf: a hexadecimal escape sequence has at most two hex. digits, not three. +* The following features have been added to the --block-size option + and similar environment variables of df, du, and ls. + - A leading "'" generates numbers with thousands separators. + For example: + $ ls -l --block-size="'1" file + -rw-rw-r-- 1 eggert src 47,483,707 Sep 24 23:40 file + - A size suffix without a leading integer generates a suffix in the output. + For example: + $ ls -l --block-size="K" + -rw-rw-r-- 1 eggert src 46371K Sep 24 23:40 file +* ls's --block-size option now affects file sizes in all cases, not + just for --block-size=human-readable and --block-size=si. Fractional + sizes are now always rounded up, for consistency with df and du. +* df now displays the block size using powers of 1000 if the requested + block size seems to be a multiple of a power of 1000. +* nl no longer gets a segfault when run like this `yes|nl -s%n' + +[4.5.3] +* du --dereference-args (-D) no longer fails in certain cases +* `ln --target-dir=DIR' no longer fails when given a single argument + +[4.5.2] +* `rm -i dir' (without --recursive (-r)) no longer recurses into dir +* `tail -c N FILE' now works with files of size >= 4GB +* `mkdir -p' can now create very deep (e.g. 40,000-component) directories +* rmdir -p dir-with-trailing-slash/ no longer fails +* printf now honors the `--' command line delimiter +* od's 8-byte formats x8, o8, and u8 now work +* tail now accepts fractional seconds for its --sleep-interval=S (-s) option + +[4.5.1] +* du and ls now report sizes of symbolic links (before they'd always report 0) +* uniq now obeys the LC_COLLATE locale, as per POSIX 1003.1-2001 TC1. + +======================================================================== +Here are the NEWS entries made from fileutils-4.1 until the +point at which the packages merged to form the coreutils: + +[4.1.11] +* `rm symlink-to-unwritable' doesn't prompt [introduced in 4.1.10] +[4.1.10] +* rm once again gives a reasonable diagnostic when failing to remove a file + owned by someone else in a sticky directory [introduced in 4.1.9] +* df now rounds all quantities up, as per POSIX. +* New ls time style: long-iso, which generates YYYY-MM-DD HH:MM. +* Any time style can be preceded by "posix-"; this causes "ls" to + use traditional timestamp format when in the POSIX locale. +* The default time style is now posix-long-iso instead of posix-iso. + Set TIME_STYLE="posix-iso" to revert to the behavior of 4.1.1 thru 4.1.9. +* `rm dangling-symlink' doesn't prompt [introduced in 4.1.9] +* stat: remove support for --secure/-s option and related %S and %C format specs +* stat: rename --link/-l to --dereference/-L. + The old options will continue to work for a while. +[4.1.9] +* rm can now remove very deep hierarchies, in spite of any limit on stack size +* new programs: link, unlink, and stat +* New ls option: --author (for the Hurd). +* `touch -c no-such-file' no longer fails, per POSIX +[4.1.8] +* mv no longer mistakenly creates links to preexisting destination files + that aren't moved +[4.1.7] +* rm: close a hole that would allow a running rm process to be subverted +[4.1.6] +* New cp option: --copy-contents. +* cp -r is now equivalent to cp -R. Use cp -R -L --copy-contents to get the + traditional (and rarely desirable) cp -r behavior. +* ls now accepts --time-style=+FORMAT, where +FORMAT works like date's format +* The obsolete usage `touch [-acm] MMDDhhmm[YY] FILE...' is no longer + supported on systems conforming to POSIX 1003.1-2001. Use touch -t instead. +* cp and inter-partition mv no longer give a misleading diagnostic in some + unusual cases +[4.1.5] +* cp -r no longer preserves symlinks +* The block size notation is now compatible with SI and with IEC 60027-2. + For example, --block-size=1MB now means --block-size=1000000, + whereas --block-size=1MiB now means --block-size=1048576. + A missing `B' (e.g. `1M') has the same meaning as before. + A trailing `B' now means decimal, not binary; this is a silent change. + The nonstandard `D' suffix (e.g. `1MD') is now obsolescent. +* -H or --si now outputs the trailing 'B', for consistency with the above. +* Programs now output trailing 'K' (not 'k') to mean 1024, as per IEC 60027-2. +* New df, du short option -B is short for --block-size. +* You can omit an integer `1' before a block size suffix, + e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'. +* The following options are now obsolescent, as their names are + incompatible with IEC 60027-2: + df, du: -m or --megabytes (use -BM or --block-size=1M) + df, du, ls: --kilobytes (use --block-size=1K) +[4.1.4] +* df --local no longer lists smbfs file systems whose name starts with // +* dd now detects the Linux/tape/lseek bug at run time and warns about it. +[4.1.3] +* ls -R once again outputs a blank line between per-directory groups of files. + This was broken by the cycle-detection change in 4.1.1. +* dd once again uses `lseek' on character devices like /dev/mem and /dev/kmem. + On systems with the linux kernel (at least up to 2.4.16), dd must still + resort to emulating `skip=N' behavior using reads on tape devices, because + lseek has no effect, yet appears to succeed. This may be a kernel bug. +[4.1.2] +* cp no longer fails when two or more source files are the same; + now it just gives a warning and doesn't copy the file the second time. + E.g., cp a a d/ produces this: + cp: warning: source file `a' specified more than once +* chmod would set the wrong bit when given symbolic mode strings like + these: g=o, o=g, o=u. E.g., `chmod a=,o=w,ug=o f' would give a mode + of --w-r---w- rather than --w--w--w-. +[4.1.1] +* mv (likewise for cp), now fails rather than silently clobbering one of + the source files in the following example: + rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c +* ls -R detects directory cycles, per POSIX. It warns and doesn't infloop. +* cp's -P option now means the same as --no-dereference, per POSIX. + Use --parents to get the old meaning. +* When copying with the -H and -L options, cp can preserve logical + links between source files with --preserve=links +* cp accepts new options: + --preserve[={mode,ownership,timestamps,links,all}] + --no-preserve={mode,ownership,timestamps,links,all} +* cp's -p and --preserve options remain unchanged and are equivalent + to `--preserve=mode,ownership,timestamps' +* mv and cp accept a new option: --reply={yes,no,query}; provides a consistent + mechanism to control whether one is prompted about certain existing + destination files. Note that cp's and mv's -f options don't have the + same meaning: cp's -f option no longer merely turns off `-i'. +* remove portability limitations (e.g., PATH_MAX on the Hurd, fixes for + 64-bit systems) +* mv now prompts before overwriting an existing, unwritable destination file + when stdin is a tty, unless --force (-f) is specified, as per POSIX. +* mv: fix the bug whereby `mv -uf source dest' would delete source, + even though it's older than dest. +* chown's --from=CURRENT_OWNER:CURRENT_GROUP option now works +* cp now ensures that the set-user-ID and set-group-ID bits are cleared for + the destination file when when copying and not preserving permissions. +* `ln -f --backup k k' gives a clearer diagnostic +* ls no longer truncates user names or group names that are longer + than 8 characters. +* ls's new --dereference-command-line option causes it to dereference + symbolic links on the command-line only. It is the default unless + one of the -d, -F, or -l options are given. +* ls -H now means the same as ls --dereference-command-line, as per POSIX. +* ls -g now acts like ls -l, except it does not display owner, as per POSIX. +* ls -n now implies -l, as per POSIX. +* ls can now display dates and times in one of four time styles: + + - The `full-iso' time style gives full ISO-style time stamps like + `2001-05-14 23:45:56.477817180 -0700'. + - The 'iso' time style gives ISO-style time stamps like '2001-05-14 ' + and '05-14 23:45'. + - The 'locale' time style gives locale-dependent time stamps like + 'touko 14 2001' and 'touko 14 23:45' (in a Finnish locale). + - The 'posix-iso' time style gives traditional POSIX-locale + time stamps like 'May 14 2001' and 'May 14 23:45' unless the user + specifies a non-POSIX locale, in which case it uses ISO-style dates. + This is the default. + + You can specify a time style with an option like --time-style='iso' + or with an environment variable like TIME_STYLE='iso'. GNU Emacs 21 + and later can parse ISO dates, but older Emacs versions cannot, so + if you are using an older version of Emacs outside the default POSIX + locale, you may need to set TIME_STYLE="locale". + +* --full-time is now an alias for "-l --time-style=full-iso". + + +======================================================================== +Here are the NEWS entries made from sh-utils-2.0 until the +point at which the packages merged to form the coreutils: + + [2.0.15] +* date no longer accepts e.g., September 31 in the MMDDhhmm syntax +* fix a bug in this package's .m4 files and in configure.ac + [2.0.14] +* nohup's behavior is changed as follows, to conform to POSIX 1003.1-2001: + - nohup no longer adjusts scheduling priority; use "nice" for that. + - nohup now redirects stderr to stdout, if stderr is not a terminal. + - nohup exit status is now 126 if command was found but not invoked, + 127 if nohup failed or if command was not found. + [2.0.13] +* uname and uptime work better on *BSD systems +* pathchk now exits nonzero for a path with a directory component + that specifies a non-directory + [2.0.12] +* kill: new program +* who accepts new options: --all (-a), --boot (-b), --dead (-d), --login, + --process (-p), --runlevel (-r), --short (-s), --time (-t), --users (-u). + The -u option now produces POSIX-specified results and is the same as + the long option `--users'. --idle is no longer the same as -u. +* The following changes apply on systems conforming to POSIX 1003.1-2001, + and are required by the new POSIX standard: + - `date -I' is no longer supported. Instead, use `date --iso-8601'. + - `nice -NUM' is no longer supported. Instead, use `nice -n NUM'. +* New 'uname' options -i or --hardware-platform, and -o or --operating-system. + 'uname -a' now outputs -i and -o information at the end. + New uname option --kernel-version is an alias for -v. + Uname option --release has been renamed to --kernel-release, + and --sysname has been renamed to --kernel-name; + the old options will work for a while, but are no longer documented. +* 'expr' now uses the LC_COLLATE locale for string comparison, as per POSIX. +* 'expr' now requires '+' rather than 'quote' to quote tokens; + this removes an incompatibility with POSIX. +* date -d 'last friday' would print a date/time that was one hour off + (e.g., 23:00 on *thursday* rather than 00:00 of the preceding friday) + when run such that the current time and the target date/time fall on + opposite sides of a daylight savings time transition. + This problem arose only with relative date strings like `last monday'. + It was not a problem with strings that include absolute dates. +* factor is twice as fast, for large numbers + [2.0.11] +* setting the date now works properly, even when using -u +* `date -f - < /dev/null' no longer dumps core +* some DOS/Windows portability changes + [2.0j] +* `date -d DATE' now parses certain relative DATEs correctly + [2.0i] +* fixed a bug introduced in 2.0h that made many programs fail with a + `write error' when invoked with the --version option + [2.0h] +* all programs fail when printing --help or --version output to a full device +* printf exits nonzero upon write failure +* yes now detects and terminates upon write failure +* date --rfc-822 now always emits day and month names from the `C' locale +* portability tweaks for Solaris8, Ultrix, and DOS + [2.0g] +* date now handles two-digit years with leading zeros correctly. +* printf interprets unicode, \uNNNN \UNNNNNNNN, on systems with the + required support; from Bruno Haible. +* stty's rprnt attribute now works on HPUX 10.20 +* seq's --equal-width option works more portably + [2.0f] +* fix build problems with ut_name vs. ut_user + [2.0e] +* stty: fix long-standing bug that caused test failures on at least HPUX + systems when COLUMNS was set to zero +* still more portability fixes +* unified lib/: now that directory and most of the configuration framework + is common between fileutils, textutils, and sh-utils + [2.0d] +* fix portability problem with sleep vs lib/strtod.c's requirement for -lm + [2.0c] +* fix portability problems with nanosleep.c and with the new code in sleep.c + [2.0b] +* Regenerate lib/Makefile.in so that nanosleep.c is distributed. + [2.0a] +* sleep accepts floating point arguments on command line +* sleep's clock continues counting down when sleep is suspended +* when a suspended sleep process is resumed, it continues sleeping if + there is any time remaining +* who once again prints whatever host information it has, even without --lookup + +======================================================================== +For older NEWS entries for the fileutils, textutils, and sh-utils +packages, see ./old/*/NEWS. + + This package began as the union of the following: + textutils-2.1, fileutils-4.1.11, sh-utils-2.0.15. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/README b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/README new file mode 100644 index 0000000..64a565c --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/README @@ -0,0 +1,167 @@ +These are the GNU core utilities. This package is the union of +the GNU fileutils, sh-utils, and textutils packages. + +Most of these programs have significant advantages over their Unix +counterparts, such as greater speed, additional options, and fewer +arbitrary limits. + +The programs that can be built with this package are: + + [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd + df dir dircolors dirname du echo env expand expr factor false fmt fold + ginstall groups head hostid hostname id join kill link ln logname ls + md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr + printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort + split stat stty su sum sync tac tail tee test touch tr true tsort tty + uname unexpand uniq unlink uptime users vdir wc who whoami yes + +See the file NEWS for a list of major changes in the current release. + +See the file INSTALL for compilation and installation instructions. + +These programs are intended to conform to POSIX (with BSD and other +extensions), like the rest of the GNU system. By default they conform +to older POSIX (1003.2-1992), and therefore support obsolete usages +like "head -10" and "chown owner.group file". This default is +overridden at build-time by the value of 's _POSIX2_VERSION +macro, and this in turn can be overridden at runtime as described in +the documentation under "Standards conformance". + +The ls, dir, and vdir commands are all separate executables instead of +one program that checks argv[0] because people often rename these +programs to things like gls, gnuls, l, etc. Renaming a program +file shouldn't affect how it operates, so that people can get the +behavior they want with whatever name they want. + +Special thanks to Paul Eggert, Brian Matthews, Bruce Evans, Karl Berry, +Kaveh Ghazi, and François Pinard for help with debugging and porting +these programs. Many thanks to all of the people who have taken the +time to submit problem reports and fixes. All contributed changes are +attributed in the ChangeLog files. + +And thanks to the following people who have provided accounts for +portability testing on many different types of systems: Bob Proulx, +Christian Robert, François Pinard, Greg McGary, Harlan Stenn, +Joel N. Weber, Mark D. Roth, Matt Schalit, Nelson H. F. Beebe, +Réjean Payette, Sam Tardieu. + +Thanks to Michael Stone for inflicting test releases of this package +on Debian's unstable distribution, and to all the kind folks who used +that distribution and found and reported bugs. + +Note that each man page is now automatically generated from a template +and from the corresponding --help usage message. Patches to the template +files (man/*.x) are welcome. However, the authoritative documentation +is in texinfo form in the doc directory. + +If you run the tests on a SunOS4.1.4 system, expect the ctime-part of +the ls `time-1' test to fail. I believe that is due to a bug in the +way Sun implemented link(2) and chmod(2). + +*********************** +HPUX 11.x build failure +----------------------- + +A known problem exists when compiling on HPUX on both hppa and ia64 +in 64-bit mode (i.e. +DD64) on HP-UX 11.0, 11.11, and 11.23. This +is not due to a bug in the package but instead due to a bug in the +system header file which breaks things in 64-bit mode. The default +compilation mode is 32-bit and the software compiles fine using the +default mode. To build this software in 64-bit mode you will need +to fix the system /usr/include/inttypes.h header file. After +correcting that file the software also compiles fine in 64-bit mode. +Here is one possible patch to correct the problem: + +--- /usr/include/inttypes.h.orig Thu May 30 01:00:00 1996 ++++ /usr/include/inttypes.h Sun Mar 23 00:20:36 2003 +@@ -489 +489 @@ +-#ifndef __STDC_32_MODE__ ++#ifndef __LP64__ + + +********************** +Running tests as root: +---------------------- + +If you run the tests as root, note that a few of them create files +and/or run programs as a non-root user, `nobody' by default. +If you want to use some other non-root username, specify it via +the NON_ROOT_USERNAME environment variable. Depending on the +permissions with which the working directories have been created, +using `nobody' may fail, because that user won't have the required +read and write access to the build and test directories. +I find that it is best to unpack and build as a non-privileged +user, and then to run the following command as that user in order +to run the privilege-requiring tests: + + sudo env NON_ROOT_USERNAME=$USER make -k check + +If you can run the tests as root, please do so and report any +problems. We get much less test coverage in that mode, and it's +arguably more important that these tools work well when run by +root than when run by less privileged users. + + +*************** +Reporting bugs: +--------------- + +IMPORTANT: if you take the time to report a test failure, +please be sure to include the output of running `make check' +in verbose mode for each each failing test. For example, +if the test that fails is tests/mv/hard-link-1, then you +would run this command: + + env VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1 + +and then include the contents of the file `log' in your bug report. + +*************************************** + +There are pretty many tests, but nowhere near as many as we need. +Additions and corrections are very welcome. + +If you see a problem that you've already reported, feel free to re-report +it -- it won't bother me to get a reminder. Besides, the more messages I +get regarding a particular problem the sooner it'll be fixed -- usually. +If you sent a complete patch and, after a couple weeks you haven't +received any acknowledgement, please ping us. A complete patch includes +a well-written ChangeLog entry, unified (diff -u format) diffs relative +to the most recent test release (or, better, relative to the latest +sources in the CVS repository), an explanation for why the patch is +necessary or useful, and if at all possible, enough information to +reproduce whatever problem prompted it. Plus, you'll earn lots of +karma if you include a test case to exercise any bug(s) you fix. +Instructions for checking out the latest source via CVS are here: + + http://savannah.gnu.org/cvs/?group=coreutils + + +If your patch adds a new feature, please try to get some sort of consensus +that it is a worthwhile change. One way to do that is to send mail to +bug-coreutils@gnu.org including as much description and justification +as you can. Based on the feedback that generates, you may be able to +convince us that it's worth adding. + + +WARNING: If you modify files like configure.in, m4/*.m4, aclocal.m4, +or any Makefile.am, then don't be surprised if what gets regenerated no +longer works. To make things work, you'll have to be using appropriate +versions of automake and autoconf. As for what versions are `appropriate', +use the versions of + + * autoconf specified via AC_PREREQ in m4/jm-macros.m4 + * automake specified via AM_INIT_AUTOMAKE in configure.ac + +Usually it's fine to use versions that are newer than those specified. + +All of these programs except `test' recognize the `--version' option. +When reporting bugs, please include in the subject line both the package +name/version and the name of the program for which you found a problem. + +For general documentation on the coding and usage standards +this distribution follows, see the GNU Coding Standards, +http://www.gnu.org/prep/standards_toc.html. + +Mail suggestions and bug reports for these programs to +the address on the last line of --help output. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/THANKS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/THANKS new file mode 100644 index 0000000..1004b9e --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/THANKS @@ -0,0 +1,471 @@ +These people have contributed to the GNU coreutils (formerly, the fileutils, +textutils, and/or sh-utils packages). Some have reported problems, others +have contributed improvements to the documentation, actual code, and even +complete programs. Those contributions are described in the ChangeLog +files. If your name has been left out, if you'd rather not be listed, +or if you'd prefer a different address be used, please send a note to +the bug-report mailing list (as seen on last line of e.g., cp --help). + +??? kytek@cybercomm.net +A Costa agcosta@gis.net +Achim Blumensath blume@corona.oche.de +Adam Klein aklein@debian.org +Akim Demaille demaille@inf.enst.fr +Alain Magloire alain@qnx.com +Alan Iwi iwi@atm.ox.ac.uk +Albert Chin-A-Young china@thewrittenword.com +Albert Hopkins ahopkins@dynacare.com +Alberto Accomazzi alberto@cfa0.harvard.edu +aldomel aldomel@ix.netcom.com +Alen Muzinic zveki@fly.cc.fer.hr +Alexandre Duret-Lutz duret_g@epita.fr +Alexey Solovyov alekso@math.uu.se +Alexey Vyskubov alexey@pippuri.mawhrin.net +Alfred M. Szmidt ams@kemisten.nu +Andi Kleen freitag@alancoxonachip.com +Andre Novaes Cunha Andre.Cunha@br.global-one.net +Andreas Gruenbacher ag@bestbits.at +Andreas Jaeger jaeger@gnu.org +Andreas Luik luik@isa.de +Andreas Schwab schwab@suse.de +Andreas Stolcke stolcke@ICSI.Berkeley.EDU +Andrei Gaponenko andr@triumf.ca +Andres Soolo andres@soolo.matti.ee +Andrew Burgess aab@cichlid.com +Andrew Dalke dalke@bioreason.com +Andrew Fabbro andrew@fabbro.org +Andrew Pham andpha@us.ibm.com +Andrew Tridgell tridge@samba.org +Andrey Borzenkov arvidjaar@mail.ru +Andries Brouwer Andries.Brouwer@cwi.nl +Andy Longton alongton@metamark.com +Anthony Thyssen anthony@griffith.edu.au +Antonio Rendas ajrendas@yahoo.com +Ariel Faigon ariel@cthulhu.engr.sgi.com +Arne H. Juul arnej@solan.unit.no +Arne Henrik Juul arnej@imf.unit.no +Arnold Robbins arnold@skeeve.com +Arthur Pool pool@commerce.uq.edu.au +Arun Sharma arun.sharma@intel.com +Arvind Autar Autar022@planet.nl +Augey Mikus mikus@dqc.org +Austin Donnelly Austin.Donnelly@cl.cam.ac.uk +Axel Kittenberger Anshil@gmx.net +Bauke Jan Douma bjdouma@xs4all.nl +Ben Elliston bje@air.net.au +Ben Harris bjh21@netbsd.org +Benjamin Cutler cutlerbc@simla.colostate.edu +Bengt Martensson bengt@mathematik.uni-Bremen.de +Bernard Giroud bernard.giroud@creditlyonnais.ch +Bernd Leibing bernd.leibing@rz.uni-ulm.de +Bernd Melchers melchers@cis.fu-berlin.de +Bernhard Baehr bernhard.baehr@gmx.de +Bernhard Gabler bernhard@uni-koblenz.de +Bernhard Rosenkraenzer bero@redhat.de +Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be +Bill Peters peters@gaffel.as.arizona.edu +Bjorn Helgaas helgaas@rsn.hp.com +Bob McCracken kerouac@ravenet.com +Bob Proulx rwp@fc.hp.com +Branden Robinson branden@necrotic.deadbeast.net +Brendan O'Dea bod@compusol.com.au +Brian Kimball bfk@footbag.org +Brian Youmans 3diff@gnu.org +Bruce Korb bkorb@veritas.com +Bruce Robertson brucer@theodolite.dyndns.org +Bruno Haible haible@clisp.cons.org +Carl Johnson carlj@cjlinux.home.org +Carl Lowenstein cdl@mpl.UCSD.EDU +Carlos Canau Carlos.Canau@relay.puug.pt +Charles Karney karney@pppl.gov +Charles Randall crandall@matchlogic.com +Chip Salzenberg chip@valinux.com +Chris Faylor cgf@cygnus.com +Chris J. Bednar cjb@AdvancedDataSolutions.com +Chris Lesniewski ctl@mit.edu +Chris Sylvain csylvain@umm.edu +Chris Yeo cyeo@biking.org +Christi Alice Scarborough christi@chiark.greenend.org.uk +Christian Harkort christian.harkort@web.de +Christian Krackowizer ckrackowiz@std.schuler-ag.com +Christian Rose menthos@menthos.com +Christian von Roques roques@pond.sub.org +Chuck Hedrick hedrick@klinzhai.rutgers.edu +Clark Morgan cmorgan@aracnet.com +Clement Wang clem.wang@overture.com +Colin Plumb colin@nyx.net +Colin Watson cjw44@riva.ucam.org +Collin Rogowski collin@rogowski.de +Cray-Cyber Project http://www.cray-cyber.org +Cyril Bouthors cyril@bouthors.org +Dale Scheetz dwarf@polaris.net +Dan Hagerty hag@gnu.ai.it.edu +Dan Jacobson http://www.geocities.com/jidani +Dan Pascu dan@services.iiruc.ro +Daniel Bergstrom noa@melody.se +Dániel Varga danielv@axelero.hu +Danny Levinson danny.levinson@overture.com +Darren Salt ds@youmustbejoking.demon.co.uk +Dave Beckett dajobe@dajobe.org +David Dyck dcd@tc.fluke.COM +David Eisner cradle@umd.edu +David Flynn dav@chess.plus.com +David Godfrey dave@delta.demon.co.uk +David Luyer david_luyer@pacific.net.au +David Malone dwmalone@cnri.dit.ie +Deepak Goel deego@gnufans.org +Dennis Henriksen opus@flamingo.osrl.dk +Dennis Smit ds@nerds-incorporated.org +Derek Clegg dclegg@next.com +Dick Streefland dick_streefland@tasking.com +Dirk Lattermann dlatt@t-online.de +Dirk-Jan Faber djfaber@snow.nl +Dmitry Rutsky rutsky@school.ioffe.rssi.ru +Dmitry V. Levin ldv@altlinux.org +Don Parsons dparsons@synapse.kent.edu +Donni Erpel donald@appc11.gsi.de +Doug Coleman coleman@iarc1.ece.utexas.edu +Doug McLaren dougmc@comco.com +Dragos Harabor dharabor@us.oracle.com +Duncan Roe duncanr@optimation.com.au +Ed Avis ed@membled.com +Edzer Pebesma Edzer.Pebesma@rivm.nl +Eirik Fuller eirik@hackrat.com +Eivind eivindt@multinet.no +Eli Zaretskii eliz@is.elta.co.il +Emile LeBlanc leblanc@math.toronto.edu +Eric Backus ericb@lsid.hp.com +Eric G. Miller egm2@jps.net +Eric Pemente pemente@northpark.edu +Eric S. Raymond esr@snark.thyrsus.com +Erik Bennett bennett@cvo.oneworld.com +Erik Corry erik@kroete2.freinet.de +Felix Lee flee@teleport.com +Ferdinand fw@scenic.mine.nu +Fletcher Mattox fletcher@cs.utexas.edu +Florin Iucha fiucha@hsys.mic.ro +François Pinard pinard@iro.umontreal.ca +Frank Adler fadler@allesklar.de +Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU +Fred Fish fnf@ninemoons.com +Frédéric L. W. Meunier 0@pervalidus.net +Frederik Eaton frederik@caltech.edu +Gabor Z. Papp gzp@gzp.org.hu +Gaël Quéri gqueri@mail.dotcom.fr +Galen Hazelwood galenh@micron.net +Gary Anderson ganderson@clark.net +Gary V. Vaughan gary@gnu.org +Gaute Hvoslef Kvalnes gaute@verdsveven.com +Geoff Collyer geoff at collyer.net +Geoff Kuenning geoff@cs.hmc.edu +Geoff Odhner geoff@franklin.com +Geoff Whale geoffw@cse.unsw.EDU.AU +Gerhard Poul gpoul@gnu.org +Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp +Göran Uddeborg goeran@uddeborg.pp.se +GOTO Masanori gotom@debian.or.jp +Greg Louis glouis@dynamicro.on.ca +Greg McGary gkm@gnu.org +Greg Schafer gschafer@zip.com.au +Greg Troxel gdt@bbn.com +Greg Wooledge gawooledge@sherwin.com +Gregory Leblanc gleblanc@cu-portland.edu +Guido Leenders guido.leenders@invantive.com +H. J. Lu hjl@valinux.com +Hans Ginzel hans@matfyz.cz +Hans Lermen lermen@fgan.de +Hans Verkuil hans@wyst.hobby.nl +Harald Dunkel harald.dunkel@t-online.de +Harry Liu rliu@lek.ugcs.caltech.edu +Harti Brandt brandt@fokus.fraunhofer.de +Helen Faulkner helen_ml_faulkner@yahoo.co.uk +Herbert Xu herbert@gondor.apana.org.au +Holger Berger hberger@ess.nec.de +Hon-Yin Kok hkok@yoda.unl.edu +Hugh Daniel hugh@xanadu.com +Ian Bruce ian.bruce@myrealbox.com +Ian Jackson ijackson@chiark.greenend.org.uk +Ian Lance Taylor ian@cygnus.com +Ian Turner vectro@pipeline.com +Iida Yosiaki iida@gnu.org +Ingo Saitz ingo@debian.org +Ivo Timmermans ivo@debian.org +James james@albion.glarp.com +James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk +James Sneeringer jvs@ocslink.com +James Tanis jtt@soscorp.com +James Youngman james+usenet@free-lunch.demon.co.uk +Jamie Lokier jamie@imbolc.ucc.ie +Jan Fedak J.Fedak@sh.cvut.cz +Jan Nieuwenhuizen janneke@gnu.org +Janos Farkas chexum@shadow.banki.hu +Jarkko Hietaniemi jhi@epsilon.hut.fi +Jean Charles Delepine delepine@u-picardie.fr +Jeff Moore jbm@mordor.com +Jeff Sheinberg jeff@bsrd.net +Jens Elkner elkner@imsgroup.de +Jens Schmidt jms@jsds.hamburg.com +Jerome Abela abela@hsc.fr +Jérôme Zago bug-coreutils-ml@agt-the-walker.net +Jesse Kornblum kornblum@usna.edu +Jesse Thilo jgt2@eecs.lehigh.edu +Jie Xu xuj@iag.net +Jim Blandy jimb@cyclic.com +Jim Dennis jimd@starshine.org +Joakim Rosqvist dvljrt@cs.umu.se +Jochen Hein jochen@jochen.org +Joe Orton joe@manyfish.co.uk +Johan Danielsson joda@pdc.kth.se +John Bley jbb6@acpub.duke.edu +John David Anglin dave.anglin@nrc.ca +John Gatewood Ham zappaman@alphabox.compsci.buu.ac.th +John Gotts jgotts@umich.edu +John Kendall kendall@capps.com +John Kodis kodis@acm.org +John Murphy jam@philabs.research.philips.com +John Roll john@panic.harvard.edu +John Salmon johns@mullet.anu.edu.au +John Summerfield summer@OS2.ami.com.au +Jon Peatfield J.S.Peatfield@damtp.cam.ac.uk +Joost van Baal joostvb@xs4all.nl +Jorge Stolfi stolfi@ic.unicamp.br +Joseph S. Myers jsm28@cam.ac.uk +Juan F. Codagnone juam@arnet.com.ar +Juan M. Guerrero st001906@hrz1.hrz.tu-darmstadt.de +Jungshik Shin jshin@pantheon.yale.edu +Jürgen Fluk louis@dachau.marco.de +Jurriaan thunder7@xs4all.nl +jvogel jvogel@linkny.com +Kai Henningsen kai@debian.org +Kai-Uwe Rommel rommel@informatik.tu-muenchen.de +Kalle Olavi Niemitalo kon@iki.fi +Kamal Paul Nigam Kamal_Paul_Nigam@gs35.sp.cs.cmu.edu +Karl Eichwalder keichwa@gmx.net +Karl Heuer kwzh@gnu.org +Karl-Michael Schneider schneide@phil.uni-passau.de +Karsten Thygesen karthy@kom.auc.dk +Kaveh R. Ghazi ghazi@caip.rutgers.edu +Keith M. Briggs keith.briggs@bt.com +Keith Owens kaos@audio.apana.org.au +Keith Thompson kst@cts.com +Ken Pizzini kenp@halcyon.com +Kristin E Thomas kristint@us.ibm.com +Kjetil Torgrim Homme kjetilho@ifi.uio.no +Kristoffer Rose kris@diku.dk +Larry McVoy lm@sgi.com +Lars Hecking lhecking@nmrc.ucc.ie +Leah Q eequor@earthlink.net +Lehti Rami rammer@cs.tut.fi +Leonard N. Zubkoff lnz@dandelion.com +Leonardo Milano lmilano@udel.edu +Lorne Baker lbaker@nitro.avint.net +Luke Hassell lukehassell@yahoo.com +M. P. Suzuki mpsuzuki@hiroshima-u.ac.jp +Maciej Kwapulinski pikpok@univ.gda.pl +Manas Garg manas@cygsoft.com +Manfred Hollstein manfred@s-direktnet.de +Marc Boucher marc@mbsi.ca +Marc Haber mh+debian-bugs@zugschlus.de +Marc Olzheim marcolz@stack.nl +Marco Franzen Marco.Franzen@Thyron.com +Marcus Brinkmann http://www.marcus-brinkmann.de +Marcus Daniels marcus@ee.pdx.edu +Mark A. Thomas thommark@access.digex.net +Mark Conty Mark_Conty@cargill.com +Mark D. Roth roth@uiuc.edu +Mark Funkenhauser mfunkenhauser@rogers.com +Mark Harris mark@monitor.designacc.com +Mark Hewitt mhewitt@armature.com +Mark Hounschell markh@compro.net +Mark Hubbart discord@mac.com +Mark Kettenis kettenis@phys.uva.nl +Mark Nudelman marknu@flash.net +Mark W. Eichin eichin@cygnus.com +Markus Demleitner msdemlei@auriga.ari.uni-heidelberg.de +Martin martin@dresden.nacamar.de +Martin Buck martin.buck@ascom.ch +Martin Gallant martyg@goodbit.net +Martin Hippe martin.hippe@schlund.de +Martin Michlmayr tbm@cyrius.com +Martin Mitchell martin@debian.org +Martin P.J. Zinser zinser@decus.de +Marty Leisner leisner@sdsp.mc.xerox.com +Masami Takikawa takikawm@CS.ORST.EDU +Mate Wierdl mw@moni.msci.memphis.edu +Matej Vela mvela@public.srce.hr +Matt Kraai kraai@ftbfs.org +Matt Perry matt@primefactor.com +Matt Schalit mschalit@pacbell.net +Matt Swift swift@alum.mit.edu +Matthew Arnison maffew@cat.org.au +Matthew Braun matthew@ans.net +Matthew Clarke Matthew_Clarke@mindlink.bc.ca +Matthew S. Levine mslevine@theory.lcs.mit.edu +Matthew Smith matts@bluesguitar.org +Matthew Swift swift@alum.mit.edu +Matthias Urlichs smurf@noris.de +Matti Aarnio matti.aarnio@zmailer.org +Mattias Wadenstein maswan@acc.umu.se +Meelis Roos mroos@tartu.cyber.ee +Michael michael@aplatform.com +Michael ??? michael@roka.net +Michael Bacarella mbac@netgraft.com> +Michael Deutschmann michael@talamasca.ocis.net +Michael Elizabeth Chastain mec.gnu@mindspring.com +Michael Gaughen mgaughen@polyserve.com +Michael Hasselberg mikelh@zonta.ping.de +Michael Hohn hohn@math.utah.edu +Michael J. Croghan mcroghan@usatoday.com +Michael McFarland sidlon@yahoo.com +Michael Piefel piefel@informatik.hu-berlin.de +Michael Steffens michael.steffens@s.netic.de +Michael Stone mstone@debian.org +Michael Stutz stutz@dsl.org +Michael van Elst mlelstv@dev.de.cw.net +Michael Veksler mveksler@techunix.technion.ac.il +Michail Litvak mci@owl.openwall.com +Michal Politowski mpol@charybda.icm.edu.pl +Michal Svec msvec@suse.cz +Michel Robitaille robitail@IRO.UMontreal.CA +Michiel Bacchiani bacchian@raven.bu.edu +Mike Castle dalgoda@ix.netcom.com +Mike Coleman mkc@mathdogs.com +Mike Jetzer mjetzer@mke.catalystwms.com +Mikko Tuumanen m@sorvankyla.yok.utu.fi +Mikulas Patocka mikulas@artax.karlin.mff.cuni.cz +Miles Bader miles@gnu.ai.mit.edu +Minh Tran-Le tranle@intellicorp.com +Morten Welinder terra@diku.dk +Neal H Walfield neal@cs.uml.edu +Neil Brown neilb@cse.unsw.edu.au +Nelson H. F. Beebe beebe@math.utah.edu +Nick Estes debian@nickstoys.com +Nick Lawes nlawes@silverplatter.com +Niklas Edmundsson nikke@acc.umu.se +Nikola Milutinovic Nikola.Milutinovic@ev.co.yu +Noah Friedman friedman@splode.com +Noel Cragg noel@red-bean.com +Olatunji Oluwabukunmi Ruwase tjruwase@stanford.edu +Olav Morkrid olav@funcom.com +Ole Laursen olau@hardworking.dk +Oliver Kiddle okiddle@yahoo.co.uk +Ørn E. Hansen oehansen@daimi.aau.dk +Oskar Liljeblad osk@hem.passagen.se +Patrick Mauritz oxygene@studentenbude.ath.cx +Paul Eggert eggert@twinsun.com +Paul Jarc prj@po.cwru.edu +Paul Nevai nevai@ops.mps.ohio-state.edu +Paul Sauer paul@alexa.com +Paul Slootman paul@debian.org +Paul Worrall paul@basilisk.uklinux.net +Pawel Prokop pablo@wizard.ae.krakow.pl +Per Cederqvist ceder@lysator.liu.se +Per Kristian Hove perhov@math.ntnu.no +Peter Eriksson peter@ifm.liu.se +Peter Horst peter@ointment.org +Peter Moulder reiter@netspace.net.au +Peter Samuelson psamuels@sampo.creighton.edu +Peter Seebach seebs@taniemarie.solon.com +Petter Reinholdtsen pere@hungry.com +Phelippe Neveu pneveu@pcigeomatics.com +Phil Richards phil.richards@vf.vodafone.co.uk +Philippe De Muyter phdm@macqel.be +Philippe Schnoebelen Philippe.Schnoebelen@imag.fr +Phillip Jones mouse@datastacks.com +Piergiorgio Sartor sartor@sony.de +Piotr Kwapulinski kwap@univ.gda.pl +Prashant TR tr@eth.net +Rainer Orth ro@TechFak.Uni-Bielefeld.DE +Ralf W. Stephan stephan@tmt.de +Ralph Loader loader@maths.ox.ac.uk +Raul Miller moth@magenta.com +Raúl Núñez de Arenas Coronado raul@pleyades.net +Reuben Thomas rrt@sc3d.org +Richard A Downing richard.downing@bcs.org.uk +Richard Braakman dark@xs4all.nl +Richard Dawe rich@phekda.freeserve.co.uk +Richard J. Rauenzahn rrauenza@hairball.cup.hp.com +Richard Neill rn214@hermes.cam.ac.uk +Richard Sharman rsharman@magmacom.com +Rick Sladkey jrs@world.std.com +Rik Faith faith@cs.unc.edu +Risto Kankkunen kankkune@lingsoft.fi +Robert H. de Vries robert@and.nl +Robert Lindgren robert@orcafat.com +Robert Millan zeratul2@wanadoo.es +Rogier Wolff R.E.Wolff@BitWizard.nl +Roland Huebner ro-huebner@gmx.de +Roland Turner raz.tah.bet@raz.cx +Ronald F. Guilmette rfg@netcom.com +Ross Alexander r.alexander@auckland.ac.nz +Ross Paterson rap@doc.ic.ac.uk +Ross Ridge rridge@calum.csclub.uwaterloo.ca +Sami Farin sfarin@ratol.fi +Samuel Tardieu sam@rfc1149.net +Samuli Karkkainen Samuli.Karkkainen@hut.fi +Sander van Malssen svm@kozmix.ow.nl +Santiago Vila Doncel sanvila@unex.es +Savochkin Andrey Vladimirovich saw@msu.ru +Scott Lurndal slurn@griffin.engr.sgi.com +Shing-Shong Shei shei@cs.indiana.edu +Soeren Sonnenburg sonnenburg@informatik.hu-berlin.de +Solar Designer solar@owl.openwall.com +Stanislav Ievlev inger@altlinux.ru +Stéphane Chazelas Stephane_CHAZELAS@yahoo.fr +Stephen Depooter sbdep@myrealbox.com +Stephen Eglen eglen@pcg.wustl.edu +Stephen Gildea gildea@stop.mail-abuse.org +Stephen Smoogen smooge@mindspring.com +Steve McConnel steve@acadcomp.sil.org +Steven G. Johnson stevenj@alum.mit.edu +Steven Mocking ufo@quicknet.nl +Steven P Watson steven@magelico.net +Stuart Kemp skemp@peter.bmc.com +Szakacsits Szabolcs szaka@sienet.hu +Tadayoshi Funaba tadf@kt.rim.or.jp +TAKAI Kousuke takai@vlsi.kuee.kyoto-u.ac.jp +Theodore Ts'o tytso@rsts-11.mit.edu +Thomas Bushnell thomas@gnu.ai.mit.edu +Thomas Goerlich thomas@schnappmatik.de +Thomas Luzat thomas@luzat.com +Thomas Quinot thomas@Cuivre.FR.EU.ORG +Tim J. Robbins tjr@FreeBSD.org +Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu +Tim Smithers mouse@dmouse.com.au +Tim Waugh twaugh@redhat +Toby Peterson toby@opendarwin.org +Todd A. Jacobs tjacobs@codegnome.org +Tom Haynes thomas@netapp.com +Tom Quinn trq@dionysos.thphys.ox.ac.uk +Tommi Kyntola tkyntola@cc.hut.fi +Ton Hospel thospel@mail.dma.be +Ton Nijkes ton@murphy.nl +Tony Kocurko akocurko@mun.ca +Tony Leneis tony@plaza.ds.adp.com +Tony Robinson ajr@eng.cam.ac.uk +Torbjorn Granlund tege@nada.kth.se +Torbjorn Lindgren tl@funcom.no +Torsten Landschoff torsten@pclab.ifg.uni-kiel.de +Ulrich Drepper drepper@gnu.org +Ulrich Hermisson ulrich_hermisson@hotmail.com +Urs Thuermann urs@isnogud.escape.de +Uwe H. Steinfeld usteinfeld@gmx.net +Vesselin Atanasov vesselin@bgnet.bg +Vin Shelton acs@alumni.princeton.edu +Volker Borchert bt@teknon.de +Volker Paul vpaul@dohle.com +Wartan Hachaturow wart@tepkom.ru +Wayne Stewart wstewa@atl.com +Wenjun Zheng zwj@yahoo.com +Werner Almesberger Werner.Almesberger@epfl.ch +Wichert Akkerman wichert@cistron.nl +Will Edgington wedgingt@acm.org +William Bader william@nscs.fast.net +William Dowling will@franklin.com +William Lewis wiml@omnigroup.com +wiregauze wiregauze@yahoo.com +Wojciech Purczynski cliph@isec.pl +Wolfram Kleff kleff@cs.uni-bonn.de +Won-kyu Park wkpark@chem.skku.ac.kr +Yann Dirson dirson@debian.org +Zvi Har'El rl@math.technion.ac.il diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/TODO b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/TODO new file mode 100644 index 0000000..318c411 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/TODO @@ -0,0 +1,203 @@ +restore djgpp, eventually +merge TODO lists +add unit tests for lib/*.c + +strip: add an option to specify the program used to strip binaries. + suggestion from Karl Berry + +doc/coreutils.texi: + Address this comment: FIXME: mv's behavior in this case is system-dependent + Better still: fix the code so it's *not* system-dependent. + +implement --target-directory=DIR for install (per texinfo documentation) + +ls: add --format=FORMAT option that controls how each line is printed. + +cp --no-preserve=X should not attempt to preserve attribute X + reported by Andreas Schwab + +copy.c: Address the FIXME-maybe comment in copy_internal. +And once that's done, add an exclusion so that `cp --link' +no longer incurs the overhead of saving src. dev/ino and dest. filename +in the hash table. + +See if we can be consistent about where --verbose sends its output: + These all send --verbose output to stdout: + head, tail, rm, cp, mv, ln, chmod, chown, chgrp, install, ln + These send it to stderr: + shred mkdir split + readlink is different + +Write an autoconf test to work around build failure in HPUX's 64-bit mode. +See notes in README -- and remove them once there's a work-around. + +Integrate use of sendfile, suggested here: + http://mail.gnu.org/archive/html/bug-fileutils/2003-03/msg00030.html +I don't plan to do that, since a few tests demonstrate no significant benefit. + +Should printf '\0123' print "\n3"? + per report from TAKAI Kousuke on Mar 27 + http://mail.gnu.org/archive/html/bug-coreutils/2003-03/index.html + +printf: consider adapting builtins/printf.def from bash + +df: add `--total' option, suggested here http://bugs.debian.org/186007 + +seq: give better diagnostics for invalid formats: + e.g. no or too many % directives +seq: consider allowing format string to contain no %-directives + +m4: rename all macros that start with AC_ to start with another prefix + +resolve RH report on cp -a forwarded by Tim Waugh + +Martin Michlmayr's patch to provide ls with `--sort directory' option + +tail: don't use xlseek; it *exits*. + Instead, maybe use a macro and return nonzero. + +add mktemp? Suggested by Nelson Beebe + +df: alignment problem of `Used' heading with e.g., -mP + reported by Karl Berry + +tr: support nontrivial equivalence classes, e.g. [=e=] with LC_COLLATE=fr_FR + +fix tail -f to work with named pipes; reported by Ian D. Allen + $ mkfifo j; tail -f j & sleep 1; echo x > j + ./tail: j: file truncated + ./tail: j: cannot seek to offset 0: Illegal seek + +lib/strftime.c: Since %N is the only format that we need but that + glibc's strftime doesn't support, consider using a wrapper that + would expand /%(-_)?\d*N/ to the desired string and then pass the + resulting string to glibc's strftime. + +sort: Compress temporary files when doing large external sort/merges. + This improves performance when you can compress/uncompress faster than + you can read/write, which is common in these days of fast CPUs. + suggestion from Charles Randall on 2001-08-10 + +sort: Add an ordering option -R that causes 'sort' to sort according + to a random permutation of the correct sort order. Also, add an + option --random-seed=SEED that causes 'sort' to use an arbitrary + string SEED to select which permutations to use, in a deterministic + manner: that is, if you sort a permutation of the same input file + with the same --random-seed=SEED option twice, you'll get the same + output. The default SEED is chosen at random, and contains enough + information to ensure that the output permutation is random. + suggestion from Feth AREZKI, Stephan Kasal, and Paul Eggert on 2003-07-17 + +unexpand: [http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.html] + printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodified. + printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n" + +Let GNU su use the `wheel' group if appropriate. + (there are a couple patches, already) + +sort: Investigate better sorting algorithms; see Knuth vol. 3. + + We tried list merge sort, but it was about 50% slower than the + recursive algorithm currently used by sortlines, and it used more + comparisons. We're not sure why this was, as the theory suggests it + should do fewer comparisons, so perhaps this should be revisited. + List merge sort was implemented in the style of Knuth algorithm + 5.2.4L, with the optimization suggested by exercise 5.2.4-22. The + test case was 140,213,394 bytes, 426,4424 lines, text taken from the + GCC 3.3 distribution, sort.c compiled with GCC 2.95.4 and running on + Debian 3.0r1 GNU/Linux, 2.4GHz Pentium 4, single pass with no + temporary files and plenty of RAM. + + Since comparisons seem to be the bottleneck, perhaps the best + algorithm to try next should be merge insertion. See Knuth section + 5.3.1, who credits Lester Ford, Jr. and Selmer Johnson, American + Mathematical Monthly 66 (1959), 387-389. + +cp --recursive: perform dir traversals in source and dest hierarchy rather + than forming full file names. The latter (current) approach fails + unnecessarily when the names become very long. + +tail --p is now ambiguous + +Remove suspicious uses of alloca (ones that may allocate more than + about 4k) + +Adapt these contribution guidelines for coreutils: + http://sources.redhat.com/automake/contribute.html + + +Changes expected to go in, post-5.2.1: +====================================== + + wc: add an option, --files0-from [as for du] to make it read NUL-delimited + file name arguments from a file. + + dd patch from Olivier Delhomme + + Apply Andreas Gruenbacher's ACL and xattr changes + + Apply Bruno Haible's hostname changes + + test/mv/*: clean up $other_partition_tmpdir in all cases + + ls: when both -l and --dereference-command-line-symlink-to-dir are + specified, consider whether to let the latter select whether to + dereference command line symlinks to directories. Since -l has + an implicit --NO-dereference-command-line-symlink-to-dir meaning. + Pointed out by Karl Berry. + + A more efficient version of factor, and possibly one that + accepts inputs of size 2^64 and larger. + + Re-add a separate test for du's stack space usage (like the one removed + from tests/rm/deep-1). + + dd: consider adding an option to suppress `bytes/block read/written' + output to stderr. Suggested here: + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165045 + + Pending copyright papers: + ------------------------ + ls --color: Ed Avis' patch to suppress escape sequences for + non-highlighted files + + getpwnam from Bruce Korb + + pb (progress bar) from Miika Pekkarinen + + Look into improving the performance of md5sum. + `openssl md5' is consistently about 30% faster than md5sum on an idle + AMD 2000-XP system with plenty of RAM and a 261 MB input file. + openssl's md5 implementation is in assembly, generated by a perl script. + +Have euidaccess.m4 check for eaccess as well as euidaccess +If found, then do `#define euidaccess eaccess'. + +Remove long-deprecated options like -V for version-control and + tail's --allow-missing + +Add a distcheck-time test to ensure that every distributed +file is either read-only(indicating generated) or is +version-controlled and up to date. + +Implement Ulrich Drepper's suggestion to use getgrouplist rather + than getugroups. This affects only `id', but makes a big difference + on systems with many users and/or groups, and makes id usable once + again on systems where access restrictions make getugroups fail. + But first we'll need a run-test (either in an autoconf macro or at + run time) to avoid the segfault bug in libc-2.3.2's getgrouplist. + In that case, we'd revert to using a new (to-be-written) getgrouplist + module that does most of what `id' already does. + +remove `%s' notation: + grep -E "\`%.{,4}s'" src/*.c + +remove.c should never exit, yet may do so (see uses of EXIT_FAILURE) + +remove or adjust chown's --changes option, since it + can't always do what it currently says it does. + +Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be + multibyte aware. The problem is that I want to avoid duplicating + significant blocks of logic, yet I also want to incur only minimal + (preferably `no') cost when operating in single-byte mode. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/config/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/config/ChangeLog new file mode 100644 index 0000000..b5bc0b7 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/config/ChangeLog @@ -0,0 +1,94 @@ +2004-12-17 Jim Meyering + + * install-sh: Sync from gnulib. + +2004-12-16 Paul Eggert + + * mdate-sh: Sync from gnulib. + +2004-11-23 Paul Eggert + + * config.sub, texinfo.tex: Sync from gnulib. + +2004-11-17 Paul Eggert + + * config.guess, config.sub: Sync from gnulib. + +2004-11-10 Paul Eggert + + * texinfo.tex: Sync from gnulib. + +2004-11-02 Paul Eggert + + * texinfo.tex: Sync from gnulib. + +2004-10-29 Paul Eggert + + * config.guess, install-sh, texinfo.tex: Sync from gnulib. + +2004-10-03 Paul Eggert + + * config.guess, config.sub, install-sh, missing, texinfo.tex: + Sync from gnulib. + +2004-09-24 Jim Meyering + + * cvsu: Remove file. The version of cvsu from the cvsutils package + does the same job with --find --type=... options. + * cvsu: New file, used by rules in coreutils' Makefile.maint. + +2004-08-05 Paul Eggert + + * config.guess, config.sub, install-sh, texinfo.tex: Sync from gnulib. + +2004-03-30 Paul Eggert + + * config.guess, config.sub, install-sh, texinfo.tex: Sync from gnulib. + +2003-08-16 Paul Eggert + + * config.rpath, texinfo.tex: Sync with gnulib. + +2003-04-21 Jim Meyering + + * depcomp: New version, now that this file is on the list + in ../Makefile.cfg. + +2003-01-12 Jim Meyering + + Lots of syntactic clean-up, mostly from Karl Berry. + * install-sh: Use consistent indentation, two spaces per level. + (scriptversion): New variable. + Change initializations like `variable=""' to `variable='. + (usage): New variable. + Use `test', not `['. + Use `test -z "$var"', not `[ x"$var" = x ]'. + Use `test -n "$var"', not `[ x"$var" != x ]'. + Alphabetize case entries. + Accept --help and --version options. + Remove unnecessary `else :' clauses. + Add a `Local variables' eval block to help emacs users update + the time-stamp variable added above. + +2002-12-20 Jim Meyering + + * install-sh: Set the execute bit on this file. + Reported by Vin Shelton. + +2002-11-09 Jim Meyering + + Make it work even when names contain spaces or shell metachars. + * install-sh: Write diagnostics to stderr, not stdout. + Normalize spacing in diagnostics: use one space (not two, and not a TAB) + after the leading `install:'. + Add double quotes around `$src' here: $doit $instcmd "$src" "$dsttmp" + + Merge in some changes from the version in automake. + * install-sh: Remove unnecessary quotes around `case' argument. + Use `[ cond1 ] || [ cond2 ]' rather than `[ cond1 -o cond2 ]'. + Use `:' rather than `true'. + +2002-02-17 Jim Meyering + + * config.guess (main): Don't use `head -1'; it's no longer portable. + Use `sed 1q' instead. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/ChangeLog new file mode 100644 index 0000000..9cf6bf9 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/ChangeLog @@ -0,0 +1,1219 @@ +2005-01-07 Jim Meyering + + * coreutils.texi (sort invocation): Specify that a string + of zero digits is interpreted as 0. Reported by Ulrich Hermisson. + +2005-01-04 Jim Meyering + + * coreutils.texi (shred invocation): Clarify that shred works fine + with journaled file systems that are configured not to journal + file system data. Also mention BFS and NTFS. + +2004-12-15 Paul Eggert + + * coreutils.texi (ls invocation): Change minor problem to be + "subdirectory not found", since top-level trouble is now serious. + (dircolors invocation): Quote argument to eval. Problem reported + by Stephane Chazelas. + +2004-12-11 Paul Eggert + + * coreutils.texi (join invocation): Mention that blank separators + in the -o option need to be quoted. Problem reported by Phil Clayton. + +2004-12-10 Paul Eggert + + * coreutils.texi (id invocation): -G also prints main group. + Problem reported by Tim Waugh. + +2004-12-09 Paul Eggert + + * coreutils.texi (ls invocation): Document new "ls" exit status. + +2004-12-08 Paul Eggert + + * getdate.texi (Time of day items, Time zone items): + Describe new formats +00:00, UTC+00:00. + +2004-12-04 Jim Meyering + + * coreutils.texi (cut invocation): Say when --complement is useful. + +2004-10-01 Paolo Bonzini + + * coreutils.texi (cut invocation): Document --complement and + adjust the documentation of -b, -c, -f. + +2004-11-27 Paul Eggert + + * coreutils.texi (du invocation): Use if=/dev/null rather + than :|. Problem reported by Dan Jacobson. + Use "seek=2GiB" rather than the wordier "seek=`echo '2^31'|bc`". + Say "KiB" not the (inaccurate) "kilobytes". + Similarly for "GiB" and "gigabytes". + +2004-11-16 Paul Eggert + + * coreutils.texi: Changes inspired by Debian coreutils 5.2.1-2. + (General output formatting): -x doesn't have an operand. + (Formatting the file names): Warn that even with -N unprintable + chars are still printed as '?' some times. + (rm invocation): Reword rm -d to note that it's sometimes useful + on non-directories. + (logname invocation, users invocation, who invocation): + The utmp and wtmp file names vary from system to system. + + * getdate.texi (General date syntax): "next" is 1, not 2. + Document that "second" isn't allowed as an ordinal number. + +2004-11-15 Paul Eggert + + * coreutils.texi (dd invocation): Reword the new dd message. + +2004-11-14 Paul Eggert + + * coreutils.texi (dd invocation): dd now outputs total bytes, + seconds, and bytes per second. + +2004-11-03 Paul Eggert + + * Makefile.am (_W, W_): New macros. + (check-texinfo): Use them instead of assuming grep -w (which is not + portable). + +2004-10-29 Paul Eggert + + * coreutils.texi: Document TZ better, and adjust to new getdate.texi. + (Top): Update menu. + (pr invocation, Formatting file timestamps, touch invocation, + stat invocation, who invocation, date invocation, Options for date): + Mention TZ. + * getdate.texi: Sync from gnulib. + +2004-10-28 Paul Eggert + + * coreutils.texi (Standards conformance): Use "head -10" rather + than "head -1" as example of obsolete usage, since the POSIX + consensus is that "head -1" could be supported even if we don't + yet have clear consensus on "head -10". See today's revision to + the SUS FAQ + . + +2004-10-24 Paul Eggert + + * coreutils.texi (pathchk invocation): Options must precede operands. + +2004-10-17 Paul Eggert + + * coreutils.texi (pathchk invocation): Overall lengths are + OS limits, not file system limits. Component length checks + apply to all components, not merely to existing ones. Say + that nonexistent names are not errors. For -p, omit all + checks based on the underlying file system, not merely length + checks. Explain what the portable file name character set is. + +2004-10-15 Paul Eggert + + * coreutils.texi (printf invocation): Mention ISO/IEC 10646 as + well as Unicode. Various minor formatting cleanups. + +2004-10-13 Paul Eggert + + * coreutils.texi (sort invocation): Move LC_ALL, LC_COLLATE + index entries to proper paragraph. + +2004-10-12 Jim Meyering + + * Makefile.am (check-texinfo): Add `builtin' and `builtins' to + the list of words to avoid. + +2004-10-11 Paul Eggert + + * coreutils.texi (Special built-in utilities): New node. + (printf invocation): builtin -> built-in, for consistency + with POSIX terminology. + (test invocation, pwd invocation): + Use specific rather than generic language to warn about + built-in commands. + (chroot invocation, env invocation, nice invocation, nohup invocation): + Warn that command must not be a special built-in. + (env invocation): Warn about environment variables with unusual + spellings, or duplicates. + +2004-09-26 Paul Eggert + + * coreutils.texi (ls invocation): Document "ls --hide". + +2004-09-24 Paul Eggert + + * coreutils.texi (chmod invocation): Warn about "chmod -w file". + +2004-09-23 Paul Eggert + + * coreutils.texi (tail invocation): Fix bugs in the description of + the obsolete syntax (e.g., it does not support -k or -m). Warn + about usages like "tail -" and "tail -c 4" that are ambigous on + older systems. + +2004-09-20 Paul Eggert + + * coreutils.texi (mv invocation, rm invocation): Say "the response + is affirmative" rather than "the response begins with y or Y", + so that the documentation is accurate in non-English locales. + Problem reported by Munzir Taha. + +2004-09-18 Paul Eggert + + * coreutils.texi (dd invocation): Distinguish between options + (e.g., --help) and operands (e.g., if=file). Move miscellaneous + stuff after the operand descriptions, for clarity. + +2004-09-09 Paul Eggert + + * coreutils.texi (sort invocation): -u disables the last-resort + comparison, too. Revamp its description. + (test invocation): Document -r, -w, -x more carefully. + +2004-09-08 Paul Eggert + + * coreutils.texi (Common options): Some programs don't reorder + options. + (tr invocation, echo invocation, printf invocation, test invocation, + expr invocation, basename invocation, chroot invocation, + nice invocation, nohup invocation, seq invocation): + This program doesn't reorder options. + (tr invocation): Mention --help, --version, --. + (echo invocation): Mention that -- isn't special. + (test invocation): Mention that the expression is optional, + and that test ! EXPR is like ! test EXPR. + Mention that -h and -L don't dereference symlinks. + (expr invocation): Mention --help, --version. + + * coreutils.texi (sort invocation): Add remarks about sort -u + versus sort | uniq. Prompted by a question from Andrew Noymer. + +2004-09-06 Paul Eggert + + * coreutils.texi (od invocation): Several changes for POSIX + and FreeBSD compatibility. Add support for XSI syntax + (POSIX 1003.1-2004). Rename -s[N] to -S N. Remove documentation + for -h. -i is now -t dI (not d2) and -l is now -t dL (not d4). + +2004-09-05 Paul Eggert + + * coreutils.texi (String tests): Improve quality of warning about + quoting strings for the shell. + +2004-09-03 Paul Eggert + + * coreutils.texi (dd invocation): Specify which conversion options + are mutually exclusive. Give a bit more detail about ascii, + ebcdic, and ibm conversions. + +2004-08-24 Paul Eggert + + POSIX-conformance fixes for "expand" and "unexpand". + * coreutils.texi: Standardize on "tab stop" (the POSIX usage) + rather than "tabstop". + (unexpand invocation): Use "blank" rather than "space" when + POSIX requires "blank". Define "blank". Initial blanks are + converted even if there's just one. For -a, convert two or + more blanks only if they occur just before a tab stop. + +2004-08-19 Paul Eggert + + * coreutils.texi (chown invocation): Fix synopsis: + group must always be preceded by separator. + "chown : file" and "chown '' file" don't change the owner or group. + Update the explanation of what happens to the set-user-ID or + set-group-ID bits, e.g., they sometimes are not cleared if they + denote mandatory locking. Change "find"-oriented examples to use + chown -h. + +2004-08-18 Paul Eggert + + * coreutils.texi (printf invocation): Clarify how "printf" is + supposed to work with extra arguments, missing arguments, etc. + +2004-08-10 Paul Eggert + + POSIX-conformance fixes for "-" used as an operand. + * coreutils.texi (Common options): Clarify that "-" means + stdin/stdout only when it is an operand, not when it is an + option-argument. + (shred invocation): "shred -- -" is equivalent to "shred -", + not to "shred ./-". + (tee invocation): "tee -" means to copy (again) to stdout. + +2004-07-25 Paul Eggert + + * coreutils.texi (nice invocation): Document the "nice value", and + how it affects the scheduling priority. (The old documentation + implied that the nice value equaled the scheduling priority, which + isn't accurate.) Document that the range of nice values might + exceed -20..19. Specify what happens when you give a nice value + that is out of range, or when you don't have permissions to lower + the nice value. Bash doesn't have a builtin 'nice', so don't say + "most shells" have one. + +2004-04-03 Dmitry V. Levin + + * coreutils.texi (readlink invocation): Document new + "readlink -f" behaviour and new canonicalize options, -e and -m. + +2004-07-02 Jim Meyering + + * Makefile.am (check-texinfo): Disallow `filename' in .texi files. + Spell it like `file name' instead, to be consistent. + Fail if a @footnote directive follows non-punctuation. + Fail upon use of @url. Use @uref instead. + +2004-07-01 Paul Eggert + + * coreutils.texi (Common options, Target directory, cp invocation, + install invocation, mv invocation, ln invocation): Add -t as a + short option for --target-directory, and -T as a short option for + --no-target-directory. Clean up relevant synopses a bit, so that + the language is similar for all. + +2004-06-30 Paul Eggert + + * coreutils.texi: Put the right amount of space at sentence ends. + Make sure "i.e." and "e.g." are followed by commas (the GNU style). + Put blank lines before and after every @example, prefer the + previous line to end in ":" (when not a sentence end, for consistency), + and prepend @noindent to the following line when appropriate. + In examples, use "--" arguments when needed to prevent undesired + interpretation of operands as options. + Use "file name" rather than "filename", as per the GNU coding standards. + Remove unwanted spaces before @footnote. + Use "---" when appropriate, instead of " -- ". + Use "name" (or something like that) rather than "path" or "pathname", + since the GNU coding standards don't allow "path". + Use @acronym, @command, @minus{}, @samp in a few places, + where appropriate. + (Target directory): Clarify description of example. + (fmt invocation): Give issue number for reference, and reword + for clarity. + (sort invocation): Note that xargs without -0 also mishandles + file names containing some special characters other than newline. + (Translating): Mention that \012 is not universally portable. + Use '\0' rather than '\000'. + (Squeezing): bourne -> Bourne. + Fix unportable usage of '\n' by replacing it with '[\n*]'. + (More details about version sort): Remove unnecessary indent + in examples. + (dd invocation): Use 'kill -s USR1', not 'kill -USR1', as POSIX + indicates that the former is more portable (the latter is an XSI + extension). + (shred invocation): Use @uref rather than @url, and use a more-typical + style for the date. + (kill invocation): Clarify usage; for example, "kill -s TERM -1" + isn't allowed. + (seq invocation): Reword to avoid implying that printf necessarily + fails for numbers outside the 32-bit range. Prefer separating + options from their operands. + (Opening the software toolbox): Give an online reference to + Robbins's article, and give a date. Don't imply that the + current documentation is unchanged from his article. + (Putting the tools together): Rework examples so that they don't + assume the C locale; nowadays many users now operate outside the C + locale by default. While we're at it, don't assume ASCII either. + Indent example to match actual output from GNU uniq. Remove some + unnecessary and confusing brackets from 'tr' operands. "Software + Tools in Pascal" is back in print, according to Amazon anyway. + Add references to Kernighan's online copies of examples. + +2004-06-30 Paul Eggert + + * coreutils.texi, perm.texi: Standardize on "file system" rather + than "filesystem", as POSIX prefers it with a space. + +2004-06-29 Paul Eggert + + * coreutils.texi (Common options, Target directory, cp + invocation, install invocation, mv invocation, ln invocation): + Likewise. + (link invocation): Explain how to rewrite link using ln now + that we have --no-target-directory. + (ln invocation): Explain that --no-target-directory subsumes + --no-dereference. + (unlink invocation): Modify wording to match new wording in + link invocation. + +2004-06-25 Paul Eggert + + * coreutils.texi (install invocation): Document + --target-directory in synopsis, too. + +2004-06-15 Paul Eggert + + * coreutils.texi (yes invocation): "--" is now supported. + (false invocation, true invocation): --help and --version now + work unconditionally. + +2004-06-07 Jim Meyering + + * coreutils.texi: Remove menu references to just-removed subsection. + +2004-06-06 Jim Meyering + + * coreutils.texi (tr invocation): Remove the section describing + how POSIXLY_CORRECT changes tr's behavior. + +2004-06-02 Jim Meyering + + * coreutils.texi (cut invocation): Clarify what --output-delimiter=STR + does with byte/character ranges. + +2004-06-01 Paul Eggert + + * coreutils.texi (tr invocation): Mention -C. + +2004-05-13 Paul Eggert + + * coreutils.texi (echo invocation): Document today's changes. + +2004-05-17 Jim Meyering + + chgrp and chown now dereference symlinks by default, per POSIX. + * coreutils.texi (chgrp invocation, chown invocation): Document it. + +2004-05-13 Paul Eggert + + * coreutils.texi (sort invocation): Document that "sort -m -o F" + might write F before reading all the input. + +2004-05-09 Jim Meyering + + * coreutils.texi (stat invocation): Change IO to I/O. + * Makefile.am (check-texinfo): Check for the above. + +2004-04-25 Paul Eggert + + * coreutils.texi (sort invocation): Mention -k earlier, so + that the options are in alphabetical order. Describe how -b works + more-accurately; this involves fixing some examples, too. Mention + what happens if the start field falls after an end field or after + a line end. Warn about using -k without -b, -g, -M, -n, or -t. + Add an example of how to sort IPv4 addresses and Apache Common + Log Format dates. Remove a duplicate example. + (Putting the tools together): Use separate options rather + than agglomerating them. + +2004-03-27 Paul Eggert + + cp -pu and mv -u (when copying) now take the destination + file system time stamp resolution into account. + + * coreutils.texi (mv invocation): Document this. + (cp invocation): Document -u (it was missing!) with new behavior. + +2004-04-08 Paul Eggert + + * coreutils.texi (dd invocation): Remove noctty flag from dd. + +2004-04-07 Paul Eggert + + New dd conv= symbols nocreat, excl, fdatasync, fsync, + and new dd options iflag= and oflag=. + + * coreutils.texi (dd invocation): Document them. + +2004-04-07 Jim Meyering + + * coreutils.texi (stty invocation - Input): Document new iutf8 option. + +2004-04-04 Jim Meyering + + * coreutils.texi (stat invocation): Correct --format description. + +2004-02-25 Paul Eggert + + * coreutils.texi (Block size): Document new envvar BLOCKSIZE. + +2004-03-24 Jim Meyering + + * Makefile.am (check-texinfo): Add a check to ensure future + consistency in using @sc{nul}, not `NUL'. + +2004-03-23 Paul Eggert + + * coreutils.texi: Use @sc{nul} consistently for NUL. + (du invocation): FILE0 -> FILE. + +2004-03-23 Jim Meyering + + * coreutils.texi (du invocation): --files0-from is useful with + --total (-c), not with --summarize. + +2004-03-22 Jim Meyering + + * coreutils.texi: Tweak a few lines that resulted in + `overfull hbox' warnings. + +2004-03-03 Jim Meyering + + * coreutils.texi (du invocation): Document new option: --file0-from=F. + +2004-02-29 Paul Eggert + + * coreutils.texi (touch invocation): + Describe use of fractional seconds. + (date invocation, Options for date): Likewise. + * getdate.texi (General date syntax, Time of day items): Likewise. + * coreutils.texi (date invocation): Mention effect of LC_TIME. + (Options for date): Describe new --iso-8601=ns option. + + * getdate.texi: Add copyright notice. Change getdate to + get_date when talking about the function name. + (Seconds since the Epoch): New section, containing the time_t + info moved from Date input formats section, along with new + info about the @ syntax. Mention negative time stamps, + fractional time stamps, and leap seconds. + (General date syntax): Modernize examples a bit to reflect new + features. + (General date syntax, Relative items in date strings): + Use ' rather than " to quote formats. + (Time of day items): Add an example with fractional seconds. + Describe fractional-second syntax. + +2004-03-15 Jim Meyering + + * coreutils.texi (date invocation): Add missing `C' to %[...] range + in the `Date directives:: ...' menu entry. From Bob Proulx. + + * coreutils.texi: Add FIXME comment: + The following don't have `invocation' nodes: [, pinky, shasum, uptime. + +2004-03-10 Jim Meyering + + * coreutils.texi (Sorting the output): Remove description of + ls's --sort=directory option. ls doesn't accept that option, yet. + Reported by Arvind Autar. + + * coreutils.texi (cp invocation): Improve description of + cp's --sparse=WHEN option. + + * coreutils.texi (nl invocation): Specify that these are _basic_ + regular expressions (BRE), and add a link to grep's documentation. + Suggestion from Dan Jacobson. + +2004-02-23 Paul Eggert + + * coreutils.texi (chown invocation): Document that chown now falls + back on USER.GROUP parsing regardless of POSIX version, as POSIX + 1003.1-2001 allows that behavior as a compatible extension. + +2004-02-22 Jim Meyering + + * coreutils.texi (du invocation): Mention that using du's -H option + currently evokes a warning. + +2004-02-15 Paul Eggert + + * coreutils.texi (expr invocation): + Document what forms integers may take, and say "integer" + consistently instead of "number". Warn about operands + that "expr" can misinterpret, and how to work around the + problem. + +2004-02-17 Jim Meyering + + * coreutils.texi (csplit invocation): Correct typo (s/LINE/N/) + in description of `N' pattern. From Reuben Thomas + +2004-02-11 Jim Meyering + + * coreutils.texi (Time directives): The %s value *is* changed by the + --date=DATE option; don't say otherwise. Patch from Padraig Brady. + +2004-02-10 Paul Eggert + + * coreutils.texi (Formatting the file names): + Improve wording for --quoting-style documentation. + Suggestions by Bruno Haible. + +2004-02-02 Jim Meyering + + * coreutils.texi (nice invocation): Add examples. + Prompted by a suggestion from Dan Jacobson. + (factor invocation): Add an example. + Update timing numbers for a more modern CPU. + +2004-01-27 Jim Meyering + + * coreutils.texi (seq invocation): Remove `@dots{}' at end of synopsis. + Separate `Synopses' section into three examples. + Clarify first paragraph. @w{}-protect an expression.1 + Use @option{--option}, rather than @code{--option}. + +2004-01-19 Paul Eggert + + * coreutils.texi (Exit status): Document that ordinary failure + might not exit with status 1 on unusual platforms. + Mention chroot, env, nice, and su as having unusual exit + status patterns. Don't bother to mention true and false + since their exit status patterns are actually normal. + (sort invocation, su invocation): Mention its unusual exit + status pattern. + (chroot invocation): Simplify description of exit status 1. + Remove duplicate description of status 127. + (env invocation): Use consistent tenses; simplifiy description + of status 1. + (nice invocation): Likewise. + +2003-12-15 Paul Eggert + + * coreutils.texi (touch invocation): touch -r and -d can now + both be specified, with -r specifying the origin for -d. + +2004-01-15 Alfred M. Szmidt + + Factor out some common options. + * coreutils.texi (Common options): Define macros here. + (What information is listed, cp invocation): Use the macro(s). + (install invocation, mv invocation, ln invocation): Likewise. + (df invocation, du invocation): Likewise. + +2004-01-09 Jim Meyering + + Document the exit status of each and every program. + * coreutils.texi (yes invocation): Document that a write error + makes `yes' exit unsuccessfully. + (chroot invocation): Enumerate the meaning of exit status values. + (nice invocation): Likewise. + (Exit status) [@macro exitstatus]: New macro. + Use @exitstatus to describe the exit status of most programs. + +2004-01-02 Jim Meyering + + * coreutils.texi (du invocation): Mention that -H will eventually + mean not --si, but --dereference-args (-D). + +2003-12-20 Jim Meyering + + * coreutils.texi (du invocation): Describe new option: -0, --null. + +2003-12-03 Paul Eggert + + * coreutils.texi (What information is listed, chroot invocation): + Adjust example 'ls' output to match new behavior with narrower + output columns. + (The cut command): Remove example that cut the output of + 'ls -l'. The output was incorrect even with the old 'ls', and + the whole idea of using 'cut' on 'ls -l' output is bogus anyway. + +2003-11-24 Paul Eggert + + Parse floating-point operands and options in the C locale. + POSIX requires this for printf, and we might as well be + consistent elsewhere (tail, sleep, seq). + + * coreutils.texi (tail invocation, printf invocation, + sleep invocation, seq invocation): Document this. + +2003-11-24 Jim Meyering + + * coreutils.texi (Traversing symlinks, Treating / specially): + New sections. + (rm invocation, chown invocation, chmod invocation, chgrp invocation): + Describe new options, --preserve-root and --no-preserve-root. + +2003-11-11 Jim Meyering + + * coreutils.texi (chown invocation) [chownchgrpoptions]: New macro + describing -H, -L, -P options. Use it here. + (chgrp invocation): And here. + +2003-11-09 Jim Meyering + + * coreutils.texi (dd invocation): Fix typo in example. + +2003-10-15 Jim Meyering + + * coreutils.texi (ln invocation): Note that --directory, -d, -F + probably won't work even for superuser. Suggestion from Dan Jacobson. + +2003-09-29 Paul Eggert + + * coreutils.texi (csplit invocation): + The regexp offset need not have a sign; POSIX requires support + for signless offets. + +2003-10-03 Jim Meyering + + * coreutils.texi (du invocation): Describe -P, --no-dereference. + +2003-09-28 Jim Meyering + + * coreutils.texi (Translating): Correct typo in menu description. + From A Costa. + +2003-09-02 Paul Eggert + + * coreutils.texi (sort invocation): -d now overrides -i. + "whitespace" -> "blanks"; "whitespace" isn't correct. + -t '\0' now specifies a NUL tab. + +2003-08-17 Jim Meyering + + * coreutils.texi (who invocation): Add an entry for -l, --login. + Remove `-l' from the entry for --lookup. + (who invocation): Begin adding missing option documentation. + +2003-08-07 Paul Eggert + + * coreutils.texi (split invocation): + Add -d or --numeric-suffixes option to 'split'. + +2003-07-31 Paul Eggert + + * getdate.texi (General date syntax): Add --rfc-2822 option to GNU date. + * coreutils.texi (Options for date): Fix a typo in format: + it's now %d not %_d. Add URLs. + +2003-07-31 Paul Eggert + + * getdate.texi (Relative items in date strings): Warn about + fuzz in relative units. + +2003-07-29 Jim Meyering + + * coreutils.texi (tail invocation): Restore two end-of-sentence words + that were mistakenly removed on 2002-09-13. Reported by Paul Worrall. + +2003-07-28 Jim Meyering + + * coreutils.texi (dd invocation): Explain that a SIGUSR1 signal + makes dd give a progress report to stderr. + +2003-07-24 Paul Eggert + + * coreutils.texi: Document changes of 2003-07-24. + +2003-07-24 Jim Meyering + + * coreutils.texi (su invocation): Use `@subsection', not invalid + `@heading'. + +2003-07-17 Paul Eggert + + * coreutils.texi (expr invocation): Exit status is 2 if the + expression is syntactically invalid, 3 if there is some other error. + This change is for conformance to POSIX. + +2003-07-14 Paul Eggert + + * coreutils.texi (uname invocation): Explain the POSIX + terminology behind uname -m and uname -s. + +2003-07-13 Jim Meyering + + * coreutils.texi (chown invocation): Warn that chown + now clears set-user-ID and set-group-ID bits on some systems. + From Bob Proulx. + (nohup invocation): Tell what happens when stdout is not a terminal. + Based on a suggestion from Steven Mocking. + +2003-07-10 Jim Meyering + + * coreutils.texi (Standards conformance): Mention that uses like + `tail -1' and `head -1', like `sort +1', are non conforming. + (chown invocation): Say that using `.' as a separator may not work. + +2003-06-25 Jim Meyering + + * coreutils.texi (Time directives) [%s]: Add a cross reference + to the related examples. + (Examples of date): Add an @anchor here, along with a few more examples. + Suggestion from Dan Jacobson. + +2003-06-12 Jim Meyering + + * coreutils.texi (wc invocation): Tweak wording: wc prints counts in + the order `newline, word, byte'. Suggestion from Keith M. Briggs. + Also change `lines' to `newlines'. + +2003-05-14 Jim Meyering + + * coreutils.texi (head invocation): Document --bytes=-N and --lines=-N. + +2003-05-13 Paul Eggert + + * coreutils.texi (uniq invocation, squeezing, The uniq command): + Use "repeated" rather than "duplicate" to describe adjacent + duplicates; this simplifies the description and makes it more + consistent with POSIX. + (uniq invocation): Make it clear that -d and -u suppress the + output of lines, rather than cause some lines to be output. + Mention what happens if a line lacks enough fields or characters. + +2003-05-13 Jim Meyering + + * coreutils.texi (true invocation): Mention that it is possible to + make true --help or true --version (in non-POSIX mode) exit nonzero. + Suggestion from Paul Eggert. + +2003-05-10 Jim Meyering + + * coreutils.texi (Exit status): Remove `uniq' from the list. + It uses standard exit codes. + (More details about version sort): Note that strverscmp, and hence + `ls -v', does not use LC_COLLATE. Reported by From: Andrey Borzenkov. + +2003-04-21 Jim Meyering + + Fix printf POSIX compatibility bug reported by Ben Harris in + . + * coreutils.texi (printf invocation): It's \NNN in the format, + \0NNN in the %b operand. + +2003-04-10 Jim Meyering + + * Makefile.am (check-texinfo): Check for uses of non-zero. + I prefer to spell it `nonzero'. + + * coreutils.texi (readlink invocation): Tweak description a little. + +2003-04-04 Jim Meyering + + * Makefile.am (constants.texi): Rename target (thus enabling it), + now that fileutils, textutils, and sh-utils have been merged. + (MAINTAINERCLEANFILES): Define. + +2003-04-02 Jim Meyering + + * coreutils.texi (false invocation): Note that false exits + unsuccessfully even with --help and --version. + + * Makefile.am (check-texinfo): Don't fail if perl is missing. + Reported by Nelson Beebe. + +2003-03-27 Jim Meyering + + * coreutils.texi (printf invocation): Fix formatting bugs. + From Paul Eggert. + (sort invocation): Describe sort's --stable (-s) option. + +2003-03-13 Jim Meyering + + * coreutils.texi (shred invocation): Mention that --exact + is now the default for non-regular files. + +2003-03-02 Jim Meyering + + * coreutils.texi (Exit status): New section. + Suggestion from Michael Stone. + +2003-02-21 Jim Meyering + + * coreutils.texi (du invocation): Document --apparent-size. + Adjust documentation of --bytes (-b). + (stat invocation): Describe %B. + +2003-02-07 Richard Dawe + + * coreutils.texi: Use @command instead of @code for program names. + + * perm.texi (Mode Structure): Mention filesystem-specific + permissions and that mounting a filesystem as read-only may + override actual file permissions. Use @command instead + of @code for program names. + +2003-02-06 Jim Meyering + + * coreutils.texi: Adjust alignment and mention `file, text, shell' + on the `* Coreutils:...' dirently line. From Karl Berry. + +2003-02-05 Jim Meyering + + * Makefile.am (check-texinfo): Allow bare `POSIX' to be used on + direntry lines. + + * coreutils.texi: Use new form of @direntry. + Put unlink in its proper place. Adjust wording in some + dir entry descriptions, mainly so they fit in 80 columns. + Don't use mark-up like @acronym{POSIX} in direntries. + Mostly from Karl Berry. + +2003-01-25 Jim Meyering + + * coreutils.texi (cut invocation): Describe new functionality of + --output-delimiter=STR. + +2003-01-24 Jim Meyering + + * coreutils.texi (The cut command): Give an example of using cut -c + with an output delimiter. From Jan Nieuwenhuizen. + + * coreutils.texi (The cut command): Extend the new example a little. + (Formatting file timestamps): Fix typo: s/%M:S/%M:%S/. + + * coreutils.texi: Change each use of `Core-utils' to `Coreutils'. + From Karl Berry. + +2003-01-19 Jim Meyering + + * coreutils.texi (Which files are listed): Document new option: + --dereference-command-line-symlink-to-dir. + +2003-01-15 Paul Eggert + + Change ls -H back to the way it was yesterday, since this is + compatible with FreeBSD and the POSIX spec is confusing + and somewhat contradictory. + + * coreutils.texi (Which files are listed, General output + formatting): Undo last change. + +2003-01-15 Jim Meyering + + * coreutils.texi (General output formatting): Reflect option name change: + s/--dereference-command-line/--dereference-command-line-symlink-to-dir/. + Say that this option changes how ls treats only symlinks to directories + specified on the command line. + +2002-08-27 Dmitry V. Levin + + * coreutils.texi: Document readlink. + +2002-12-14 Jim Meyering + + * coreutils.texi (mknod invocation): Specify how major and minor mode + numbers are interpreted. Report forwarded by Kristin E Thomas. + +2002-11-13 Jim Meyering + + * coreutils.texi (Examples of expr): Remove bogus `^'s. + Reported by Thomas Goerlich. + +2002-11-09 Jim Meyering + + * coreutils.texi (What information is listed) [--dired]: + Correct parts of --dired description. Reported by Andre Spiegel. + Include a lot more description, with examples. + +2002-11-06 Jim Meyering + + * coreutils.texi (printf invocation): Fix typo in index: + change \0x prefix to \x. + Change \xhhh to \xhh. + +2002-10-07 Paul Eggert + + Add support for locale-specific size indications (e.g., + thousands-separators) and for explicit size suffixes on output. + + * coreutils.texi (Block size): Say that: + This affects display format as well as block size. + Fractional block counts are rounded up. + ls file size blocksize defaults to 1. + A block size spec preceded by ' generates thousands separators. + A suffix without a preceding integer generates suffixes. + (tail invocation): 32k -> 32 KiB. + (What information is listed): ls -h is now equivalent to + ls --block-size=human, and ls -H is now equivalent to + ls --block-size=si. Displayed file size is now always affected by + --block-size. + +2002-09-13 Jim Meyering + + * coreutils.texi (tail invocation): In --sleep-interval=NUMBER, + NUMBER may now be a floating point number. + (stat invocation): Remove references to now-removed %S and %C. + (Time directives) [%S]: Explain why the range is [0..60]. + +2002-08-30 Jim Meyering + + * coreutils.texi [START-INFO-DIR-ENTRY]: Don't use sc{} on LHS. + Fix typo: s/permission/permissions/. From Michail Litvak. + +2002-08-02 Paul Eggert + + * coreutils.texi (uniq invocation): uniq now obeys LC_COLLATE. + +2002-07-29 Paul Eggert + + * coreutils.texi (nohup invocation): Change behavior to conform to + POSIX 1003.1-2001: + - Do not adjust scheduling priority. + - Redirects stderr to stdout, if stderr is not a terminal. + - Exit status is now 126 if command was found but not invoked, + 127 if nohup failed or if command was not found. + +2002-07-24 Jim Meyering + + * coreutils.texi (Time directives): Document %P, %R, %e, %F, + %g, %G, and %V + +2002-07-22 Martin Michlmayr + + * coreutils.texi (Formatting the file names): Document + that -N/--literal are equivalent to --quoting-style=literal. + Reported by Oskar Liljeblad as Debian bug#103612. + +2002-07-10 Jim Meyering + + * coreutils.texi (du invocation): s/PAT/PATTERN/. + From Martin Michlmayr. + +2002-07-08 Jim Meyering + + * coreutils.texi (cp invocation): Remove unnecessary "$@" in example; + Texinfo would render the @" as an umlaut over the following character. + From Paul Eggert. + * Makefile.am (check-texinfo): Check for the above. + +2002-07-06 Jim Meyering + + * coreutils.texi (stat invocation): Remove description of --secure. + +2002-07-03 Jim Meyering + + * coreutils.texi (stat invocation): Rename --link/-l + to --dereference/-L. Rewrite description of --dereference. + +2002-06-26 Paul Eggert + + * coreutils.texi (Putting the tools together): Don't mention egrep, + since it's not part of POSIX 1003.1-2001. + +2002-06-21 Jim Meyering + + * coreutils.texi (stat invocation): New section. From Michael Meskes. + +2002-05-19 Paul Eggert + + * coreutils.texi (ls invocation): Document new option: --author. + +2002-06-03 Jim Meyering + + * coreutils.texi (rm invocation): Add the warning (also in the --help + output) that the contents of a removed file are often recoverable. + +2002-05-27 Jim Meyering + + * Makefile.am (check-texinfo): Adapt to reflect that now we use + @acronym{POSIX}. + +2002-05-26 Jim Meyering + + * coreutils.texi: Use @acronym in place of most uses of @sc. + * getdate.texi (Date input formats): Likewise. + +2002-04-28 Jim Meyering + + * coreutils.texi: Change `@code{PROG}' to `@command{PROG}'. + +2002-04-28 Paul Eggert + + * coreutils.texi (kill invocation): Document the above. + Document POSIX signals better. + +2002-04-15 Jim Meyering + + * coreutils.texi: Document kill. + Written by Marcus Brinkmann. + +2002-04-13 Jim Meyering + + * coreutils.texi: Document link and unlink. + +2002-04-08 Jim Meyering + + * coreutils.texi: Use new directives, @copying and @insertcopying, + thus now requiring texinfo-4.2 to create the .info file. + +2002-02-26 Paul Eggert + + * coreutils.texi (File characteristic tests): Document the + behavior of test -nt and -ot when one of the files does not exist, + using the same behavior that is documented in ksh93. + +2002-03-05 Paul Eggert + + * coreutils.texi (cut invocation): Say that selected input is + written in the same order that it is read, and is written + exactly once. + +2002-03-03 Paul Eggert + + Make cp -r equivalent to cp -R. Add a new cp option --copy-contents + for people who want to emulate the traditional (and rarely desirable) + cp -r behavior. + + * coreutils.texi (cp invocation): Document this. + Fix some related minor bugs: --no-dereference is no longer + equivalent to -d, and --archive (-a) can override the other + symlink options. Warn that cp -R is not portable on symbolic + links unless you also specify -P. + +2002-03-02 Jim Meyering + + * coreutils.texi (cp invocation): Document that cp -r + preserves symlinks. Emphasize non-portability of cp -r. + +2002-02-27 Paul Eggert + + * coreutils.texi (Time directives): Add %N for nanoseconds. + This documents the recent change to 'ls'. + +2002-02-28 Jim Meyering + + * coreutils.texi (pr invocation): Reword to avoid using `:' + in an @opindex entry -- info doesn't permit it. + +2002-02-27 Paul Eggert + + * coreutils.texi (Formatting file timestamps): Document new + time-formatting method: --time-style=+FORMAT. + +2002-02-18 Paul Eggert + + * coreutils.texi (seq invocation): In the example, use "tail + -n 3", not "tail -3", to conform to POSIX 1003.1-2001. + +2002-02-17 Jim Meyering + + * coreutils.texi (tsort background): New section. + From Ian Lance Taylor. + (tsort invocation): Add a more realistic example. + +2002-02-15 Paul Eggert + + * coreutils.texi: Document _POSIX2_VERSION. + (Standards Conformance): New section. + +2002-01-24 Jim Meyering + + * coreutils.texi (START-INFO-DIR-ENTRY): Remove a few entries + and clean up a few others based on suggestions from Bob Proulx. + +2002-02-14 Paul Eggert + + Add support for POSIX 1003.1-2001, which requires removal for + support of obsolete "+" option syntax in sort, tail, and uniq. + * coreutils.texi: Document this. (Also, document a similar + change to "touch", for fileutils). + +2002-01-12 Jim Meyering + + * coreutils.texi (shred invocation): List some journaled filesystems. + +2001-11-10 Jim Meyering + + * coreutils.texi (Date directives): Document %u. + +2001-11-07 Paul Eggert + + * coreutils.texi (paste invocation): Give examples. + Thanks to Dan Jacobson for suggesting the examples. + +2001-11-05 Jim Meyering + + * coreutils.texi (sort invocation): Recommend setting LC_ALL=C, + not LC_COLLATE=C. Explain how the latter can cause problems. + Based on a message from Paul Eggert. + (ls invocation): Recommend setting LC_ALL=C, not LC_COLLATE=C. + +2001-10-21 Jim Meyering + + * coreutils.texi (cp invocation): Describe --reply=... + +2001-10-17 Jim Meyering + + * coreutils.texi (cp invocation): `cp --no-dereference' is + no longer equivalent to `cp -d'. + `cp -d' is equivalent to `--no-dereference --preserve=links'. + cp's -P option means --no-dereference, not --parents. + Describe new optional argument to --preserve. + Describe new option: --no-preserve=ATTRIBUTE_LIST. + +2001-09-23 Jim Meyering + + * Makefile.am (check-texinfo): Redirect stderr of `grep -w' to + /dev/null, so people with old versions of grep don't see the failure. + +2001-09-16 Jim Meyering + + * coreutils.texi (mv invocation): Describe new option: + --reply={yes,no,query}. Fix a few typos. + +2001-09-15 Paul Eggert + + * coreutils.texi (uniq invocation): The input need not + be sorted. Try to clarify -d versus -D versus -u. + +2001-09-12 Jim Meyering + + * coreutils.texi (tail invocation): Document new option: -F. + From Herbert Xu. + +2001-09-04 Paul Eggert + + * coreutils.texi (join invocation): Describe the GNU + extension to join, which does not require sorted input when + the input contains no unpairable lines. + +2001-09-03 Paul Eggert + + * coreutils.texi: + New 'uname' options -i or --hardware-platform, + and -o or --operating-system. + 'uname -a' now outputs -i and -o information at the end. + New uname option --kernel-version is an alias for -v. + Uname option --release has been renamed to --kernel-release, + and --sysname has been renamed to --kernel-name; + the old options will work for a while, but are no longer documented. + +2001-08-24 Herbert Xu + + * coreutils.texi (cut invocation): Document how cut treats lines + with no separators. + +2001-06-19 Paul Eggert + + * coreutils.texi: expr now uses LC_COLLATE for string comparison, + as per POSIX. + +2001-08-25 Jim Meyering + + * coreutils.texi: Use @option, rather than @samp everywhere. + +2001-06-21 Paul Eggert + + * coreutils.texi: 'expr' now requires '+' rather than 'quote' + to quote tokens. + +2001-07-14 Jim Meyering + + * coreutils.texi (cp invocation): Reflect 2001-07-08 change to + cp (via copy.c). + +2001-06-16 Jim Meyering + + * Makefile.am (info_TEXINFOS): Reflect renaming: s/omni-/core/. + * coreutils.texi: Likewise. + + * coreutils.texi: New, renamed from omni-utils.texi. + * omni-utils.texi: Removed, renamed to coreutils.texi. + + * omni-utils.texi (ls invocation): Mention the effect of locale. + Reported by Keith Thompson. + +2001-05-24 Jim Meyering + + * texinfo.tex: Update from master source. + + * omni-utils.texi (ls invocation): Document more clearly what ls + does when given no arguments. + +2001-05-21 Jim Meyering + + * textutils.texi: Remove file. + + * Makefile.am ($(DVIS), $(INFO_DEPS)): Depend on $(EXTRA_DIST). + (DISABLED_constants.texi): New rule -- disabled for now. + + This directory is now shared by fileutils, textutils, and sh-utils. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/coreutils.info b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/coreutils.info new file mode 100644 index 0000000..263ca12 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/doc/coreutils.info @@ -0,0 +1,14780 @@ +This is coreutils.info, produced by makeinfo version 4.8 from +coreutils.texi. + +INFO-DIR-SECTION Basics +START-INFO-DIR-ENTRY +* Coreutils: (coreutils). Core GNU (file, text, shell) utilities. +* Common options: (coreutils)Common options. Common options. +* File permissions: (coreutils)File permissions. Access modes. +* Date input formats: (coreutils)Date input formats. +END-INFO-DIR-ENTRY + +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* basename: (coreutils)basename invocation. Strip directory and suffix. +* cat: (coreutils)cat invocation. Concatenate and write files. +* chgrp: (coreutils)chgrp invocation. Change file groups. +* chmod: (coreutils)chmod invocation. Change file permissions. +* chown: (coreutils)chown invocation. Change file owners/groups. +* chroot: (coreutils)chroot invocation. Specify the root directory. +* cksum: (coreutils)cksum invocation. Print POSIX CRC checksum. +* comm: (coreutils)comm invocation. Compare sorted files by line. +* cp: (coreutils)cp invocation. Copy files. +* csplit: (coreutils)csplit invocation. Split by context. +* cut: (coreutils)cut invocation. Print selected parts of lines. +* date: (coreutils)date invocation. Print/set system date and time. +* dd: (coreutils)dd invocation. Copy and convert a file. +* df: (coreutils)df invocation. Report file system disk usage. +* dir: (coreutils)dir invocation. List directories briefly. +* dircolors: (coreutils)dircolors invocation. Color setup for ls. +* dirname: (coreutils)dirname invocation. Strip non-directory suffix. +* du: (coreutils)du invocation. Report on disk usage. +* echo: (coreutils)echo invocation. Print a line of text. +* env: (coreutils)env invocation. Modify the environment. +* expand: (coreutils)expand invocation. Convert tabs to spaces. +* expr: (coreutils)expr invocation. Evaluate expressions. +* factor: (coreutils)factor invocation. Print prime factors +* false: (coreutils)false invocation. Do nothing, unsuccessfully. +* fmt: (coreutils)fmt invocation. Reformat paragraph text. +* fold: (coreutils)fold invocation. Wrap long input lines. +* groups: (coreutils)groups invocation. Print group names a user is in. +* head: (coreutils)head invocation. Output the first part of files. +* hostid: (coreutils)hostid invocation. Print numeric host identifier. +* hostname: (coreutils)hostname invocation. Print or set system name. +* id: (coreutils)id invocation. Print real/effective uid/gid. +* install: (coreutils)install invocation. Copy and change attributes. +* join: (coreutils)join invocation. Join lines on a common field. +* kill: (coreutils)kill invocation. Send a signal to processes. +* link: (coreutils)link invocation. Make hard links between files. +* ln: (coreutils)ln invocation. Make links between files. +* logname: (coreutils)logname invocation. Print current login name. +* ls: (coreutils)ls invocation. List directory contents. +* md5sum: (coreutils)md5sum invocation. Print or check message-digests. +* mkdir: (coreutils)mkdir invocation. Create directories. +* mkfifo: (coreutils)mkfifo invocation. Create FIFOs (named pipes). +* mknod: (coreutils)mknod invocation. Create special files. +* mv: (coreutils)mv invocation. Rename files. +* nice: (coreutils)nice invocation. Modify scheduling priority. +* nl: (coreutils)nl invocation. Number lines and write files. +* nohup: (coreutils)nohup invocation. Immunize to hangups. +* od: (coreutils)od invocation. Dump files in octal, etc. +* paste: (coreutils)paste invocation. Merge lines of files. +* pathchk: (coreutils)pathchk invocation. Check file name portability. +* pr: (coreutils)pr invocation. Paginate or columnate files. +* printenv: (coreutils)printenv invocation. Print environment variables. +* printf: (coreutils)printf invocation. Format and print data. +* ptx: (coreutils)ptx invocation. Produce permuted indexes. +* pwd: (coreutils)pwd invocation. Print working directory. +* readlink: (coreutils)readlink invocation. Print referent of a symlink. +* rm: (coreutils)rm invocation. Remove files. +* rmdir: (coreutils)rmdir invocation. Remove empty directories. +* seq: (coreutils)seq invocation. Print numeric sequences +* shred: (coreutils)shred invocation. Remove files more securely. +* sleep: (coreutils)sleep invocation. Delay for a specified time. +* sort: (coreutils)sort invocation. Sort text files. +* split: (coreutils)split invocation. Split into fixed-size pieces. +* stat: (coreutils)stat invocation. Report file(system) status. +* stty: (coreutils)stty invocation. Print/change terminal settings. +* su: (coreutils)su invocation. Modify user and group id. +* sum: (coreutils)sum invocation. Print traditional checksum. +* sync: (coreutils)sync invocation. Synchronize memory and disk. +* tac: (coreutils)tac invocation. Reverse files. +* tail: (coreutils)tail invocation. Output the last part of files. +* tee: (coreutils)tee invocation. Redirect to multiple files. +* test: (coreutils)test invocation. File/string tests. +* touch: (coreutils)touch invocation. Change file timestamps. +* tr: (coreutils)tr invocation. Translate characters. +* true: (coreutils)true invocation. Do nothing, successfully. +* tsort: (coreutils)tsort invocation. Topological sort. +* tty: (coreutils)tty invocation. Print terminal name. +* uname: (coreutils)uname invocation. Print system information. +* unexpand: (coreutils)unexpand invocation. Convert spaces to tabs. +* uniq: (coreutils)uniq invocation. Uniquify files. +* unlink: (coreutils)unlink invocation. Removal via unlink(2). +* users: (coreutils)users invocation. Print current user names. +* vdir: (coreutils)vdir invocation. List directories verbosely. +* wc: (coreutils)wc invocation. Line, word, and byte counts. +* who: (coreutils)who invocation. Print who is logged in. +* whoami: (coreutils)whoami invocation. Print effective user id. +* yes: (coreutils)yes invocation. Print a string indefinitely. +END-INFO-DIR-ENTRY + + This manual documents version 5.3.0 of the GNU core utilities, +including the standard programs for text and file manipulation. + + Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.1 or any later version published by the Free Software + Foundation; with no Invariant Sections, with no Front-Cover Texts, + and with no Back-Cover Texts. A copy of the license is included + in the section entitled "GNU Free Documentation License". + + +File: coreutils.info, Node: Top, Next: Introduction, Up: (dir) + +GNU Coreutils +************* + +This manual documents version 5.3.0 of the GNU core utilities, +including the standard programs for text and file manipulation. + + Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004 Free +Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.1 or any later version published by the Free Software + Foundation; with no Invariant Sections, with no Front-Cover Texts, + and with no Back-Cover Texts. A copy of the license is included + in the section entitled "GNU Free Documentation License". + +* Menu: + +* Introduction:: Caveats, overview, and authors. +* Common options:: Common options. +* Output of entire files:: cat tac nl od +* Formatting file contents:: fmt pr fold +* Output of parts of files:: head tail split csplit +* Summarizing files:: wc sum cksum md5sum +* Operating on sorted files:: sort uniq comm ptx tsort +* Operating on fields within a line:: cut paste join +* Operating on characters:: tr expand unexpand +* Directory listing:: ls dir vdir d v dircolors +* Basic operations:: cp dd install mv rm shred +* Special file types:: ln mkdir rmdir mkfifo mknod +* Changing file attributes:: chgrp chmod chown touch +* Disk usage:: df du stat sync +* Printing text:: echo printf yes +* Conditions:: false true test expr +* Redirection:: tee +* File name manipulation:: dirname basename pathchk +* Working context:: pwd stty printenv tty +* User information:: id logname whoami groups users who +* System context:: date uname hostname +* Modified command invocation:: chroot env nice nohup su +* Process control:: kill +* Delaying:: sleep +* Numeric operations:: factor seq +* File permissions:: Access modes. +* Date input formats:: Specifying date strings. +* Opening the software toolbox:: The software tools philosophy. +* GNU Free Documentation License:: The license for this documentation. +* Index:: General index. + + --- The Detailed Node Listing --- + +Common Options + +* Exit status:: Indicating program success or failure. +* Backup options:: Backup options +* Block size:: Block size +* Target directory:: Target directory +* Trailing slashes:: Trailing slashes +* Traversing symlinks:: Traversing symlinks to directories +* Treating / specially:: Treating / specially +* Standards conformance:: Standards conformance + +Output of entire files + +* cat invocation:: Concatenate and write files. +* tac invocation:: Concatenate and write files in reverse. +* nl invocation:: Number lines and write files. +* od invocation:: Write files in octal or other formats. + +Formatting file contents + +* fmt invocation:: Reformat paragraph text. +* pr invocation:: Paginate or columnate files for printing. +* fold invocation:: Wrap input lines to fit in specified width. + +Output of parts of files + +* head invocation:: Output the first part of files. +* tail invocation:: Output the last part of files. +* split invocation:: Split a file into fixed-size pieces. +* csplit invocation:: Split a file into context-determined pieces. + +Summarizing files + +* wc invocation:: Print newline, word, and byte counts. +* sum invocation:: Print checksum and block counts. +* cksum invocation:: Print CRC checksum and byte counts. +* md5sum invocation:: Print or check message-digests. + +Operating on sorted files + +* sort invocation:: Sort text files. +* uniq invocation:: Uniquify files. +* comm invocation:: Compare two sorted files line by line. +* ptx invocation:: Produce a permuted index of file contents. +* tsort invocation:: Topological sort. + +`ptx': Produce permuted indexes + +* General options in ptx:: Options which affect general program behavior. +* Charset selection in ptx:: Underlying character set considerations. +* Input processing in ptx:: Input fields, contexts, and keyword selection. +* Output formatting in ptx:: Types of output format, and sizing the fields. +* Compatibility in ptx:: The GNU extensions to `ptx' + +Operating on fields within a line + +* cut invocation:: Print selected parts of lines. +* paste invocation:: Merge lines of files. +* join invocation:: Join lines on a common field. + +Operating on characters + +* tr invocation:: Translate, squeeze, and/or delete characters. +* expand invocation:: Convert tabs to spaces. +* unexpand invocation:: Convert spaces to tabs. + +`tr': Translate, squeeze, and/or delete characters + +* Character sets:: Specifying sets of characters. +* Translating:: Changing one set of characters to another. +* Squeezing:: Squeezing repeats and deleting. + +Directory listing + +* ls invocation:: List directory contents +* dir invocation:: Briefly list directory contents +* vdir invocation:: Verbosely list directory contents +* dircolors invocation:: Color setup for `ls' + +`ls': List directory contents + +* Which files are listed:: Which files are listed +* What information is listed:: What information is listed +* Sorting the output:: Sorting the output +* More details about version sort:: More details about version sort +* General output formatting:: General output formatting +* Formatting the file names:: Formatting the file names + +Basic operations + +* cp invocation:: Copy files and directories +* dd invocation:: Convert and copy a file +* install invocation:: Copy files and set attributes +* mv invocation:: Move (rename) files +* rm invocation:: Remove files or directories +* shred invocation:: Remove files more securely + +Special file types + +* link invocation:: Make a hard link via the link syscall +* ln invocation:: Make links between files +* mkdir invocation:: Make directories +* mkfifo invocation:: Make FIFOs (named pipes) +* mknod invocation:: Make block or character special files +* readlink invocation:: Print the referent of a symbolic link +* rmdir invocation:: Remove empty directories +* unlink invocation:: Remove files via unlink syscall + +Changing file attributes + +* chown invocation:: Change file owner and group +* chgrp invocation:: Change group ownership +* chmod invocation:: Change access permissions +* touch invocation:: Change file timestamps + +Disk usage + +* df invocation:: Report file system disk space usage +* du invocation:: Estimate file space usage +* stat invocation:: Report file or file system status +* sync invocation:: Synchronize data on disk with memory + +Printing text + +* echo invocation:: Print a line of text +* printf invocation:: Format and print data +* yes invocation:: Print a string until interrupted + +Conditions + +* false invocation:: Do nothing, unsuccessfully +* true invocation:: Do nothing, successfully +* test invocation:: Check file types and compare values +* expr invocation:: Evaluate expressions + +`test': Check file types and compare values + +* File type tests:: File type tests +* Access permission tests:: Access permission tests +* File characteristic tests:: File characteristic tests +* String tests:: String tests +* Numeric tests:: Numeric tests + +`expr': Evaluate expression + +* String expressions:: + : match substr index length +* Numeric expressions:: + - * / % +* Relations for expr:: | & < <= = == != >= > +* Examples of expr:: Examples of using `expr' + +Redirection + +* tee invocation:: Redirect output to multiple files + +File name manipulation + +* basename invocation:: Strip directory and suffix from a file name +* dirname invocation:: Strip non-directory suffix from a file name +* pathchk invocation:: Check file name portability + +Working context + +* pwd invocation:: Print working directory +* stty invocation:: Print or change terminal characteristics +* printenv invocation:: Print all or some environment variables +* tty invocation:: Print file name of terminal on standard input + +`stty': Print or change terminal characteristics + +* Control:: Control settings +* Input:: Input settings +* Output:: Output settings +* Local:: Local settings +* Combination:: Combination settings +* Characters:: Special characters +* Special:: Special settings + +User information + +* id invocation:: Print real and effective uid and gid +* logname invocation:: Print current login name +* whoami invocation:: Print effective user id +* groups invocation:: Print group names a user is in +* users invocation:: Print login names of users currently logged in +* who invocation:: Print who is currently logged in + +System context + +* date invocation:: Print or set system date and time +* uname invocation:: Print system information +* hostname invocation:: Print or set system name +* hostid invocation:: Print numeric host identifier. + +`date': Print or set system date and time + +* Time directives:: Time directives +* Date directives:: Date directives +* Literal directives:: Literal directives +* Padding:: Padding +* Setting the time:: Setting the time +* Options for date:: Options for `date' +* Examples of date:: Examples of `date' + +Modified command invocation + +* chroot invocation:: Run a command with a different root directory +* env invocation:: Run a command in a modified environment +* nice invocation:: Run a command with modified scheduling priority +* nohup invocation:: Run a command immune to hangups +* su invocation:: Run a command with substitute user and group id + +Process control + +* kill invocation:: Sending a signal to processes. + +Delaying + +* sleep invocation:: Delay for a specified time + +Numeric operations + +* factor invocation:: Print prime factors +* seq invocation:: Print numeric sequences + +File permissions + +* Mode Structure:: Structure of File Permissions +* Symbolic Modes:: Mnemonic permissions representation +* Numeric Modes:: Permissions as octal numbers + +Date input formats + +* General date syntax:: Common rules. +* Calendar date items:: 19 Dec 1994. +* Time of day items:: 9:20pm. +* Time zone items:: EST, PDT, GMT. +* Day of week items:: Monday and others. +* Relative items in date strings:: next tuesday, 2 years ago. +* Pure numbers in date strings:: 19931219, 1440. +* Seconds since the Epoch:: @1078100502. +* Specifying time zone rules:: TZ="America/New_York", TZ="UTC0". +* Authors of get_date:: Bellovin, Eggert, Salz, Berets, et al. + +Opening the software toolbox + +* Toolbox introduction:: Toolbox introduction +* I/O redirection:: I/O redirection +* The who command:: The `who' command +* The cut command:: The `cut' command +* The sort command:: The `sort' command +* The uniq command:: The `uniq' command +* Putting the tools together:: Putting the tools together + +GNU Free Documentation License + +* How to use this License for your documents:: + + +File: coreutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top + +1 Introduction +************** + +This manual is a work in progress: many sections make no attempt to +explain basic concepts in a way suitable for novices. Thus, if you are +interested, please get involved in improving this manual. The entire +GNU community will benefit. + + The GNU utilities documented here are mostly compatible with the +POSIX standard. Please report bugs to . +Remember to include the version number, machine architecture, input +files, and any other information needed to reproduce the bug: your +input, what you expected, what you got, and why it is wrong. Diffs are +welcome, but please include a description of the problem as well, since +this is sometimes difficult to infer. *Note Bugs: (gcc)Bugs. + + This manual was originally derived from the Unix man pages in the +distributions, which were written by David MacKenzie and updated by Jim +Meyering. What you are reading now is the authoritative documentation +for these utilities; the man pages are no longer being maintained. The +original `fmt' man page was written by Ross Paterson. Franc,ois Pinard +did the initial conversion to Texinfo format. Karl Berry did the +indexing, some reorganization, and editing of the results. Brian +Youmans of the Free Software Foundation office staff combined the +manuals for textutils, fileutils, and sh-utils to produce the present +omnibus manual. Richard Stallman contributed his usual invaluable +insights to the overall process. + + +File: coreutils.info, Node: Common options, Next: Output of entire files, Prev: Introduction, Up: Top + +2 Common options +**************** + +Certain options are available in all of these programs. Rather than +writing identical descriptions for each of the programs, they are +described here. (In fact, every GNU program accepts (or should accept) +these options.) + + Normally options and operands can appear in any order, and programs +act as if all the options appear before any operands. For example, +`sort -r passwd -t :' acts like `sort -r -t : passwd', since `:' is an +option-argument of `-t'. However, if the `POSIXLY_CORRECT' environment +variable is set, options must appear before operands, unless otherwise +specified for a particular command. + + A few programs can usefully have trailing operands with leading `-'. +With such a program, options must precede operands even if +`POSIXLY_CORRECT' is not set, and this fact is noted in the program +description. For example, the `env' command's options must appear +before its operands, since in some cases the operands specify a command +that itself contains options. + + Some of these programs recognize the `--help' and `--version' +options only when one of them is the sole command line argument. + +`--help' + Print a usage message listing all available options, then exit + successfully. + +`--version' + Print the version number, then exit successfully. + +`--' + Delimit the option list. Later arguments, if any, are treated as + operands even if they begin with `-'. For example, `sort -- -r' + reads from the file named `-r'. + + + A single `-' operand is not really an option, though it looks like +one. It stands for standard input, or for standard output if that is +clear from the context. For example, `sort -' reads from standard +input, and is equivalent to plain `sort', and `tee -' writes an extra +copy of its input to standard output. Unless otherwise specified, `-' +can appear as any operand that requires a file name. + +* Menu: + +* Exit status:: Indicating program success or failure. +* Backup options:: -b -S -V, in some programs. +* Block size:: BLOCK_SIZE and --block-size, in some programs. +* Target directory:: Specifying a target directory, in some programs. +* Trailing slashes:: --strip-trailing-slashes, in some programs. +* Traversing symlinks:: -H, -L, or -P, in some programs. +* Treating / specially:: --preserve-root and --no-preserve-root. +* Special built-in utilities:: `break', `:', `eval', ... +* Standards conformance:: Conformance to the POSIX standard. + + +File: coreutils.info, Node: Exit status, Next: Backup options, Up: Common options + +2.1 Exit status +=============== + +Nearly every command invocation yields an integral "exit status" that +can be used to change how other commands work. For the vast majority +of commands, an exit status of zero indicates success. Failure is +indicated by a nonzero value--typically `1', though it may differ on +unusual platforms as POSIX requires only that it be nonzero. + + However, some of the programs documented here do produce other exit +status values and a few associate different meanings with the values +`0' and `1'. Here are some of the exceptions: `chroot', `env', `expr', +`nice', `nohup', `printenv', `sort', `su', `test', `tty'. + + +File: coreutils.info, Node: Backup options, Next: Block size, Prev: Exit status, Up: Common options + +2.2 Backup options +================== + +Some GNU programs (at least `cp', `install', `ln', and `mv') optionally +make backups of files before writing new versions. These options +control the details of these backups. The options are also briefly +mentioned in the descriptions of the particular programs. + +`-b' +`--backup[=METHOD]' + Make a backup of each file that would otherwise be overwritten or + removed. Without this option, the original versions are destroyed. + Use METHOD to determine the type of backups to make. When this + option is used but METHOD is not specified, then the value of the + `VERSION_CONTROL' environment variable is used. And if + `VERSION_CONTROL' is not set, the default backup type is + `existing'. + + Note that the short form of this option, `-b' does not accept any + argument. Using `-b' is equivalent to using `--backup=existing'. + + This option corresponds to the Emacs variable `version-control'; + the values for METHOD are the same as those used in Emacs. This + option also accepts more descriptive names. The valid METHODs are + (unique abbreviations are accepted): + + `none' + `off' + Never make backups. + + `numbered' + `t' + Always make numbered backups. + + `existing' + `nil' + Make numbered backups of files that already have them, simple + backups of the others. + + `simple' + `never' + Always make simple backups. Please note `never' is not to be + confused with `none'. + + +`-S SUFFIX' +`--suffix=SUFFIX' + Append SUFFIX to each backup file made with `-b'. If this option + is not specified, the value of the `SIMPLE_BACKUP_SUFFIX' + environment variable is used. And if `SIMPLE_BACKUP_SUFFIX' is not + set, the default is `~', just as in Emacs. + +`--version-control=METHOD' + This option is obsolete and will be removed in a future release. + It has been replaced with `--backup'. + + + +File: coreutils.info, Node: Block size, Next: Target directory, Prev: Backup options, Up: Common options + +2.3 Block size +============== + +Some GNU programs (at least `df', `du', and `ls') display sizes in +"blocks". You can adjust the block size and method of display to make +sizes easier to read. The block size used for display is independent +of any file system block size. Fractional block counts are rounded up +to the nearest integer. + + The default block size is chosen by examining the following +environment variables in turn; the first one that is set determines the +block size. + +`DF_BLOCK_SIZE' + This specifies the default block size for the `df' command. + Similarly, `DU_BLOCK_SIZE' specifies the default for `du' and + `LS_BLOCK_SIZE' for `ls'. + +`BLOCK_SIZE' + This specifies the default block size for all three commands, if + the above command-specific environment variables are not set. + +`BLOCKSIZE' + This specifies the default block size for all values that are + normally printed as blocks, if neither `BLOCK_SIZE' nor the above + command-specific environment variables are set. Unlike the other + environment variables, `BLOCKSIZE' does not affect values that are + normally printed as byte counts, e.g., the file sizes contained in + `ls -l' output. + +`POSIXLY_CORRECT' + If neither `COMMAND_BLOCK_SIZE', nor `BLOCK_SIZE', nor `BLOCKSIZE' + is set, but this variable is set, the block size defaults to 512. + + + If none of the above environment variables are set, the block size +currently defaults to 1024 bytes in most contexts, but this number may +change in the future. For `ls' file sizes, the block size defaults to +1 byte. + + A block size specification can be a positive integer specifying the +number of bytes per block, or it can be `human-readable' or `si' to +select a human-readable format. Integers may be followed by suffixes +that are upward compatible with the SI prefixes +(http://www.bipm.fr/enus/3_SI/si-prefixes.html) for decimal multiples +and with the IEC 60027-2 prefixes for binary multiples +(http://physics.nist.gov/cuu/Units/binary.html). + + With human-readable formats, output sizes are followed by a size +letter such as `M' for megabytes. `BLOCK_SIZE=human-readable' uses +powers of 1024; `M' stands for 1,048,576 bytes. `BLOCK_SIZE=si' is +similar, but uses powers of 1000 and appends `B'; `MB' stands for +1,000,000 bytes. + + A block size specification preceded by `'' causes output sizes to be +displayed with thousands separators. The `LC_NUMERIC' locale specifies +the thousands separator and grouping. For example, in an American +English locale, `--block-size="'1kB"' would cause a size of 1234000 +bytes to be displayed as `1,234'. In the default C locale, there is no +thousands separator so a leading `'' has no effect. + + An integer block size can be followed by a suffix to specify a +multiple of that size. A bare size letter, or one followed by `iB', +specifies a multiple using powers of 1024. A size letter followed by +`B' specifies powers of 1000 instead. For example, `1M' and `1MiB' are +equivalent to `1048576', whereas `1MB' is equivalent to `1000000'. + + A plain suffix without a preceding integer acts as if `1' were +prepended, except that it causes a size indication to be appended to +the output. For example, `--block-size="kB"' displays 3000 as `3kB'. + + The following suffixes are defined. Large sizes like `1Y' may be +rejected by your computer due to limitations of its arithmetic. + +`kB' + kilobyte: 10^3 = 1000. + +`k' +`K' +`KiB' + kibibyte: 2^10 = 1024. `K' is special: the SI prefix is `k' and + the IEC 60027-2 prefix is `Ki', but tradition and POSIX use `k' to + mean `KiB'. + +`MB' + megabyte: 10^6 = 1,000,000. + +`M' +`MiB' + mebibyte: 2^20 = 1,048,576. + +`GB' + gigabyte: 10^9 = 1,000,000,000. + +`G' +`GiB' + gibibyte: 2^30 = 1,073,741,824. + +`TB' + terabyte: 10^12 = 1,000,000,000,000. + +`T' +`TiB' + tebibyte: 2^40 = 1,099,511,627,776. + +`PB' + petabyte: 10^15 = 1,000,000,000,000,000. + +`P' +`PiB' + pebibyte: 2^50 = 1,125,899,906,842,624. + +`EB' + exabyte: 10^18 = 1,000,000,000,000,000,000. + +`E' +`EiB' + exbibyte: 2^60 = 1,152,921,504,606,846,976. + +`ZB' + zettabyte: 10^21 = 1,000,000,000,000,000,000,000 + +`Z' +`ZiB' + 2^70 = 1,180,591,620,717,411,303,424. (`Zi' is a GNU extension to + IEC 60027-2.) + +`YB' + yottabyte: 10^24 = 1,000,000,000,000,000,000,000,000. + +`Y' +`YiB' + 2^80 = 1,208,925,819,614,629,174,706,176. (`Yi' is a GNU + extension to IEC 60027-2.) + + Block size defaults can be overridden by an explicit +`--block-size=SIZE' option. The `-k' option is equivalent to +`--block-size=1K', which is the default unless the `POSIXLY_CORRECT' +environment variable is set. The `-h' or `--human-readable' option is +equivalent to `--block-size=human-readable'. The `--si' option is +equivalent to `--block-size=si'. + + +File: coreutils.info, Node: Target directory, Next: Trailing slashes, Prev: Block size, Up: Common options + +2.4 Target directory +==================== + +The `cp', `install', `ln', and `mv' commands normally treat the last +operand specially when it is a directory or a symbolic link to a +directory. For example, `cp source dest' is equivalent to `cp source +dest/source' if `dest' is a directory. Sometimes this behavior is not +exactly what is wanted, so these commands support the following options +to allow more fine-grained control: + +`-T' +`--no-target-directory' + Do not treat the last operand specially when it is a directory or a + symbolic link to a directory. This can help avoid race conditions + in programs that operate in a shared area. For example, when the + command `mv /tmp/source /tmp/dest' succeeds, there is no guarantee + that `/tmp/source' was renamed to `/tmp/dest': it could have been + renamed to `/tmp/dest/source' instead, if some other process + created `/tmp/dest' as a directory. However, if `mv -T + /tmp/source /tmp/dest' succeeds, there is no question that + `/tmp/source' was renamed to `/tmp/dest'. + + In the opposite situation, where you want the last operand to be + treated as a directory and want a diagnostic otherwise, you can use + the `--target-directory' (`-t') option. + +`-t DIRECTORY' +`--target-directory=DIRECTORY' + Use DIRECTORY as the directory component of each destination file + name. + + The interface for most programs is that after processing options + and a finite (possibly zero) number of fixed-position arguments, + the remaining argument list is either expected to be empty, or is + a list of items (usually files) that will all be handled + identically. The `xargs' program is designed to work well with + this convention. + + The commands in the `mv'-family are unusual in that they take a + variable number of arguments with a special case at the _end_ + (namely, the target directory). This makes it nontrivial to + perform some operations, e.g., "move all files from here to + ../d/", because `mv * ../d/' might exhaust the argument space, and + `ls | xargs ...' doesn't have a clean way to specify an extra + final argument for each invocation of the subject command. (It + can be done by going through a shell command, but that requires + more human labor and brain power than it should.) + + The `--target-directory' (`-t') option allows the `cp', `install', + `ln', and `mv' programs to be used conveniently with `xargs'. For + example, you can move the files from the current directory to a + sibling directory, `d' like this: + + ls | xargs mv -t ../d -- + + However, this doesn't move files whose names begin with `.'. If + you use the GNU `find' program, you can move those files too, with + this command: + + find . -mindepth 1 -maxdepth 1 \ + | xargs mv -t ../d + + But both of the above approaches fail if there are no files in the + current directory, or if any file has a name containing a blank or + some other special characters. The following example removes + those limitations and requires both GNU `find' and GNU `xargs': + + find . -mindepth 1 -maxdepth 1 -print0 \ + | xargs --null --no-run-if-empty \ + mv -t ../d + + +The `--target-directory' (`-t') and `--no-target-directory' (`-T') +options cannot be combined. + + +File: coreutils.info, Node: Trailing slashes, Next: Traversing symlinks, Prev: Target directory, Up: Common options + +2.5 Trailing slashes +==================== + +Some GNU programs (at least `cp' and `mv') allow you to remove any +trailing slashes from each SOURCE argument before operating on it. The +`--strip-trailing-slashes' option enables this behavior. + + This is useful when a SOURCE argument may have a trailing slash and +specify a symbolic link to a directory. This scenario is in fact rather +common because some shells can automatically append a trailing slash +when performing file name completion on such symbolic links. Without +this option, `mv', for example, (via the system's rename function) must +interpret a trailing slash as a request to dereference the symbolic link +and so must rename the indirectly referenced _directory_ and not the +symbolic link. Although it may seem surprising that such behavior be +the default, it is required by POSIX and is consistent with other parts +of that standard. + + +File: coreutils.info, Node: Traversing symlinks, Next: Treating / specially, Prev: Trailing slashes, Up: Common options + +2.6 Traversing symlinks +======================= + +The following options modify how `chown' and `chgrp' traverse a +hierarchy when the `--recursive' (`-R') option is also specified. If +more than one of the following options is specified, only the final one +takes effect. These options specify whether processing a symbolic link +to a directory entails operating on just the symbolic link or on all +files in the hierarchy rooted at that directory. + + These options are independent of `--dereference' and +`--no-dereference' (`-h'), which control whether to modify a symlink or +its referent. + +`-H' + If `--recursive' (`-R') is specified and a command line argument + is a symbolic link to a directory, traverse it. + +`-L' + In a recursive traversal, traverse every symbolic link to a + directory that is encountered. + +`-P' + Do not traverse any symbolic links. This is the default if none + of `-H', `-L', or `-P' is specified. + + + +File: coreutils.info, Node: Treating / specially, Next: Special built-in utilities, Prev: Traversing symlinks, Up: Common options + +2.7 Treating / specially +======================== + +Certain commands can operate destructively on entire hierarchies. For +example, if a user with appropriate privileges mistakenly runs `rm -rf +/ tmp/junk' or `cd /bin; rm -rf ../', that may remove all files on the +entire system. Since there are so few (1) legitimate uses for such a +command, GNU `rm' provides the `--preserve-root' option to make it so +`rm' declines to operate on any directory that resolves to `/'. The +default is still to allow `rm -rf /' to operate unimpeded. Another new +option, `--no-preserve-root', cancels the effect of any preceding +`--preserve-root' option. Note that the `--preserve-root' behavior may +become the default for `rm'. + + The commands `chgrp', `chmod' and `chown' can also operate +destructively on entire hierarchies, so they too support these options. +Although, unlike `rm', they don't actually unlink files, these +commands are arguably more dangerous when operating recursively on `/', +since they often work much more quickly, and hence damage more files +before an alert user can interrupt them. + + ---------- Footnotes ---------- + + (1) If you know of one, please write to . + + +File: coreutils.info, Node: Special built-in utilities, Next: Standards conformance, Prev: Treating / specially, Up: Common options + +2.8 Special built-in utilities +============================== + +Some programs like `nice' can invoke other programs; for example, the +command `nice cat file' invokes the program `cat' by executing the +command `cat file'. However, "special built-in utilities" like `exit' +cannot be invoked this way. For example, the command `nice exit' does +not have a well-defined behavior: it may generate an error message +instead of exiting. + + Here is a list of the special built-in utilities that are +standardized by POSIX 1003.1-2004. + + . : break continue eval exec exit export readonly return set shift + times trap unset + + For example, because `.', `:', and `exec' are special, the commands +`nice . foo.sh', `nice :', and `nice exec pwd' do not work as you might +expect. + + Many shells extend this list. For example, Bash has several extra +special built-in utilities like `history', and `suspend', and with Bash +the command `nice suspend' generates an error message instead of +suspending. + + +File: coreutils.info, Node: Standards conformance, Prev: Special built-in utilities, Up: Common options + +2.9 Standards conformance +========================= + +In a few cases, the GNU utilities' default behavior is incompatible +with the POSIX standard. To suppress these incompatibilities, define +the `POSIXLY_CORRECT' environment variable. Unless you are checking +for POSIX conformance, you probably do not need to define +`POSIXLY_CORRECT'. + + Newer versions of POSIX are occasionally incompatible with older +versions. For example, older versions of POSIX required the command +`sort +1' to sort based on the second and succeeding fields in each +input line, but starting with POSIX 1003.1-2001 the same command is +required to sort the file named `+1', and you must instead use the +command `sort -k 2' to get the field-based sort. + + The GNU utilities normally conform to the version of POSIX that is +standard for your system. To cause them to conform to a different +version of POSIX, define the `_POSIX2_VERSION' environment variable to +a value of the form YYYYMM specifying the year and month the standard +was adopted. Two values are currently supported for `_POSIX2_VERSION': +`199209' stands for POSIX 1003.2-1992, and `200112' stands for POSIX +1003.1-2001. For example, if you are running older software that +assumes an older version of POSIX and uses `sort +1', `head -10', or +`tail +10', you can work around the compatibility problems by setting +`_POSIX2_VERSION=199209' in your environment. + + +File: coreutils.info, Node: Output of entire files, Next: Formatting file contents, Prev: Common options, Up: Top + +3 Output of entire files +************************ + +These commands read and write entire files, possibly transforming them +in some way. + +* Menu: + +* cat invocation:: Concatenate and write files. +* tac invocation:: Concatenate and write files in reverse. +* nl invocation:: Number lines and write files. +* od invocation:: Write files in octal or other formats. + + +File: coreutils.info, Node: cat invocation, Next: tac invocation, Up: Output of entire files + +3.1 `cat': Concatenate and write files +====================================== + +`cat' copies each FILE (`-' means standard input), or standard input if +none are given, to standard output. Synopsis: + + cat [OPTION] [FILE]... + + The program accepts the following options. Also see *Note Common +options::. + +`-A' +`--show-all' + Equivalent to `-vET'. + +`-B' +`--binary' + On MS-DOS and MS-Windows only, read and write the files in binary + mode. By default, `cat' on MS-DOS/MS-Windows uses binary mode + only when standard output is redirected to a file or a pipe; this + option overrides that. Binary file I/O is used so that the files + retain their format (Unix text as opposed to DOS text and binary), + because `cat' is frequently used as a file-copying program. Some + options (see below) cause `cat' to read and write files in text + mode because in those cases the original file contents aren't + important (e.g., when lines are numbered by `cat', or when line + endings should be marked). This is so these options work as + DOS/Windows users would expect; for example, DOS-style text files + have their lines end with the CR-LF pair of characters, which + won't be processed as an empty line by `-b' unless the file is + read in text mode. + +`-b' +`--number-nonblank' + Number all nonblank output lines, starting with 1. On MS-DOS and + MS-Windows, this option causes `cat' to read and write files in + text mode. + +`-e' + Equivalent to `-vE'. + +`-E' +`--show-ends' + Display a `$' after the end of each line. On MS-DOS and + MS-Windows, this option causes `cat' to read and write files in + text mode. + +`-n' +`--number' + Number all output lines, starting with 1. On MS-DOS and + MS-Windows, this option causes `cat' to read and write files in + text mode. + +`-s' +`--squeeze-blank' + Replace multiple adjacent blank lines with a single blank line. On + MS-DOS and MS-Windows, this option causes `cat' to read and write + files in text mode. + +`-t' + Equivalent to `-vT'. + +`-T' +`--show-tabs' + Display TAB characters as `^I'. + +`-u' + Ignored; for Unix compatibility. + +`-v' +`--show-nonprinting' + Display control characters except for LFD and TAB using `^' + notation and precede characters that have the high bit set with + `M-'. On MS-DOS and MS-Windows, this option causes `cat' to read + files and standard input in DOS binary mode, so the CR characters + at the end of each line are also visible. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: tac invocation, Next: nl invocation, Prev: cat invocation, Up: Output of entire files + +3.2 `tac': Concatenate and write files in reverse +================================================= + +`tac' copies each FILE (`-' means standard input), or standard input if +none are given, to standard output, reversing the records (lines by +default) in each separately. Synopsis: + + tac [OPTION]... [FILE]... + + "Records" are separated by instances of a string (newline by +default). By default, this separator string is attached to the end of +the record that it follows in the file. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--before' + The separator is attached to the beginning of the record that it + precedes in the file. + +`-r' +`--regex' + Treat the separator string as a regular expression. Users of `tac' + on MS-DOS/MS-Windows should note that, since `tac' reads files in + binary mode, each line of a text file might end with a CR/LF pair + instead of the Unix-style LF. + +`-s SEPARATOR' +`--separator=SEPARATOR' + Use SEPARATOR as the record separator, instead of newline. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: nl invocation, Next: od invocation, Prev: tac invocation, Up: Output of entire files + +3.3 `nl': Number lines and write files +====================================== + +`nl' writes each FILE (`-' means standard input), or standard input if +none are given, to standard output, with line numbers added to some or +all of the lines. Synopsis: + + nl [OPTION]... [FILE]... + + `nl' decomposes its input into (logical) pages; by default, the line +number is reset to 1 at the top of each logical page. `nl' treats all +of the input files as a single document; it does not reset line numbers +or logical pages between files. + + A logical page consists of three sections: header, body, and footer. +Any of the sections can be empty. Each can be numbered in a different +style from the others. + + The beginnings of the sections of logical pages are indicated in the +input file by a line containing exactly one of these delimiter strings: + +`\:\:\:' + start of header; + +`\:\:' + start of body; + +`\:' + start of footer. + + The two characters from which these strings are made can be changed +from `\' and `:' via options (see below), but the pattern and length of +each string cannot be changed. + + A section delimiter is replaced by an empty line on output. Any text +that comes before the first section delimiter string in the input file +is considered to be part of a body section, so `nl' treats a file that +contains no section delimiters as a single body section. + + The program accepts the following options. Also see *Note Common +options::. + +`-b STYLE' +`--body-numbering=STYLE' + Select the numbering style for lines in the body section of each + logical page. When a line is not numbered, the current line number + is not incremented, but the line number separator character is + still prepended to the line. The styles are: + + `a' + number all lines, + + `t' + number only nonempty lines (default for body), + + `n' + do not number lines (default for header and footer), + + `pBRE' + number only lines that contain a match for the basic regular + expression BRE. *Note Regular Expressions: (grep)Regular + Expressions. + +`-d CD' +`--section-delimiter=CD' + Set the section delimiter characters to CD; default is `\:'. If + only C is given, the second remains `:'. (Remember to protect `\' + or other metacharacters from shell expansion with quotes or extra + backslashes.) + +`-f STYLE' +`--footer-numbering=STYLE' + Analogous to `--body-numbering'. + +`-h STYLE' +`--header-numbering=STYLE' + Analogous to `--body-numbering'. + +`-i NUMBER' +`--page-increment=NUMBER' + Increment line numbers by NUMBER (default 1). + +`-l NUMBER' +`--join-blank-lines=NUMBER' + Consider NUMBER (default 1) consecutive empty lines to be one + logical line for numbering, and only number the last one. Where + fewer than NUMBER consecutive empty lines occur, do not number + them. An empty line is one that contains no characters, not even + spaces or tabs. + +`-n FORMAT' +`--number-format=FORMAT' + Select the line numbering format (default is `rn'): + + `ln' + left justified, no leading zeros; + + `rn' + right justified, no leading zeros; + + `rz' + right justified, leading zeros. + +`-p' +`--no-renumber' + Do not reset the line number at the start of a logical page. + +`-s STRING' +`--number-separator=STRING' + Separate the line number from the text line in the output with + STRING (default is the TAB character). + +`-v NUMBER' +`--starting-line-number=NUMBER' + Set the initial line number on each logical page to NUMBER + (default 1). + +`-w NUMBER' +`--number-width=NUMBER' + Use NUMBER characters for line numbers (default 6). + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: od invocation, Prev: nl invocation, Up: Output of entire files + +3.4 `od': Write files in octal or other formats +=============================================== + +`od' writes an unambiguous representation of each FILE (`-' means +standard input), or standard input if none are given. Synopses: + + od [OPTION]... [FILE]... + od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]] + od [OPTION]... --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]] + + Each line of output consists of the offset in the input, followed by +groups of data from the file. By default, `od' prints the offset in +octal, and each group of file data is a C `short int''s worth of input +printed as a single octal number. + + If OFFSET is given, it specifies how many input bytes to skip before +formatting and writing. By default, it is interpreted as an octal +number, but the optional trailing decimal point causes it to be +interpretated as decimal. If no decimal is specified and the offset +begins with `0x' or `0X' it is interpreted as a hexadecimal number. If +there is a trailing `b', the number of bytes skipped will be OFFSET +multiplied by 512. + + If a command is of both the first and second forms, the second form +is assumed if the last operand begins with `+' or (if there are two +operands) a digit. For example, in `od foo 10' and `od +10' the `10' +is an offset, whereas in `od 10' the `10' is a file name. + + The program accepts the following options. Also see *Note Common +options::. + +`-A RADIX' +`--address-radix=RADIX' + Select the base in which file offsets are printed. RADIX can be + one of the following: + + `d' + decimal; + + `o' + octal; + + `x' + hexadecimal; + + `n' + none (do not print offsets). + + The default is octal. + +`-j BYTES' +`--skip-bytes=BYTES' + Skip BYTES input bytes before formatting and writing. If BYTES + begins with `0x' or `0X', it is interpreted in hexadecimal; + otherwise, if it begins with `0', in octal; otherwise, in decimal. + Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by + 1048576. + +`-N BYTES' +`--read-bytes=BYTES' + Output at most BYTES bytes of the input. Prefixes and suffixes on + `bytes' are interpreted as for the `-j' option. + +`-S N' +`--strings[=N]' + Instead of the normal output, output only "string constants": at + least N consecutive ASCII graphic characters, followed by a null + (zero) byte. + + If N is omitted with `--strings', the default is 3. + +`-t TYPE' +`--format=TYPE' + Select the format in which to output the file data. TYPE is a + string of one or more of the below type indicator characters. If + you include more than one type indicator character in a single TYPE + string, or use this option more than once, `od' writes one copy of + each output line using each of the data types that you specified, + in the order that you specified. + + Adding a trailing "z" to any type specification appends a display + of the ASCII character representation of the printable characters + to the output line generated by the type specification. + + `a' + named character + + `c' + ASCII character or backslash escape, + + `d' + signed decimal + + `f' + floating point + + `o' + octal + + `u' + unsigned decimal + + `x' + hexadecimal + + The type `a' outputs things like `sp' for space, `nl' for newline, + and `nul' for a null (zero) byte. Type `c' outputs ` ', `\n', and + `\0', respectively. + + Except for types `a' and `c', you can specify the number of bytes + to use in interpreting each number in the given data type by + following the type indicator character with a decimal integer. + Alternately, you can specify the size of one of the C compiler's + built-in data types by following the type indicator character with + one of the following characters. For integers (`d', `o', `u', + `x'): + + `C' + char + + `S' + short + + `I' + int + + `L' + long + + For floating point (`f'): + + F + float + + D + double + + L + long double + +`-v' +`--output-duplicates' + Output consecutive lines that are identical. By default, when two + or more consecutive output lines would be identical, `od' outputs + only the first line, and puts just an asterisk on the following + line to indicate the elision. + +`-w N' +`--width[=N]' + Dump `n' input bytes per output line. This must be a multiple of + the least common multiple of the sizes associated with the + specified output types. + + If this option is not given at all, the default is 16. If N is + omitted with `--width', the default is 32. On older systems, GNU + `od' instead supports an obsolete option `-w[N]', where N also + defaults to 32. POSIX 1003.1-2001 (*note Standards conformance::) + does not allow `-w' without an argument; use `--width' instead. + + + The next several options are shorthands for format specifications. +GNU `od' accepts any combination of shorthands and format specification +options. These options accumulate. + +`-a' + Output as named characters. Equivalent to `-t a'. + +`-b' + Output as octal bytes. Equivalent to `-t o1'. + +`-c' + Output as ASCII characters or backslash escapes. Equivalent to + `-t c'. + +`-d' + Output as unsigned decimal two-byte units. Equivalent to `-t u2'. + +`-f' + Output as floats. Equivalent to `-t fF'. + +`-i' + Output as decimal ints. Equivalent to `-t dI'. + +`-l' + Output as decimal long ints. Equivalent to `-t dL'. + +`-o' + Output as octal two-byte units. Equivalent to `-t o2'. + +`-s' + Output as decimal two-byte units. Equivalent to `-t d2'. + +`-x' + Output as hexadecimal two-byte units. Equivalent to `-t x2'. + +`--traditional' + Recognize the non-option label argument that traditional `od' + accepted. The following syntax: + + od --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]] + + can be used to specify at most one file and optional arguments + specifying an offset and a pseudo-start address, LABEL. The LABEL + argument is interpreted just like OFFSET, but it specifies an + initial pseudo-address. The pseudo-addresses are displayed in + parentheses following any normal address. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Formatting file contents, Next: Output of parts of files, Prev: Output of entire files, Up: Top + +4 Formatting file contents +************************** + +These commands reformat the contents of files. + +* Menu: + +* fmt invocation:: Reformat paragraph text. +* pr invocation:: Paginate or columnate files for printing. +* fold invocation:: Wrap input lines to fit in specified width. + + +File: coreutils.info, Node: fmt invocation, Next: pr invocation, Up: Formatting file contents + +4.1 `fmt': Reformat paragraph text +================================== + +`fmt' fills and joins lines to produce output lines of (at most) a +given number of characters (75 by default). Synopsis: + + fmt [OPTION]... [FILE]... + + `fmt' reads from the specified FILE arguments (or standard input if +none are given), and writes to standard output. + + By default, blank lines, spaces between words, and indentation are +preserved in the output; successive input lines with different +indentation are not joined; tabs are expanded on input and introduced on +output. + + `fmt' prefers breaking lines at the end of a sentence, and tries to +avoid line breaks after the first word of a sentence or before the last +word of a sentence. A "sentence break" is defined as either the end of +a paragraph or a word ending in any of `.?!', followed by two spaces or +end of line, ignoring any intervening parentheses or quotes. Like TeX, +`fmt' reads entire "paragraphs" before choosing line breaks; the +algorithm is a variant of that given by Donald E. Knuth and Michael F. +Plass in "Breaking Paragraphs Into Lines", `Software--Practice & +Experience' 11, 11 (November 1981), 1119-1184. + + The program accepts the following options. Also see *Note Common +options::. + +`-c' +`--crown-margin' + "Crown margin" mode: preserve the indentation of the first two + lines within a paragraph, and align the left margin of each + subsequent line with that of the second line. + +`-t' +`--tagged-paragraph' + "Tagged paragraph" mode: like crown margin mode, except that if + indentation of the first line of a paragraph is the same as the + indentation of the second, the first line is treated as a one-line + paragraph. + +`-s' +`--split-only' + Split lines only. Do not join short lines to form longer ones. + This prevents sample lines of code, and other such "formatted" + text from being unduly combined. + +`-u' +`--uniform-spacing' + Uniform spacing. Reduce spacing between words to one space, and + spacing between sentences to two spaces. + +`-WIDTH' +`-w WIDTH' +`--width=WIDTH' + Fill output lines up to WIDTH characters (default 75). `fmt' + initially tries to make lines about 7% shorter than this, to give + it room to balance line lengths. + +`-p PREFIX' +`--prefix=PREFIX' + Only lines beginning with PREFIX (possibly preceded by whitespace) + are subject to formatting. The prefix and any preceding + whitespace are stripped for the formatting and then re-attached to + each formatted output line. One use is to format certain kinds of + program comments, while leaving the code unchanged. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: pr invocation, Next: fold invocation, Prev: fmt invocation, Up: Formatting file contents + +4.2 `pr': Paginate or columnate files for printing +================================================== + +`pr' writes each FILE (`-' means standard input), or standard input if +none are given, to standard output, paginating and optionally +outputting in multicolumn format; optionally merges all FILEs, printing +all in parallel, one per column. Synopsis: + + pr [OPTION]... [FILE]... + + By default, a 5-line header is printed at each page: two blank lines; +a line with the date, the file name, and the page count; and two more +blank lines. A footer of five blank lines is also printed. With the +`-F' option, a 3-line header is printed: the leading two blank lines are +omitted; no footer is used. The default PAGE_LENGTH in both cases is 66 +lines. The default number of text lines changes from 56 (without `-F') +to 63 (with `-F'). The text line of the header takes the form `DATE +STRING PAGE', with spaces inserted around STRING so that the line takes +up the full PAGE_WIDTH. Here, DATE is the date (see the `-D' or +`--date-format' option for details), STRING is the centered header +string, and PAGE identifies the page number. The `LC_MESSAGES' locale +category affects the spelling of PAGE; in the default C locale, it is +`Page NUMBER' where NUMBER is the decimal page number. + + Form feeds in the input cause page breaks in the output. Multiple +form feeds produce empty pages. + + Columns are of equal width, separated by an optional string (default +is `space'). For multicolumn output, lines will always be truncated to +PAGE_WIDTH (default 72), unless you use the `-J' option. For single +column output no line truncation occurs by default. Use `-W' option to +truncate lines in that case. + + The following changes were made in version 1.22i and apply to later +versions of `pr': - Brian + * Some small LETTER OPTIONS (`-s', `-w') have been redefined for + better POSIX compliance. The output of some further cases has + been adapted to other Unix systems. These changes are not + compatible with earlier versions of the program. + + * Some NEW CAPITAL LETTER options (`-J', `-S', `-W') have been + introduced to turn off unexpected interferences of small letter + options. The `-N' option and the second argument LAST_PAGE of + `+FIRST_PAGE' offer more flexibility. The detailed handling of + form feeds set in the input files requires the `-T' option. + + * Capital letter options override small letter ones. + + * Some of the option-arguments (compare `-s', `-e', `-i', `-n') + cannot be specified as separate arguments from the preceding + option letter (already stated in the POSIX specification). + + The program accepts the following options. Also see *Note Common +options::. + +`+FIRST_PAGE[:LAST_PAGE]' +`--pages=FIRST_PAGE[:LAST_PAGE]' + Begin printing with page FIRST_PAGE and stop with LAST_PAGE. + Missing `:LAST_PAGE' implies end of file. While estimating the + number of skipped pages each form feed in the input file results + in a new page. Page counting with and without `+FIRST_PAGE' is + identical. By default, counting starts with the first page of + input file (not first page printed). Line numbering may be + altered by `-N' option. + +`-COLUMN' +`--columns=COLUMN' + With each single FILE, produce COLUMN columns of output (default + is 1) and print columns down, unless `-a' is used. The column + width is automatically decreased as COLUMN increases; unless you + use the `-W/-w' option to increase PAGE_WIDTH as well. This + option might well cause some lines to be truncated. The number of + lines in the columns on each page are balanced. The options `-e' + and `-i' are on for multiple text-column output. Together with + `-J' option column alignment and line truncation is turned off. + Lines of full length are joined in a free field format and `-S' + option may set field separators. `-COLUMN' may not be used with + `-m' option. + +`-a' +`--across' + With each single FILE, print columns across rather than down. The + `-COLUMN' option must be given with COLUMN greater than one. If a + line is too long to fit in a column, it is truncated. + +`-c' +`--show-control-chars' + Print control characters using hat notation (e.g., `^G'); print + other nonprinting characters in octal backslash notation. By + default, nonprinting characters are not changed. + +`-d' +`--double-space' + Double space the output. + +`-D FORMAT' +`--date-format=FORMAT' + Format header dates using FORMAT, using the same conventions as + for the the command `date +FORMAT'; *Note date invocation::. + Except for directives, which start with `%', characters in FORMAT + are printed unchanged. You can use this option to specify an + arbitrary string in place of the header date, e.g., + `--date-format="Monday morning"'. + + Normally the date format defaults to `%Y-%m-%d %H:%M' (for + example, `2001-12-04 23:59'); but if the `POSIXLY_CORRECT' + environment variable is set and the `LC_TIME' locale category + specifies the POSIX locale, the default is `%b %e %H:%M %Y' (for + example, `Dec 4 23:59 2001'. + + Time stamps are listed according to the time zone rules specified + by the `TZ' environment variable, or by the system default rules if + `TZ' is not set. *Note Specifying the Time Zone with `TZ': + (libc)TZ Variable. + +`-e[IN-TABCHAR[IN-TABWIDTH]]' +`--expand-tabs[=IN-TABCHAR[IN-TABWIDTH]]' + Expand TABs to spaces on input. Optional argument IN-TABCHAR is + the input tab character (default is the TAB character). Second + optional argument IN-TABWIDTH is the input tab character's width + (default is 8). + +`-f' +`-F' +`--form-feed' + Use a form feed instead of newlines to separate output pages. The + default page length of 66 lines is not altered. But the number of + lines of text per page changes from default 56 to 63 lines. + +`-h HEADER' +`--header=HEADER' + Replace the file name in the header with the centered string + HEADER. When using the shell, HEADER should be quoted and should + be separated from `-h' by a space. + +`-i[OUT-TABCHAR[OUT-TABWIDTH]]' +`--output-tabs[=OUT-TABCHAR[OUT-TABWIDTH]]' + Replace spaces with TABs on output. Optional argument OUT-TABCHAR + is the output tab character (default is the TAB character). + Second optional argument OUT-TABWIDTH is the output tab + character's width (default is 8). + +`-J' +`--join-lines' + Merge lines of full length. Used together with the column options + `-COLUMN', `-a -COLUMN' or `-m'. Turns off `-W/-w' line + truncation; no column alignment used; may be used with + `--sep-string[=STRING]'. `-J' has been introduced (together with + `-W' and `--sep-string') to disentangle the old (POSIX-compliant) + options `-w' and `-s' along with the three column options. + +`-l PAGE_LENGTH' +`--length=PAGE_LENGTH' + Set the page length to PAGE_LENGTH (default 66) lines, including + the lines of the header [and the footer]. If PAGE_LENGTH is less + than or equal to 10 (or <= 3 with `-F'), the header and footer are + omitted, and all form feeds set in input files are eliminated, as + if the `-T' option had been given. + +`-m' +`--merge' + Merge and print all FILEs in parallel, one in each column. If a + line is too long to fit in a column, it is truncated, unless the + `-J' option is used. `--sep-string[=STRING]' may be used. Empty + pages in some FILEs (form feeds set) produce empty columns, still + marked by STRING. The result is a continuous line numbering and + column marking throughout the whole merged file. Completely empty + merged pages show no separators or line numbers. The default + header becomes `DATE PAGE' with spaces inserted in the middle; this + may be used with the `-h' or `--header' option to fill up the + middle blank part. + +`-n[NUMBER-SEPARATOR[DIGITS]]' +`--number-lines[=NUMBER-SEPARATOR[DIGITS]]' + Provide DIGITS digit line numbering (default for DIGITS is 5). + With multicolumn output the number occupies the first DIGITS + column positions of each text column or only each line of `-m' + output. With single column output the number precedes each line + just as `-m' does. Default counting of the line numbers starts + with the first line of the input file (not the first line printed, + compare the `--page' option and `-N' option). Optional argument + NUMBER-SEPARATOR is the character appended to the line number to + separate it from the text followed. The default separator is the + TAB character. In a strict sense a TAB is always printed with + single column output only. The TAB-width varies with the + TAB-position, e.g., with the left MARGIN specified by `-o' option. + With multicolumn output priority is given to `equal width of + output columns' (a POSIX specification). The TAB-width is fixed + to the value of the first column and does not change with + different values of left MARGIN. That means a fixed number of + spaces is always printed in the place of the NUMBER-SEPARATOR TAB. + The tabification depends upon the output position. + +`-N LINE_NUMBER' +`--first-line-number=LINE_NUMBER' + Start line counting with the number LINE_NUMBER at first line of + first page printed (in most cases not the first line of the input + file). + +`-o MARGIN' +`--indent=MARGIN' + Indent each line with a margin MARGIN spaces wide (default is + zero). The total page width is the size of the margin plus the + PAGE_WIDTH set with the `-W/-w' option. A limited overflow may + occur with numbered single column output (compare `-n' option). + +`-r' +`--no-file-warnings' + Do not print a warning message when an argument FILE cannot be + opened. (The exit status will still be nonzero, however.) + +`-s[CHAR]' +`--separator[=CHAR]' + Separate columns by a single character CHAR. The default for CHAR + is the TAB character without `-w' and `no character' with `-w'. + Without `-s' the default separator `space' is set. `-s[char]' + turns off line truncation of all three column options + (`-COLUMN'|`-a -COLUMN'|`-m') unless `-w' is set. This is a + POSIX-compliant formulation. + +`-S STRING' +`--sep-string[=STRING]' + Use STRING to separate output columns. The `-S' option doesn't + affect the `-W/-w' option, unlike the `-s' option which does. It + does not affect line truncation or column alignment. Without + `-S', and with `-J', `pr' uses the default output separator, TAB. + Without `-S' or `-J', `pr' uses a `space' (same as `-S" "'). With + `-SSTRING', STRING must be nonempty; `--sep-string' with no STRING + is equivalent to `--sep-string=""'. + + On older systems, `pr' instead supports an obsolete option + `-S[STRING]', where STRING is optional. POSIX 1003.1-2001 (*note + Standards conformance::) does not allow this older usage. To + specify an empty STRING portably, use `--sep-string'. + +`-t' +`--omit-header' + Do not print the usual header [and footer] on each page, and do + not fill out the bottom of pages (with blank lines or a form + feed). No page structure is produced, but form feeds set in the + input files are retained. The predefined pagination is not + changed. `-t' or `-T' may be useful together with other options; + e.g.: `-t -e4', expand TAB characters in the input file to 4 + spaces but don't make any other changes. Use of `-t' overrides + `-h'. + +`-T' +`--omit-pagination' + Do not print header [and footer]. In addition eliminate all form + feeds set in the input files. + +`-v' +`--show-nonprinting' + Print nonprinting characters in octal backslash notation. + +`-w PAGE_WIDTH' +`--width=PAGE_WIDTH' + Set page width to PAGE_WIDTH characters for multiple text-column + output only (default for PAGE_WIDTH is 72). `-s[CHAR]' turns off + the default page width and any line truncation and column + alignment. Lines of full length are merged, regardless of the + column options set. No PAGE_WIDTH setting is possible with single + column output. A POSIX-compliant formulation. + +`-W PAGE_WIDTH' +`--page_width=PAGE_WIDTH' + Set the page width to PAGE_WIDTH characters. That's valid with and + without a column option. Text lines are truncated, unless `-J' is + used. Together with one of the three column options (`-COLUMN', + `-a -COLUMN' or `-m') column alignment is always used. The + separator options `-S' or `-s' don't affect the `-W' option. + Default is 72 characters. Without `-W PAGE_WIDTH' and without any + of the column options NO line truncation is used (defined to keep + downward compatibility and to meet most frequent tasks). That's + equivalent to `-W 72 -J'. The header line is never truncated. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: fold invocation, Prev: pr invocation, Up: Formatting file contents + +4.3 `fold': Wrap input lines to fit in specified width +====================================================== + +`fold' writes each FILE (`-' means standard input), or standard input +if none are given, to standard output, breaking long lines. Synopsis: + + fold [OPTION]... [FILE]... + + By default, `fold' breaks lines wider than 80 columns. The output +is split into as many lines as necessary. + + `fold' counts screen columns by default; thus, a tab may count more +than one column, backspace decreases the column count, and carriage +return sets the column to zero. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--bytes' + Count bytes rather than columns, so that tabs, backspaces, and + carriage returns are each counted as taking up one column, just + like other characters. + +`-s' +`--spaces' + Break at word boundaries: the line is broken after the last blank + before the maximum line length. If the line contains no such + blanks, the line is broken at the maximum line length as usual. + +`-w WIDTH' +`--width=WIDTH' + Use a maximum line length of WIDTH columns instead of 80. + + On older systems, `fold' supports an obsolete option `-WIDTH'. + POSIX 1003.1-2001 (*note Standards conformance::) does not allow + this; use `-w WIDTH' instead. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Output of parts of files, Next: Summarizing files, Prev: Formatting file contents, Up: Top + +5 Output of parts of files +************************** + +These commands output pieces of the input. + +* Menu: + +* head invocation:: Output the first part of files. +* tail invocation:: Output the last part of files. +* split invocation:: Split a file into fixed-size pieces. +* csplit invocation:: Split a file into context-determined pieces. + + +File: coreutils.info, Node: head invocation, Next: tail invocation, Up: Output of parts of files + +5.1 `head': Output the first part of files +========================================== + +`head' prints the first part (10 lines by default) of each FILE; it +reads from standard input if no files are given or when given a FILE of +`-'. Synopsis: + + head [OPTION]... [FILE]... + + If more than one FILE is specified, `head' prints a one-line header +consisting of: + + ==> FILE NAME <== + +before the output for each FILE. + + The program accepts the following options. Also see *Note Common +options::. + +`-c N' +`--bytes=N' + Print the first N bytes, instead of initial lines. Appending `b' + multiplies N by 512, `k' by 1024, and `m' by 1048576. However, if + N starts with a `-', print all but the last N bytes of each file. + +`-n N' +`--lines=N' + Output the first N lines. However, if N starts with a `-', print + all but the last N lines of each file. + +`-q' +`--quiet' +`--silent' + Never print file name headers. + +`-v' +`--verbose' + Always print file name headers. + + + On older systems, `head' supports an obsolete option +`-COUNTOPTIONS', which is recognized only if it is specified first. +COUNT is a decimal number optionally followed by a size letter (`b', +`k', `m') as in `-c', or `l' to mean count by lines, or other option +letters (`cqv'). POSIX 1003.1-2001 (*note Standards conformance::) +does not allow this; use `-c COUNT' or `-n COUNT' instead. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: tail invocation, Next: split invocation, Prev: head invocation, Up: Output of parts of files + +5.2 `tail': Output the last part of files +========================================= + +`tail' prints the last part (10 lines by default) of each FILE; it +reads from standard input if no files are given or when given a FILE of +`-'. Synopsis: + + tail [OPTION]... [FILE]... + + If more than one FILE is specified, `tail' prints a one-line header +consisting of: + + ==> FILE NAME <== + +before the output for each FILE. + + GNU `tail' can output any amount of data (some other versions of +`tail' cannot). It also has no `-r' option (print in reverse), since +reversing a file is really a different job from printing the end of a +file; BSD `tail' (which is the one with `-r') can only reverse files +that are at most as large as its buffer, which is typically 32 KiB. A +more reliable and versatile way to reverse files is the GNU `tac' +command. + + If any option-argument is a number N starting with a `+', `tail' +begins printing with the Nth item from the start of each file, instead +of from the end. + + The program accepts the following options. Also see *Note Common +options::. + +`-c BYTES' +`--bytes=BYTES' + Output the last BYTES bytes, instead of final lines. Appending + `b' multiplies BYTES by 512, `k' by 1024, and `m' by 1048576. + +`-f' +`--follow[=HOW]' + Loop forever trying to read more characters at the end of the file, + presumably because the file is growing. This option is ignored if + no FILE operand is specified and standard input is a pipe. If + more than one file is given, `tail' prints a header whenever it + gets output from a different file, to indicate which file that + output is from. + + There are two ways to specify how you'd like to track files with + this option, but that difference is noticeable only when a + followed file is removed or renamed. If you'd like to continue to + track the end of a growing file even after it has been unlinked, + use `--follow=descriptor'. This is the default behavior, but it + is not useful if you're tracking a log file that may be rotated + (removed or renamed, then reopened). In that case, use + `--follow=name' to track the named file by reopening it + periodically to see if it has been removed and recreated by some + other program. + + No matter which method you use, if the tracked file is determined + to have shrunk, `tail' prints a message saying the file has been + truncated and resumes tracking the end of the file from the + newly-determined endpoint. + + When a file is removed, `tail''s behavior depends on whether it is + following the name or the descriptor. When following by name, + tail can detect that a file has been removed and gives a message + to that effect, and if `--retry' has been specified it will + continue checking periodically to see if the file reappears. When + following a descriptor, tail does not detect that the file has + been unlinked or renamed and issues no message; even though the + file may no longer be accessible via its original name, it may + still be growing. + + The option values `descriptor' and `name' may be specified only + with the long form of the option, not with `-f'. + +`-F' + This option is the same as `--follow=name --retry'. That is, tail + will attempt to reopen a file when it is removed. Should this + fail, tail will keep trying until it becomes accessible again. + +`--retry' + This option is meaningful only when following by name. Without + this option, when tail encounters a file that doesn't exist or is + otherwise inaccessible, it reports that fact and never checks it + again. + +`--sleep-interval=NUMBER' + Change the number of seconds to wait between iterations (the + default is 1.0). During one iteration, every specified file is + checked to see if it has changed size. Historical implementations + of `tail' have required that NUMBER be an integer. However, GNU + `tail' accepts an arbitrary floating point number (using a period + before any fractional digits). + +`--pid=PID' + When following by name or by descriptor, you may specify the + process ID, PID, of the sole writer of all FILE arguments. Then, + shortly after that process terminates, tail will also terminate. + This will work properly only if the writer and the tailing process + are running on the same machine. For example, to save the output + of a build in a file and to watch the file grow, if you invoke + `make' and `tail' like this then the tail process will stop when + your build completes. Without this option, you would have had to + kill the `tail -f' process yourself. + + $ make >& makerr & tail --pid=$! -f makerr + + If you specify a PID that is not in use or that does not correspond + to the process that is writing to the tailed files, then `tail' + may terminate long before any FILEs stop growing or it may not + terminate until long after the real writer has terminated. Note + that `--pid' cannot be supported on some systems; `tail' will + print a warning if this is the case. + +`--max-unchanged-stats=N' + When tailing a file by name, if there have been N (default + n=5) consecutive iterations for which the file has not changed, + then `open'/`fstat' the file to determine if that file name is + still associated with the same device/inode-number pair as before. + When following a log file that is rotated, this is approximately + the number of seconds between when tail prints the last + pre-rotation lines and when it prints the lines that have + accumulated in the new log file. This option is meaningful only + when following by name. + +`-n N' +`--lines=N' + Output the last N lines. + +`-q' +`--quiet' +`--silent' + Never print file name headers. + +`-v' +`--verbose' + Always print file name headers. + + + On older systems, `tail' supports an obsolete option +`-COUNT[bcl][f]', which is recognized only if it is specified first. +COUNT is an optional decimal number optionally followed by a size +letter (`b', `c', `l') to mean count by 512-byte blocks, bytes, or +lines, optionally followed by `f' which has the same meaning as `-f'. +Also, the leading `-' can be replaced by `+' with the same meaning as +in counts. POSIX 1003.1-2001 (*note Standards conformance::) does not +allow most of these obsolete usages; use `-c COUNT[b]', `-n COUNT', +and/or `-f' instead. + + On older systems, obsolete usage overrides normal usage, so portable +shell scripts should avoid commands that can be interpreted either way. +For example, use `tail -- - file' rather than `tail - file', and use +`tail -c4' rather than `tail -c 4'. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: split invocation, Next: csplit invocation, Prev: tail invocation, Up: Output of parts of files + +5.3 `split': Split a file into fixed-size pieces +================================================ + +`split' creates output files containing consecutive sections of INPUT +(standard input if none is given or INPUT is `-'). Synopsis: + + split [OPTION] [INPUT [PREFIX]] + + By default, `split' puts 1000 lines of INPUT (or whatever is left +over for the last section), into each output file. + + The output files' names consist of PREFIX (`x' by default) followed +by a group of characters (`aa', `ab', ... by default), such that +concatenating the output files in traditional sorted order by file name +produces the original input file. If the output file names are +exhausted, `split' reports an error without deleting the output files +that it did create. + + The program accepts the following options. Also see *Note Common +options::. + +`-a LENGTH' +`--suffix-length=LENGTH' + Use suffixes of length LENGTH. The default LENGTH is 2. + +`-l LINES' +`--lines=LINES' + Put LINES lines of INPUT into each output file. + + On older systems, `split' supports an obsolete option `-LINES'. + POSIX 1003.1-2001 (*note Standards conformance::) does not allow + this; use `-l LINES' instead. + +`-b BYTES' +`--bytes=BYTES' + Put the first BYTES bytes of INPUT into each output file. + Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by + 1048576. + +`-C BYTES' +`--line-bytes=BYTES' + Put into each output file as many complete lines of INPUT as + possible without exceeding BYTES bytes. For lines longer than + BYTES bytes, put BYTES bytes into each output file until less than + BYTES bytes of the line are left, then continue normally. BYTES + has the same format as for the `--bytes' option. + +`-d' +`--numeric-suffixes' + Use digits in suffixes rather than lower-case letters. + +`--verbose' + Write a diagnostic to standard error just before each output file + is opened. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: csplit invocation, Prev: split invocation, Up: Output of parts of files + +5.4 `csplit': Split a file into context-determined pieces +========================================================= + +`csplit' creates zero or more output files containing sections of INPUT +(standard input if INPUT is `-'). Synopsis: + + csplit [OPTION]... INPUT PATTERN... + + The contents of the output files are determined by the PATTERN +arguments, as detailed below. An error occurs if a PATTERN argument +refers to a nonexistent line of the input file (e.g., if no remaining +line matches a given regular expression). After every PATTERN has been +matched, any remaining input is copied into one last output file. + + By default, `csplit' prints the number of bytes written to each +output file after it has been created. + + The types of pattern arguments are: + +`N' + Create an output file containing the input up to but not including + line N (a positive integer). If followed by a repeat count, also + create an output file containing the next N lines of the input + file once for each repeat. + +`/REGEXP/[OFFSET]' + Create an output file containing the current line up to (but not + including) the next line of the input file that contains a match + for REGEXP. The optional OFFSET is an integer. If it is given, + the input up to (but not including) the matching line plus or + minus OFFSET is put into the output file, and the line after that + begins the next section of input. + +`%REGEXP%[OFFSET]' + Like the previous type, except that it does not create an output + file, so that section of the input file is effectively ignored. + +`{REPEAT-COUNT}' + Repeat the previous pattern REPEAT-COUNT additional times. The + REPEAT-COUNT can either be a positive integer or an asterisk, + meaning repeat as many times as necessary until the input is + exhausted. + + + The output files' names consist of a prefix (`xx' by default) +followed by a suffix. By default, the suffix is an ascending sequence +of two-digit decimal numbers from `00' to `99'. In any case, +concatenating the output files in sorted order by file name produces the +original input file. + + By default, if `csplit' encounters an error or receives a hangup, +interrupt, quit, or terminate signal, it removes any output files that +it has created so far before it exits. + + The program accepts the following options. Also see *Note Common +options::. + +`-f PREFIX' +`--prefix=PREFIX' + Use PREFIX as the output file name prefix. + +`-b SUFFIX' +`--suffix=SUFFIX' + Use SUFFIX as the output file name suffix. When this option is + specified, the suffix string must include exactly one + `printf(3)'-style conversion specification, possibly including + format specification flags, a field width, a precision + specifications, or all of these kinds of modifiers. The format + letter must convert a binary integer argument to readable form; + thus, only `d', `i', `u', `o', `x', and `X' conversions are + allowed. The entire SUFFIX is given (with the current output file + number) to `sprintf(3)' to form the file name suffixes for each of + the individual output files in turn. If this option is used, the + `--digits' option is ignored. + +`-n DIGITS' +`--digits=DIGITS' + Use output file names containing numbers that are DIGITS digits + long instead of the default 2. + +`-k' +`--keep-files' + Do not remove output files when errors are encountered. + +`-z' +`--elide-empty-files' + Suppress the generation of zero-length output files. (In cases + where the section delimiters of the input file are supposed to + mark the first lines of each of the sections, the first output + file will generally be a zero-length file unless you use this + option.) The output file sequence numbers always run + consecutively starting from 0, even when this option is specified. + +`-s' +`-q' +`--silent' +`--quiet' + Do not print counts of output file sizes. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Summarizing files, Next: Operating on sorted files, Prev: Output of parts of files, Up: Top + +6 Summarizing files +******************* + +These commands generate just a few numbers representing entire contents +of files. + +* Menu: + +* wc invocation:: Print newline, word, and byte counts. +* sum invocation:: Print checksum and block counts. +* cksum invocation:: Print CRC checksum and byte counts. +* md5sum invocation:: Print or check message-digests. + + +File: coreutils.info, Node: wc invocation, Next: sum invocation, Up: Summarizing files + +6.1 `wc': Print newline, word, and byte counts +============================================== + +`wc' counts the number of bytes, characters, whitespace-separated +words, and newlines in each given FILE, or standard input if none are +given or for a FILE of `-'. Synopsis: + + wc [OPTION]... [FILE]... + + `wc' prints one line of counts for each file, and if the file was +given as an argument, it prints the file name following the counts. If +more than one FILE is given, `wc' prints a final line containing the +cumulative counts, with the file name `total'. The counts are printed +in this order: newlines, words, characters, bytes. Each count is +printed right-justified in a field with at least one space between +fields so that the numbers and file names normally line up nicely in +columns. The width of the count fields varies depending on the inputs, +so you should not depend on a particular field width. However, as a +GNU extension, if only one count is printed, it is guaranteed to be +printed without leading spaces. + + By default, `wc' prints three counts: the newline, words, and byte +counts. Options can specify that only certain counts be printed. +Options do not undo others previously given, so + + wc --bytes --words + +prints both the byte counts and the word counts. + + With the `--max-line-length' option, `wc' prints the length of the +longest line per file, and if there is more than one file it prints the +maximum (not the sum) of those lengths. + + The program accepts the following options. Also see *Note Common +options::. + +`-c' +`--bytes' + Print only the byte counts. + +`-m' +`--chars' + Print only the character counts. + +`-w' +`--words' + Print only the word counts. + +`-l' +`--lines' + Print only the newline counts. + +`-L' +`--max-line-length' + Print only the maximum line lengths. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: sum invocation, Next: cksum invocation, Prev: wc invocation, Up: Summarizing files + +6.2 `sum': Print checksum and block counts +========================================== + +`sum' computes a 16-bit checksum for each given FILE, or standard input +if none are given or for a FILE of `-'. Synopsis: + + sum [OPTION]... [FILE]... + + `sum' prints the checksum for each FILE followed by the number of +blocks in the file (rounded up). If more than one FILE is given, file +names are also printed (by default). (With the `--sysv' option, +corresponding file names are printed when there is at least one file +argument.) + + By default, GNU `sum' computes checksums using an algorithm +compatible with BSD `sum' and prints file sizes in units of 1024-byte +blocks. + + The program accepts the following options. Also see *Note Common +options::. + +`-r' + Use the default (BSD compatible) algorithm. This option is + included for compatibility with the System V `sum'. Unless `-s' + was also given, it has no effect. + +`-s' +`--sysv' + Compute checksums using an algorithm compatible with System V + `sum''s default, and print file sizes in units of 512-byte blocks. + + + `sum' is provided for compatibility; the `cksum' program (see next +section) is preferable in new applications. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: cksum invocation, Next: md5sum invocation, Prev: sum invocation, Up: Summarizing files + +6.3 `cksum': Print CRC checksum and byte counts +=============================================== + +`cksum' computes a cyclic redundancy check (CRC) checksum for each +given FILE, or standard input if none are given or for a FILE of `-'. +Synopsis: + + cksum [OPTION]... [FILE]... + + `cksum' prints the CRC checksum for each file along with the number +of bytes in the file, and the file name unless no arguments were given. + + `cksum' is typically used to ensure that files transferred by +unreliable means (e.g., netnews) have not been corrupted, by comparing +the `cksum' output for the received files with the `cksum' output for +the original files (typically given in the distribution). + + The CRC algorithm is specified by the POSIX standard. It is not +compatible with the BSD or System V `sum' algorithms (see the previous +section); it is more robust. + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: md5sum invocation, Prev: cksum invocation, Up: Summarizing files + +6.4 `md5sum': Print or check message-digests +============================================ + +`md5sum' computes a 128-bit checksum (or "fingerprint" or +"message-digest") for each specified FILE. If a FILE is specified as +`-' or if no files are given `md5sum' computes the checksum for the +standard input. `md5sum' can also determine whether a file and +checksum are consistent. Synopses: + + md5sum [OPTION]... [FILE]... + md5sum [OPTION]... --check [FILE] + + For each FILE, `md5sum' outputs the MD5 checksum, a flag indicating +a binary or text input file, and the file name. If FILE is omitted or +specified as `-', standard input is read. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--binary' + Treat all input files as binary. This option has no effect on Unix + systems, since they don't distinguish between binary and text + files. This option is useful on systems that have different + internal and external character representations. On MS-DOS and + MS-Windows, this is the default. + +`-c' +`--check' + Read file names and checksum information from the single FILE (or + from stdin if no FILE was specified) and report whether each named + file and the corresponding checksum data are consistent. The + input to this mode of `md5sum' is usually the output of a prior, + checksum-generating run of `md5sum'. Each valid line of input + consists of an MD5 checksum, a binary/text flag, and then a file + name. Binary files are marked with `*', text with ` '. For each + such line, `md5sum' reads the named file and computes its MD5 + checksum. Then, if the computed message digest does not match the + one on the line with the file name, the file is noted as having + failed the test. Otherwise, the file passes the test. By + default, for each valid line, one line is written to standard + output indicating whether the named file passed the test. After + all checks have been performed, if there were any failures, a + warning is issued to standard error. Use the `--status' option to + inhibit that output. If any listed file cannot be opened or read, + if any valid line has an MD5 checksum inconsistent with the + associated file, or if no valid line is found, `md5sum' exits with + nonzero status. Otherwise, it exits successfully. + +`--status' + This option is useful only when verifying checksums. When + verifying checksums, don't generate the default one-line-per-file + diagnostic and don't output the warning summarizing any failures. + Failures to open or read a file still evoke individual diagnostics + to standard error. If all listed files are readable and are + consistent with the associated MD5 checksums, exit successfully. + Otherwise exit with a status code indicating there was a failure. + +`-t' +`--text' + Treat all input files as text files. This is the reverse of + `--binary'. + +`-w' +`--warn' + When verifying checksums, warn about improperly formatted MD5 + checksum lines. This option is useful only if all but a few lines + in the checked input are valid. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Operating on sorted files, Next: Operating on fields within a line, Prev: Summarizing files, Up: Top + +7 Operating on sorted files +*************************** + +These commands work with (or produce) sorted files. + +* Menu: + +* sort invocation:: Sort text files. +* uniq invocation:: Uniquify files. +* comm invocation:: Compare two sorted files line by line. +* ptx invocation:: Produce a permuted index of file contents. +* tsort invocation:: Topological sort. +* tsort background:: Where tsort came from. + + +File: coreutils.info, Node: sort invocation, Next: uniq invocation, Up: Operating on sorted files + +7.1 `sort': Sort text files +=========================== + +`sort' sorts, merges, or compares all the lines from the given files, +or standard input if none are given or for a FILE of `-'. By default, +`sort' writes the results to standard output. Synopsis: + + sort [OPTION]... [FILE]... + + `sort' has three modes of operation: sort (the default), merge, and +check for sortedness. The following options change the operation mode: + +`-c' +`--check' + Check whether the given files are already sorted: if they are not + all sorted, print an error message and exit with a status of 1. + Otherwise, exit successfully. + +`-m' +`--merge' + Merge the given files by sorting them as a group. Each input file + must always be individually sorted. It always works to sort + instead of merge; merging is provided because it is faster, in the + case where it works. + + + A pair of lines is compared as follows: `sort' compares each pair of +fields, in the order specified on the command line, according to the +associated ordering options, until a difference is found or no fields +are left. If no key fields are specified, `sort' uses a default key of +the entire line. Finally, as a last resort when all keys compare +equal, `sort' compares entire lines as if no ordering options other +than `--reverse' (`-r') were specified. The `--stable' (`-s') option +disables this "last-resort comparison" so that lines in which all +fields compare equal are left in their original relative order. The +`--unique' (`-u') option also disables the last-resort comparison. + + Unless otherwise specified, all comparisons use the character +collating sequence specified by the `LC_COLLATE' locale.(1) + + GNU `sort' (as specified for all GNU utilities) has no limit on +input line length or restrictions on bytes allowed within lines. In +addition, if the final byte of an input file is not a newline, GNU +`sort' silently supplies one. A line's trailing newline is not part of +the line for comparison purposes. + + Exit status: + + 0 if no error occurred + 1 if invoked with `-c' and the input is not properly sorted + 2 if an error occurred + + If the environment variable `TMPDIR' is set, `sort' uses its value +as the directory for temporary files instead of `/tmp'. The +`--temporary-directory' (`-T') option in turn overrides the environment +variable. + + The following options affect the ordering of output lines. They may +be specified globally or as part of a specific key field. If no key +fields are specified, global options apply to comparison of entire +lines; otherwise the global options are inherited by key fields that do +not specify any special options of their own. In pre-POSIX versions of +`sort', global options affect only later key fields, so portable shell +scripts should specify global options first. + +`-b' +`--ignore-leading-blanks' + Ignore leading blanks when finding sort keys in each line. The + `LC_CTYPE' locale determines character types. + +`-d' +`--dictionary-order' + Sort in "phone directory" order: ignore all characters except + letters, digits and blanks when sorting. The `LC_CTYPE' locale + determines character types. + +`-f' +`--ignore-case' + Fold lowercase characters into the equivalent uppercase characters + when comparing so that, for example, `b' and `B' sort as equal. + The `LC_CTYPE' locale determines character types. + +`-g' +`--general-numeric-sort' + Sort numerically, using the standard C function `strtod' to convert + a prefix of each line to a double-precision floating point number. + This allows floating point numbers to be specified in scientific + notation, like `1.0e-34' and `10e100'. The `LC_NUMERIC' locale + determines the decimal-point character. Do not report overflow, + underflow, or conversion errors. Use the following collating + sequence: + + * Lines that do not start with numbers (all considered to be + equal). + + * NaNs ("Not a Number" values, in IEEE floating point + arithmetic) in a consistent but machine-dependent order. + + * Minus infinity. + + * Finite numbers in ascending numeric order (with -0 and +0 + equal). + + * Plus infinity. + + Use this option only if there is no alternative; it is much slower + than `--numeric-sort' (`-n') and it can lose information when + converting to floating point. + +`-i' +`--ignore-nonprinting' + Ignore nonprinting characters. The `LC_CTYPE' locale determines + character types. This option has no effect if the stronger + `--dictionary-order' (`-d') option is also given. + +`-M' +`--month-sort' + An initial string, consisting of any amount of blanks, followed by + a month name abbreviation, is folded to UPPER case and compared in + the order `JAN' < `FEB' < ... < `DEC'. Invalid names compare low + to valid names. The `LC_TIME' locale category determines the + month spellings. + +`-n' +`--numeric-sort' + Sort numerically: the number begins each line; specifically, it + consists of optional blanks, an optional `-' sign, and zero or more + digits possibly separated by thousands separators, optionally + followed by a decimal-point character and zero or more digits. A + string of no digits is interpreted as `0'. The `LC_NUMERIC' + locale specifies the decimal-point character and thousands + separator. + + Numeric sort uses what might be considered an unconventional + method to compare strings representing floating point numbers. + Rather than first converting each string to the C `double' type + and then comparing those values, `sort' aligns the decimal-point + characters in the two strings and compares the strings a character + at a time. One benefit of using this approach is its speed. In + practice this is much more efficient than performing the two + corresponding string-to-double (or even string-to-integer) + conversions and then comparing doubles. In addition, there is no + corresponding loss of precision. Converting each string to + `double' before comparison would limit precision to about 16 + digits on most systems. + + Neither a leading `+' nor exponential notation is recognized. To + compare such strings numerically, use the `--general-numeric-sort' + (`-g') option. + +`-r' +`--reverse' + Reverse the result of comparison, so that lines with greater key + values appear earlier in the output instead of later. + + + Other options are: + +`-k POS1[,POS2]' +`--key=POS1[,POS2]' + Specify a sort field that consists of the part of the line between + POS1 and POS2 (or the end of the line, if POS2 is omitted), + _inclusive_. Fields and character positions are numbered starting + with 1. So to sort on the second field, you'd use `--key=2,2' + (`-k 2,2'). See below for more examples. + +`-o OUTPUT-FILE' +`--output=OUTPUT-FILE' + Write output to OUTPUT-FILE instead of standard output. Normally, + `sort' reads all input before opening OUTPUT-FILE, so you can + safely sort a file in place by using commands like `sort -o F F' + and `cat F | sort -o F'. However, `sort' with `--merge' (`-m') + can open the output file before reading all input, so a command + like `cat F | sort -m -o F - G' is not safe as `sort' might start + writing `F' before `cat' is done reading it. + + On newer systems, `-o' cannot appear after an input file if + `POSIXLY_CORRECT' is set, e.g., `sort F -o F'. Portable scripts + should specify `-o OUTPUT-FILE' before any input files. + +`-s' +`--stable' + Make `sort' stable by disabling its last-resort comparison. This + option has no effect if no fields or global ordering options other + than `--reverse' (`-R') are specified. + +`-S SIZE' +`--buffer-size=SIZE' + Use a main-memory sort buffer of the given SIZE. By default, SIZE + is in units of 1024 bytes. Appending `%' causes SIZE to be + interpreted as a percentage of physical memory. Appending `K' + multiplies SIZE by 1024 (the default), `M' by 1,048,576, `G' by + 1,073,741,824, and so on for `T', `P', `E', `Z', and `Y'. + Appending `b' causes SIZE to be interpreted as a byte count, with + no multiplication. + + This option can improve the performance of `sort' by causing it to + start with a larger or smaller sort buffer than the default. + However, this option affects only the initial buffer size. The + buffer grows beyond SIZE if `sort' encounters input lines larger + than SIZE. + +`-t SEPARATOR' +`--field-separator=SEPARATOR' + Use character SEPARATOR as the field separator when finding the + sort keys in each line. By default, fields are separated by the + empty string between a non-blank character and a blank character. + That is, given the input line ` foo bar', `sort' breaks it into + fields ` foo' and ` bar'. The field separator is not considered + to be part of either the field preceding or the field following, + so with `sort -t " "' the same input line has three fields: an + empty field, `foo', and `bar'. However, fields that extend to the + end of the line, as `-k 2', or fields consisting of a range, as + `-k 2,3', retain the field separators present between the + endpoints of the range. + + To specify a zero byte (ASCII NUL (Null) character) as the field + separator, use the two-character string `\0', e.g., `sort -t '\0''. + +`-T TEMPDIR' +`--temporary-directory=TEMPDIR' + Use directory TEMPDIR to store temporary files, overriding the + `TMPDIR' environment variable. If this option is given more than + once, temporary files are stored in all the directories given. If + you have a large sort or merge that is I/O-bound, you can often + improve performance by using this option to specify directories on + different disks and controllers. + +`-u' +`--unique' + Normally, output only the first of a sequence of lines that compare + equal. For the `--check' (`-c') option, check that no pair of + consecutive lines compares equal. + + This option also disables the default last-resort comparison. + + The commands `sort -u' and `sort | uniq' are equivalent, but this + equivalence does not extend to arbitrary `sort' options. For + example, `sort -n -u' inspects only the value of the initial + numeric string when checking for uniqueness, whereas `sort -n | + uniq' inspects the entire line. *Note uniq invocation::. + +`-z' +`--zero-terminated' + Treat the input as a set of lines, each terminated by a zero byte + (ASCII NUL (Null) character) instead of an ASCII LF (Line Feed). + This option can be useful in conjunction with `perl -0' or `find + -print0' and `xargs -0' which do the same in order to reliably + handle arbitrary file names (even those containing blanks or other + special characters). + + + Historical (BSD and System V) implementations of `sort' have +differed in their interpretation of some options, particularly `-b', +`-f', and `-n'. GNU sort follows the POSIX behavior, which is usually +(but not always!) like the System V behavior. According to POSIX, `-n' +no longer implies `-b'. For consistency, `-M' has been changed in the +same way. This may affect the meaning of character positions in field +specifications in obscure cases. The only fix is to add an explicit +`-b'. + + A position in a sort field specified with the `-k' option has the +form `F.C', where F is the number of the field to use and C is the +number of the first character from the beginning of the field. In a +start position, an omitted `.C' stands for the field's first character. +In an end position, an omitted or zero `.C' stands for the field's +last character. If the start field falls after the end of the line or +after the end field, the field is empty. If the `-b' option was +specified, the `.C' part of a field specification is counted from the +first nonblank character of the field. + + A sort key position may also have any of the option letters `Mbdfinr' +appended to it, in which case the global ordering options are not used +for that particular field. The `-b' option may be independently +attached to either or both of the start and end positions of a field +specification, and if it is inherited from the global options it will +be attached to both. If input lines can contain leading or adjacent +blanks and `-t' is not used, then `-k' is typically combined with `-b', +`-g', `-M', or `-n'; otherwise the varying numbers of leading blanks in +fields can cause confusing results. + + Keys can span multiple fields. + + On older systems, `sort' supports an obsolete origin-zero syntax +`+POS1 [-POS2]' for specifying sort keys. POSIX 1003.1-2001 (*note +Standards conformance::) does not allow this; use `-k' instead. + + Here are some examples to illustrate various combinations of options. + + * Sort in descending (reverse) numeric order. + + sort -n -r + + * Sort alphabetically, omitting the first and second fields and the + blanks at the start of the third field. This uses a single key + composed of the characters beginning at the start of the first + nonblank character in field three and extending to the end of each + line. + + sort -k 3b + + * Sort numerically on the second field and resolve ties by sorting + alphabetically on the third and fourth characters of field five. + Use `:' as the field delimiter. + + sort -t : -k 2,2n -k 5.3,5.4 + + Note that if you had written `-k 2n' instead of `-k 2,2n' `sort' + would have used all characters beginning in the second field and + extending to the end of the line as the primary _numeric_ key. + For the large majority of applications, treating keys spanning + more than one field as numeric will not do what you expect. + + Also note that the `n' modifier was applied to the field-end + specifier for the first key. It would have been equivalent to + specify `-k 2n,2' or `-k 2n,2n'. All modifiers except `b' apply + to the associated _field_, regardless of whether the modifier + character is attached to the field-start and/or the field-end part + of the key specifier. + + * Sort the password file on the fifth field and ignore any leading + blanks. Sort lines with equal values in field five on the numeric + user ID in field three. Fields are separated by `:'. + + sort -t : -k 5b,5 -k 3,3n /etc/passwd + sort -t : -n -k 5b,5 -k 3,3 /etc/passwd + sort -t : -b -k 5,5 -k 3,3n /etc/passwd + + These three commands have equivalent effect. The first specifies + that the first key's start position ignores leading blanks and the + second key is sorted numerically. The other two commands rely on + global options being inherited by sort keys that lack modifiers. + The inheritance works in this case because `-k 5b,5b' and `-k + 5b,5' are equivalent, as the location of a field-end lacking a `.C' + character position is not affected by whether initial blanks are + skipped. + + * Sort a set of log files, primarily by IPv4 address and secondarily + by time stamp. If two lines' primary and secondary keys are + identical, output the lines in the same order that they were + input. The log files contain lines that look like this: + + 4.150.156.3 - - [01/Apr/2004:06:31:51 +0000] message 1 + 211.24.3.231 - - [24/Apr/2004:20:17:39 +0000] message 2 + + Fields are separated by exactly one space. Sort IPv4 addresses + lexicographically, e.g., 212.61.52.2 sorts before 212.129.233.201 + because 61 is less than 129. + + sort -s -t ' ' -k 4.9n -k 4.5M -k 4.2n -k 4.14,4.21 file*.log | + sort -s -t '.' -k 1,1n -k 2,2n -k 3,3n -k 4,4n + + This example cannot be done with a single `sort' invocation, since + IPv4 address components are separated by `.' while dates come just + after a space. So it is broken down into two invocations of + `sort': the first sorts by time stamp and the second by IPv4 + address. The time stamp is sorted by year, then month, then day, + and finally by hour-minute-second field, using `-k' to isolate each + field. Except for hour-minute-second there's no need to specify + the end of each key field, since the `n' and `M' modifiers sort + based on leading prefixes that cannot cross field boundaries. The + IPv4 addresses are sorted lexicographically. The second sort uses + `-s' so that ties in the primary key are broken by the secondary + key; the first sort uses `-s' so that the combination of the two + sorts is stable. + + * Generate a tags file in case-insensitive sorted order. + + find src -type f -print0 | sort -z -f | xargs -0 etags --append + + The use of `-print0', `-z', and `-0' in this case means that file + names that contain blanks or other special characters are not + broken up by the sort operation. + + + ---------- Footnotes ---------- + + (1) If you use a non-POSIX locale (e.g., by setting `LC_ALL' to +`en_US'), then `sort' may produce output that is sorted differently +than you're accustomed to. In that case, set the `LC_ALL' environment +variable to `C'. Note that setting only `LC_COLLATE' has two problems. +First, it is ineffective if `LC_ALL' is also set. Second, it has +undefined behavior if `LC_CTYPE' (or `LANG', if `LC_CTYPE' is unset) is +set to an incompatible value. For example, you get undefined behavior +if `LC_CTYPE' is `ja_JP.PCK' but `LC_COLLATE' is `en_US.UTF-8'. + + +File: coreutils.info, Node: uniq invocation, Next: comm invocation, Prev: sort invocation, Up: Operating on sorted files + +7.2 `uniq': Uniquify files +========================== + +`uniq' writes the unique lines in the given `input', or standard input +if nothing is given or for an INPUT name of `-'. Synopsis: + + uniq [OPTION]... [INPUT [OUTPUT]] + + By default, `uniq' prints its input lines, except that it discards +all but the first of adjacent repeated lines, so that no output lines +are repeated. Optionally, it can instead discard lines that are not +repeated, or all repeated lines. + + The input need not be sorted, but repeated input lines are detected +only if they are adjacent. If you want to discard non-adjacent +duplicate lines, perhaps you want to use `sort -u'. *Note sort +invocation::. + + Comparisons use the character collating sequence specified by the +`LC_COLLATE' locale category. + + If no OUTPUT file is specified, `uniq' writes to standard output. + + The program accepts the following options. Also see *Note Common +options::. + +`-f N' +`--skip-fields=N' + Skip N fields on each line before checking for uniqueness. Use a + null string for comparison if a line has fewer than N fields. + Fields are sequences of non-space non-tab characters that are + separated from each other by at least one space or tab. + + On older systems, `uniq' supports an obsolete option `-N'. POSIX + 1003.1-2001 (*note Standards conformance::) does not allow this; + use `-f N' instead. + +`-s N' +`--skip-chars=N' + Skip N characters before checking for uniqueness. Use a null + string for comparison if a line has fewer than N characters. If + you use both the field and character skipping options, fields are + skipped over first. + + On older systems, `uniq' supports an obsolete option `+N'. POSIX + 1003.1-2001 (*note Standards conformance::) does not allow this; + use `-s N' instead. + +`-c' +`--count' + Print the number of times each line occurred along with the line. + +`-i' +`--ignore-case' + Ignore differences in case when comparing lines. + +`-d' +`--repeated' + Discard lines that are not repeated. When used by itself, this + option causes `uniq' to print the first copy of each repeated line, + and nothing else. + +`-D' +`--all-repeated[=DELIMIT-METHOD]' + Do not discard the second and subsequent repeated input lines, but + discard lines that are not repeated. This option is useful mainly + in conjunction with other options e.g., to ignore case or to + compare only selected fields. The optional DELIMIT-METHOD tells + how to delimit groups of repeated lines, and must be one of the + following: + + `none' + Do not delimit groups of repeated lines. This is equivalent + to `--all-repeated' (`-D'). + + `prepend' + Output a newline before each group of repeated lines. + + `separate' + Separate groups of repeated lines with a single newline. + This is the same as using `prepend', except that there is no + newline before the first group, and hence may be better + suited for output direct to users. + + Note that when groups are delimited and the input stream contains + two or more consecutive blank lines, then the output is ambiguous. + To avoid that, filter the input through `tr -s '\n'' to replace + each sequence of consecutive newlines with a single newline. + + This is a GNU extension. + +`-u' +`--unique' + Discard the first repeated line. When used by itself, this option + causes `uniq' to print unique lines, and nothing else. + +`-w N' +`--check-chars=N' + Compare at most N characters on each line (after skipping any + specified fields and characters). By default the entire rest of + the lines are compared. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: comm invocation, Next: ptx invocation, Prev: uniq invocation, Up: Operating on sorted files + +7.3 `comm': Compare two sorted files line by line +================================================= + +`comm' writes to standard output lines that are common, and lines that +are unique, to two input files; a file name of `-' means standard +input. Synopsis: + + comm [OPTION]... FILE1 FILE2 + + Before `comm' can be used, the input files must be sorted using the +collating sequence specified by the `LC_COLLATE' locale. If an input +file ends in a non-newline character, a newline is silently appended. +The `sort' command with no options always outputs a file that is +suitable input to `comm'. + + With no options, `comm' produces three-column output. Column one +contains lines unique to FILE1, column two contains lines unique to +FILE2, and column three contains lines common to both files. Columns +are separated by a single TAB character. + + The options `-1', `-2', and `-3' suppress printing of the +corresponding columns. Also see *Note Common options::. + + Unlike some other comparison utilities, `comm' has an exit status +that does not depend on the result of the comparison. Upon normal +completion `comm' produces an exit code of zero. If there is an error +it exits with nonzero status. + + +File: coreutils.info, Node: tsort invocation, Next: tsort background, Prev: ptx invocation, Up: Operating on sorted files + +7.4 `tsort': Topological sort +============================= + +`tsort' performs a topological sort on the given FILE, or standard +input if no input file is given or for a FILE of `-'. For more details +and some history, see *Note tsort background::. Synopsis: + + tsort [OPTION] [FILE] + + `tsort' reads its input as pairs of strings, separated by blanks, +indicating a partial ordering. The output is a total ordering that +corresponds to the given partial ordering. + + For example + + tsort < out + $ dd bs=1 skip=222 count=6 < out 2>/dev/null; echo + deeper + + Note that although the listing above includes a trailing slash for + the `deeper' entry, the offsets select the name without the + trailing slash. However, if you invoke `ls' with `--dired' along + with an option like `--escape' (aka `-b') and operate on a file + whose name contains special characters, notice that the backslash + _is_ included: + + $ touch 'a b' + $ ls -blog --dired 'a b' + -rw-r--r-- 1 0 Dec 3 00:52 a\ b + //DIRED// 31 35 + //DIRED-OPTIONS// --quoting-style=escape + + If you use a quoting style that adds quote marks (e.g., + `--quoting-style=c'), then the offsets include the quote marks. + So beware that the user may select the quoting style via the + environment variable `QUOTING_STYLE'. Hence, applications using + `--dired' should either specify an explicit + `--quoting-style=literal' option (aka `-N' or `--literal') on the + command line, or else be prepared to parse the escaped names. + +`--full-time' + Produce long format directory listings, and list times in full. + It is equivalent to using `--format=long' with + `--time-style=full-iso' (*note Formatting file timestamps::). + +`-g' + Produce long format directory listings, but don't display owner + information. + +`-G' +`--no-group' + Inhibit display of group information in a long format directory + listing. (This is the default in some non-GNU versions of `ls', + so we provide this option for compatibility.) + +`-h' +`--human-readable' + Append a size letter to each size, such as `M' for mebibytes. + Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes. + Use the `--si' option if you prefer powers of 1000. + +`-i' +`--inode' + Print the inode number (also called the file serial number and + index number) of each file to the left of the file name. (This + number uniquely identifies each file within a particular file + system.) + +`-l' +`--format=long' +`--format=verbose' + In addition to the name of each file, print the file type, + permissions, number of hard links, owner name, group name, size, + and timestamp (*note Formatting file timestamps::), normally the + modification time. + + Normally the size is printed as a byte count without punctuation, + but this can be overridden (*note Block size::). For example, `-h' + prints an abbreviated, human-readable count, and + `--block-size="'1"' prints a byte count with the thousands + separator of the current locale. + + For each directory that is listed, preface the files with a line + `total BLOCKS', where BLOCKS is the total disk allocation for all + files in that directory. The block size currently defaults to 1024 + bytes, but this can be overridden (*note Block size::). The + BLOCKS computed counts each hard link separately; this is arguably + a deficiency. + + The permissions listed are similar to symbolic mode specifications + (*note Symbolic Modes::). But `ls' combines multiple bits into the + third character of each set of permissions as follows: + `s' + If the setuid or setgid bit and the corresponding executable + bit are both set. + + `S' + If the setuid or setgid bit is set but the corresponding + executable bit is not set. + + `t' + If the sticky bit and the other-executable bit are both set. + + `T' + If the sticky bit is set but the other-executable bit is not + set. + + `x' + If the executable bit is set and none of the above apply. + + `-' + Otherwise. + + Following the permission bits is a single character that specifies + whether an alternate access method applies to the file. When that + character is a space, there is no alternate access method. When it + is a printing character (e.g., `+'), then there is such a method. + +`-n' +`--numeric-uid-gid' + Produce long format directory listings, but display numeric UIDs + and GIDs instead of the owner and group names. + +`-o' + Produce long format directory listings, but don't display group + information. It is equivalent to using `--format=long' with + `--no-group' . + +`-s' +`--size' + Print the disk allocation of each file to the left of the file + name. This is the amount of disk space used by the file, which is + usually a bit more than the file's size, but it can be less if the + file has holes. + + Normally the disk allocation is printed in units of 1024 bytes, + but this can be overridden (*note Block size::). + + For files that are NFS-mounted from an HP-UX system to a BSD + system, this option reports sizes that are half the correct + values. On HP-UX systems, it reports sizes that are twice the + correct values for files that are NFS-mounted from BSD systems. + This is due to a flaw in HP-UX; it also affects the HP-UX `ls' + program. + +`--si' + Append an SI-style abbreviation to each size, such as `MB' for + megabytes. Powers of 1000 are used, not 1024; `MB' stands for + 1,000,000 bytes. This option is equivalent to `--block-size=si'. + Use the `-h' or `--human-readable' option if you prefer powers of + 1024. + + + +File: coreutils.info, Node: Sorting the output, Next: More details about version sort, Prev: What information is listed, Up: ls invocation + +10.1.3 Sorting the output +------------------------- + +These options change the order in which `ls' sorts the information it +outputs. By default, sorting is done by character code (e.g., ASCII +order). + +`-c' +`--time=ctime' +`--time=status' +`--time=use' + If the long listing format (e.g., `-l', `-o') is being used, print + the status change time (the `ctime' in the inode) instead of the + modification time. When explicitly sorting by time (`--sort=time' + or `-t') or when not using a long listing format, sort according + to the status change time. + +`-f' + Primarily, like `-U'--do not sort; list the files in whatever + order they are stored in the directory. But also enable `-a' (list + all files) and disable `-l', `--color', and `-s' (if they were + specified before the `-f'). + +`-r' +`--reverse' + Reverse whatever the sorting method is--e.g., list files in reverse + alphabetical order, youngest first, smallest first, or whatever. + +`-S' +`--sort=size' + Sort by file size, largest first. + +`-t' +`--sort=time' + Sort by modification time (the `mtime' in the inode), newest first. + +`-u' +`--time=atime' +`--time=access' + If the long listing format (e.g., `--format=long') is being used, + print the last access time (the `atime' in the inode). When + explicitly sorting by time (`--sort=time' or `-t') or when not + using a long listing format, sort according to the access time. + +`-U' +`--sort=none' + Do not sort; list the files in whatever order they are stored in + the directory. (Do not do any of the other unrelated things that + `-f' does.) This is especially useful when listing very large + directories, since not doing any sorting can be noticeably faster. + +`-v' +`--sort=version' + Sort by version name and number, lowest first. It behaves like a + default sort, except that each sequence of decimal digits is + treated numerically as an index/version number. (*Note More + details about version sort::.) + +`-X' +`--sort=extension' + Sort directory contents alphabetically by file extension + (characters after the last `.'); files with no extension are + sorted first. + + + +File: coreutils.info, Node: More details about version sort, Next: General output formatting, Prev: Sorting the output, Up: ls invocation + +10.1.4 More details about version sort +-------------------------------------- + +The version sort takes into account the fact that file names frequently +include indices or version numbers. Standard sorting functions usually +do not produce the ordering that people expect because comparisons are +made on a character-by-character basis. The version sort addresses +this problem, and is especially useful when browsing directories that +contain many files with indices/version numbers in their names: + + $ ls -1 $ ls -1v + foo.zml-1.gz foo.zml-1.gz + foo.zml-100.gz foo.zml-2.gz + foo.zml-12.gz foo.zml-6.gz + foo.zml-13.gz foo.zml-12.gz + foo.zml-2.gz foo.zml-13.gz + foo.zml-25.gz foo.zml-25.gz + foo.zml-6.gz foo.zml-100.gz + + Note also that numeric parts with leading zeroes are considered as +fractional one: + + $ ls -1 $ ls -1v + abc-1.007.tgz abc-1.007.tgz + abc-1.012b.tgz abc-1.01a.tgz + abc-1.01a.tgz abc-1.012b.tgz + + This functionality is implemented using the `strverscmp' function. +*Note String/Array Comparison: (libc)String/Array Comparison. One +result of that implementation decision is that `ls -v' does not use the +locale category, `LC_COLLATE'. As a result, non-numeric prefixes are +sorted as if `LC_COLLATE' were set to `C'. + + +File: coreutils.info, Node: General output formatting, Next: Formatting file timestamps, Prev: More details about version sort, Up: ls invocation + +10.1.5 General output formatting +-------------------------------- + +These options affect the appearance of the overall output. + +`-1' +`--format=single-column' + List one file per line. This is the default for `ls' when standard + output is not a terminal. + +`-C' +`--format=vertical' + List files in columns, sorted vertically. This is the default for + `ls' if standard output is a terminal. It is always the default + for the `dir' and `d' programs. GNU `ls' uses variable width + columns to display as many files as possible in the fewest lines. + +`--color [=WHEN]' + Specify whether to use color for distinguishing file types. WHEN + may be omitted, or one of: + * none - Do not use color at all. This is the default. + + * auto - Only use color if standard output is a terminal. + + * always - Always use color. + Specifying `--color' and no WHEN is equivalent to `--color=always'. + Piping a colorized listing through a pager like `more' or `less' + usually produces unreadable results. However, using `more -f' + does seem to work. + +`-F' +`--classify' +`--indicator-style=classify' + Append a character to each file name indicating the file type. + Also, for regular files that are executable, append `*'. The file + type indicators are `/' for directories, `@' for symbolic links, + `|' for FIFOs, `=' for sockets, and nothing for regular files. Do + not follow symbolic links listed on the command line unless the + `--dereference-command-line' (`-H'), `--dereference' (`-L'), or + `--dereference-command-line-symlink-to-dir' options are specified. + +`--indicator-style=WORD' + Append a character indicator with style WORD to entry names, as + follows: + `none' + Do not append any character indicator; this is the default. + + `file-type' + Append `/' for directories, `@' for symbolic links, `|' for + FIFOs, `=' for sockets, and nothing for regular files. This + is the same as the `-p' or `--file-type' option. + + `classify' + Append `*' for executable regular files, otherwise behave as + for `file-type'. This is the same as the `-F' or + `--classify' option. + +`-k' + Print file sizes in 1024-byte blocks, overriding the default block + size (*note Block size::). This option is equivalent to + `--block-size=1K'. + +`-m' +`--format=commas' + List files horizontally, with as many as will fit on each line, + separated by `, ' (a comma and a space). + +`-p' +`--file-type' +`--indicator-style=file-type' + Append a character to each file name indicating the file type. + This is like `-F', except that executables are not marked. + +`-x' +`--format=across' +`--format=horizontal' + List the files in columns, sorted horizontally. + +`-T COLS' +`--tabsize=COLS' + Assume that each tab stop is COLS columns wide. The default is 8. + `ls' uses tabs where possible in the output, for efficiency. If + COLS is zero, do not use tabs at all. + +`-w' +`--width=COLS' + Assume the screen is COLS columns wide. The default is taken from + the terminal settings if possible; otherwise the environment + variable `COLUMNS' is used if it is set; otherwise the default is + 80. + + + +File: coreutils.info, Node: Formatting file timestamps, Next: Formatting the file names, Prev: General output formatting, Up: ls invocation + +10.1.6 Formatting file timestamps +--------------------------------- + +By default, file timestamps are listed in abbreviated form. Most +locales use a timestamp like `2002-03-30 23:45'. However, the default +POSIX locale uses a date like `Mar 30 2002' for non-recent timestamps, +and a date-without-year and time like `Mar 30 23:45' for recent +timestamps. + + A timestamp is considered to be "recent" if it is less than six +months old, and is not dated in the future. If a timestamp dated today +is not listed in recent form, the timestamp is in the future, which +means you probably have clock skew problems which may break programs +like `make' that rely on file timestamps. + + Time stamps are listed according to the time zone rules specified by +the `TZ' environment variable, or by the system default rules if `TZ' +is not set. *Note Specifying the Time Zone with `TZ': (libc)TZ +Variable. + + The following option changes how file timestamps are printed. + +`--time-style=STYLE' + List timestamps in style STYLE. The STYLE should be one of the + following: + + `+FORMAT' + List timestamps using FORMAT, where FORMAT is interpreted + like the format argument of `date' (*note date invocation::). + For example, `--time-style="+%Y-%m-%d %H:%M:%S"' causes `ls' + to list timestamps like `2002-03-30 23:45:56'. As with + `date', FORMAT's interpretation is affected by the `LC_TIME' + locale category. + + If FORMAT contains two format strings separated by a newline, + the former is used for non-recent files and the latter for + recent files; if you want output columns to line up, you may + need to insert spaces in one of the two formats. + + `full-iso' + List timestamps in full using ISO 8601 date, time, and time + zone format with nanosecond precision, e.g., `2002-03-30 + 23:45:56.477817180 -0700'. This style is equivalent to + `+%Y-%m-%d %H:%M:%S.%N %z'. + + This is useful because the time output includes all the + information that is available from the operating system. For + example, this can help explain `make''s behavior, since GNU + `make' uses the full timestamp to determine whether a file is + out of date. + + `long-iso' + List ISO 8601 date and time in minutes, e.g., `2002-03-30 + 23:45'. These timestamps are shorter than `full-iso' + timestamps, and are usually good enough for everyday work. + This style is equivalent to `%Y-%m-%d %H:%M'. + + `iso' + List ISO 8601 dates for non-recent timestamps (e.g., + `2002-03-30 '), and ISO 8601 month, day, hour, and minute for + recent timestamps (e.g., `03-30 23:45'). These timestamps + are uglier than `long-iso' timestamps, but they carry nearly + the same information in a smaller space and their brevity + helps `ls' output fit within traditional 80-column output + lines. The following two `ls' invocations are equivalent: + + newline=' + ' + ls -l --time-style="+%Y-%m-%d $newline%m-%d %H:%M" + ls -l --time-style="iso" + + `locale' + List timestamps in a locale-dependent form. For example, a + Finnish locale might list non-recent timestamps like `maalis + 30 2002' and recent timestamps like `maalis 30 23:45'. + Locale-dependent timestamps typically consume more space than + `iso' timestamps and are harder for programs to parse because + locale conventions vary so widely, but they are easier for + many people to read. + + The `LC_TIME' locale category specifies the timestamp format. + The default POSIX locale uses timestamps like `Mar 30 2002' + and `Mar 30 23:45'; in this locale, the following two `ls' + invocations are equivalent: + + newline=' + ' + ls -l --time-style="+%b %e %Y$newline%b %e %H:%M" + ls -l --time-style="locale" + + Other locales behave differently. For example, in a German + locale, `--time-style="locale"' might be equivalent to + `--time-style="+%e. %b %Y $newline%e. %b %H:%M"' and might + generate timestamps like `30. Ma"r 2002 ' and `30. Ma"r + 23:45'. + + `posix-STYLE' + List POSIX-locale timestamps if the `LC_TIME' locale category + is POSIX, STYLE timestamps otherwise. For example, the + default style, which is `posix-long-iso', lists timestamps + like `Mar 30 2002' and `Mar 30 23:45' when in the POSIX + locale, and like `2002-03-30 23:45' otherwise. + + You can specify the default value of the `--time-style' option with +the environment variable `TIME_STYLE'; if `TIME_STYLE' is not set the +default style is `posix-long-iso'. GNU Emacs 21 and later can parse +ISO dates, but older Emacs versions do not, so if you are using an +older version of Emacs and specify a non-POSIX locale, you may need to +set `TIME_STYLE="locale"'. + + +File: coreutils.info, Node: Formatting the file names, Prev: Formatting file timestamps, Up: ls invocation + +10.1.7 Formatting the file names +-------------------------------- + +These options change how file names themselves are printed. + +`-b' +`--escape' +`--quoting-style=escape' + Quote nongraphic characters in file names using alphabetic and + octal backslash sequences like those used in C. + +`-N' +`--literal' +`--quoting-style=literal' + Do not quote file names. However, with `ls' nongraphic characters + are still printed as question marks if the output is a terminal + and you do not specify the `--show-control-chars' option. + +`-q' +`--hide-control-chars' + Print question marks instead of nongraphic characters in file + names. This is the default if the output is a terminal and the + program is `ls'. + +`-Q' +`--quote-name' +`--quoting-style=c' + Enclose file names in double quotes and quote nongraphic + characters as in C. + +`--quoting-style=WORD' + Use style WORD to quote file names and other strings that may + contain arbitrary characters. The WORD should be one of the + following: + `literal' + Output strings as-is; this is the same as the `-N' or + `--literal' option. + + `shell' + Quote strings for the shell if they contain shell + metacharacters or would cause ambiguous output. The quoting + is suitable for POSIX-compatible shells like `bash', but it + does not always work for incompatible shells like `csh'. + + `shell-always' + Quote strings for the shell, even if they would normally not + require quoting. + + `c' + Quote strings as for C character string literals, including + the surrounding double-quote characters; this is the same as + the `-Q' or `--quote-name' option. + + `escape' + Quote strings as for C character string literals, except omit + the surrounding double-quote characters; this is the same as + the `-b' or `--escape' option. + + `clocale' + Quote strings as for C character string literals, except use + surrounding quotation marks appropriate for the locale. + + `locale' + Quote strings as for C character string literals, except use + surrounding quotation marks appropriate for the locale, and + quote `like this' instead of "like this" in the default C + locale. This looks nicer on many displays. + + You can specify the default value of the `--quoting-style' option + with the environment variable `QUOTING_STYLE'. If that environment + variable is not set, the default value is `literal', but this + default may change to `shell' in a future version of this package. + +`--show-control-chars' + Print nongraphic characters as-is in file names. This is the + default unless the output is a terminal and the program is `ls'. + + + +File: coreutils.info, Node: dir invocation, Next: vdir invocation, Prev: ls invocation, Up: Directory listing + +10.2 `dir': Briefly list directory contents +=========================================== + +`dir' (also installed as `d') is equivalent to `ls -C -b'; that is, by +default files are listed in columns, sorted vertically, and special +characters are represented by backslash escape sequences. + + *Note `ls': ls invocation. + + +File: coreutils.info, Node: vdir invocation, Next: dircolors invocation, Prev: dir invocation, Up: Directory listing + +10.3 `vdir': Verbosely list directory contents +============================================== + +`vdir' (also installed as `v') is equivalent to `ls -l -b'; that is, by +default files are listed in long format and special characters are +represented by backslash escape sequences. + + +File: coreutils.info, Node: dircolors invocation, Prev: vdir invocation, Up: Directory listing + +10.4 `dircolors': Color setup for `ls' +====================================== + +`dircolors' outputs a sequence of shell commands to set up the terminal +for color output from `ls' (and `dir', etc.). Typical usage: + + eval "`dircolors [OPTION]... [FILE]`" + + If FILE is specified, `dircolors' reads it to determine which colors +to use for which file types and extensions. Otherwise, a precompiled +database is used. For details on the format of these files, run +`dircolors --print-database'. + + The output is a shell command to set the `LS_COLORS' environment +variable. You can specify the shell syntax to use on the command line, +or `dircolors' will guess it from the value of the `SHELL' environment +variable. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--sh' +`--bourne-shell' + Output Bourne shell commands. This is the default if the `SHELL' + environment variable is set and does not end with `csh' or `tcsh'. + +`-c' +`--csh' +`--c-shell' + Output C shell commands. This is the default if `SHELL' ends with + `csh' or `tcsh'. + +`-p' +`--print-database' + Print the (compiled-in) default color configuration database. This + output is itself a valid configuration file, and is fairly + descriptive of the possibilities. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Basic operations, Next: Special file types, Prev: Directory listing, Up: Top + +11 Basic operations +******************* + +This chapter describes the commands for basic file manipulation: +copying, moving (renaming), and deleting (removing). + +* Menu: + +* cp invocation:: Copy files. +* dd invocation:: Convert and copy a file. +* install invocation:: Copy files and set attributes. +* mv invocation:: Move (rename) files. +* rm invocation:: Remove files or directories. +* shred invocation:: Remove files more securely. + + +File: coreutils.info, Node: cp invocation, Next: dd invocation, Up: Basic operations + +11.1 `cp': Copy files and directories +===================================== + +`cp' copies files (or, optionally, directories). The copy is +completely independent of the original. You can either copy one file to +another, or copy arbitrarily many files to a destination directory. +Synopses: + + cp [OPTION]... [-T] SOURCE DEST + cp [OPTION]... SOURCE... DIRECTORY + cp [OPTION]... -t DIRECTORY SOURCE... + + * If two file names are given, `cp' copies the first file to the + second. + + * If the `--target-directory' (`-t') option is given, or failing + that if the last file is a directory and the + `--no-target-directory' (`-T') option is not given, `cp' copies + each SOURCE file to the specified directory, using the SOURCEs' + names. + + Generally, files are written just as they are read. For exceptions, +see the `--sparse' option below. + + By default, `cp' does not copy directories. However, the `-R', +`-a', and `-r' options cause `cp' to copy recursively by descending +into source directories and copying files to corresponding destination +directories. + + By default, `cp' follows symbolic links only when not copying +recursively. This default can be overridden with the `--archive' +(`-a'), `-d', `--dereference' (`-L'), `--no-dereference' (`-P'), and +`-H' options. If more than one of these options is specified, the last +one silently overrides the others. + + By default, `cp' copies the contents of special files only when not +copying recursively. This default can be overridden with the +`--copy-contents' option. + + `cp' generally refuses to copy a file onto itself, with the +following exception: if `--force --backup' is specified with SOURCE and +DEST identical, and referring to a regular file, `cp' will make a +backup file, either regular or numbered, as specified in the usual ways +(*note Backup options::). This is useful when you simply want to make +a backup of an existing file before changing it. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--archive' + Preserve as much as possible of the structure and attributes of the + original files in the copy (but do not attempt to preserve internal + directory structure; i.e., `ls -U' may list the entries in a copied + directory in a different order). Equivalent to `-dpPR'. + +`-b' +`--backup[=METHOD]' + *Note Backup options::. Make a backup of each file that would + otherwise be overwritten or removed. As a special case, `cp' + makes a backup of SOURCE when the force and backup options are + given and SOURCE and DEST are the same name for an existing, + regular file. One useful application of this combination of + options is this tiny Bourne shell script: + + #!/bin/sh + # Usage: backup FILE... + # Create a GNU-style backup of each listed FILE. + for i; do + cp --backup --force -- "$i" "$i" + done + +`--copy-contents' + If copying recursively, copy the contents of any special files + (e.g., FIFOs and device files) as if they were regular files. + This means trying to read the data in each source file and writing + it to the destination. It is usually a mistake to use this + option, as it normally has undesirable effects on special files + like FIFOs and the ones typically found in the `/dev' directory. + In most cases, `cp -R --copy-contents' will hang indefinitely + trying to read from FIFOs and special files like `/dev/console', + and it will fill up your destination disk if you use it to copy + `/dev/zero'. This option has no effect unless copying + recursively, and it does not affect the copying of symbolic links. + +`-d' + Copy symbolic links as symbolic links rather than copying the + files that they point to, and preserve hard links between source + files in the copies. Equivalent to `--no-dereference + --preserve=links'. + +`-f' +`--force' + When copying without this option and an existing destination file + cannot be opened for writing, the copy fails. However, with + `--force'), when a destination file cannot be opened, `cp' then + unlinks it and tries to open it again. Contrast this behavior + with that enabled by `--link' and `--symbolic-link', whereby the + destination file is never opened but rather is unlinked + unconditionally. Also see the description of + `--remove-destination'. + +`-H' + If a command line argument specifies a symbolic link, then copy the + file it points to rather than the symbolic link itself. However, + copy (preserving its nature) any symbolic link that is encountered + via recursive traversal. + +`-i' +`--interactive' + Prompt whether to overwrite existing regular destination files. + +`-l' +`--link' + Make hard links instead of copies of non-directories. + +`-L' +`--dereference' + Always follow symbolic links. + +`-P' +`--no-dereference' + Copy symbolic links as symbolic links rather than copying the + files that they point to. + +`-p' +`--preserve[=ATTRIBUTE_LIST]' + Preserve the specified attributes of the original files. If + specified, the ATTRIBUTE_LIST must be a comma-separated list of + one or more of the following strings: + + `mode' + Preserve the permission attributes. + + `ownership' + Preserve the owner and group. On most modern systems, only + the super-user may change the owner of a file, and regular + users may preserve the group ownership of a file only if they + happen to be a member of the desired group. + + `timestamps' + Preserve the times of last access and last modification. + + `links' + Preserve in the destination files any links between + corresponding source files. + + `all' + Preserve all file attributes. Equivalent to specifying all + of the above. + + Using `--preserve' with no ATTRIBUTE_LIST is equivalent to + `--preserve=mode,ownership,timestamps'. + + In the absence of this option, each destination file is created + with the permissions of the corresponding source file, minus the + bits set in the umask and minus the set-user-id and set-group-id + bits. *Note File permissions::. + +`--no-preserve=ATTRIBUTE_LIST' + Do not preserve the specified attributes. The ATTRIBUTE_LIST has + the same form as for `--preserve'. + +`--parents' + Form the name of each destination file by appending to the target + directory a slash and the specified name of the source file. The + last argument given to `cp' must be the name of an existing + directory. For example, the command: + + cp --parents a/b/c existing_dir + + copies the file `a/b/c' to `existing_dir/a/b/c', creating any + missing intermediate directories. + +`--reply[=HOW]' + Using `--reply=yes' makes `cp' act as if `yes' were given as a + response to every prompt about a destination file. That + effectively cancels any preceding `--interactive' or `-i' option. + Specify `--reply=no' to make `cp' act as if `no' were given as a + response to every prompt about a destination file. Specify + `--reply=query' to make `cp' prompt the user about each existing + destination file. + +`-R' +`-r' +`--recursive' + Copy directories recursively. Symbolic links are not followed by + default; see the `--archive' (`-a'), `-d', `--dereference' (`-L'), + `--no-dereference' (`-P'), and `-H' options. Special files are + copied by creating a destination file of the same type as the + source; see the `--copy-contents' option. It is not portable to + use `-r' to copy symbolic links or special files. On some non-GNU + systems, `-r' implies the equivalent of `-L' and `--copy-contents' + for historical reasons. Also, it is not portable to use `-R' to + copy symbolic links unless you also specify `-P', as POSIX allows + implementations that dereference symbolic links by default. + +`--remove-destination' + Remove each existing destination file before attempting to open it + (contrast with `-f' above). + +`--sparse=WHEN' + A "sparse file" contains "holes"--a sequence of zero bytes that + does not occupy any physical disk blocks; the `read' system call + reads these as zeroes. This can both save considerable disk space + and increase speed, since many binary files contain lots of + consecutive zero bytes. By default, `cp' detects holes in input + source files via a crude heuristic and makes the corresponding + output file sparse as well. Only regular files may be sparse. + + The WHEN value can be one of the following: + `auto' + The default behavior: if the input file is sparse, attempt to + make the output file sparse, too. However, if an output file + exists but refers to a non-regular file, then do not attempt + to make it sparse. + + `always' + For each sufficiently long sequence of zero bytes in the + input file, attempt to create a corresponding hole in the + output file, even if the input file does not appear to be + sparse. This is useful when the input file resides on a file + system that does not support sparse files (for example, + `efs' file systems in SGI IRIX 5.3 and earlier), but the + output file is on a type of file system that does support + them. Holes may be created only in regular files, so if the + destination file is of some other type, `cp' does not even + try to make it sparse. + + `never' + Never make the output file sparse. This is useful in + creating a file for use with the `mkswap' command, since such + a file must not have any holes. + +`--strip-trailing-slashes' + Remove any trailing slashes from each SOURCE argument. *Note + Trailing slashes::. + +`-s' +`--symbolic-link' + Make symbolic links instead of copies of non-directories. All + source file names must be absolute (starting with `/') unless the + destination files are in the current directory. This option merely + results in an error message on systems that do not support + symbolic links. + +`-S SUFFIX' +`--suffix=SUFFIX' + Append SUFFIX to each backup file made with `-b'. *Note Backup + options::. + +`-t DIRECTORY' +`--target-directory=DIRECTORY' + Specify the destination DIRECTORY. *Note Target directory::. + +`-T' +`--no-target-directory' + Do not treat the last operand specially when it is a directory or a + symbolic link to a directory. *Note Target directory::. + +`-u' +`--update' + Do not copy a non-directory that has an existing destination with + the same or newer modification time. If time stamps are being + preserved, the comparison is to the source time stamp truncated to + the resolutions of the destination file system and of the system + calls used to update time stamps; this avoids duplicate work if + several `cp -pu' commands are executed with the same source and + destination. + +`-v' +`--verbose' + Print the name of each file before copying it. + +`-V METHOD' +`--version-control=METHOD' + Change the type of backups made with `-b'. The METHOD argument + can be `none' (or `off'), `numbered' (or `t'), `existing' (or + `nil'), or `never' (or `simple'). *Note Backup options::. + +`-x' +`--one-file-system' + Skip subdirectories that are on different file systems from the + one that the copy started on. However, mount point directories + _are_ copied. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: dd invocation, Next: install invocation, Prev: cp invocation, Up: Basic operations + +11.2 `dd': Convert and copy a file +================================== + +`dd' copies a file (from standard input to standard output, by default) +with a changeable I/O block size, while optionally performing +conversions on it. Synopses: + + dd [OPERAND]... + dd OPTION + + The only options are `--help' and `--version'. *Note Common +options::. `dd' accepts the following operands. + +`if=FILE' + Read from FILE instead of standard input. + +`of=FILE' + Write to FILE instead of standard output. Unless `conv=notrunc' + is given, `dd' truncates FILE to zero bytes (or the size specified + with `seek='). + +`ibs=BYTES' + Read BYTES bytes at a time. + +`obs=BYTES' + Write BYTES bytes at a time. + +`bs=BYTES' + Both read and write BYTES bytes at a time. This overrides `ibs' + and `obs'. + +`cbs=BYTES' + Convert BYTES bytes at a time. + +`skip=BLOCKS' + Skip BLOCKS `ibs'-byte blocks in the input file before copying. + +`seek=BLOCKS' + Skip BLOCKS `obs'-byte blocks in the output file before copying. + +`count=BLOCKS' + Copy BLOCKS `ibs'-byte blocks from the input file, instead of + everything until the end of the file. + +`conv=CONVERSION[,CONVERSION]...' + Convert the file as specified by the CONVERSION argument(s). (No + spaces around any comma(s).) + + Conversions: + + `ascii' + Convert EBCDIC to ASCII, using the conversion table specified + by POSIX. This provides a 1:1 translation for all 256 bytes. + + `ebcdic' + Convert ASCII to EBCDIC. This is the inverse of the `ascii' + conversion. + + `ibm' + Convert ASCII to alternate EBCDIC, using the alternate + conversion table specified by POSIX. This is not a 1:1 + translation, but reflects common historical practice for `~', + `[', and `]'. + + The `ascii', `ebcdic', and `ibm' conversions are mutually + exclusive. + + `block' + For each line in the input, output `cbs' bytes, replacing the + input newline with a space and padding with spaces as + necessary. + + `unblock' + Replace trailing spaces in each `cbs'-sized input block with a + newline. + + The `block' and `unblock' conversions are mutually exclusive. + + `lcase' + Change uppercase letters to lowercase. + + `ucase' + Change lowercase letters to uppercase. + + The `lcase' and `ucase' conversions are mutually exclusive. + + `swab' + Swap every pair of input bytes. GNU `dd', unlike others, + works when an odd number of bytes are read--the last byte is + simply copied (since there is nothing to swap it with). + + `noerror' + Continue after read errors. + + `nocreat' + Do not create the output file; the output file must already + exist. + + `excl' + Fail if the output file already exists; `dd' must create the + output file itself. + + The `excl' and `nocreat' conversions are mutually exclusive. + + `notrunc' + Do not truncate the output file. + + `sync' + Pad every input block to size of `ibs' with trailing zero + bytes. When used with `block' or `unblock', pad with spaces + instead of zero bytes. + + `fdatasync' + Synchronize output data just before finishing. This forces a + physical write of output data. + + `fsync' + Synchronize output data and metadata just before finishing. + This forces a physical write of output data and metadata. + + +`iflag=FLAG[,FLAG]...' + Access the input file using the flags specified by the FLAG + argument(s). (No spaces around any comma(s).) + +`oflag=FLAG[,FLAG]...' + Access the output file using the flags specified by the FLAG + argument(s). (No spaces around any comma(s).) + + Flags: + + `append' + Write in append mode, so that even if some other process is + writing to this file, every `dd' write will append to the + current contents of the file. This flag makes sense only for + output. + + `direct' + Use direct I/O for data, avoiding the buffer cache. + + `dsync' + Use synchronized I/O for data. For the output file, this + forces a physical write of output data on each write. For + the input file, this flag can matter when reading from a + remote file that has been written to synchronously by some + other process. Metadata (e.g., last-access and last-modified + time) is not necessarily synchronized. + + `sync' + Use synchronized I/O for both data and metadata. + + `nonblock' + Use non-blocking I/O. + + `nofollow' + Do not follow symbolic links. + + `noctty' + Do not assign the file to be a controlling terminal for `dd'. + This has no effect when the file is not a terminal. On many + hosts (e.g., GNU/Linux hosts), this option has no effect at + all. + + + These flags are not supported on all systems, and `dd' rejects + attempts to use them when they are not supported. When reading + from standard input or writing to standard output, the `nofollow' + and `noctty' flags should not be specified, and the other flags + (e.g., `nonblock') can affect how other processes behave with the + affected file descriptors, even after `dd' exits. + + + The numeric-valued strings above (BYTES and BLOCKS) can be followed +by a multiplier: `b'=512, `c'=1, `w'=2, `xM'=M, or any of the standard +block size suffixes like `k'=1024 (*note Block size::). + + Use different `dd' invocations to use different block sizes for +skipping and I/O. For example, the following shell commands copy data +in 512 KiB blocks between a disk and a tape, but do not save or restore +a 4 KiB label at the start of the disk: + + disk=/dev/rdsk/c0t1d0s2 + tape=/dev/rmt/0 + + # Copy all but the label from disk to tape. + (dd bs=4k skip=1 count=0 && dd bs=512k) <$disk >$tape + + # Copy from tape back to disk, but leave the disk label alone. + (dd bs=4k seek=1 count=0 && dd bs=512k) <$tape >$disk + + Note that sending a `SIGUSR1' signal to a running `dd' process makes +it print I/O statistics to standard error, then to resume copying. In +the example below, `dd' is run in the background to copy 10 million +blocks. The `kill' command makes it output intermediate I/O statistics, +and when `dd' completes, it outputs the final statistics. + + $ dd if=/dev/zero of=/dev/null count=10MB & pid=$! + $ kill -s USR1 $pid; wait $pid + 3385223+0 records in + 3385223+0 records out + 1733234176 bytes (1.7 GB) copied, 6.42173 seconds, 270 MB/s + 10000000+0 records in + 10000000+0 records out + 5120000000 bytes (5.1 GB) copied, 18.913 seconds, 271 MB/s + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: install invocation, Next: mv invocation, Prev: dd invocation, Up: Basic operations + +11.3 `install': Copy files and set attributes +============================================= + +`install' copies files while setting their permission modes and, if +possible, their owner and group. Synopses: + + install [OPTION]... [-T] SOURCE DEST + install [OPTION]... SOURCE... DIRECTORY + install [OPTION]... -t DIRECTORY SOURCE... + install [OPTION]... -d DIRECTORY... + + * If two file names are given, `install' copies the first file to the + second. + + * If the `--target-directory' (`-t') option is given, or failing + that if the last file is a directory and the + `--no-target-directory' (`-T') option is not given, `install' + copies each SOURCE file to the specified directory, using the + SOURCEs' names. + + * If the `--directory' (`-d') option is given, `install' creates + each DIRECTORY and any missing parent directories. + + `install' is similar to `cp', but allows you to control the +attributes of destination files. It is typically used in Makefiles to +copy programs into their destination directories. It refuses to copy +files onto themselves. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--backup[=METHOD]' + *Note Backup options::. Make a backup of each file that would + otherwise be overwritten or removed. + +`-c' + Ignored; for compatibility with old Unix versions of `install'. + +`-d' +`--directory' + Create each given directory and any missing parent directories, + setting the owner, group and mode as given on the command line or + to the defaults. It also gives any parent directories it creates + those attributes. (This is different from the SunOS 4.x + `install', which gives directories that it creates the default + attributes.) + +`-g GROUP' +`--group=GROUP' + Set the group ownership of installed files or directories to + GROUP. The default is the process's current group. GROUP may be + either a group name or a numeric group id. + +`-m MODE' +`--mode=MODE' + Set the permissions for the installed file or directory to MODE, + which can be either an octal number, or a symbolic mode as in + `chmod', with 0 as the point of departure (*note File + permissions::). The default mode is `u=rwx,go=rx'--read, write, + and execute for the owner, and read and execute for group and + other. + +`-o OWNER' +`--owner=OWNER' + If `install' has appropriate privileges (is run as root), set the + ownership of installed files or directories to OWNER. The default + is `root'. OWNER may be either a user name or a numeric user ID. + +`-p' +`--preserve-timestamps' + Set the time of last access and the time of last modification of + each installed file to match those of each corresponding original + file. When a file is installed without this option, its last + access and last modification times are both set to the time of + installation. This option is useful if you want to use the last + modification times of installed files to keep track of when they + were last built as opposed to when they were last installed. + +`-s' +`--strip' + Strip the symbol tables from installed binary executables. + +`-S SUFFIX' +`--suffix=SUFFIX' + Append SUFFIX to each backup file made with `-b'. *Note Backup + options::. + +`-t DIRECTORY' +`--target-directory=DIRECTORY' + Specify the destination DIRECTORY. *Note Target directory::. + +`-T' +`--no-target-directory' + Do not treat the last operand specially when it is a directory or a + symbolic link to a directory. *Note Target directory::. + +`-v' +`--verbose' + Print the name of each file before copying it. + +`-V METHOD' +`--version-control=METHOD' + Change the type of backups made with `-b'. The METHOD argument + can be `none' (or `off'), `numbered' (or `t'), `existing' (or + `nil'), or `never' (or `simple'). *Note Backup options::. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: mv invocation, Next: rm invocation, Prev: install invocation, Up: Basic operations + +11.4 `mv': Move (rename) files +============================== + +`mv' moves or renames files (or directories). Synopses: + + mv [OPTION]... [-T] SOURCE DEST + mv [OPTION]... SOURCE... DIRECTORY + mv [OPTION]... -t DIRECTORY SOURCE... + + * If two file names are given, `mv' moves the first file to the + second. + + * If the `--target-directory' (`-t') option is given, or failing + that if the last file is a directory and the + `--no-target-directory' (`-T') option is not given, `mv' moves + each SOURCE file to the specified directory, using the SOURCEs' + names. + + `mv' can move any type of file from one file system to another. +Prior to version `4.0' of the fileutils, `mv' could move only regular +files between file systems. For example, now `mv' can move an entire +directory hierarchy including special device files from one partition +to another. It first uses some of the same code that's used by `cp -a' +to copy the requested directories and files, then (assuming the copy +succeeded) it removes the originals. If the copy fails, then the part +that was copied to the destination partition is removed. If you were +to copy three directories from one partition to another and the copy of +the first directory succeeded, but the second didn't, the first would +be left on the destination partition and the second and third would be +left on the original partition. + + If a destination file exists but is normally unwritable, standard +input is a terminal, and the `-f' or `--force' option is not given, +`mv' prompts the user for whether to replace the file. (You might own +the file, or have write permission on its directory.) If the response +is not affirmative, the file is skipped. + + _Warning_: If you try to move a symlink that points to a directory, +and you specify the symlink with a trailing slash, then `mv' doesn't +move the symlink but instead moves the directory referenced by the +symlink. *Note Trailing slashes::. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--backup[=METHOD]' + *Note Backup options::. Make a backup of each file that would + otherwise be overwritten or removed. + +`-f' +`--force' + Do not prompt the user before removing a destination file. + +`-i' +`--interactive' + Prompt whether to overwrite each existing destination file, + regardless of its permissions. If the response is not + affirmative, the file is skipped. + +`--reply[=HOW]' + Specifying `--reply=yes' is equivalent to using `--force'. + Specify `--reply=no' to make `mv' act as if `no' were given as a + response to every prompt about a destination file. Specify + `--reply=query' to make `mv' prompt the user about each existing + destination file. + +`-u' +`--update' + Do not move a non-directory that has an existing destination with + the same or newer modification time. If the move is across file + system boundaries, the comparison is to the source time stamp + truncated to the resolutions of the destination file system and of + the system calls used to update time stamps; this avoids duplicate + work if several `mv -u' commands are executed with the same source + and destination. + +`-v' +`--verbose' + Print the name of each file before moving it. + +`--strip-trailing-slashes' + Remove any trailing slashes from each SOURCE argument. *Note + Trailing slashes::. + +`-S SUFFIX' +`--suffix=SUFFIX' + Append SUFFIX to each backup file made with `-b'. *Note Backup + options::. + +`-t DIRECTORY' +`--target-directory=DIRECTORY' + Specify the destination DIRECTORY. *Note Target directory::. + +`-T' +`--no-target-directory' + Do not treat the last operand specially when it is a directory or a + symbolic link to a directory. *Note Target directory::. + +`-V METHOD' +`--version-control=METHOD' + Change the type of backups made with `-b'. The METHOD argument + can be `none' (or `off'), `numbered' (or `t'), `existing' (or + `nil'), or `never' (or `simple'). *Note Backup options::. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: rm invocation, Next: shred invocation, Prev: mv invocation, Up: Basic operations + +11.5 `rm': Remove files or directories +====================================== + +`rm' removes each given FILE. By default, it does not remove +directories. Synopsis: + + rm [OPTION]... [FILE]... + + If a file is unwritable, standard input is a terminal, and the `-f' +or `--force' option is not given, or the `-i' or `--interactive' option +_is_ given, `rm' prompts the user for whether to remove the file. If +the response is not affirmative, the file is skipped. + + _Warning_: If you use `rm' to remove a file, it is usually possible +to recover the contents of that file. If you want more assurance that +the contents are truly unrecoverable, consider using `shred'. + + The program accepts the following options. Also see *Note Common +options::. + +`-d' +`--directory' + Use the `unlink' function unconditionally rather than attempting + to check whether the file is a directory and using `rmdir' if it + is a directory. This can be useful on corrupted file systems where + `unlink' works even though other, file-checking functions fail. + For directories, this works only if you have appropriate + privileges and if your operating system supports `unlink' for + directories. Because unlinking a directory causes any files in + the deleted directory to become unreferenced, it is wise to `fsck' + the file system afterwards. + +`-f' +`--force' + Ignore nonexistent files and never prompt the user. Ignore any + previous `--interactive' (`-i') option. + +`-i' +`--interactive' + Prompt whether to remove each file. If the response is not + affirmative, the file is skipped. Ignore any previous `--force' + (`-f') option. + +`--preserve-root' + Fail upon any attempt to remove the file system root, `/', when + used with the `--recursive' option. Without `--recursive', this + option has no effect. *Note Treating / specially::. + +`--no-preserve-root' + Cancel the effect of any preceding `--preserve-root' option. + *Note Treating / specially::. + +`-r' +`-R' +`--recursive' + Remove the contents of directories recursively. + +`-v' +`--verbose' + Print the name of each file before removing it. + + + One common question is how to remove files whose names begin with a +`-'. GNU `rm', like every program that uses the `getopt' function to +parse its arguments, lets you use the `--' option to indicate that all +following arguments are non-options. To remove a file called `-f' in +the current directory, you could type either: + + rm -- -f + +or: + + rm ./-f + + The Unix `rm' program's use of a single `-' for this purpose +predates the development of the getopt standard syntax. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: shred invocation, Prev: rm invocation, Up: Basic operations + +11.6 `shred': Remove files more securely +======================================== + +`shred' overwrites devices or files, to help prevent even very +expensive hardware from recovering the data. + + Ordinarily when you remove a file (*note rm invocation::), the data +is not actually destroyed. Only the index listing where the file is +stored is destroyed, and the storage is made available for reuse. +There are undelete utilities that will attempt to reconstruct the index +and can bring the file back if the parts were not reused. + + On a busy system with a nearly-full drive, space can get reused in a +few seconds. But there is no way to know for sure. If you have +sensitive data, you may want to be sure that recovery is not possible +by actually overwriting the file with non-sensitive data. + + However, even after doing that, it is possible to take the disk back +to a laboratory and use a lot of sensitive (and expensive) equipment to +look for the faint "echoes" of the original data underneath the +overwritten data. If the data has only been overwritten once, it's not +even that hard. + + The best way to remove something irretrievably is to destroy the +media it's on with acid, melt it down, or the like. For cheap +removable media like floppy disks, this is the preferred method. +However, hard drives are expensive and hard to melt, so the `shred' +utility tries to achieve a similar effect non-destructively. + + This uses many overwrite passes, with the data patterns chosen to +maximize the damage they do to the old data. While this will work on +floppies, the patterns are designed for best effect on hard drives. +For more details, see the source code and Peter Gutmann's paper `Secure +Deletion of Data from Magnetic and Solid-State Memory' +(http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html), from the +proceedings of the Sixth USENIX Security Symposium (San Jose, +California, July 22-25, 1996). + + *Please note* that `shred' relies on a very important assumption: +that the file system overwrites data in place. This is the traditional +way to do things, but many modern file system designs do not satisfy +this assumption. Exceptions include: + + * Log-structured or journaled file systems, such as those supplied + with AIX and Solaris, and JFS, ReiserFS, XFS, Ext3, BFS, NTFS etc. + when they are configured to journal _data_. + + * File systems that write redundant data and carry on even if some + writes fail, such as RAID-based file systems. + + * File systems that make snapshots, such as Network Appliance's NFS + server. + + * File systems that cache in temporary locations, such as NFS + version 3 clients. + + * Compressed file systems. + + If you are not sure how your file system operates, then you should +assume that it does not overwrite data in place, which means that shred +cannot reliably operate on regular files in your file system. + + Generally speaking, it is more reliable to shred a device than a +file, since this bypasses the problem of file system design mentioned +above. However, even shredding devices is not always completely +reliable. For example, most disks map out bad sectors invisibly to the +application; if the bad sectors contain sensitive data, `shred' won't +be able to destroy it. + + `shred' makes no attempt to detect or report this problem, just as +it makes no attempt to do anything about backups. However, since it is +more reliable to shred devices than files, `shred' by default does not +truncate or remove the output file. This default is more suitable for +devices, which typically cannot be truncated and should not be removed. + + Finally, consider the risk of backups and mirrors. File system +backups and remote mirrors may contain copies of the file that cannot +be removed, and that will allow a shredded file to be recovered later. +So if you keep any data you may later want to destroy using `shred', be +sure that it is not backed up or mirrored. + + shred [OPTION]... FILE[...] + + The program accepts the following options. Also see *Note Common +options::. + +`-f' +`--force' + Override file permissions if necessary to allow overwriting. + +`-NUMBER' +`-n NUMBER' +`--iterations=NUMBER' + By default, `shred' uses 25 passes of overwrite. This is enough + for all of the useful overwrite patterns to be used at least once. + You can reduce this to save time, or increase it if you have a lot + of time to waste. + +`-s BYTES' +`--size=BYTES' + Shred the first BYTES bytes of the file. The default is to shred + the whole file. BYTES can be followed by a size specification like + `K', `M', or `G' to specify a multiple. *Note Block size::. + +`-u' +`--remove' + After shredding a file, truncate it (if possible) and then remove + it. If a file has multiple links, only the named links will be + removed. + +`-v' +`--verbose' + Display status updates as sterilization proceeds. + +`-x' +`--exact' + By default, `shred' rounds the size of a regular file up to the + next multiple of the file system block size to fully erase the + last block of the file. Use `--exact' to suppress that behavior. + Thus, by default if you shred a 10-byte regular file on a system + with 512-byte blocks, the resulting file will be 512 bytes long. + With this option, shred does not increase the apparent size of the + file. + +`-z' +`--zero' + Normally, the last pass that `shred' writes is made up of random + data. If this would be conspicuous on your hard drive (for + example, because it looks like encrypted data), or you just think + it's tidier, the `--zero' option adds an additional overwrite pass + with all zero bits. This is in addition to the number of passes + specified by the `--iterations' option. + + + You might use the following command to erase all trace of the file +system you'd created on the floppy disk in your first drive. That +command takes about 20 minutes to erase a "1.44MB" (actually 1440 KiB) +floppy. + + shred --verbose /dev/fd0 + + Similarly, to erase all data on a selected partition of your hard +disk, you could give a command like this: + + shred --verbose /dev/sda5 + + A FILE of `-' denotes standard output. The intended use of this is +to shred a removed temporary file. For example: + + i=`tempfile -m 0600` + exec 3<>"$i" + rm -- "$i" + echo "Hello, world" >&3 + shred - >&3 + exec 3>- + + However, the command `shred - >file' does not shred the contents of +FILE, since the shell truncates FILE before invoking `shred'. Use the +command `shred file' or (if using a Bourne-compatible shell) the +command `shred - 1<>file' instead. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Special file types, Next: Changing file attributes, Prev: Basic operations, Up: Top + +12 Special file types +********************* + +This chapter describes commands which create special types of files (and +`rmdir', which removes directories, one special file type). + + Although Unix-like operating systems have markedly fewer special file +types than others, not _everything_ can be treated only as the +undifferentiated byte stream of "normal files". For example, when a +file is created or removed, the system must record this information, +which it does in a "directory"--a special type of file. Although you +can read directories as normal files, if you're curious, in order for +the system to do its job it must impose a structure, a certain order, +on the bytes of the file. Thus it is a "special" type of file. + + Besides directories, other special file types include named pipes +(FIFOs), symbolic links, sockets, and so-called "special files". + +* Menu: + +* link invocation:: Make a hard link via the link syscall +* ln invocation:: Make links between files. +* mkdir invocation:: Make directories. +* mkfifo invocation:: Make FIFOs (named pipes). +* mknod invocation:: Make block or character special files. +* readlink invocation:: Print the referent of a symbolic link. +* rmdir invocation:: Remove empty directories. +* unlink invocation:: Remove files via the unlink syscall + + +File: coreutils.info, Node: link invocation, Next: ln invocation, Up: Special file types + +12.1 `link': Make a hard link via the link syscall +================================================== + +`link' creates a single hard link at a time. It is a minimalist +interface to the system-provided `link' function. *Note Hard Links: +(libc)Hard Links. It avoids the bells and whistles of the more +commonly-used `ln' command (*note ln invocation::). Synopsis: + + link FILENAME LINKNAME + + FILENAME must specify an existing file, and LINKNAME must specify a +nonexistent entry in an existing directory. `link' simply calls `link +(FILENAME, LINKNAME)' to create the link. + + On a GNU system, this command acts like `ln --directory +--no-target-directory FILENAME LINKNAME'. However, the `--directory' +and `--no-target-directory' options are not specified by POSIX, and the +`link' command is more portable in practice. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: ln invocation, Next: mkdir invocation, Prev: link invocation, Up: Special file types + +12.2 `ln': Make links between files +=================================== + +`ln' makes links between files. By default, it makes hard links; with +the `-s' option, it makes symbolic (or "soft") links. Synopses: + + ln [OPTION]... [-T] TARGET LINKNAME + ln [OPTION]... TARGET + ln [OPTION]... TARGET... DIRECTORY + ln [OPTION]... -t DIRECTORY TARGET... + + * If two file names are given, `ln' creates a link to the first file + from the second. + + * If one TARGET is given, `ln' creates a link to that file in the + current directory. + + * If the `--target-directory' (`-t') option is given, or failing + that if the last file is a directory and the + `--no-target-directory' (`-T') option is not given, `ln' creates a + link to each TARGET file in the specified directory, using the + TARGETs' names. + + + Normally `ln' does not remove existing files. Use the `--force' +(`-f') option to remove them unconditionally, the `--interactive' +(`-i') option to remove them conditionally, and the `--backup' (`-b') +option to rename them. + + A "hard link" is another name for an existing file; the link and the +original are indistinguishable. Technically speaking, they share the +same inode, and the inode contains all the information about a +file--indeed, it is not incorrect to say that the inode _is_ the file. +On all existing implementations, you cannot make a hard link to a +directory, and hard links cannot cross file system boundaries. (These +restrictions are not mandated by POSIX, however.) + + "Symbolic links" ("symlinks" for short), on the other hand, are a +special file type (which not all kernels support: System V release 3 +(and older) systems lack symlinks) in which the link file actually +refers to a different file, by name. When most operations (opening, +reading, writing, and so on) are passed the symbolic link file, the +kernel automatically "dereferences" the link and operates on the target +of the link. But some operations (e.g., removing) work on the link +file itself, rather than on its target. *Note Symbolic Links: +(libc)Symbolic Links. + + The program accepts the following options. Also see *Note Common +options::. + +`-b' +`--backup[=METHOD]' + *Note Backup options::. Make a backup of each file that would + otherwise be overwritten or removed. + +`-d' +`-F' +`--directory' + Allow the super-user to attempt to make hard links to directories. + However, note that this will probably fail due to system + restrictions, even for the super-user. + +`-f' +`--force' + Remove existing destination files. + +`-i' +`--interactive' + Prompt whether to remove existing destination files. + +`-n' +`--no-dereference' + Do not treat the last operand specially when it is a symbolic link + to a directory. Instead, treat it as if it were a normal file. + + When the destination is an actual directory (not a symlink to one), + there is no ambiguity. The link is created in that directory. + But when the specified destination is a symlink to a directory, + there are two ways to treat the user's request. `ln' can treat + the destination just as it would a normal directory and create the + link in it. On the other hand, the destination can be viewed as a + non-directory--as the symlink itself. In that case, `ln' must + delete or backup that symlink before creating the new link. The + default is to treat a destination that is a symlink to a directory + just like a directory. + + This option is weaker than the `--no-target-directory' (`-T') + option, so it has no effect if both options are given. + +`-s' +`--symbolic' + Make symbolic links instead of hard links. This option merely + produces an error message on systems that do not support symbolic + links. + +`-S SUFFIX' +`--suffix=SUFFIX' + Append SUFFIX to each backup file made with `-b'. *Note Backup + options::. + +`-t DIRECTORY' +`--target-directory=DIRECTORY' + Specify the destination DIRECTORY. *Note Target directory::. + +`-T' +`--no-target-directory' + Do not treat the last operand specially when it is a directory or a + symbolic link to a directory. *Note Target directory::. + +`-v' +`--verbose' + Print the name of each file before linking it. + +`-V METHOD' +`--version-control=METHOD' + Change the type of backups made with `-b'. The METHOD argument + can be `none' (or `off'), `numbered' (or `t'), `existing' (or + `nil'), or `never' (or `simple'). *Note Backup options::. + + + Examples: + + ln -s /some/name # creates link ./name pointing to /some/name + ln -s /some/name myname # creates link ./myname pointing to /some/name + ln -s a b .. # creates links ../a and ../b pointing to ./a and ./b + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: mkdir invocation, Next: mkfifo invocation, Prev: ln invocation, Up: Special file types + +12.3 `mkdir': Make directories +============================== + +`mkdir' creates directories with the specified names. Synopsis: + + mkdir [OPTION]... NAME... + + If a NAME is an existing file but not a directory, `mkdir' prints a +warning message on stderr and will exit with a status of 1 after +processing any remaining NAMEs. The same is done when a NAME is an +existing directory and the -p option is not given. If a NAME is an +existing directory and the -p option is given, `mkdir' will ignore it. +That is, `mkdir' will not print a warning, raise an error, or change +the mode of the directory (even if the -m option is given), and will +move on to processing any remaining NAMEs. + + The program accepts the following options. Also see *Note Common +options::. + +`-m MODE' +`--mode=MODE' + Set the mode of created directories to MODE, which is symbolic as + in `chmod' and uses `a=rwx' (read, write and execute allowed for + everyone) minus the bits set in the umask for the point of the + departure. *Note File permissions::. + +`-p' +`--parents' + Make any missing parent directories for each argument. The mode + for parent directories is set to the umask modified by `u+wx'. + Ignore arguments corresponding to existing directories. + +`-v' + +`--verbose' + Print a message for each created directory. This is most useful + with `--parents'. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: mkfifo invocation, Next: mknod invocation, Prev: mkdir invocation, Up: Special file types + +12.4 `mkfifo': Make FIFOs (named pipes) +======================================= + +`mkfifo' creates FIFOs (also called "named pipes") with the specified +names. Synopsis: + + mkfifo [OPTION] NAME... + + A "FIFO" is a special file type that permits independent processes +to communicate. One process opens the FIFO file for writing, and +another for reading, after which data can flow as with the usual +anonymous pipe in shells or elsewhere. + + The program accepts the following option. Also see *Note Common +options::. + +`-m MODE' +`--mode=MODE' + Set the mode of created FIFOs to MODE, which is symbolic as in + `chmod' and uses `a=rw' (read and write allowed for everyone) minus + the bits set in the umask for the point of departure. *Note File + permissions::. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: mknod invocation, Next: readlink invocation, Prev: mkfifo invocation, Up: Special file types + +12.5 `mknod': Make block or character special files +=================================================== + +`mknod' creates a FIFO, character special file, or block special file +with the specified name. Synopsis: + + mknod [OPTION]... NAME TYPE [MAJOR MINOR] + + Unlike the phrase "special file type" above, the term "special file" +has a technical meaning on Unix: something that can generate or receive +data. Usually this corresponds to a physical piece of hardware, e.g., +a printer or a disk. (These files are typically created at +system-configuration time.) The `mknod' command is what creates files +of this type. Such devices can be read either a character at a time or +a "block" (many characters) at a time, hence we say there are "block +special" files and "character special" files. + + The arguments after NAME specify the type of file to make: + +`p' + for a FIFO + +`b' + for a block special file + +`c' + for a character special file + + + When making a block or character special file, the major and minor +device numbers must be given after the file type. If a major or minor +device number begins with `0x' or `0X', it is interpreted as +hexadecimal; otherwise, if it begins with `0', as octal; otherwise, as +decimal. + + The program accepts the following option. Also see *Note Common +options::. + +`-m MODE' +`--mode=MODE' + Set the mode of created files to MODE, which is symbolic as in + `chmod' and uses `a=rw' minus the bits set in the umask as the + point of departure. *Note File permissions::. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: readlink invocation, Next: rmdir invocation, Prev: mknod invocation, Up: Special file types + +12.6 `readlink': Print the referent of a symbolic link +====================================================== + +`readlink' may work in one of two supported modes: + +`Readlink mode' + `readlink' outputs the value of the given symbolic link. If + `readlink' is invoked with an argument other than the name of a + symbolic link, it produces no output and exits with a nonzero exit + code. + +`Canonicalize mode' + `readlink' outputs the absolute name of the given file which + contains no `.', `..' components nor any repeated separators (`/') + or symbolic links. + + + readlink [OPTION] FILE + + By default, `readlink' operates in readlink mode. + + The program accepts the following options. Also see *Note Common +options::. + +`-f' +`--canonicalize' + Activate canonicalize mode. If any path component except the last + one is missing or unavailable, `readlink' produces no output and + exits with a nonzero exit code. + +`-e' +`--canonicalize-existing' + Activate canonicalize mode. If any path component is missing or + unavailable, `readlink' produces no output and exits with a + nonzero exit code. + +`-m' +`--canonicalize-missing' + Activate canonicalize mode. If any path component is missing or + unavailable, `readlink' treats it as a directory. + +`-n' +`--no-newline' + Do not output the trailing newline. + +`-s' +`-q' +`--silent' +`--quiet' + Suppress most error messages. + +`-v' +`--verbose' + Report error messages. + + + The `readlink' utility first appeared in OpenBSD 2.1. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: rmdir invocation, Next: unlink invocation, Prev: readlink invocation, Up: Special file types + +12.7 `rmdir': Remove empty directories +====================================== + +`rmdir' removes empty directories. Synopsis: + + rmdir [OPTION]... DIRECTORY... + + If any DIRECTORY argument does not refer to an existing empty +directory, it is an error. + + The program accepts the following option. Also see *Note Common +options::. + +`--ignore-fail-on-non-empty' + Ignore each failure to remove a directory that is solely because + the directory is non-empty. + +`-p' +`--parents' + Remove DIRECTORY, then try to remove each component of DIRECTORY. + So, for example, `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b + a'. As such, it fails if any of those directories turns out not + to be empty. Use the `--ignore-fail-on-non-empty' option to make + it so such a failure does not evoke a diagnostic and does not + cause `rmdir' to exit unsuccessfully. + +`-v' + +`--verbose' + Give a diagnostic for each successful removal. DIRECTORY is + removed. + + + *Note rm invocation::, for how to remove non-empty directories +(recursively). + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: unlink invocation, Prev: rmdir invocation, Up: Special file types + +12.8 `unlink': Remove files via the unlink syscall +================================================== + +`unlink' deletes a single specified file name. It is a minimalist +interface to the system-provided `unlink' function. *Note Deleting +Files: (libc)Deleting Files. Synopsis: It avoids the bells and +whistles of the more commonly-used `rm' command (*note rm invocation::). + + unlink FILENAME + + On some systems `unlink' can be used to delete the name of a +directory. On others, it can be used that way only by a privileged +user. In the GNU system `unlink' can never delete the name of a +directory. + + The `unlink' command honors the `--help' and `--version' options. +To remove a file whose name begins with `-', prefix the name with `./', +e.g., `unlink ./--help'. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Changing file attributes, Next: Disk usage, Prev: Special file types, Up: Top + +13 Changing file attributes +*************************** + +A file is not merely its contents, a name, and a file type (*note +Special file types::). A file also has an owner (a userid), a group (a +group id), permissions (what the owner can do with the file, what +people in the group can do, and what everyone else can do), various +timestamps, and other information. Collectively, we call these a file's +"attributes". + + These commands change file attributes. + +* Menu: + +* chgrp invocation:: Change file groups. +* chmod invocation:: Change access permissions. +* chown invocation:: Change file owners and groups. +* touch invocation:: Change file timestamps. + + +File: coreutils.info, Node: chown invocation, Next: touch invocation, Prev: chmod invocation, Up: Changing file attributes + +13.1 `chown': Change file owner and group +========================================= + +`chown' changes the user and/or group ownership of each given FILE to +NEW-OWNER or to the user and group of an existing reference file. +Synopsis: + + chown [OPTION]... {NEW-OWNER | --reference=REF_FILE} FILE... + + If used, NEW-OWNER specifies the new owner and/or group as follows +(with no embedded white space): + + [OWNER] [ : [GROUP] ] + + Specifically: + +OWNER + If only an OWNER (a user name or numeric user id) is given, that + user is made the owner of each given file, and the files' group is + not changed. + +OWNER`:'GROUP + If the OWNER is followed by a colon and a GROUP (a group name or + numeric group id), with no spaces between them, the group + ownership of the files is changed as well (to GROUP). + +OWNER`:' + If a colon but no group name follows OWNER, that user is made the + owner of the files and the group of the files is changed to + OWNER's login group. + +`:'GROUP + If the colon and following GROUP are given, but the owner is + omitted, only the group of the files is changed; in this case, + `chown' performs the same function as `chgrp'. + +`:' + If only a colon is given, or if NEW-OWNER is empty, neither the + owner nor the group is changed. + + + Some older scripts may still use `.' in place of the `:' separator. +POSIX 1003.1-2001 (*note Standards conformance::) does not require +support for that, but for backward compatibility GNU `chown' supports +`.' so long as no ambiguity results. New scripts should avoid the use +of `.' because it is not portable, and because it has undesirable +results if the entire OWNER`.'GROUP happens to identify a user whose +name contains `.'. + + The `chown' command sometimes clears the set-user-ID or set-group-ID +permission bits. This behavior depends on the policy and functionality +of the underlying `chown' system call, which may make system-dependent +file mode modifications outside the control of the `chown' command. +For example, the `chown' command might not affect those bits when +operated as the superuser, or if the bits signify some function other +than executable permission (e.g., mandatory locking). When in doubt, +check the underlying system behavior. + + The program accepts the following options. Also see *Note Common +options::. + +`-c' +`--changes' + Verbosely describe the action for each FILE whose ownership + actually changes. + +`-f' +`--silent' +`--quiet' + Do not print error messages about files whose ownership cannot be + changed. + +`--from=OLD-OWNER' + Change a FILE's ownership only if it has current attributes + specified by OLD-OWNER. OLD-OWNER has the same form as NEW-OWNER + described above. This option is useful primarily from a security + standpoint in that it narrows considerably the window of potential + abuse. For example, to reflect a UID numbering change for one + user's files without an option like this, `root' might run + + find / -owner OLDUSER -print0 | xargs -0 chown -h NEWUSER + + But that is dangerous because the interval between when the `find' + tests the existing file's owner and when the `chown' is actually + run may be quite large. One way to narrow the gap would be to + invoke chown for each file as it is found: + + find / -owner OLDUSER -exec chown -h NEWUSER {} \; + + But that is very slow if there are many affected files. With this + option, it is safer (the gap is narrower still) though still not + perfect: + + chown -h -R --from=OLDUSER NEWUSER / + +`--dereference' + Do not act on symbolic links themselves but rather on what they + point to. This is the default. + +`-h' +`--no-dereference' + Act on symbolic links themselves instead of what they point to. + This mode relies on the `lchown' system call. On systems that do + not provide the `lchown' system call, `chown' fails when a file + specified on the command line is a symbolic link. By default, no + diagnostic is issued for symbolic links encountered during a + recursive traversal, but see `--verbose'. + +`--preserve-root' + Fail upon any attempt to recursively change the file system root, + `/'. Without `--recursive', this option has no effect. *Note + Treating / specially::. + +`--no-preserve-root' + Cancel the effect of any preceding `--preserve-root' option. + *Note Treating / specially::. + +`--reference=REF_FILE' + Change the user and group of each FILE to be the same as those of + REF_FILE. If REF_FILE is a symbolic link, do not use the user and + group of the symbolic link, but rather those of the file it refers + to. + +`-v' +`--verbose' + Output a diagnostic for every file processed. If a symbolic link + is encountered during a recursive traversal on a system without + the `lchown' system call, and `--no-dereference' is in effect, + then issue a diagnostic saying neither the symbolic link nor its + referent is being changed. + +`-R' +`--recursive' + Recursively change ownership of directories and their contents. + +`-H' + If `--recursive' (`-R') is specified and a command line argument + is a symbolic link to a directory, traverse it. *Note Traversing + symlinks::. + +`-L' + In a recursive traversal, traverse every symbolic link to a + directory that is encountered. *Note Traversing symlinks::. + +`-P' + Do not traverse any symbolic links. This is the default if none + of `-H', `-L', or `-P' is specified. *Note Traversing symlinks::. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: chgrp invocation, Next: chmod invocation, Up: Changing file attributes + +13.2 `chgrp': Change group ownership +==================================== + +`chgrp' changes the group ownership of each given FILE to GROUP (which +can be either a group name or a numeric group id) or to the group of an +existing reference file. Synopsis: + + chgrp [OPTION]... {GROUP | --reference=REF_FILE} FILE... + + The program accepts the following options. Also see *Note Common +options::. + +`-c' +`--changes' + Verbosely describe the action for each FILE whose group actually + changes. + +`-f' +`--silent' +`--quiet' + Do not print error messages about files whose group cannot be + changed. + +`--dereference' + Do not act on symbolic links themselves but rather on what they + point to. This is the default. + +`-h' +`--no-dereference' + Act on symbolic links themselves instead of what they point to. + This mode relies on the `lchown' system call. On systems that do + not provide the `lchown' system call, `chgrp' fails when a file + specified on the command line is a symbolic link. By default, no + diagnostic is issued for symbolic links encountered during a + recursive traversal, but see `--verbose'. + +`--preserve-root' + Fail upon any attempt to recursively change the file system root, + `/'. Without `--recursive', this option has no effect. *Note + Treating / specially::. + +`--no-preserve-root' + Cancel the effect of any preceding `--preserve-root' option. + *Note Treating / specially::. + +`--reference=REF_FILE' + Change the group of each FILE to be the same as that of REF_FILE. + If REF_FILE is a symbolic link, do not use the group of the + symbolic link, but rather that of the file it refers to. + +`-v' +`--verbose' + Output a diagnostic for every file processed. If a symbolic link + is encountered during a recursive traversal on a system without + the `lchown' system call, and `--no-dereference' is in effect, + then issue a diagnostic saying neither the symbolic link nor its + referent is being changed. + +`-R' +`--recursive' + Recursively change the group ownership of directories and their + contents. + +`-H' + If `--recursive' (`-R') is specified and a command line argument + is a symbolic link to a directory, traverse it. *Note Traversing + symlinks::. + +`-L' + In a recursive traversal, traverse every symbolic link to a + directory that is encountered. *Note Traversing symlinks::. + +`-P' + Do not traverse any symbolic links. This is the default if none + of `-H', `-L', or `-P' is specified. *Note Traversing symlinks::. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: chmod invocation, Next: chown invocation, Prev: chgrp invocation, Up: Changing file attributes + +13.3 `chmod': Change access permissions +======================================= + +`chmod' changes the access permissions of the named files. Synopsis: + + chmod [OPTION]... {MODE | --reference=REF_FILE} FILE... + + `chmod' never changes the permissions of symbolic links, since the +`chmod' system call cannot change their permissions. This is not a +problem since the permissions of symbolic links are never used. +However, for each symbolic link listed on the command line, `chmod' +changes the permissions of the pointed-to file. In contrast, `chmod' +ignores symbolic links encountered during recursive directory +traversals. + + If used, MODE specifies the new permissions. For details, see the +section on *Note File permissions::. In the extremely rare cases where +MODE has leading `-', a portable script should use `--' first, e.g., +`chmod -- -w file'. Typically, though, `chmod a-w file' is preferable. + + The program accepts the following options. Also see *Note Common +options::. + +`-c' +`--changes' + Verbosely describe the action for each FILE whose permissions + actually changes. + +`-f' +`--silent' +`--quiet' + Do not print error messages about files whose permissions cannot be + changed. + +`--preserve-root' + Fail upon any attempt to recursively change the file system root, + `/'. Without `--recursive', this option has no effect. *Note + Treating / specially::. + +`--no-preserve-root' + Cancel the effect of any preceding `--preserve-root' option. + *Note Treating / specially::. + +`-v' +`--verbose' + Verbosely describe the action or non-action taken for every FILE. + +`--reference=REF_FILE' + Change the mode of each FILE to be the same as that of REF_FILE. + *Note File permissions::. If REF_FILE is a symbolic link, do not + use the mode of the symbolic link, but rather that of the file it + refers to. + +`-R' +`--recursive' + Recursively change permissions of directories and their contents. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: touch invocation, Prev: chown invocation, Up: Changing file attributes + +13.4 `touch': Change file timestamps +==================================== + +`touch' changes the access and/or modification times of the specified +files. Synopsis: + + touch [OPTION]... FILE... + + On older systems, `touch' supports an obsolete syntax, as follows. +If the first FILE would be a valid argument to the `-t' option and no +timestamp is given with any of the `-d', `-r', or `-t' options and the +`--' argument is not given, that argument is interpreted as the time +for the other files instead of as a file name. POSIX 1003.1-2001 +(*note Standards conformance::) does not allow this; use `-t' instead. + + Any FILE that does not exist is created empty. + + If changing both the access and modification times to the current +time, `touch' can change the timestamps for files that the user running +it does not own but has write permission for. Otherwise, the user must +own the files. + + Although `touch' provides options for changing two of the times--the +times of last access and modification--of a file, there is actually a +third one as well: the inode change time. This is often referred to as +a file's `ctime'. The inode change time represents the time when the +file's meta-information last changed. One common example of this is +when the permissions of a file change. Changing the permissions +doesn't access the file, so the atime doesn't change, nor does it +modify the file, so the mtime doesn't change. Yet, something about the +file itself has changed, and this must be noted somewhere. This is the +job of the ctime field. This is necessary, so that, for example, a +backup program can make a fresh copy of the file, including the new +permissions value. Another operation that modifies a file's ctime +without affecting the others is renaming. In any case, it is not +possible, in normal operations, for a user to change the ctime field to +a user-specified value. + + Time stamps assume the time zone rules specified by the `TZ' +environment variable, or by the system default rules if `TZ' is not +set. *Note Specifying the Time Zone with `TZ': (libc)TZ Variable. You +can avoid avoid ambiguities during daylight saving transitions by using +UTC time stamps. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--time=atime' +`--time=access' +`--time=use' + Change the access time only. + +`-c' +`--no-create' + Do not create files that do not exist. + +`-d' +`--date=TIME' + Use TIME instead of the current time. It can contain month names, + time zones, `am' and `pm', `yesterday', etc. For example, + `--date="2004-02-27 14:19:13.489392193 +0530"' specifies the + instant of time that is 489,392,193 nanoseconds after February 27, + 2004 at 2:19:13 PM in a time zone that is 5 hours and 30 minutes + east of UTC. *Note Date input formats::. File systems that do + not support high-resolution time stamps silently ignore any excess + precision here. + +`-f' + Ignored; for compatibility with BSD versions of `touch'. + +`-m' +`--time=mtime' +`--time=modify' + Change the modification time only. + +`-r FILE' +`--reference=FILE' + Use the times of the reference FILE instead of the current time. + If this option is combined with the `--date=TIME' (`-d TIME') + option, the reference FILE's time is the origin for any relative + TIMEs given, but is otherwise ignored. For example, `-r foo -d + '-5 seconds'' specifies a time stamp equal to five seconds before + the corresponding time stamp for `foo'. + +`-t [[CC]YY]MMDDhhmm[.ss]' + Use the argument (optional four-digit or two-digit years, months, + days, hours, minutes, optional seconds) instead of the current + time. If the year is specified with only two digits, then CC is + 20 for years in the range 0 ... 68, and 19 for years in 69 ... 99. + If no digits of the year are specified, the argument is + interpreted as a date in the current year. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Disk usage, Next: Printing text, Prev: Changing file attributes, Up: Top + +14 Disk usage +************* + +No disk can hold an infinite amount of data. These commands report on +how much disk storage is in use or available. (This has nothing much to +do with how much _main memory_, i.e., RAM, a program is using when it +runs; for that, you want `ps' or `pstat' or `swap' or some such +command.) + +* Menu: + +* df invocation:: Report file system disk space usage. +* du invocation:: Estimate file space usage. +* stat invocation:: Report file or file system status. +* sync invocation:: Synchronize memory and disk. + + +File: coreutils.info, Node: df invocation, Next: du invocation, Up: Disk usage + +14.1 `df': Report file system disk space usage +============================================== + +`df' reports the amount of disk space used and available on file +systems. Synopsis: + + df [OPTION]... [FILE]... + + With no arguments, `df' reports the space used and available on all +currently mounted file systems (of all types). Otherwise, `df' reports +on the file system containing each argument FILE. + + Normally the disk space is printed in units of 1024 bytes, but this +can be overridden (*note Block size::). Non-integer quantities are +rounded up to the next higher unit. + + If an argument FILE is a disk device file containing a mounted file +system, `df' shows the space available on that file system rather than +on the file system containing the device node (i.e., the root file +system). GNU `df' does not attempt to determine the disk usage on +unmounted file systems, because on most kinds of systems doing so +requires extremely nonportable intimate knowledge of file system +structures. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--all' + Include in the listing file systems that have a size of 0 blocks, + which are omitted by default. Such file systems are typically + special-purpose pseudo-file-systems, such as automounter entries. + Also, file systems of type "ignore" or "auto", supported by some + operating systems, are only included if this option is specified. + +`-B SIZE' +`--block-size=SIZE' + Scale sizes by SIZE before printing them (*note Block size::). + For example, `-BG' prints sizes in units of 1,073,741,824 bytes. + +`-h' +`--human-readable' + Append a size letter to each size, such as `M' for mebibytes. + Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes. + Use the `--si' option if you prefer powers of 1000. + +`-H' + Equivalent to `--si'. + +`-i' +`--inodes' + List inode usage information instead of block usage. An inode + (short for index node) contains information about a file such as + its owner, permissions, timestamps, and location on the disk. + +`-k' + Print sizes in 1024-byte blocks, overriding the default block size + (*note Block size::). This option is equivalent to + `--block-size=1K'. + +`-l' +`--local' + Limit the listing to local file systems. By default, remote file + systems are also listed. + +`--no-sync' + Do not invoke the `sync' system call before getting any usage data. + This may make `df' run significantly faster on systems with many + disks, but on some systems (notably SunOS) the results may be + slightly out of date. This is the default. + +`-P' +`--portability' + Use the POSIX output format. This is like the default format + except for the following: + + 1. The information about each file system is always printed on + exactly one line; a mount device is never put on a line by + itself. This means that if the mount device name is more + than 20 characters long (e.g., for some network mounts), the + columns are misaligned. + + 2. The labels in the header output line are changed to conform + to POSIX. + +`--si' + Append an SI-style abbreviation to each size, such as `MB' for + megabytes. Powers of 1000 are used, not 1024; `MB' stands for + 1,000,000 bytes. This option is equivalent to `--block-size=si'. + Use the `-h' or `--human-readable' option if you prefer powers of + 1024. + +`--sync' + Invoke the `sync' system call before getting any usage data. On + some systems (notably SunOS), doing this yields more up to date + results, but in general this option makes `df' much slower, + especially when there are many or very busy file systems. + +`-t FSTYPE' +`--type=FSTYPE' + Limit the listing to file systems of type FSTYPE. Multiple file + system types can be specified by giving multiple `-t' options. By + default, nothing is omitted. + +`-T' +`--print-type' + Print each file system's type. The types printed here are the + same ones you can include or exclude with `-t' and `-x'. The + particular types printed are whatever is supported by the system. + Here are some of the common names (this list is certainly not + exhaustive): + + `nfs' + An NFS file system, i.e., one mounted over a network from + another machine. This is the one type name which seems to be + used uniformly by all systems. + + `4.2, ufs, efs...' + A file system on a locally-mounted hard disk. (The system + might even support more than one type here; Linux does.) + + `hsfs, cdfs' + A file system on a CD-ROM drive. HP-UX uses `cdfs', most + other systems use `hsfs' (`hs' for "High Sierra"). + + `pcfs' + An MS-DOS file system, usually on a diskette. + + +`-x FSTYPE' +`--exclude-type=FSTYPE' + Limit the listing to file systems not of type FSTYPE. Multiple + file system types can be eliminated by giving multiple `-x' + options. By default, no file system types are omitted. + +`-v' + Ignored; for compatibility with System V versions of `df'. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: du invocation, Next: stat invocation, Prev: df invocation, Up: Disk usage + +14.2 `du': Estimate file space usage +==================================== + +`du' reports the amount of disk space used by the specified files and +for each subdirectory (of directory arguments). Synopsis: + + du [OPTION]... [FILE]... + + With no arguments, `du' reports the disk space for the current +directory. Normally the disk space is printed in units of 1024 bytes, +but this can be overridden (*note Block size::). Non-integer +quantities are rounded up to the next higher unit. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--all' + Show counts for all files, not just directories. + +`--apparent-size' + Print apparent sizes, rather than disk usage. The apparent size + of a file is the number of bytes reported by `wc -c' on regular + files, or more generally, `ls -l --block-size=1' or `stat + --format=%s'. For example, a file containing the word `zoo' with + no newline would, of course, have an apparent size of 3. Such a + small file may require anywhere from 0 to 16 KiB or more of disk + space, depending on the type and configuration of the file system + on which the file resides. However, a sparse file created with + this command: + + dd bs=1 seek=2GiB if=/dev/null of=big + + has an apparent size of 2 GiB, yet on most modern systems, it + actually uses almost no disk space. + +`-b' +`--bytes' + Equivalent to `--apparent-size --block-size=1'. + +`-B SIZE' +`--block-size=SIZE' + Scale sizes by SIZE before printing them (*note Block size::). + For example, `-BG' prints sizes in units of 1,073,741,824 bytes. + +`-c' +`--total' + Print a grand total of all arguments after all arguments have been + processed. This can be used to find out the total disk usage of a + given set of files or directories. + +`-D' +`--dereference-args' + Dereference symbolic links that are command line arguments. Does + not affect other symbolic links. This is helpful for finding out + the disk usage of directories, such as `/usr/tmp', which are often + symbolic links. + +`--files0-from=FILE' + Rather than processing files named on the command line, process + those in the NUL-terminated list in file FILE. This is useful + with the `--total' (`-c') option when the list of file names is so + long that it may exceed a command line length limitation. In such + cases, running `du' via `xargs' is undesirable because it splits + the list into pieces and makes `du' print a total for each sublist + rather than for the entire list. One way to produce a list of + NUL-terminated file names is with GNU `find', using its `-print0' + predicate. Do not specify any FILE on the command line when using + this option. + +`-h' +`--human-readable' + Append a size letter to each size, such as `M' for mebibytes. + Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes. + Use the `--si' option if you prefer powers of 1000. + +`-H' + Currently, `-H' is the same as `--si', except that `-H' evokes a + warning. This option will be changed to be equivalent to + `--dereference-args' (`-D'). + +`-k' + Print sizes in 1024-byte blocks, overriding the default block size + (*note Block size::). This option is equivalent to + `--block-size=1K'. + +`-l' +`--count-links' + Count the size of all files, even if they have appeared already + (as a hard link). + +`-L' +`--dereference' + Dereference symbolic links (show the disk space used by the file + or directory that the link points to instead of the space used by + the link). + +`-P' +`--no-dereference' + For each symbolic links encountered by `du', consider the disk + space used by the symbolic link. + +`--max-depth=DEPTH' + Show the total for each directory (and file if -all) that is at + most MAX_DEPTH levels down from the root of the hierarchy. The + root is at level 0, so `du --max-depth=0' is equivalent to `du -s'. + +`-0' +`--null' + Output the zero byte (NUL) at the end of each line, rather than a + newline. This option enables other programs to parse the output + of `du' even when that output would contain file names with + embedded newlines. + +`--si' + Append an SI-style abbreviation to each size, such as `MB' for + megabytes. Powers of 1000 are used, not 1024; `MB' stands for + 1,000,000 bytes. Use the `-h' or `--human-readable' option if you + prefer powers of 1024. + +`-s' +`--summarize' + Display only a total for each argument. + +`-S' +`--separate-dirs' + Report the size of each directory separately, not including the + sizes of subdirectories. + +`-x' +`--one-file-system' + Skip directories that are on different file systems from the one + that the argument being processed is on. + +`--exclude=PATTERN' + When recursing, skip subdirectories or files matching PATTERN. + For example, `du --exclude='*.o'' excludes files whose names end + in `.o'. + +`-X FILE' +`--exclude-from=FILE' + Like `--exclude', except take the patterns to exclude from FILE, + one per line. If FILE is `-', take the patterns from standard + input. + + + On BSD systems, `du' reports sizes that are half the correct values +for files that are NFS-mounted from HP-UX systems. On HP-UX systems, +it reports sizes that are twice the correct values for files that are +NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also +affects the HP-UX `du' program. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: stat invocation, Next: sync invocation, Prev: du invocation, Up: Disk usage + +14.3 `stat': Report file or file system status +============================================== + +`stat' displays information about the specified file(s). Synopsis: + + stat [OPTION]... [FILE]... + + With no option, `stat' reports all information about the given files. +But it also can be used to report the information of the file systems +the given files are located on. If the files are links, `stat' can +also give information about the files the links point to. + +`-f' +`--file-system' + Report information about the file systems where the given files + are located instead of information about the files themselves. + +`-L' +`--dereference' + Change how `stat' treats symbolic links. With this option, `stat' + acts on the file referenced by each symbolic link argument. + Without it, `stat' acts on any symbolic link argument directly. + +`-t' +`--terse' + Print the information in terse form, suitable for parsing by other + programs. + +`-c' +`--format=FORMAT' + Use FORMAT rather than the default format. + + Interpreted sequences for file stat are: + + * %a - Access rights in octal + + * %A - Access rights in human readable form + + * %b - Number of blocks allocated (see `%B') + + * %B - The size in bytes of each block reported by `%b' + + * %d - Device number in decimal + + * %D - Device number in hex + + * %f - raw mode in hex + + * %F - File type + + * %g - Group Id of owner + + * %G - Group name of owner + + * %h - Number of hard links + + * %i - Inode number + + * %n - File name + + * %N - Quoted File name with dereference if symbolic link + + * %o - I/O block size + + * %s - Total size, in bytes + + * %t - Major device type in hex + + * %T - Minor device type in hex + + * %u - User Id of owner + + * %U - User name of owner + + * %x - Time of last access + + * %X - Time of last access as seconds since Epoch + + * %y - Time of last modification + + * %Y - Time of last modification as seconds since Epoch + + * %z - Time of last change + + * %Z - Time of last change as seconds since Epoch + + Interpreted sequences for file system stat are: + + * %n - File name + + * %i - File System id in hex + + * %l - Maximum length of file names + + * %t - Type in hex + + * %T - Type in human readable form + + * %b - Total data blocks in file system + + * %f - Free blocks in file system + + * %a - Free blocks available to non-superuser + + * %s - Optimal transfer block size + + * %c - Total file nodes in file system + + Time stamps are listed according to the time zone rules specified + by the `TZ' environment variable, or by the system default rules if + `TZ' is not set. *Note Specifying the Time Zone with `TZ': + (libc)TZ Variable. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: sync invocation, Prev: stat invocation, Up: Disk usage + +14.4 `sync': Synchronize data on disk with memory +================================================= + +`sync' writes any data buffered in memory out to disk. This can +include (but is not limited to) modified superblocks, modified inodes, +and delayed reads and writes. This must be implemented by the kernel; +The `sync' program does nothing but exercise the `sync' system call. + + The kernel keeps data in memory to avoid doing (relatively slow) disk +reads and writes. This improves performance, but if the computer +crashes, data may be lost or the file system corrupted as a result. +The `sync' command ensures everything in memory is written to disk. + + Any arguments are ignored, except for a lone `--help' or `--version' +(*note Common options::). + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Printing text, Next: Conditions, Prev: Disk usage, Up: Top + +15 Printing text +**************** + +This section describes commands that display text strings. + +* Menu: + +* echo invocation:: Print a line of text. +* printf invocation:: Format and print data. +* yes invocation:: Print a string until interrupted. + + +File: coreutils.info, Node: echo invocation, Next: printf invocation, Up: Printing text + +15.1 `echo': Print a line of text +================================= + +`echo' writes each given STRING to standard output, with a space +between each and a newline after the last one. Synopsis: + + echo [OPTION]... [STRING]... + + The program accepts the following options. Also see *Note Common +options::. Options must precede operands, and the normally-special +argument `--' has no special meaning and is treated like any other +STRING. + +`-n' + Do not output the trailing newline. + +`-e' + Enable interpretation of the following backslash-escaped + characters in each STRING: + + `\a' + alert (bell) + + `\b' + backspace + + `\c' + suppress trailing newline + + `\f' + form feed + + `\n' + new line + + `\r' + carriage return + + `\t' + horizontal tab + + `\v' + vertical tab + + `\\' + backslash + + `\0NNN' + the eight-bit value that is the octal number NNN (zero to + three octal digits) + + `\NNN' + the eight-bit value that is the octal number NNN (one to + three octal digits) + + `\xHH' + the eight-bit value that is the hexadecimal number HH (one or + two hexadecimal digits) + +`-E' + Disable interpretation of backslash escapes in each STRING. This + is the default. If `-e' and `-E' are both specified, the last one + given takes effect. + + + If the `POSIXLY_CORRECT' environment variable is set, then when +`echo''s first argument is not `-n' it outputs option-like arguments +instead of treating them as options. For example, `echo -ne hello' +outputs `-ne hello' instead of plain `hello'. + + POSIX does not require support for any options, and says that the +behavior of `echo' is implementation-defined if any STRING contains a +backslash or if the first argument is `-n'. Portable programs can use +the `printf' command if they need to omit trailing newlines or output +control characters or backslashes. *Note printf invocation::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: printf invocation, Next: yes invocation, Prev: echo invocation, Up: Printing text + +15.2 `printf': Format and print data +==================================== + +`printf' does formatted printing of text. Synopsis: + + printf FORMAT [ARGUMENT]... + + `printf' prints the FORMAT string, interpreting `%' directives and +`\' escapes to format numeric and string arguments in a way that is +mostly similar to the C `printf' function. The differences are as +follows: + + * The FORMAT argument is reused as necessary to convert all the + given ARGUMENTs. For example, the command `printf %s a b' outputs + `ab'. + + * Missing ARGUMENTs are treated as null strings or as zeros, + depending on whether the context expects a string or a number. For + example, the command `printf %sx%d' prints `x0'. + + * An additional escape, `\c', causes `printf' to produce no further + output. For example, the command `printf 'A%sC\cD%sF' B E' prints + `ABC'. + + * The hexadecimal escape sequence `\xHH' has at most two digits, as + opposed to C where it can have an unlimited number of digits. For + example, the command `printf '\x07e'' prints two bytes, whereas + the C statement `printf ("\x07e")' prints just one. + + * `printf' has an additional directive, `%b', which prints its + argument string with `\' escapes interpreted in the same way as in + the FORMAT string, except that octal escapes are of the form + `\0OOO' where OOO is 0 to 3 octal digits. If a precision is also + given, it limits the number of bytes printed from the converted + string. + + * Numeric arguments must be single C constants, possibly with leading + `+' or `-'. For example, `printf %.4d -3' outputs `-0003'. + + * If the leading character of a numeric argument is `"' or `'' then + its value is the numeric value of the immediately following + character. Any remaining characters are silently ignored if the + `POSIXLY_CORRECT' environment variable is set; otherwise, a + warning is printed. For example, `printf "%d" "'a"' outputs `97' + on hosts that use the ASCII character set, since `a' has the + numeric value 97 in ASCII. + + + A floating-point argument must use a period before any fractional +digits, but is printed according to the `LC_NUMERIC' category of the +current locale. For example, in a locale whose radix character is a +comma, the command `printf %g 3.14' outputs `3,14' whereas the command +`printf %g 3,14' is an error. + + `printf' interprets `\OOO' in FORMAT as an octal number (if OOO is 1 +to 3 octal digits) specifying a character to print, and `\xHH' as a +hexadecimal number (if HH is 1 to 2 hex digits) specifying a character +to print. + + `printf' interprets two character syntaxes introduced in ISO C 99: +`\u' for 16-bit Unicode (ISO/IEC 10646) characters, specified as four +hexadecimal digits HHHH, and `\U' for 32-bit Unicode characters, +specified as eight hexadecimal digits HHHHHHHH. `printf' outputs the +Unicode characters according to the `LC_CTYPE' locale. + + The processing of `\u' and `\U' requires a full-featured `iconv' +facility. It is activated on systems with glibc 2.2 (or newer), or +when `libiconv' is installed prior to this package. Otherwise `\u' and +`\U' will print as-is. + + The only options are a lone `--help' or `--version'. *Note Common +options::. Options must precede operands. + + The Unicode character syntaxes are useful for writing strings in a +locale independent way. For example, a string containing the Euro +currency symbol + + $ /usr/local/bin/printf '\u20AC 14.95' + +will be output correctly in all locales supporting the Euro symbol +(ISO-8859-15, UTF-8, and others). Similarly, a Chinese string + + $ /usr/local/bin/printf '\u4e2d\u6587' + +will be output correctly in all Chinese locales (GB2312, BIG5, UTF-8, +etc). + + Note that in these examples, the full name of `printf' has been +given, to distinguish it from the GNU `bash' built-in function `printf'. + + For larger strings, you don't need to look up the hexadecimal code +values of each character one by one. ASCII characters mixed with \u +escape sequences is also known as the JAVA source file encoding. You +can use GNU recode 3.5c (or newer) to convert strings to this encoding. +Here is how to convert a piece of text into a shell script which will +output this text in a locale-independent way: + + $ LC_CTYPE=zh_CN.big5 /usr/local/bin/printf \ + '\u4e2d\u6587\n' > sample.txt + $ recode BIG5..JAVA < sample.txt \ + | sed -e "s|^|/usr/local/bin/printf '|" -e "s|$|\\\\n'|" \ + > sample.sh + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: yes invocation, Prev: printf invocation, Up: Printing text + +15.3 `yes': Print a string until interrupted +============================================ + +`yes' prints the command line arguments, separated by spaces and +followed by a newline, forever until it is killed. If no arguments are +given, it prints `y' followed by a newline forever until killed. + + Upon a write error, `yes' exits with status `1'. + + The only options are a lone `--help' or `--version'. To output an +argument that begins with `-', precede it with `--', e.g., `yes -- +--help'. *Note Common options::. + + +File: coreutils.info, Node: Conditions, Next: Redirection, Prev: Printing text, Up: Top + +16 Conditions +************* + +This section describes commands that are primarily useful for their exit +status, rather than their output. Thus, they are often used as the +condition of shell `if' statements, or as the last command in a +pipeline. + +* Menu: + +* false invocation:: Do nothing, unsuccessfully. +* true invocation:: Do nothing, successfully. +* test invocation:: Check file types and compare values. +* expr invocation:: Evaluate expressions. + + +File: coreutils.info, Node: false invocation, Next: true invocation, Up: Conditions + +16.1 `false': Do nothing, unsuccessfully +======================================== + +`false' does nothing except return an exit status of 1, meaning +"failure". It can be used as a place holder in shell scripts where an +unsuccessful command is needed. + + `false' honors the `--help' and `--version' options. + + This version of `false' is implemented as a C program, and is thus +more secure and faster than a shell script implementation, and may +safely be used as a dummy shell for the purpose of disabling accounts. + + Note that `false' (unlike all other programs documented herein) +exits unsuccessfully, even when invoked with `--help' or `--version'. + + +File: coreutils.info, Node: true invocation, Next: test invocation, Prev: false invocation, Up: Conditions + +16.2 `true': Do nothing, successfully +===================================== + +`true' does nothing except return an exit status of 0, meaning +"success". It can be used as a place holder in shell scripts where a +successful command is needed, although the shell built-in command `:' +(colon) may do the same thing faster. In most modern shells, `true' is +a built-in command, so when you use `true' in a script, you're probably +using the built-in command, not the one documented here. + + `true' honors the `--help' and `--version' options. + + Note, however, that it is possible to cause `true' to exit with +nonzero status: when invoked in non-POSIX mode, with the `--help' or +`--version' option, and with standard output already closed or +redirected to a file that evokes an I/O error. For example, using a +Bourne-compatible shell: + + $ ./true --version >&- + ./true: write error: Bad file number + $ ./true --version > /dev/full + ./true: write error: No space left on device + + This version of `true' is implemented as a C program, and is thus +more secure and faster than a shell script implementation, and may +safely be used as a dummy shell for the purpose of disabling accounts. + + +File: coreutils.info, Node: test invocation, Next: expr invocation, Prev: true invocation, Up: Conditions + +16.3 `test': Check file types and compare values +================================================ + +`test' returns a status of 0 (true) or 1 (false) depending on the +evaluation of the conditional expression EXPR. Each part of the +expression must be a separate argument. + + `test' has file status checks, string operators, and numeric +comparison operators. + + `test' has an alternate form that uses opening and closing square +brackets instead a leading `test'. For example, instead of `test -d +/', you can write `[ -d / ]'. The square brackets must be separate +arguments; for example, `[-d /]' does not have the desired effect. +Since `test EXPR' and `[ EXPR ]' have the same meaning, only the former +form is discussed below. + + Synopses: + + test EXPRESSION + test + [ EXPRESSION ] + [ ] + [ OPTION + + Because most shells have a built-in `test' command, using an +unadorned `test' in a script or interactively may get you different +functionality than that described here. + + If EXPRESSION is omitted, `test' returns false. If EXPRESSION is a +single argument, `test' returns false if the argument is null and true +otherwise. The argument can be any string, including strings like +`-d', `-1', `--', `--help', and `--version' that most other programs +would treat as options. To get help and version information, invoke +the commands `[ --help' and `[ --version', without the usual closing +brackets. *Note Common options::. + + Exit status: + + 0 if the expression is true, + 1 if the expression is false, + 2 if an error occurred. + +* Menu: + +* File type tests:: -[bcdfhLpSt] +* Access permission tests:: -[gkruwxOG] +* File characteristic tests:: -e -s -nt -ot -ef +* String tests:: -z -n = != +* Numeric tests:: -eq -ne -lt -le -gt -ge +* Connectives for test:: ! -a -o + + +File: coreutils.info, Node: File type tests, Next: Access permission tests, Up: test invocation + +16.3.1 File type tests +---------------------- + +These options test for particular types of files. (Everything's a file, +but not all files are the same!) + +`-b FILE' + True if FILE exists and is a block special device. + +`-c FILE' + True if FILE exists and is a character special device. + +`-d FILE' + True if FILE exists and is a directory. + +`-f FILE' + True if FILE exists and is a regular file. + +`-h FILE' +`-L FILE' + True if FILE exists and is a symbolic link. Unlike all other + file-related tests, this test does not dereference FILE if it is a + symbolic link. + +`-p FILE' + True if FILE exists and is a named pipe. + +`-S FILE' + True if FILE exists and is a socket. + +`-t FD' + True if FD is a file descriptor that is associated with a terminal. + + + +File: coreutils.info, Node: Access permission tests, Next: File characteristic tests, Prev: File type tests, Up: test invocation + +16.3.2 Access permission tests +------------------------------ + +These options test for particular access permissions. + +`-g FILE' + True if FILE exists and has its set-group-id bit set. + +`-k FILE' + True if FILE exists and has its "sticky" bit set. + +`-r FILE' + True if FILE exists and read permission is granted. + +`-u FILE' + True if FILE exists and has its set-user-id bit set. + +`-w FILE' + True if FILE exists and write permission is granted. + +`-x FILE' + True if FILE exists and execute permission is granted (or search + permission, if it is a directory). + +`-O FILE' + True if FILE exists and is owned by the current effective user id. + +`-G FILE' + True if FILE exists and is owned by the current effective group id. + + + +File: coreutils.info, Node: File characteristic tests, Next: String tests, Prev: Access permission tests, Up: test invocation + +16.3.3 File characteristic tests +-------------------------------- + +These options test other file characteristics. + +`-e FILE' + True if FILE exists. + +`-s FILE' + True if FILE exists and has a size greater than zero. + +`FILE1 -nt FILE2' + True if FILE1 is newer (according to modification date) than + FILE2, or if FILE1 exists and FILE2 does not. + +`FILE1 -ot FILE2' + True if FILE1 is older (according to modification date) than + FILE2, or if FILE2 exists and FILE1 does not. + +`FILE1 -ef FILE2' + True if FILE1 and FILE2 have the same device and inode numbers, + i.e., if they are hard links to each other. + + + +File: coreutils.info, Node: String tests, Next: Numeric tests, Prev: File characteristic tests, Up: test invocation + +16.3.4 String tests +------------------- + +These options test string characteristics. You may need to quote +STRING arguments for the shell. For example: + + test -n "$V" + + The quotes here prevent the wrong arguments from being passed to +`test' if `$V' is empty or contains special characters. + +`-z STRING' + True if the length of STRING is zero. + +`-n STRING' +`STRING' + True if the length of STRING is nonzero. + +`STRING1 = STRING2' + True if the strings are equal. + +`STRING1 != STRING2' + True if the strings are not equal. + + + +File: coreutils.info, Node: Numeric tests, Next: Connectives for test, Prev: String tests, Up: test invocation + +16.3.5 Numeric tests +-------------------- + +Numeric relationals. The arguments must be entirely numeric (possibly +negative), or the special expression `-l STRING', which evaluates to +the length of STRING. + +`ARG1 -eq ARG2' +`ARG1 -ne ARG2' +`ARG1 -lt ARG2' +`ARG1 -le ARG2' +`ARG1 -gt ARG2' +`ARG1 -ge ARG2' + These arithmetic binary operators return true if ARG1 is equal, + not-equal, less-than, less-than-or-equal, greater-than, or + greater-than-or-equal than ARG2, respectively. + + + For example: + + test -1 -gt -2 && echo yes + => yes + test -l abc -gt 1 && echo yes + => yes + test 0x100 -eq 1 + error--> test: integer expression expected before -eq + + +File: coreutils.info, Node: Connectives for test, Prev: Numeric tests, Up: test invocation + +16.3.6 Connectives for `test' +----------------------------- + +The usual logical connectives. + +`! EXPR' + True if EXPR is false. + +`EXPR1 -a EXPR2' + True if both EXPR1 and EXPR2 are true. + +`EXPR1 -o EXPR2' + True if either EXPR1 or EXPR2 is true. + + + +File: coreutils.info, Node: expr invocation, Prev: test invocation, Up: Conditions + +16.4 `expr': Evaluate expressions +================================= + +`expr' evaluates an expression and writes the result on standard +output. Each token of the expression must be a separate argument. + + Operands are either integers or strings. Integers consist of one or +more decimal digits, with an optional leading `-'. `expr' converts +anything appearing in an operand position to an integer or a string +depending on the operation being applied to it. + + Strings are not quoted for `expr' itself, though you may need to +quote them to protect characters with special meaning to the shell, +e.g., spaces. However, regardless of whether it is quoted, a string +operand should not be a parenthesis or any of `expr''s operators like +`+', so you cannot safely pass an arbitrary string `$str' to expr +merely by quoting it to the shell. One way to work around this is to +use the GNU extension `+', (e.g., `+ "$str" = foo'); a more portable +way is to use `" $str"' and to adjust the rest of the expression to take +the leading space into account (e.g., `" $str" = " foo"'). + + You should not pass a negative integer or a string with leading `-' +as `expr''s first argument, as it might be misinterpreted as an option; +this can be avoided by parenthesization. Also, portable scripts should +not use a string operand that happens to take the form of an integer; +this can be worked around by inserting leading spaces as mentioned +above. + + Operators may be given as infix symbols or prefix keywords. +Parentheses may be used for grouping in the usual manner. You must +quote parentheses and many operators to avoid the shell evaluating them, +however. + + The only options are `--help' and `--version'. *Note Common +options::. Options must precede operands. + + Exit status: + + 0 if the expression is neither null nor 0, + 1 if the expression is null or 0, + 2 if the expression is syntactically invalid, + 3 if an error occurred. + +* Menu: + +* String expressions:: + : match substr index length +* Numeric expressions:: + - * / % +* Relations for expr:: | & < <= = == != >= > +* Examples of expr:: Examples. + + +File: coreutils.info, Node: String expressions, Next: Numeric expressions, Up: expr invocation + +16.4.1 String expressions +------------------------- + +`expr' supports pattern matching and other string operators. These +have lower precedence than both the numeric and relational operators (in +the next sections). + +`STRING : REGEX' + Perform pattern matching. The arguments are converted to strings + and the second is considered to be a (basic, a la GNU `grep') + regular expression, with a `^' implicitly prepended. The first + argument is then matched against this regular expression. + + If the match succeeds and REGEX uses `\(' and `\)', the `:' + expression returns the part of STRING that matched the + subexpression; otherwise, it returns the number of characters + matched. + + If the match fails, the `:' operator returns the null string if + `\(' and `\)' are used in REGEX, otherwise 0. + + Only the first `\( ... \)' pair is relevant to the return value; + additional pairs are meaningful only for grouping the regular + expression operators. + + In the regular expression, `\+', `\?', and `\|' are operators + which respectively match one or more, zero or one, or separate + alternatives. SunOS and other `expr''s treat these as regular + characters. (POSIX allows either behavior.) *Note Regular + Expression Library: (regex)Top, for details of regular expression + syntax. Some examples are in *Note Examples of expr::. + +`match STRING REGEX' + An alternative way to do pattern matching. This is the same as + `STRING : REGEX'. + +`substr STRING POSITION LENGTH' + Returns the substring of STRING beginning at POSITION with length + at most LENGTH. If either POSITION or LENGTH is negative, zero, + or non-numeric, returns the null string. + +`index STRING CHARSET' + Returns the first position in STRING where the first character in + CHARSET was found. If no character in CHARSET is found in STRING, + return 0. + +`length STRING' + Returns the length of STRING. + +`+ TOKEN' + Interpret TOKEN as a string, even if it is a keyword like MATCH or + an operator like `/'. This makes it possible to test `expr length + + "$x"' or `expr + "$x" : '.*/\(.\)'' and have it do the right + thing even if the value of $X happens to be (for example) `/' or + `index'. This operator is a GNU extension. Portable shell + scripts should use `" $token" : ' \(.*\)'' instead of `+ "$token"'. + + + To make `expr' interpret keywords as strings, you must use the +`quote' operator. + + +File: coreutils.info, Node: Numeric expressions, Next: Relations for expr, Prev: String expressions, Up: expr invocation + +16.4.2 Numeric expressions +-------------------------- + +`expr' supports the usual numeric operators, in order of increasing +precedence. The string operators (previous section) have lower +precedence, the connectives (next section) have higher. + +`+ -' + Addition and subtraction. Both arguments are converted to + integers; an error occurs if this cannot be done. + +`* / %' + Multiplication, division, remainder. Both arguments are converted + to integers; an error occurs if this cannot be done. + + + +File: coreutils.info, Node: Relations for expr, Next: Examples of expr, Prev: Numeric expressions, Up: expr invocation + +16.4.3 Relations for `expr' +--------------------------- + +`expr' supports the usual logical connectives and relations. These are +higher precedence than either the string or numeric operators (previous +sections). Here is the list, lowest-precedence operator first. + +`|' + Returns its first argument if that is neither null nor zero, + otherwise its second argument if it is neither null nor zero, + otherwise 0. It does not evaluate its second argument if its + first argument is neither null nor zero. + +`&' + Return its first argument if neither argument is null or zero, + otherwise 0. It does not evaluate its second argument if its + first argument is null or zero. + +`< <= = == != >= >' + Compare the arguments and return 1 if the relation is true, 0 + otherwise. `==' is a synonym for `='. `expr' first tries to + convert both arguments to integers and do a numeric comparison; if + either conversion fails, it does a lexicographic comparison using + the character collating sequence specified by the `LC_COLLATE' + locale. + + + +File: coreutils.info, Node: Examples of expr, Prev: Relations for expr, Up: expr invocation + +16.4.4 Examples of using `expr' +------------------------------- + +Here are a few examples, including quoting for shell metacharacters. + + To add 1 to the shell variable `foo', in Bourne-compatible shells: + + foo=`expr $foo + 1` + + To print the non-directory part of the file name stored in `$fname', +which need not contain a `/': + + expr $fname : '.*/\(.*\)' '|' $fname + + An example showing that `\+' is an operator: + + expr aaa : 'a\+' + => 3 + + expr abc : 'a\(.\)c' + => b + expr index abcdef cz + => 3 + expr index index a + error--> expr: syntax error + expr index quote index a + => 0 + + +File: coreutils.info, Node: Redirection, Next: File name manipulation, Prev: Conditions, Up: Top + +17 Redirection +************** + +Unix shells commonly provide several forms of "redirection"--ways to +change the input source or output destination of a command. But one +useful redirection is performed by a separate command, not by the shell; +it's described here. + +* Menu: + +* tee invocation:: Redirect output to multiple files. + + +File: coreutils.info, Node: tee invocation, Up: Redirection + +17.1 `tee': Redirect output to multiple files +============================================= + +The `tee' command copies standard input to standard output and also to +any files given as arguments. This is useful when you want not only to +send some data down a pipe, but also to save a copy. Synopsis: + + tee [OPTION]... [FILE]... + + If a file being written to does not already exist, it is created. +If a file being written to already exists, the data it previously +contained is overwritten unless the `-a' option is used. + + A FILE of `-' causes `tee' to send another copy of input to standard +output, but this is typically not that useful as the copies are +interleaved. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--append' + Append standard input to the given files rather than overwriting + them. + +`-i' +`--ignore-interrupts' + Ignore interrupt signals. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: File name manipulation, Next: Working context, Prev: Redirection, Up: Top + +18 File name manipulation +************************* + +This section describes commands that manipulate file names. + +* Menu: + +* basename invocation:: Strip directory and suffix from a file name. +* dirname invocation:: Strip non-directory suffix from a file name. +* pathchk invocation:: Check file name portability. + + +File: coreutils.info, Node: basename invocation, Next: dirname invocation, Up: File name manipulation + +18.1 `basename': Strip directory and suffix from a file name +============================================================ + +`basename' removes any leading directory components from NAME. +Synopsis: + + basename NAME [SUFFIX] + + If SUFFIX is specified and is identical to the end of NAME, it is +removed from NAME as well. `basename' prints the result on standard +output. + + The only options are `--help' and `--version'. *Note Common +options::. Options must precede operands. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: dirname invocation, Next: pathchk invocation, Prev: basename invocation, Up: File name manipulation + +18.2 `dirname': Strip non-directory suffix from a file name +=========================================================== + +`dirname' prints all but the final slash-delimited component of a +string (presumably a file name). Synopsis: + + dirname NAME + + If NAME is a single component, `dirname' prints `.' (meaning the +current directory). + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: pathchk invocation, Prev: dirname invocation, Up: File name manipulation + +18.3 `pathchk': Check file name portability +=========================================== + +`pathchk' checks portability of file names. Synopsis: + + pathchk [OPTION]... NAME... + + For each NAME, `pathchk' prints a message if any of these conditions +is true: + + 1. One of the existing directories in NAME does not have search + (execute) permission, + + 2. The length of NAME is larger than the maximum supported by the + operating system. + + 3. The length of one component of NAME is longer than its file + system's maximum. + + A nonexistent NAME is not an error, so long a file with that name +could be created under the above conditions. + + The program accepts the following option. Also see *Note Common +options::. Options must precede operands. + +`-p' +`--portability' + Do not perform checks based on the underlying file system. + Instead, check the length of each file name and its components + against the POSIX minimum limits for portability. Also check that + the file name contains only characters that are in the portable + file name character set, namely, the ASCII letters and digits, `-', + `.', `/', and `_'. + + + Exit status: + + 0 if all specified file names passed all checks, + 1 otherwise. + + +File: coreutils.info, Node: Working context, Next: User information, Prev: File name manipulation, Up: Top + +19 Working context +****************** + +This section describes commands that display or alter the context in +which you are working: the current directory, the terminal settings, and +so forth. See also the user-related commands in the next section. + +* Menu: + +* pwd invocation:: Print working directory. +* stty invocation:: Print or change terminal characteristics. +* printenv invocation:: Print environment variables. +* tty invocation:: Print file name of terminal on standard input. + + +File: coreutils.info, Node: pwd invocation, Next: stty invocation, Up: Working context + +19.1 `pwd': Print working directory +=================================== + +`pwd' prints the fully resolved name of the current directory. That +is, all components of the printed name will be actual directory +names--none will be symbolic links. + + Because most shells have a built-in `pwd' command, using an +unadorned `pwd' in a script or interactively may get you different +functionality than that described here. + + The only options are a lone `--help' or `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: stty invocation, Next: printenv invocation, Prev: pwd invocation, Up: Working context + +19.2 `stty': Print or change terminal characteristics +===================================================== + +`stty' prints or changes terminal characteristics, such as baud rate. +Synopses: + + stty [OPTION] [SETTING]... + stty [OPTION] + + If given no line settings, `stty' prints the baud rate, line +discipline number (on systems that support it), and line settings that +have been changed from the values set by `stty sane'. By default, mode +reading and setting are performed on the tty line connected to standard +input, although this can be modified by the `--file' option. + + `stty' accepts many non-option arguments that change aspects of the +terminal line operation, as described below. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--all' + Print all current settings in human-readable form. This option + may not be used in combination with any line settings. + +`-F DEVICE' +`--file=DEVICE' + Set the line opened by the file name specified in DEVICE instead of + the tty line connected to standard input. This option is necessary + because opening a POSIX tty requires use of the `O_NONDELAY' flag + to prevent a POSIX tty from blocking until the carrier detect line + is high if the `clocal' flag is not set. Hence, it is not always + possible to allow the shell to open the device in the traditional + manner. + +`-g' +`--save' + Print all current settings in a form that can be used as an + argument to another `stty' command to restore the current + settings. This option may not be used in combination with any + line settings. + + + Many settings can be turned off by preceding them with a `-'. Such +arguments are marked below with "May be negated" in their description. +The descriptions themselves refer to the positive case, that is, when +_not_ negated (unless stated otherwise, of course). + + Some settings are not available on all POSIX systems, since they use +extensions. Such arguments are marked below with "Non-POSIX" in their +description. On non-POSIX systems, those or other settings also may not +be available, but it's not feasible to document all the variations: just +try it and see. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + +* Menu: + +* Control:: Control settings +* Input:: Input settings +* Output:: Output settings +* Local:: Local settings +* Combination:: Combination settings +* Characters:: Special characters +* Special:: Special settings + + +File: coreutils.info, Node: Control, Next: Input, Up: stty invocation + +19.2.1 Control settings +----------------------- + +Control settings: + +`parenb' + Generate parity bit in output and expect parity bit in input. May + be negated. + +`parodd' + Set odd parity (even if negated). May be negated. + +`cs5' +`cs6' +`cs7' +`cs8' + Set character size to 5, 6, 7, or 8 bits. + +`hup' +`hupcl' + Send a hangup signal when the last process closes the tty. May be + negated. + +`cstopb' + Use two stop bits per character (one if negated). May be negated. + +`cread' + Allow input to be received. May be negated. + +`clocal' + Disable modem control signals. May be negated. + +`crtscts' + Enable RTS/CTS flow control. Non-POSIX. May be negated. + + +File: coreutils.info, Node: Input, Next: Output, Prev: Control, Up: stty invocation + +19.2.2 Input settings +--------------------- + +`ignbrk' + Ignore break characters. May be negated. + +`brkint' + Make breaks cause an interrupt signal. May be negated. + +`ignpar' + Ignore characters with parity errors. May be negated. + +`parmrk' + Mark parity errors (with a 255-0-character sequence). May be + negated. + +`inpck' + Enable input parity checking. May be negated. + +`istrip' + Clear high (8th) bit of input characters. May be negated. + +`inlcr' + Translate newline to carriage return. May be negated. + +`igncr' + Ignore carriage return. May be negated. + +`icrnl' + Translate carriage return to newline. May be negated. + +`iutf8' + Assume input characters are UTF-8 encoded. May be negated. + +`ixon' + Enable XON/XOFF flow control (that is, `CTRL-S'/`CTRL-Q'). May be + negated. + +`ixoff' +`tandem' + Enable sending of `stop' character when the system input buffer is + almost full, and `start' character when it becomes almost empty + again. May be negated. + +`iuclc' + Translate uppercase characters to lowercase. Non-POSIX. May be + negated. + +`ixany' + Allow any character to restart output (only the start character if + negated). Non-POSIX. May be negated. + +`imaxbel' + Enable beeping and not flushing input buffer if a character arrives + when the input buffer is full. Non-POSIX. May be negated. + + +File: coreutils.info, Node: Output, Next: Local, Prev: Input, Up: stty invocation + +19.2.3 Output settings +---------------------- + +These arguments specify output-related operations. + +`opost' + Postprocess output. May be negated. + +`olcuc' + Translate lowercase characters to uppercase. Non-POSIX. May be + negated. + +`ocrnl' + Translate carriage return to newline. Non-POSIX. May be negated. + +`onlcr' + Translate newline to carriage return-newline. Non-POSIX. May be + negated. + +`onocr' + Do not print carriage returns in the first column. Non-POSIX. + May be negated. + +`onlret' + Newline performs a carriage return. Non-POSIX. May be negated. + +`ofill' + Use fill (padding) characters instead of timing for delays. + Non-POSIX. May be negated. + +`ofdel' + Use delete characters for fill instead of null characters. + Non-POSIX. May be negated. + +`nl1' +`nl0' + Newline delay style. Non-POSIX. + +`cr3' +`cr2' +`cr1' +`cr0' + Carriage return delay style. Non-POSIX. + +`tab3' +`tab2' +`tab1' +`tab0' + Horizontal tab delay style. Non-POSIX. + +`bs1' +`bs0' + Backspace delay style. Non-POSIX. + +`vt1' +`vt0' + Vertical tab delay style. Non-POSIX. + +`ff1' +`ff0' + Form feed delay style. Non-POSIX. + + +File: coreutils.info, Node: Local, Next: Combination, Prev: Output, Up: stty invocation + +19.2.4 Local settings +--------------------- + +`isig' + Enable `interrupt', `quit', and `suspend' special characters. May + be negated. + +`icanon' + Enable `erase', `kill', `werase', and `rprnt' special characters. + May be negated. + +`iexten' + Enable non-POSIX special characters. May be negated. + +`echo' + Echo input characters. May be negated. + +`echoe' +`crterase' + Echo `erase' characters as backspace-space-backspace. May be + negated. + +`echok' + Echo a newline after a `kill' character. May be negated. + +`echonl' + Echo newline even if not echoing other characters. May be negated. + +`noflsh' + Disable flushing after `interrupt' and `quit' special characters. + May be negated. + +`xcase' + Enable input and output of uppercase characters by preceding their + lowercase equivalents with `\', when `icanon' is set. Non-POSIX. + May be negated. + +`tostop' + Stop background jobs that try to write to the terminal. Non-POSIX. + May be negated. + +`echoprt' +`prterase' + Echo erased characters backward, between `\' and `/'. Non-POSIX. + May be negated. + +`echoctl' +`ctlecho' + Echo control characters in hat notation (`^C') instead of + literally. Non-POSIX. May be negated. + +`echoke' +`crtkill' + Echo the `kill' special character by erasing each character on the + line as indicated by the `echoprt' and `echoe' settings, instead + of by the `echoctl' and `echok' settings. Non-POSIX. May be + negated. + + +File: coreutils.info, Node: Combination, Next: Characters, Prev: Local, Up: stty invocation + +19.2.5 Combination settings +--------------------------- + +Combination settings: + +`evenp' +`parity' + Same as `parenb -parodd cs7'. May be negated. If negated, same + as `-parenb cs8'. + +`oddp' + Same as `parenb parodd cs7'. May be negated. If negated, same as + `-parenb cs8'. + +`nl' + Same as `-icrnl -onlcr'. May be negated. If negated, same as + `icrnl -inlcr -igncr onlcr -ocrnl -onlret'. + +`ek' + Reset the `erase' and `kill' special characters to their default + values. + +`sane' + Same as: + + cread -ignbrk brkint -inlcr -igncr icrnl -ixoff + -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr + -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 + ff0 isig icanon iexten echo echoe echok -echonl + -noflsh -xcase -tostop -echoprt echoctl echoke + + and also sets all special characters to their default values. + +`cooked' + Same as `brkint ignpar istrip icrnl ixon opost isig icanon', plus + sets the `eof' and `eol' characters to their default values if + they are the same as the `min' and `time' characters. May be + negated. If negated, same as `raw'. + +`raw' + Same as: + + -ignbrk -brkint -ignpar -parmrk -inpck -istrip + -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany + -imaxbel -opost -isig -icanon -xcase min 1 time 0 + + May be negated. If negated, same as `cooked'. + +`cbreak' + Same as `-icanon'. May be negated. If negated, same as `icanon'. + +`pass8' + Same as `-parenb -istrip cs8'. May be negated. If negated, same + as `parenb istrip cs7'. + +`litout' + Same as `-parenb -istrip -opost cs8'. May be negated. If + negated, same as `parenb istrip opost cs7'. + +`decctlq' + Same as `-ixany'. Non-POSIX. May be negated. + +`tabs' + Same as `tab0'. Non-POSIX. May be negated. If negated, same as + `tab3'. + +`lcase' +`LCASE' + Same as `xcase iuclc olcuc'. Non-POSIX. May be negated. + +`crt' + Same as `echoe echoctl echoke'. + +`dec' + Same as `echoe echoctl echoke -ixany intr ^C erase ^? kill C-u'. + + +File: coreutils.info, Node: Characters, Next: Special, Prev: Combination, Up: stty invocation + +19.2.6 Special characters +------------------------- + +The special characters' default values vary from system to system. +They are set with the syntax `name value', where the names are listed +below and the value can be given either literally, in hat notation +(`^C'), or as an integer which may start with `0x' to indicate +hexadecimal, `0' to indicate octal, or any other digit to indicate +decimal. + + For GNU stty, giving a value of `^-' or `undef' disables that +special character. (This is incompatible with Ultrix `stty', which +uses a value of `u' to disable a special character. GNU `stty' treats +a value `u' like any other, namely to set that special character to +.) + +`intr' + Send an interrupt signal. + +`quit' + Send a quit signal. + +`erase' + Erase the last character typed. + +`kill' + Erase the current line. + +`eof' + Send an end of file (terminate the input). + +`eol' + End the line. + +`eol2' + Alternate character to end the line. Non-POSIX. + +`swtch' + Switch to a different shell layer. Non-POSIX. + +`start' + Restart the output after stopping it. + +`stop' + Stop the output. + +`susp' + Send a terminal stop signal. + +`dsusp' + Send a terminal stop signal after flushing the input. Non-POSIX. + +`rprnt' + Redraw the current line. Non-POSIX. + +`werase' + Erase the last word typed. Non-POSIX. + +`lnext' + Enter the next character typed literally, even if it is a special + character. Non-POSIX. + + +File: coreutils.info, Node: Special, Prev: Characters, Up: stty invocation + +19.2.7 Special settings +----------------------- + +`min N' + Set the minimum number of characters that will satisfy a read until + the time value has expired, when `-icanon' is set. + +`time N' + Set the number of tenths of a second before reads time out if the + minimum number of characters have not been read, when `-icanon' is + set. + +`ispeed N' + Set the input speed to N. + +`ospeed N' + Set the output speed to N. + +`rows N' + Tell the tty kernel driver that the terminal has N rows. + Non-POSIX. + +`cols N' +`columns N' + Tell the kernel that the terminal has N columns. Non-POSIX. + +`size' + Print the number of rows and columns that the kernel thinks the + terminal has. (Systems that don't support rows and columns in the + kernel typically use the environment variables `LINES' and + `COLUMNS' instead; however, GNU `stty' does not know anything + about them.) Non-POSIX. + +`line N' + Use line discipline N. Non-POSIX. + +`speed' + Print the terminal speed. + +`N' + Set the input and output speeds to N. N can be one of: 0 50 75 + 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 + `exta' `extb'. `exta' is the same as 19200; `extb' is the same as + 38400. 0 hangs up the line if `-clocal' is set. + + +File: coreutils.info, Node: printenv invocation, Next: tty invocation, Prev: stty invocation, Up: Working context + +19.3 `printenv': Print all or some environment variables +======================================================== + +`printenv' prints environment variable values. Synopsis: + + printenv [OPTION] [VARIABLE]... + + If no VARIABLEs are specified, `printenv' prints the value of every +environment variable. Otherwise, it prints the value of each VARIABLE +that is set, and nothing for those that are not set. + + The only options are a lone `--help' or `--version'. *Note Common +options::. + + Exit status: + + 0 if all variables specified were found + 1 if at least one specified variable was not found + 2 if a write error occurred + + +File: coreutils.info, Node: tty invocation, Prev: printenv invocation, Up: Working context + +19.4 `tty': Print file name of terminal on standard input +========================================================= + +`tty' prints the file name of the terminal connected to its standard +input. It prints `not a tty' if standard input is not a terminal. +Synopsis: + + tty [OPTION]... + + The program accepts the following option. Also see *Note Common +options::. + +`-s' +`--silent' +`--quiet' + Print nothing; only return an exit status. + + + Exit status: + + 0 if standard input is a terminal + 1 if standard input is not a terminal + 2 if given incorrect arguments + 3 if a write error occurs + + +File: coreutils.info, Node: User information, Next: System context, Prev: Working context, Up: Top + +20 User information +******************* + +This section describes commands that print user-related information: +logins, groups, and so forth. + +* Menu: + +* id invocation:: Print real and effective uid and gid. +* logname invocation:: Print current login name. +* whoami invocation:: Print effective user id. +* groups invocation:: Print group names a user is in. +* users invocation:: Print login names of users currently logged in. +* who invocation:: Print who is currently logged in. + + +File: coreutils.info, Node: id invocation, Next: logname invocation, Up: User information + +20.1 `id': Print real and effective uid and gid +=============================================== + +`id' prints information about the given user, or the process running it +if no user is specified. Synopsis: + + id [OPTION]... [USERNAME] + + By default, it prints the real user id, real group id, effective +user id if different from the real user id, effective group id if +different from the real group id, and supplemental group ids. + + Each of these numeric values is preceded by an identifying string and +followed by the corresponding user or group name in parentheses. + + The options cause `id' to print only part of the above information. +Also see *Note Common options::. + +`-g' +`--group' + Print only the group id. + +`-G' +`--groups' + Print only the group id and the supplementary groups. + +`-n' +`--name' + Print the user or group name instead of the ID number. Requires + `-u', `-g', or `-G'. + +`-r' +`--real' + Print the real, instead of effective, user or group id. Requires + `-u', `-g', or `-G'. + +`-u' +`--user' + Print only the user id. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: logname invocation, Next: whoami invocation, Prev: id invocation, Up: User information + +20.2 `logname': Print current login name +======================================== + +`logname' prints the calling user's name, as found in a +system-maintained file (often `/var/run/utmp' or `/etc/utmp'), and +exits with a status of 0. If there is no entry for the calling +process, `logname' prints an error message and exits with a status of 1. + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: whoami invocation, Next: groups invocation, Prev: logname invocation, Up: User information + +20.3 `whoami': Print effective user id +====================================== + +`whoami' prints the user name associated with the current effective +user id. It is equivalent to the command `id -un'. + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: groups invocation, Next: users invocation, Prev: whoami invocation, Up: User information + +20.4 `groups': Print group names a user is in +============================================= + +`groups' prints the names of the primary and any supplementary groups +for each given USERNAME, or the current process if no names are given. +If names are given, the name of each user is printed before the list of +that user's groups. Synopsis: + + groups [USERNAME]... + + The group lists are equivalent to the output of the command `id -Gn'. + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: users invocation, Next: who invocation, Prev: groups invocation, Up: User information + +20.5 `users': Print login names of users currently logged in +============================================================ + +`users' prints on a single line a blank-separated list of user names of +users currently logged in to the current host. Each user name +corresponds to a login session, so if a user has more than one login +session, that user's name will appear the same number of times in the +output. Synopsis: + + users [FILE] + + With no FILE argument, `users' extracts its information from a +system-maintained file (often `/var/run/utmp' or `/etc/utmp'). If a +file argument is given, `users' uses that file instead. A common +choice is `/var/log/wtmp'. + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: who invocation, Prev: users invocation, Up: User information + +20.6 `who': Print who is currently logged in +============================================ + +`who' prints information about users who are currently logged on. +Synopsis: + + `who' [OPTION] [FILE] [am i] + + If given no non-option arguments, `who' prints the following +information for each user currently logged on: login name, terminal +line, login time, and remote hostname or X display. + + If given one non-option argument, `who' uses that instead of a +default system-maintained file (often `/var/run/utmp' or +`/etc/utmp') +as the name of the file containing the record of users logged on. +`/var/log/wtmp' is commonly given as an argument to `who' to look at +who has previously logged on. + + If given two non-option arguments, `who' prints only the entry for +the user running it (determined from its standard input), preceded by +the hostname. Traditionally, the two arguments given are `am i', as in +`who am i'. + + Time stamps are listed according to the time zone rules specified by +the `TZ' environment variable, or by the system default rules if `TZ' +is not set. *Note Specifying the Time Zone with `TZ': (libc)TZ +Variable. + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--all' + Same as `-b -d --login -p -r -t -T -u'. + +`-b' +`--boot' + Print the date and time of last system boot. + +`-d' +`--dead' + Print information corresponding to dead processes. + +`-H' +`--heading' + Print column headings. + +`-i' +`--idle' + Include idle time in HOURS:MINUTES, `.' (to indicate current + process), or `old'. + +`-m' + Same as `who am i'. + +`-q' +`--count' + Print only the login names and the number of users logged on. + Overrides all other options. + +`-s' + Ignored; for compatibility with other versions of `who'. + +`-i' +`-u' +`--idle' + After the login time, print the number of hours and minutes that + the user has been idle. `.' means the user was active in last + minute. `old' means the user was idle for more than 24 hours. + +`-l' +`--login' + List only the entries that correspond to processes via which the + system is waiting for a user to login. The user name is always + `LOGIN'. + +`--lookup' + Attempt to canonicalize hostnames found in utmp through a DNS + lookup. This is not the default because it can cause significant + delays on systems with automatic dial-up internet access. + +`-H' +`--heading' + Print a line of column headings. + +`-w' +`-T' +`--mesg' +`--message' +`--writable' + After each login name print a character indicating the user's + message status: + + `+' allowing `write' messages + `-' disallowing `write' messages + `?' cannot find terminal device + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: System context, Next: Modified command invocation, Prev: User information, Up: Top + +21 System context +***************** + +This section describes commands that print or change system-wide +information. + +* Menu: + +* date invocation:: Print or set system date and time. +* uname invocation:: Print system information. +* hostname invocation:: Print or set system name. +* hostid invocation:: Print numeric host identifier. + + +File: coreutils.info, Node: date invocation, Next: uname invocation, Up: System context + +21.1 `date': Print or set system date and time +============================================== + +Synopses: + + date [OPTION]... [+FORMAT] + date [-u|--utc|--universal] [ MMDDhhmm[[CC]YY][.ss] ] + + Invoking `date' with no FORMAT argument is equivalent to invoking it +with a default format that depends on the `LC_TIME' locale category. +In the default C locale, this format is `'+%a %b %e %H:%M:%S %Z %Y'', +so the output looks like `Fri Feb 27 13:47:51 PST 2004'. + + Normally, `date' uses the time zone rules indicated by the `TZ' +environment variable, or the system default rules if `TZ' is not set. +*Note Specifying the Time Zone with `TZ': (libc)TZ Variable. + + If given an argument that starts with a `+', `date' prints the +current time and date (or the time and date specified by the `--date' +option, see below) in the format defined by that argument, which is +similar to that of the `strftime' function. Except for directives, +which start with `%', characters in the format string are printed +unchanged. The directives are described below. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + +* Menu: + +* Time directives:: %[HIklMprsSTXzZ] +* Date directives:: %[aAbBcCdDhjmUwWxyY] +* Literal directives:: %[%nt] +* Padding:: Pad with zeroes, spaces (%_), or nothing (%-). +* Setting the time:: Changing the system clock. +* Options for date:: Instead of the current time. +* Examples of date:: Examples. + + +File: coreutils.info, Node: Time directives, Next: Date directives, Up: date invocation + +21.1.1 Time directives +---------------------- + +`date' directives related to times. + +`%H' + hour (00...23) + +`%I' + hour (01...12) + +`%k' + hour ( 0...23) + +`%l' + hour ( 1...12) + +`%M' + minute (00...59) + +`%N' + nanoseconds (000000000...999999999) + +`%p' + locale's upper case `AM' or `PM' (blank in many locales) + +`%P' + locale's lower case `am' or `pm' (blank in many locales) + +`%r' + time, 12-hour (hh:mm:ss [AP]M) + +`%R' + time, 24-hour (hh:mm). Same as `%H:%M'. + +`%s' + seconds since the epoch, i.e., 1 January 1970 00:00:00 UTC (a GNU + extension). For examples, *Note %s-examples::. + +`%S' + second (00...60). The range is [00...60], and not [00...59], in + order to accommodate the occasional positive leap second. + +`%T' + time, 24-hour (hh:mm:ss) + +`%X' + locale's time representation (%H:%M:%S) + +`%z' + RFC-2822 style numeric time zone (e.g., `-0600' or `+0100'), or + nothing if no time zone is determinable. This value reflects the + _current_ time zone. It isn't changed by the `--date' option. + +`%Z' + time zone (e.g., EDT), or nothing if no time zone is determinable. + Note that this value reflects the _current_ time zone. It isn't + changed by the `--date' option. + + +File: coreutils.info, Node: Date directives, Next: Literal directives, Prev: Time directives, Up: date invocation + +21.1.2 Date directives +---------------------- + +`date' directives related to dates. + +`%a' + locale's abbreviated weekday name (Sun...Sat) + +`%A' + locale's full weekday name, variable length (Sunday...Saturday) + +`%b' + locale's abbreviated month name (Jan...Dec) + +`%B' + locale's full month name, variable length (January...December) + +`%c' + locale's date and time (Sat Nov 04 12:02:33 EST 1989) + +`%C' + century (year divided by 100 and truncated to an integer) (00...99) + +`%d' + day of month (01...31) + +`%D' + date (mm/dd/yy) + +`%e' + blank-padded day of month (1...31) + +`%F' + the ISO 8601 standard date format: `%Y-%m-%d'. This is the + preferred form for all uses. + +`%g' + The year corresponding to the ISO week number, but without the + century (range `00' through `99'). This has the same format and + value as `%y', except that if the ISO week number (see `%V') + belongs to the previous or next year, that year is used instead. + +`%G' + The year corresponding to the ISO week number. This has the same + format and value as `%Y', except that if the ISO week number (see + `%V') belongs to the previous or next year, that year is used + instead. + +`%h' + same as %b + +`%j' + day of year (001...366) + +`%m' + month (01...12) + +`%u' + day of week (1...7) with 1 corresponding to Monday + +`%U' + week number of year with Sunday as first day of week (00...53). + Days in a new year preceding the first Sunday are in week zero. + +`%V' + week number of year with Monday as first day of the week as a + decimal (01...53). If the week containing January 1 has four or + more days in the new year, then it is considered week 1; + otherwise, it is week 53 of the previous year, and the next week + is week 1. (See the ISO 8601 standard.) + +`%w' + day of week (0...6) with 0 corresponding to Sunday + +`%W' + week number of year with Monday as first day of week (00...53). + Days in a new year preceding the first Monday are in week zero. + +`%x' + locale's date representation (mm/dd/yy) + +`%y' + last two digits of year (00...99) + +`%Y' + year (1970....) + + +File: coreutils.info, Node: Literal directives, Next: Padding, Prev: Date directives, Up: date invocation + +21.1.3 Literal directives +------------------------- + +`date' directives that produce literal strings. + +`%%' + a literal % + +`%n' + a newline + +`%t' + a horizontal tab + + +File: coreutils.info, Node: Padding, Next: Setting the time, Prev: Literal directives, Up: date invocation + +21.1.4 Padding +-------------- + +By default, `date' pads numeric fields with zeroes, so that, for +example, numeric months are always output as two digits. GNU `date' +recognizes the following numeric modifiers between the `%' and the +directive. + +`-' + (hyphen) do not pad the field; useful if the output is intended for + human consumption. + +`_' + (underscore) pad the field with spaces; useful if you need a fixed + number of characters in the output, but zeroes are too distracting. + +These are GNU extensions. + + Here is an example illustrating the differences: + + date +%d/%m -d "Feb 1" + => 01/02 + date +%-d/%-m -d "Feb 1" + => 1/2 + date +%_d/%_m -d "Feb 1" + => 1/ 2 + + +File: coreutils.info, Node: Setting the time, Next: Options for date, Prev: Padding, Up: date invocation + +21.1.5 Setting the time +----------------------- + +If given an argument that does not start with `+', `date' sets the +system clock to the time and date specified by that argument (as +described below). You must have appropriate privileges to set the +system clock. The `--date' and `--set' options may not be used with +such an argument. The `--universal' option may be used with such an +argument to indicate that the specified time and date are relative to +Coordinated Universal Time rather than to the local time zone. + + The argument must consist entirely of digits, which have the +following meaning: + +`MM' + month + +`DD' + day within month + +`hh' + hour + +`mm' + minute + +`CC' + first two digits of year (optional) + +`YY' + last two digits of year (optional) + +`ss' + second (optional) + + The `--set' option also sets the system clock; see the next section. + + +File: coreutils.info, Node: Options for date, Next: Examples of date, Prev: Setting the time, Up: date invocation + +21.1.6 Options for `date' +------------------------- + +The program accepts the following options. Also see *Note Common +options::. + +`-d DATESTR' +`--date=DATESTR' + Display the time and date specified in DATESTR instead of the + current time and date. DATESTR can be in almost any common + format. It can contain month names, time zones, `am' and `pm', + `yesterday', etc. For example, `--date="2004-02-27 + 14:19:13.489392193 +0530"' specifies the instant of time that is + 489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a + time zone that is 5 hours and 30 minutes east of UTC. *Note Date + input formats::. + +`-f DATEFILE' +`--file=DATEFILE' + Parse each line in DATEFILE as with `-d' and display the resulting + time and date. If DATEFILE is `-', use standard input. This is + useful when you have many dates to process, because the system + overhead of starting up the `date' executable many times can be + considerable. + +`-I TIMESPEC' +`--iso-8601[=TIMESPEC]' + Display the date using the ISO 8601 format, `%Y-%m-%d'. + + The argument TIMESPEC specifies the number of additional terms of + the time to include. It can be one of the following: + `auto' + The default behavior: print just the date. + + `hours' + Append the hour of the day to the date. + + `minutes' + Append the hours and minutes. + + `seconds' + Append the hours, minutes, and seconds. + + `ns' + Append the hours, minutes, seconds, and nanoseconds. + + If showing any time terms, then include the time zone using the + format `%z'. + + If TIMESPEC is omitted with `--iso-8601', the default is `auto'. + On older systems, GNU `date' instead supports an obsolete option + `-I[TIMESPEC]', where TIMESPEC defaults to `auto'. POSIX + 1003.1-2001 (*note Standards conformance::) does not allow `-I' + without an argument; use `--iso-8601' instead. + +`-R' +`--rfc-822' +`--rfc-2822' + Display the time and date using the format `%a, %d %b %Y %H:%M:%S + %z', evaluated in the C locale so abbreviations are always in + English. For example: + + Fri, 1 Aug 2003 23:05:56 -0700 + + This format conforms to RFC 2822 + (ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt) and RFC 822 + (ftp://ftp.rfc-editor.org/in-notes/rfc822.txt), the current and + previous standards for Internet email. + +`-r FILE' +`--reference=FILE' + Display the time and date reference according to the last + modification time of FILE, instead of the current time and date. + +`-s DATESTR' +`--set=DATESTR' + Set the time and date to DATESTR. See `-d' above. + +`-u' +`--utc' +`--universal' + Use Coordinated Universal Time (UTC) by operating as if the `TZ' + environment variable were set to the string `UTC0'. Coordinated + Universal Time is often called "Greenwich Mean Time" (GMT) for + historical reasons. + + +File: coreutils.info, Node: Examples of date, Prev: Options for date, Up: date invocation + +21.1.7 Examples of `date' +------------------------- + +Here are a few examples. Also see the documentation for the `-d' +option in the previous section. + + * To print the date of the day before yesterday: + + date --date='2 days ago' + + * To print the date of the day three months and one day hence: + + date --date='3 months 1 day' + + * To print the day of year of Christmas in the current year: + + date --date='25 Dec' +%j + + * To print the current full month name and the day of the month: + + date '+%B %d' + + But this may not be what you want because for the first nine days + of the month, the `%d' expands to a zero-padded two-digit field, + for example `date -d 1may '+%B %d'' will print `May 01'. + + * To print a date without the leading zero for one-digit days of the + month, you can use the (GNU extension) `-' modifier to suppress + the padding altogether: + + date -d 1may '+%B %-d + + * To print the current date and time in the format required by many + non-GNU versions of `date' when setting the system clock: + + date +%m%d%H%M%Y.%S + + * To set the system clock forward by two minutes: + + date --set='+2 minutes' + + * To print the date in the format specified by RFC-2822, use `date + --rfc-2822'. I just did and saw this: + + Thu, 31 Jul 2003 13:13:05 -0700 + + * To convert a date string to the number of seconds since the epoch + (which is 1970-01-01 00:00:00 UTC), use the `--date' option with + the `%s' format. That can be useful in sorting and/or graphing + and/or comparing data by date. The following command outputs the + number of the seconds since the epoch for the time two minutes + after the epoch: + + date --date='1970-01-01 00:02:00 +0000' +%s + 120 + + If you do not specify time zone information in the date string, + `date' uses your computer's idea of the time zone when + interpreting the string. For example, if your computer's time + zone is that of Cambridge, Massachusetts, which was then 5 hours + (i.e., 18,000 seconds) behind UTC: + + # local time zone used + date --date='1970-01-01 00:02:00' +%s + 18120 + + * If you're sorting or graphing dated data, your raw date values may + be represented as seconds since the epoch. But few people can + look at the date `946684800' and casually note "Oh, that's the + first second of the year 2000 in Greenwich, England." + + date --date='2000-01-01 UTC' +%s + 946684800 + + An alternative is to use the `--utc' (`-u') option. Then you may + omit `UTC' from the date string. Although this produces the same + result for `%s' and many other format sequences, with a time zone + offset different from zero, it would give a different result for + zone-dependent formats like `%z'. + + date -u --date=2000-01-01 +%s + 946684800 + + To convert such an unwieldy number of seconds back to a more + readable form, use a command like this: + + # local time zone used + date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z" + 1999-12-31 19:00:00 -0500 + + Often it is better to output UTC-relative date and time: + + date -u -d '1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z" + 2000-01-01 00:00:00 +0000 + + + +File: coreutils.info, Node: uname invocation, Next: hostname invocation, Prev: date invocation, Up: System context + +21.2 `uname': Print system information +====================================== + +`uname' prints information about the machine and operating system it is +run on. If no options are given, `uname' acts as if the `-s' option +were given. Synopsis: + + uname [OPTION]... + + If multiple options or `-a' are given, the selected information is +printed in this order: + + KERNEL-NAME NODENAME KERNEL-RELEASE KERNEL-VERSION + MACHINE PROCESSOR HARDWARE-PLATFORM OPERATING-SYSTEM + + The information may contain internal spaces, so such output cannot be +parsed reliably. In the following example, RELEASE is +`2.2.18ss.e820-bda652a #4 SMP Tue Jun 5 11:24:08 PDT 2001': + + uname -a + => Linux dum 2.2.18 #4 SMP Tue Jun 5 11:24:08 PDT 2001 i686 unknown unknown GNU/Linux + + The program accepts the following options. Also see *Note Common +options::. + +`-a' +`--all' + Print all of the below information. + +`-i' +`--hardware-platform' + Print the hardware platform name (sometimes called the hardware + implementation). + +`-m' +`--machine' + Print the machine hardware name (sometimes called the hardware + class or hardware type). + +`-n' +`--nodename' + Print the network node hostname. + +`-p' +`--processor' + Print the processor type (sometimes called the instruction set + architecture or ISA). + +`-o' +`--operating-system' + Print the name of the operating system. + +`-r' +`--kernel-release' + Print the kernel release. + +`-s' +`--kernel-name' + Print the kernel name. POSIX 1003.1-2001 (*note Standards + conformance::) calls this "the implementation of the operating + system", because the POSIX specification itself has no notion of + "kernel". The kernel name might be the same as the operating + system name printed by the `-o' or `--operating-system' option, + but it might differ. Some operating systems (e.g., FreeBSD, + HP-UX) have the same name as their underlying kernels; others + (e.g., GNU/Linux, Solaris) do not. + +`-v' +`--kernel-version' + Print the kernel version. + + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: hostname invocation, Next: hostid invocation, Prev: uname invocation, Up: System context + +21.3 `hostname': Print or set system name +========================================= + +With no arguments, `hostname' prints the name of the current host +system. With one argument, it sets the current host name to the +specified string. You must have appropriate privileges to set the host +name. Synopsis: + + hostname [NAME] + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: hostid invocation, Prev: hostname invocation, Up: System context + +21.4 `hostid': Print numeric host identifier. +============================================= + +`hostid' prints the numeric identifier of the current host in +hexadecimal. This command accepts no arguments. The only options are +`--help' and `--version'. *Note Common options::. + + For example, here's what it prints on one system I use: + + $ hostid + 1bac013d + + On that system, the 32-bit quantity happens to be closely related to +the system's Internet address, but that isn't always the case. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Modified command invocation, Next: Process control, Prev: System context, Up: Top + +22 Modified command invocation +****************************** + +This section describes commands that run other commands in some context +different than the current one: a modified environment, as a different +user, etc. + +* Menu: + +* chroot invocation:: Modify the root directory. +* env invocation:: Modify environment variables. +* nice invocation:: Modify scheduling priority. +* nohup invocation:: Immunize to hangups. +* su invocation:: Modify user and group id. + + +File: coreutils.info, Node: chroot invocation, Next: env invocation, Up: Modified command invocation + +22.1 `chroot': Run a command with a different root directory +============================================================ + +`chroot' runs a command with a specified root directory. On many +systems, only the super-user can do this. Synopses: + + chroot NEWROOT [COMMAND [ARGS]...] + chroot OPTION + + Ordinarily, file names are looked up starting at the root of the +directory structure, i.e., `/'. `chroot' changes the root to the +directory NEWROOT (which must exist) and then runs COMMAND with +optional ARGS. If COMMAND is not specified, the default is the value +of the `SHELL' environment variable or `/bin/sh' if not set, invoked +with the `-i' option. COMMAND must not be a special built-in utility +(*note Special built-in utilities::). + + The only options are `--help' and `--version'. *Note Common +options::. Options must precede operands. + + Here are a few tips to help avoid common problems in using chroot. +To start with a simple example, make COMMAND refer to a statically +linked binary. If you were to use a dynamically linked executable, then +you'd have to arrange to have the shared libraries in the right place +under your new root directory. + + For example, if you create a statically linked `ls' executable, and +put it in `/tmp/empty', you can run this command as root: + + $ chroot /tmp/empty /ls -Rl / + + Then you'll see output like this: + + /: + total 1023 + -rwxr-xr-x 1 0 0 1041745 Aug 16 11:17 ls + + If you want to use a dynamically linked executable, say `bash', then +first run `ldd bash' to see what shared objects it needs. Then, in +addition to copying the actual binary, also copy the listed files to +the required positions under your intended new root directory. +Finally, if the executable requires any other files (e.g., data, state, +device files), copy them into place, too. + + Exit status: + + 1 if `chroot' itself fails + 126 if COMMAND is found but cannot be invoked + 127 if COMMAND cannot be found + the exit status of COMMAND otherwise + + +File: coreutils.info, Node: env invocation, Next: nice invocation, Prev: chroot invocation, Up: Modified command invocation + +22.2 `env': Run a command in a modified environment +=================================================== + +`env' runs a command with a modified environment. Synopses: + + env [OPTION]... [NAME=VALUE]... [COMMAND [ARGS]...] + env + + Operands of the form `VARIABLE=VALUE' set the environment variable +VARIABLE to value VALUE. VALUE may be empty (`VARIABLE='). Setting a +variable to an empty value is different from unsetting it. These +operands are evaluated left-to-right, so if two operands mention the +same variable the earlier is ignored. + + Environment variable names can be empty, and can contain any +characters other than `=' and the null character (ASCII NUL). However, +it is wise to limit yourself to names that consist solely of +underscores, digits, and ASCII letters, and that begin with a +non-digit, as applications like the shell do not work well with other +names. + + The first operand that does not contain the character `=' specifies +the program to invoke; it is searched for according to the `PATH' +environment variable. Any remaining arguments are passed as arguments +to that program. The program should not be a special built-in utility +(*note Special built-in utilities::). + + If no command name is specified following the environment +specifications, the resulting environment is printed. This is like +specifying the `printenv' program. + + The program accepts the following options. Also see *Note Common +options::. Options must precede operands. + +`-u NAME' +`--unset=NAME' + Remove variable NAME from the environment, if it was in the + environment. + +`-' +`-i' +`--ignore-environment' + Start with an empty environment, ignoring the inherited + environment. + + + Exit status: + + 0 if no COMMAND is specified and the environment is output + 1 if `env' itself fails + 126 if COMMAND is found but cannot be invoked + 127 if COMMAND cannot be found + the exit status of COMMAND otherwise + + +File: coreutils.info, Node: nice invocation, Next: nohup invocation, Prev: env invocation, Up: Modified command invocation + +22.3 `nice': Run a command with modified scheduling priority +============================================================ + +`nice' prints or modifies a process's "nice value", a parameter that +affects the process's scheduling priority. Synopsis: + + nice [OPTION]... [COMMAND [ARG]...] + + If no arguments are given, `nice' prints the current nice value, +which it inherited. Otherwise, `nice' runs the given COMMAND with its +nice value adjusted. By default, its nice value is incremented by 10. + + Nice values range at least from -20 (resulting in the most favorable +scheduling) through 19 (the least favorable). Some systems may have a +wider range of nice values; conversely, other systems may enforce more +restrictive limits. An attempt to set the nice value outside the +supported range is treated as an attempt to use the minimum or maximum +supported value. + + COMMAND must not be a special built-in utility (*note Special +built-in utilities::). + + Because many shells have a built-in `nice' command, using an +unadorned `nice' in a script or interactively may get you different +functionality than that described here. + + The program accepts the following option. Also see *Note Common +options::. Options must precede operands. + +`-n ADJUSTMENT' +`--adjustment=ADJUSTMENT' + Add ADJUSTMENT instead of 10 to the command's nice value. If + ADJUSTMENT is negative and you lack appropriate privileges, `nice' + issues a warning but otherwise acts as if you specified a zero + adjustment. + + On older systems, `nice' supports an obsolete option + `-ADJUSTMENT'. POSIX 1003.1-2001 (*note Standards conformance::) + does not allow this; use `-n ADJUSTMENT' instead. + + + Exit status: + + 0 if no COMMAND is specified and the current priority is output + 1 if `nice' itself fails + 126 if COMMAND is found but cannot be invoked + 127 if COMMAND cannot be found + the exit status of COMMAND otherwise + + It is sometimes useful to run non-interactive programs with reduced +priority. + + $ nice factor 4611686018427387903 + + Since `nice' prints the current priority, you can invoke it through +itself to demonstrate how it works. + + The default behavior is to increase the nice value by `10': + + $ nice + 0 + $ nice nice + 10 + $ nice -n 10 nice + 10 + + The ADJUSTMENT is relative to the current nice value. In the next +example, the first `nice' invocation runs the second one with nice +value 10, and it in turn runs the final one with a nice value that is 3 +more: + + $ nice nice -n 3 nice + 13 + + Specifying a nice value larger than the supported range is the same +as specifying the maximum supported value: + + $ nice -n 10000000000 nice + 19 + + Only a privileged user may run a process with higher priority: + + $ nice -n -1 nice + nice: cannot set priority: Permission denied + 0 + $ sudo nice -n -1 nice + -1 + + +File: coreutils.info, Node: nohup invocation, Next: su invocation, Prev: nice invocation, Up: Modified command invocation + +22.4 `nohup': Run a command immune to hangups +============================================= + +`nohup' runs the given COMMAND with hangup signals ignored, so that the +command can continue running in the background after you log out. +Synopsis: + + nohup COMMAND [ARG]... + + If standard output is a terminal, it is redirected so that it is +appended to the file `nohup.out'; if that cannot be written to, it is +appended to the file `$HOME/nohup.out'. If that cannot be written to, +the command is not run. If standard output is not a terminal, then the +standard output of COMMAND will be the same as that of `nohup'. + + If `nohup' creates either `nohup.out' or `$HOME/nohup.out', it +creates it with no "group" or "other" access permissions. It does not +change the permissions if the output file already existed. + + If standard error is a terminal, it is redirected to the same file +descriptor as the standard output. + + `nohup' does not automatically put the command it runs in the +background; you must do that explicitly, by ending the command line +with an `&'. Also, `nohup' does not change the scheduling priority of +COMMAND; use `nice' for that, e.g., `nohup nice COMMAND'. + + COMMAND must not be a special built-in utility (*note Special +built-in utilities::). + + The only options are `--help' and `--version'. *Note Common +options::. Options must precede operands. + + Exit status: + + 126 if COMMAND is found but cannot be invoked + 127 if `nohup' itself fails or if COMMAND cannot be found + the exit status of COMMAND otherwise + + +File: coreutils.info, Node: su invocation, Prev: nohup invocation, Up: Modified command invocation + +22.5 `su': Run a command with substitute user and group id +========================================================== + +`su' allows one user to temporarily become another user. It runs a +command (often an interactive shell) with the real and effective user +id, group id, and supplemental groups of a given USER. Synopsis: + + su [OPTION]... [USER [ARG]...] + + If no USER is given, the default is `root', the super-user. The +shell to use is taken from USER's `passwd' entry, or `/bin/sh' if none +is specified there. If USER has a password, `su' prompts for the +password unless run by a user with effective user id of zero (the +super-user). + + By default, `su' does not change the current directory. It sets the +environment variables `HOME' and `SHELL' from the password entry for +USER, and if USER is not the super-user, sets `USER' and `LOGNAME' to +USER. By default, the shell is not a login shell. + + Any additional ARGs are passed as additional arguments to the shell. + + GNU `su' does not treat `/bin/sh' or any other shells specially +(e.g., by setting `argv[0]' to `-su', passing `-c' only to certain +shells, etc.). + + `su' can optionally be compiled to use `syslog' to report failed, +and optionally successful, `su' attempts. (If the system supports +`syslog'.) However, GNU `su' does not check if the user is a member of +the `wheel' group; see below. + + The program accepts the following options. Also see *Note Common +options::. + +`-c COMMAND' +`--command=COMMAND' + Pass COMMAND, a single command line to run, to the shell with a + `-c' option instead of starting an interactive shell. + +`-f' +`--fast' + Pass the `-f' option to the shell. This probably only makes sense + if the shell run is `csh' or `tcsh', for which the `-f' option + prevents reading the startup file (`.cshrc'). With Bourne-like + shells, the `-f' option disables file name pattern expansion + (globbing), which is not likely to be useful. + +`-' +`-l' +`--login' + Make the shell a login shell. This means the following. Unset all + environment variables except `TERM', `HOME', and `SHELL' (which + are set as described above), and `USER' and `LOGNAME' (which are + set, even for the super-user, as described above), and set `PATH' + to a compiled-in default value. Change to USER's home directory. + Prepend `-' to the shell's name, intended to make it read its + login startup file(s). + +`-m' +`-p' +`--preserve-environment' + Do not change the environment variables `HOME', `USER', `LOGNAME', + or `SHELL'. Run the shell given in the environment variable + `SHELL' instead of the shell from USER's passwd entry, unless the + user running `su' is not the superuser and USER's shell is + restricted. A "restricted shell" is one that is not listed in the + file `/etc/shells', or in a compiled-in list if that file does not + exist. Parts of what this option does can be overridden by + `--login' and `--shell'. + +`-s SHELL' +`--shell=SHELL' + Run SHELL instead of the shell from USER's passwd entry, unless + the user running `su' is not the superuser and USER's shell is + restricted (see `-m' just above). + + + Exit status: + + 1 if `su' itself fails + 126 if subshell is found but cannot be invoked + 127 if subshell cannot be found + the exit status of the subshell otherwise + +22.5.1 Why GNU `su' does not support the `wheel' group +------------------------------------------------------ + +(This section is by Richard Stallman.) + + Sometimes a few of the users try to hold total power over all the +rest. For example, in 1984, a few users at the MIT AI lab decided to +seize power by changing the operator password on the Twenex system and +keeping it secret from everyone else. (I was able to thwart this coup +and give power back to the users by patching the kernel, but I wouldn't +know how to do that in Unix.) + + However, occasionally the rulers do tell someone. Under the usual +`su' mechanism, once someone learns the root password who sympathizes +with the ordinary users, he or she can tell the rest. The "wheel +group" feature would make this impossible, and thus cement the power of +the rulers. + + I'm on the side of the masses, not that of the rulers. If you are +used to supporting the bosses and sysadmins in whatever they do, you +might find this idea strange at first. + + +File: coreutils.info, Node: Process control, Next: Delaying, Prev: Modified command invocation, Up: Top + +23 Process control +****************** + +* Menu: + +* kill invocation:: Sending a signal to processes. + + +File: coreutils.info, Node: kill invocation, Up: Process control + +23.1 `kill': Send a signal to processes +======================================= + +The `kill' command sends a signal to processes, causing them to +terminate or otherwise act upon receiving the signal in some way. +Alternatively, it lists information about signals. Synopses: + + kill [-s SIGNAL | --signal SIGNAL | -SIGNAL] PID... + kill [-l | --list | -t | --table] [SIGNAL]... + + The first form of the `kill' command sends a signal to all PID +arguments. The default signal to send if none is specified is `TERM'. +The special signal number `0' does not denote a valid signal, but can +be used to test whether the PID arguments specify processes to which a +signal could be sent. + + If PID is positive, the signal is sent to the process with the +process id PID. If PID is zero, the signal is sent to all processes in +the process group of the current process. If PID is -1, the signal is +sent to all processes for which the user has permission to send a +signal. If PID is less than -1, the signal is sent to all processes in +the process group that equals the absolute value of PID. + + If PID is not positive, a system-dependent set of system processes +is excluded from the list of processes to which the signal is sent. + + If a negative PID argument is desired as the first one, it should be +preceded by `--'. However, as a common extension to POSIX, `--' is not +required with `kill -SIGNAL -PID'. The following commands are +equivalent: + + kill -15 -1 + kill -TERM -1 + kill -s TERM -- -1 + kill -- -1 + + The first form of the `kill' command succeeds if every PID argument +specifies at least one process that the signal was sent to. + + The second form of the `kill' command lists signal information. +Either the `-l' or `--list' option, or the `-t' or `--table' option +must be specified. Without any SIGNAL argument, all supported signals +are listed. The output of `-l' or `--list' is a list of the signal +names, one per line; if SIGNAL is already a name, the signal number is +printed instead. The output of `-t' or `--table' is a table of signal +numbers, names, and descriptions. This form of the `kill' command +succeeds if all SIGNAL arguments are valid and if there is no output +error. + + The `kill' command also supports the `--help' and `--version' +options. *Note Common options::. + + A SIGNAL may be a signal name like `HUP', or a signal number like +`1', or an exit status of a process terminated by the signal. A signal +name can be given in canonical form or prefixed by `SIG'. The case of +the letters is ignored, except for the `-SIGNAL' option which must use +upper case to avoid ambiguity with lower case option letters. The +following signal names and numbers are supported on all POSIX compliant +systems: + +`HUP' + 1. Hangup. + +`INT' + 2. Terminal interrupt. + +`QUIT' + 3. Terminal quit. + +`ABRT' + 6. Process abort. + +`KILL' + 9. Kill (cannot be caught or ignored). + +`ALRM' + 14. Alarm Clock. + +`TERM' + 15. Termination. + +Other supported signal names have system-dependent corresponding +numbers. All systems conforming to POSIX 1003.1-2001 also support the +following signals: + +`BUS' + Access to an undefined portion of a memory object. + +`CHLD' + Child process terminated, stopped, or continued. + +`CONT' + Continue executing, if stopped. + +`FPE' + Erroneous arithmetic operation. + +`ILL' + Illegal Instruction. + +`PIPE' + Write on a pipe with no one to read it. + +`SEGV' + Invalid memory reference. + +`STOP' + Stop executing (cannot be caught or ignored). + +`TSTP' + Terminal stop. + +`TTIN' + Background process attempting read. + +`TTOU' + Background process attempting write. + +`URG' + High bandwidth data is available at a socket. + +`USR1' + User-defined signal 1. + +`USR2' + User-defined signal 2. + +POSIX 1003.1-2001 systems that support the XSI extension also support +the following signals: + +`POLL' + Pollable event. + +`PROF' + Profiling timer expired. + +`SYS' + Bad system call. + +`TRAP' + Trace/breakpoint trap. + +`VTALRM' + Virtual timer expired. + +`XCPU' + CPU time limit exceeded. + +`XFSZ' + File size limit exceeded. + +POSIX 1003.1-2001 systems that support the XRT extension also support +at least eight real-time signals called `RTMIN', `RTMIN+1', ..., +`RTMAX-1', `RTMAX'. + + +File: coreutils.info, Node: Delaying, Next: Numeric operations, Prev: Process control, Up: Top + +24 Delaying +*********** + +* Menu: + +* sleep invocation:: Delay for a specified time. + + +File: coreutils.info, Node: sleep invocation, Up: Delaying + +24.1 `sleep': Delay for a specified time +======================================== + +`sleep' pauses for an amount of time specified by the sum of the values +of the command line arguments. Synopsis: + + sleep NUMBER[smhd]... + + Each argument is a number followed by an optional unit; the default +is seconds. The units are: + +`s' + seconds + +`m' + minutes + +`h' + hours + +`d' + days + + Historical implementations of `sleep' have required that NUMBER be +an integer. However, GNU `sleep' accepts arbitrary floating point +numbers (using a period before any fractional digits). + + The only options are `--help' and `--version'. *Note Common +options::. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: Numeric operations, Next: File permissions, Prev: Delaying, Up: Top + +25 Numeric operations +********************* + +These programs do numerically-related operations. + +* Menu: + +* factor invocation:: Show factors of numbers. +* seq invocation:: Print sequences of numbers. + + +File: coreutils.info, Node: factor invocation, Next: seq invocation, Up: Numeric operations + +25.1 `factor': Print prime factors +================================== + +`factor' prints prime factors. Synopses: + + factor [NUMBER]... + factor OPTION + + If no NUMBER is specified on the command line, `factor' reads +numbers from standard input, delimited by newlines, tabs, or spaces. + + The only options are `--help' and `--version'. *Note Common +options::. + + The algorithm it uses is not very sophisticated, so for some inputs +`factor' runs for a long time. The hardest numbers to factor are the +products of large primes. Factoring the product of the two largest +32-bit prime numbers takes about 80 seconds of CPU time on a 1.6 GHz +Athlon. + + $ p=`echo '4294967279 * 4294967291'|bc` + $ factor $p + 18446743979220271189: 4294967279 4294967291 + + Similarly, it takes about 80 seconds for GNU factor (from +coreutils-5.1.2) to "factor" the largest 64-bit prime: + + $ factor 18446744073709551557 + 18446744073709551557: 18446744073709551557 + + In contrast, `factor' factors the largest 64-bit number in just over +a tenth of a second: + + $ factor `echo '2^64-1'|bc` + 18446744073709551615: 3 5 17 257 641 65537 6700417 + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: seq invocation, Prev: factor invocation, Up: Numeric operations + +25.2 `seq': Print numeric sequences +=================================== + +`seq' prints a sequence of numbers to standard output. Synopses: + + seq [OPTION]... LAST + seq [OPTION]... FIRST LAST + seq [OPTION]... FIRST INCREMENT LAST + + `seq' prints the numbers from FIRST to LAST by INCREMENT. By +default, each number is printed on a separate line. When INCREMENT is +not specified, it defaults to `1', even when FIRST is larger than LAST. +FIRST also defaults to `1'. So `seq 1' prints `1', but `seq 0' and +`seq 10 5' produce no output. Floating-point numbers may be specified +(using a period before any fractional digits). + + The program accepts the following options. Also see *Note Common +options::. Options must precede operands. + +`-f FORMAT' +`--format=FORMAT' + Print all numbers using FORMAT; default `%g'. FORMAT must contain + exactly one of the floating point output formats `%e', `%f', or + `%g'. + +`-s STRING' +`--separator=STRING' + Separate numbers with STRING; default is a newline. The output + always terminates with a newline. + +`-w' +`--equal-width' + Print all numbers with the same width, by padding with leading + zeroes. (To have other kinds of padding, use `--format'). + + + If you want to use `seq' to print sequences of large integer values, +don't use the default `%g' format since it can result in loss of +precision: + + $ seq 1000000 1000001 + 1e+06 + 1e+06 + + Instead, you can use the format, `%1.f', to print large decimal +numbers with no exponent and no decimal point. + + $ seq --format=%1.f 1000000 1000001 + 1000000 + 1000001 + + If you want hexadecimal output, you can use `printf' to perform the +conversion: + + $ printf %x'\n' `seq -f %1.f 1048575 1024 1050623` + fffff + 1003ff + 1007ff + + For very long lists of numbers, use xargs to avoid system +limitations on the length of an argument list: + + $ seq -f %1.f 1000000 | xargs printf %x'\n' | tail -n 3 + f423e + f423f + f4240 + + To generate octal output, use the printf `%o' format instead of +`%x'. Note however that using printf might not work for numbers +outside the usual 32-bit range: + + $ printf "%x\n" `seq -f %1.f 4294967295 4294967296` + ffffffff + bash: printf: 4294967296: Numerical result out of range + + On most systems, seq can produce whole-number output for values up to +`2^53', so here's a more general approach to base conversion that also +happens to be more robust for such large numbers. It works by using +`bc' and setting its output radix variable, OBASE, to `16' in this case +to produce hexadecimal output. + + $ (echo obase=16; seq -f %1.f 4294967295 4294967296)|bc + FFFFFFFF + 100000000 + + Be careful when using `seq' with a fractional INCREMENT, otherwise +you may see surprising results. Most people would expect to see `0.3' +printed as the last number in this example: + + $ seq -s ' ' 0 .1 .3 + 0 0.1 0.2 + + But that doesn't happen on most systems because `seq' is implemented +using binary floating point arithmetic (via the C `double' type)--which +means some decimal numbers like `.1' cannot be represented exactly. +That in turn means some nonintuitive conditions like `.1 * 3 > .3' will +end up being true. + + To work around that in the above example, use a slightly larger +number as the LAST value: + + $ seq -s ' ' 0 .1 .31 + 0 0.1 0.2 0.3 + + In general, when using an INCREMENT with a fractional part, where +(LAST - FIRST) / INCREMENT is (mathematically) a whole number, specify +a slightly larger (or smaller, if INCREMENT is negative) value for LAST +to ensure that LAST is the final value printed by seq. + + An exit status of zero indicates success, and a nonzero value +indicates failure. + + +File: coreutils.info, Node: File permissions, Next: Date input formats, Prev: Numeric operations, Up: Top + +26 File permissions +******************* + +Each file has a set of "permissions" that control the kinds of access +that users have to that file. The permissions for a file are also +called its "access mode". They can be represented either in symbolic +form or as an octal number. + +* Menu: + +* Mode Structure:: Structure of file permissions. +* Symbolic Modes:: Mnemonic permissions representation. +* Numeric Modes:: Permissions as octal numbers. + + +File: coreutils.info, Node: Mode Structure, Next: Symbolic Modes, Up: File permissions + +26.1 Structure of File Permissions +================================== + +There are three kinds of permissions that a user can have for a file: + + 1. permission to read the file. For directories, this means + permission to list the contents of the directory. + + 2. permission to write to (change) the file. For directories, this + means permission to create and remove files in the directory. + + 3. permission to execute the file (run it as a program). For + directories, this means permission to access files in the + directory. + + There are three categories of users who may have different +permissions to perform any of the above operations on a file: + + 1. the file's owner; + + 2. other users who are in the file's group; + + 3. everyone else. + + Files are given an owner and group when they are created. Usually +the owner is the current user and the group is the group of the +directory the file is in, but this varies with the operating system, the +file system the file is created on, and the way the file is created. +You can change the owner and group of a file by using the `chown' and +`chgrp' commands. + + In addition to the three sets of three permissions listed above, a +file's permissions have three special components, which affect only +executable files (programs) and, on some systems, directories: + + 1. set the process's effective user ID to that of the file upon + execution (called the "setuid bit"). No effect on directories. + + 2. set the process's effective group ID to that of the file upon + execution (called the "setgid bit"). For directories on some + systems, put files created in the directory into the same group as + the directory, no matter what group the user who creates them is + in. + + 3. save the program's text image on the swap device so it will load + more quickly when run (called the "sticky bit"). For directories + on some systems, prevent users from removing or renaming a file in + a directory unless they own the file or the directory; this is + called the "restricted deletion flag" for the directory. + + In addition to the permissions listed above, there may be file +attributes specific to the file system, e.g: access control lists +(ACLs), whether a file is compressed, whether a file can be modified +(immutability), whether a file can be dumped. These are usually set +using programs specific to the file system. For example: + +ext2 + On GNU and Linux/GNU the file permissions ("attributes") specific + to the ext2 file system are set using `chattr'. + +FFS + On FreeBSD the file permissions ("flags") specific to the FFS file + system are set using `chrflags'. + + Although a file's permission "bits" allow an operation on that file, +that operation may still fail, because: + + * the file-system-specific permissions do not permit it; + + * the file system is mounted as read-only. + + For example, if the immutable attribute is set on a file, it cannot +be modified, regardless of the fact that you may have just run `chmod +a+w FILE'. + + +File: coreutils.info, Node: Symbolic Modes, Next: Numeric Modes, Prev: Mode Structure, Up: File permissions + +26.2 Symbolic Modes +=================== + +"Symbolic modes" represent changes to files' permissions as operations +on single-character symbols. They allow you to modify either all or +selected parts of files' permissions, optionally based on their +previous values, and perhaps on the current `umask' as well (*note +Umask and Protection::). + + The format of symbolic modes is: + + [ugoa...][[+-=][rwxXstugo...]...][,...] + + The following sections describe the operators and other details of +symbolic modes. + +* Menu: + +* Setting Permissions:: Basic operations on permissions. +* Copying Permissions:: Copying existing permissions. +* Changing Special Permissions:: Special permissions. +* Conditional Executability:: Conditionally affecting executability. +* Multiple Changes:: Making multiple changes. +* Umask and Protection:: The effect of the umask. + + +File: coreutils.info, Node: Setting Permissions, Next: Copying Permissions, Up: Symbolic Modes + +26.2.1 Setting Permissions +-------------------------- + +The basic symbolic operations on a file's permissions are adding, +removing, and setting the permission that certain users have to read, +write, and execute the file. These operations have the following +format: + + USERS OPERATION PERMISSIONS + +The spaces between the three parts above are shown for readability only; +symbolic modes cannot contain spaces. + + The USERS part tells which users' access to the file is changed. It +consists of one or more of the following letters (or it can be empty; +*note Umask and Protection::, for a description of what happens then). +When more than one of these letters is given, the order that they are +in does not matter. + +`u' + the user who owns the file; + +`g' + other users who are in the file's group; + +`o' + all other users; + +`a' + all users; the same as `ugo'. + + The OPERATION part tells how to change the affected users' access to +the file, and is one of the following symbols: + +`+' + to add the PERMISSIONS to whatever permissions the USERS already + have for the file; + +`-' + to remove the PERMISSIONS from whatever permissions the USERS + already have for the file; + +`=' + to make the PERMISSIONS the only permissions that the USERS have + for the file. + + The PERMISSIONS part tells what kind of access to the file should be +changed; it is zero or more of the following letters. As with the +USERS part, the order does not matter when more than one letter is +given. Omitting the PERMISSIONS part is useful only with the `=' +operation, where it gives the specified USERS no access at all to the +file. + +`r' + the permission the USERS have to read the file; + +`w' + the permission the USERS have to write to the file; + +`x' + the permission the USERS have to execute the file. + + For example, to give everyone permission to read and write a file, +but not to execute it, use: + + a=rw + + To remove write permission for from all users other than the file's +owner, use: + + go-w + +The above command does not affect the access that the owner of the file +has to it, nor does it affect whether other users can read or execute +the file. + + To give everyone except a file's owner no permission to do anything +with that file, use the mode below. Other users could still remove the +file, if they have write permission on the directory it is in. + + go= + +Another way to specify the same thing is: + + og-rxw + + +File: coreutils.info, Node: Copying Permissions, Next: Changing Special Permissions, Prev: Setting Permissions, Up: Symbolic Modes + +26.2.2 Copying Existing Permissions +----------------------------------- + +You can base a file's permissions on its existing permissions. To do +this, instead of using `r', `w', or `x' after the operator, you use the +letter `u', `g', or `o'. For example, the mode + o+g + adds the permissions for users who are in a file's group to the +permissions that other users have for the file. Thus, if the file +started out as mode 664 (`rw-rw-r--'), the above mode would change it +to mode 666 (`rw-rw-rw-'). If the file had started out as mode 741 +(`rwxr----x'), the above mode would change it to mode 745 +(`rwxr--r-x'). The `-' and `=' operations work analogously. + + +File: coreutils.info, Node: Changing Special Permissions, Next: Conditional Executability, Prev: Copying Permissions, Up: Symbolic Modes + +26.2.3 Changing Special Permissions +----------------------------------- + +In addition to changing a file's read, write, and execute permissions, +you can change its special permissions. *Note Mode Structure::, for a +summary of these permissions. + + To change a file's permission to set the user ID on execution, use +`u' in the USERS part of the symbolic mode and `s' in the PERMISSIONS +part. + + To change a file's permission to set the group ID on execution, use +`g' in the USERS part of the symbolic mode and `s' in the PERMISSIONS +part. + + To change a file's permission to stay permanently on the swap device, +use `o' in the USERS part of the symbolic mode and `t' in the +PERMISSIONS part. + + For example, to add set user ID permission to a program, you can use +the mode: + + u+s + + To remove both set user ID and set group ID permission from it, you +can use the mode: + + ug-s + + To cause a program to be saved on the swap device, you can use the +mode: + + o+t + + Remember that the special permissions only affect files that are +executable, plus, on some systems, directories (on which they have +different meanings; *note Mode Structure::). Also, the combinations +`u+t', `g+t', and `o+s' have no effect. + + The `=' operator is not very useful with special permissions; for +example, the mode: + + o=t + +does cause the file to be saved on the swap device, but it also removes +all read, write, and execute permissions that users not in the file's +group might have had for it. + + +File: coreutils.info, Node: Conditional Executability, Next: Multiple Changes, Prev: Changing Special Permissions, Up: Symbolic Modes + +26.2.4 Conditional Executability +-------------------------------- + +There is one more special type of symbolic permission: if you use `X' +instead of `x', execute permission is affected only if the file already +had execute permission or is a directory. It affects directories' +execute permission even if they did not initially have any execute +permissions set. + + For example, this mode: + + a+X + +gives all users permission to execute files (or search directories) if +anyone could before. + + +File: coreutils.info, Node: Multiple Changes, Next: Umask and Protection, Prev: Conditional Executability, Up: Symbolic Modes + +26.2.5 Making Multiple Changes +------------------------------ + +The format of symbolic modes is actually more complex than described +above (*note Setting Permissions::). It provides two ways to make +multiple changes to files' permissions. + + The first way is to specify multiple OPERATION and PERMISSIONS parts +after a USERS part in the symbolic mode. + + For example, the mode: + + og+rX-w + +gives users other than the owner of the file read permission and, if it +is a directory or if someone already had execute permission to it, +gives them execute permission; and it also denies them write permission +to the file. It does not affect the permission that the owner of the +file has for it. The above mode is equivalent to the two modes: + + og+rX + og-w + + The second way to make multiple changes is to specify more than one +simple symbolic mode, separated by commas. For example, the mode: + + a+r,go-w + +gives everyone permission to read the file and removes write permission +on it for all users except its owner. Another example: + + u=rwx,g=rx,o= + +sets all of the non-special permissions for the file explicitly. (It +gives users who are not in the file's group no permission at all for +it.) + + The two methods can be combined. The mode: + + a+r,g+x-w + +gives all users permission to read the file, and gives users who are in +the file's group permission to execute it, as well, but not permission +to write to it. The above mode could be written in several different +ways; another is: + + u+r,g+rx,o+r,g-w + + +File: coreutils.info, Node: Umask and Protection, Prev: Multiple Changes, Up: Symbolic Modes + +26.2.6 The Umask and Protection +------------------------------- + +If the USERS part of a symbolic mode is omitted, it defaults to `a' +(affect all users), except that any permissions that are _set_ in the +system variable `umask' are _not affected_. The value of `umask' can +be set using the `umask' command. Its default value varies from system +to system. + + Omitting the USERS part of a symbolic mode is generally not useful +with operations other than `+'. It is useful with `+' because it +allows you to use `umask' as an easily customizable protection against +giving away more permission to files than you intended to. + + As an example, if `umask' has the value 2, which removes write +permission for users who are not in the file's group, then the mode: + + +w + +adds permission to write to the file to its owner and to other users who +are in the file's group, but _not_ to other users. In contrast, the +mode: + + a+w + +ignores `umask', and _does_ give write permission for the file to all +users. + + +File: coreutils.info, Node: Numeric Modes, Prev: Symbolic Modes, Up: File permissions + +26.3 Numeric Modes +================== + +File permissions are stored internally as integers. As an alternative +to giving a symbolic mode, you can give an octal (base 8) number that +corresponds to the internal representation of the new mode. This +number is always interpreted in octal; you do not have to add a leading +0, as you do in C. Mode 0055 is the same as mode 55. + + A numeric mode is usually shorter than the corresponding symbolic +mode, but it is limited in that it cannot take into account a file's +previous permissions; it can only set them absolutely. + + On most systems, the permissions granted to the user, to other users +in the file's group, and to other users not in the file's group are +each stored as three bits, which are represented as one octal digit. +The three special permissions are also each stored as one bit, and they +are as a group represented as another octal digit. Here is how the +bits are arranged, starting with the lowest valued bit: + + Value in Corresponding + Mode Permission + + Other users not in the file's group: + 1 Execute + 2 Write + 4 Read + + Other users in the file's group: + 10 Execute + 20 Write + 40 Read + + The file's owner: + 100 Execute + 200 Write + 400 Read + + Special permissions: + 1000 Save text image on swap device + 2000 Set group ID on execution + 4000 Set user ID on execution + + For example, numeric mode 4755 corresponds to symbolic mode +`u=rwxs,go=rx', and numeric mode 664 corresponds to symbolic mode +`ug=rw,o=r'. Numeric mode 0 corresponds to symbolic mode `ugo='. + + +File: coreutils.info, Node: Date input formats, Next: Opening the software toolbox, Prev: File permissions, Up: Top + +27 Date input formats +********************* + +First, a quote: + + Our units of temporal measurement, from seconds on up to months, + are so complicated, asymmetrical and disjunctive so as to make + coherent mental reckoning in time all but impossible. Indeed, had + some tyrannical god contrived to enslave our minds to time, to + make it all but impossible for us to escape subjection to sodden + routines and unpleasant surprises, he could hardly have done + better than handing down our present system. It is like a set of + trapezoidal building blocks, with no vertical or horizontal + surfaces, like a language in which the simplest thought demands + ornate constructions, useless particles and lengthy + circumlocutions. Unlike the more successful patterns of language + and science, which enable us to face experience boldly or at least + level-headedly, our system of temporal calculation silently and + persistently encourages our terror of time. + + ... It is as though architects had to measure length in feet, + width in meters and height in ells; as though basic instruction + manuals demanded a knowledge of five different languages. It is + no wonder then that we often look into our own immediate past or + future, last Tuesday or a week from Sunday, with feelings of + helpless confusion. ... + + -- Robert Grudin, `Time and the Art of Living'. + + This section describes the textual date representations that GNU +programs accept. These are the strings you, as a user, can supply as +arguments to the various programs. The C interface (via the `get_date' +function) is not described here. + +* Menu: + +* General date syntax:: Common rules. +* Calendar date items:: 19 Dec 1994. +* Time of day items:: 9:20pm. +* Time zone items:: EST, PDT, GMT. +* Day of week items:: Monday and others. +* Relative items in date strings:: next tuesday, 2 years ago. +* Pure numbers in date strings:: 19931219, 1440. +* Seconds since the Epoch:: @1078100502. +* Specifying time zone rules:: TZ="America/New_York", TZ="UTC0". +* Authors of get_date:: Bellovin, Eggert, Salz, Berets, et al. + + +File: coreutils.info, Node: General date syntax, Next: Calendar date items, Up: Date input formats + +27.1 General date syntax +======================== + +A "date" is a string, possibly empty, containing many items separated +by whitespace. The whitespace may be omitted when no ambiguity arises. +The empty string means the beginning of today (i.e., midnight). Order +of the items is immaterial. A date string may contain many flavors of +items: + + * calendar date items + + * time of day items + + * time zone items + + * day of the week items + + * relative items + + * pure numbers. + +We describe each of these item types in turn, below. + + A few ordinal numbers may be written out in words in some contexts. +This is most useful for specifying day of the week items or relative +items (see below). Among the most commonly used ordinal numbers, the +word `last' stands for -1, `this' stands for 0, and `first' and `next' +both stand for 1. Because the word `second' stands for the unit of +time there is no way to write the ordinal number 2, but for convenience +`third' stands for 3, `fourth' for 4, `fifth' for 5, `sixth' for 6, +`seventh' for 7, `eighth' for 8, `ninth' for 9, `tenth' for 10, +`eleventh' for 11 and `twelfth' for 12. + + When a month is written this way, it is still considered to be +written numerically, instead of being "spelled in full"; this changes +the allowed strings. + + In the current implementation, only English is supported for words +and abbreviations like `AM', `DST', `EST', `first', `January', +`Sunday', `tomorrow', and `year'. + + The output of the `date' command is not always acceptable as a date +string, not only because of the language problem, but also because +there is no standard meaning for time zone items like `IST'. When using +`date' to generate a date string intended to be parsed later, specify a +date format that is independent of language and that does not use time +zone items other than `UTC' and `Z'. Here are some ways to do this: + + $ LC_ALL=C TZ=UTC0 date + Mon Mar 1 00:21:42 UTC 2004 + $ TZ=UTC0 date +'%Y-%m-%d %H:%M:%SZ' + 2004-03-01 00:21:42Z + $ date --iso-8601=ns # a GNU extension + 2004-02-29T16:21:42,692722128-0800 + $ date --rfc-2822 # a GNU extension + Sun, 29 Feb 2004 16:21:42 -0800 + $ date +'%Y-%m-%d %H:%M:%S %z' # %z is a GNU extension. + 2004-02-29 16:21:42 -0800 + $ date +'@%s.%N' # %s and %N are GNU extensions. + @1078100502.692722128 + + Alphabetic case is completely ignored in dates. Comments may be +introduced between round parentheses, as long as included parentheses +are properly nested. Hyphens not followed by a digit are currently +ignored. Leading zeros on numbers are ignored. + + +File: coreutils.info, Node: Calendar date items, Next: Time of day items, Prev: General date syntax, Up: Date input formats + +27.2 Calendar date items +======================== + +A "calendar date item" specifies a day of the year. It is specified +differently, depending on whether the month is specified numerically or +literally. All these strings specify the same calendar date: + + 1972-09-24 # ISO 8601. + 72-9-24 # Assume 19xx for 69 through 99, + # 20xx for 00 through 68. + 72-09-24 # Leading zeros are ignored. + 9/24/72 # Common U.S. writing. + 24 September 1972 + 24 Sept 72 # September has a special abbreviation. + 24 Sep 72 # Three-letter abbreviations always allowed. + Sep 24, 1972 + 24-sep-72 + 24sep72 + + The year can also be omitted. In this case, the last specified year +is used, or the current year if none. For example: + + 9/24 + sep 24 + + Here are the rules. + + For numeric months, the ISO 8601 format `YEAR-MONTH-DAY' is allowed, +where YEAR is any positive number, MONTH is a number between 01 and 12, +and DAY is a number between 01 and 31. A leading zero must be present +if a number is less than ten. If YEAR is 68 or smaller, then 2000 is +added to it; otherwise, if YEAR is less than 100, then 1900 is added to +it. The construct `MONTH/DAY/YEAR', popular in the United States, is +accepted. Also `MONTH/DAY', omitting the year. + + Literal months may be spelled out in full: `January', `February', +`March', `April', `May', `June', `July', `August', `September', +`October', `November' or `December'. Literal months may be abbreviated +to their first three letters, possibly followed by an abbreviating dot. +It is also permitted to write `Sept' instead of `September'. + + When months are written literally, the calendar date may be given as +any of the following: + + DAY MONTH YEAR + DAY MONTH + MONTH DAY YEAR + DAY-MONTH-YEAR + + Or, omitting the year: + + MONTH DAY + + +File: coreutils.info, Node: Time of day items, Next: Time zone items, Prev: Calendar date items, Up: Date input formats + +27.3 Time of day items +====================== + +A "time of day item" in date strings specifies the time on a given day. +Here are some examples, all of which represent the same time: + + 20:02:00.000000 + 20:02 + 8:02pm + 20:02-0500 # In EST (U.S. Eastern Standard Time). + + More generally, the time of day may be given as +`HOUR:MINUTE:SECOND', where HOUR is a number between 0 and 23, MINUTE +is a number between 0 and 59, and SECOND is a number between 0 and 59 +possibly followed by `.' or `,' and a fraction containing one or more +digits. Alternatively, `:SECOND' can be omitted, in which case it is +taken to be zero. + + If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), HOUR +is restricted to run from 1 to 12, and `:MINUTE' may be omitted (taken +to be zero). `am' indicates the first half of the day, `pm' indicates +the second half of the day. In this notation, 12 is the predecessor of +1: midnight is `12am' while noon is `12pm'. (This is the zero-oriented +interpretation of `12am' and `12pm', as opposed to the old tradition +derived from Latin which uses `12m' for noon and `12pm' for midnight.) + + The time may alternatively be followed by a time zone correction, +expressed as `SHHMM', where S is `+' or `-', HH is a number of zone +hours and MM is a number of zone minutes. You can also separate HH +from MM with a colon. When a time zone correction is given this way, it +forces interpretation of the time relative to Coordinated Universal +Time (UTC), overriding any previous specification for the time zone or +the local time zone. For example, `+0530' and `+05:30' both stand for +the time zone 5.5 hours ahead of UTC (e.g., India). The MINUTE part of +the time of day may not be elided when a time zone correction is used. +This is the best way to specify a time zone correction by fractional +parts of an hour. + + Either `am'/`pm' or a time zone correction may be specified, but not +both. + + +File: coreutils.info, Node: Time zone items, Next: Day of week items, Prev: Time of day items, Up: Date input formats + +27.4 Time zone items +==================== + +A "time zone item" specifies an international time zone, indicated by a +small set of letters, e.g., `UTC' or `Z' for Coordinated Universal +Time. Any included periods are ignored. By following a +non-daylight-saving time zone by the string `DST' in a separate word +(that is, separated by some white space), the corresponding daylight +saving time zone may be specified. Alternatively, a +non-daylight-saving time zone can be followed by a time zone +correction, to add the two values. This is normally done only for +`UTC'; for example, `UTC+05:30' is equivalent to `+05:30'. + + Time zone items other than `UTC' and `Z' are obsolescent and are not +recommended, because they are ambiguous; for example, `EST' has a +different meaning in Australia than in the United States. Instead, +it's better to use unambiguous numeric time zone corrections like +`-0500', as described in the previous section. + + If neither a time zone item nor a time zone correction is supplied, +time stamps are interpreted using the rules of the default time zone +(*note Specifying time zone rules::). + + +File: coreutils.info, Node: Day of week items, Next: Relative items in date strings, Prev: Time zone items, Up: Date input formats + +27.5 Day of week items +====================== + +The explicit mention of a day of the week will forward the date (only +if necessary) to reach that day of the week in the future. + + Days of the week may be spelled out in full: `Sunday', `Monday', +`Tuesday', `Wednesday', `Thursday', `Friday' or `Saturday'. Days may +be abbreviated to their first three letters, optionally followed by a +period. The special abbreviations `Tues' for `Tuesday', `Wednes' for +`Wednesday' and `Thur' or `Thurs' for `Thursday' are also allowed. + + A number may precede a day of the week item to move forward +supplementary weeks. It is best used in expression like `third +monday'. In this context, `last DAY' or `next DAY' is also acceptable; +they move one week before or after the day that DAY by itself would +represent. + + A comma following a day of the week item is ignored. + + +File: coreutils.info, Node: Relative items in date strings, Next: Pure numbers in date strings, Prev: Day of week items, Up: Date input formats + +27.6 Relative items in date strings +=================================== + +"Relative items" adjust a date (or the current date if none) forward or +backward. The effects of relative items accumulate. Here are some +examples: + + 1 year + 1 year ago + 3 years + 2 days + + The unit of time displacement may be selected by the string `year' +or `month' for moving by whole years or months. These are fuzzy units, +as years and months are not all of equal duration. More precise units +are `fortnight' which is worth 14 days, `week' worth 7 days, `day' +worth 24 hours, `hour' worth 60 minutes, `minute' or `min' worth 60 +seconds, and `second' or `sec' worth one second. An `s' suffix on +these units is accepted and ignored. + + The unit of time may be preceded by a multiplier, given as an +optionally signed number. Unsigned numbers are taken as positively +signed. No number at all implies 1 for a multiplier. Following a +relative item by the string `ago' is equivalent to preceding the unit +by a multiplier with value -1. + + The string `tomorrow' is worth one day in the future (equivalent to +`day'), the string `yesterday' is worth one day in the past (equivalent +to `day ago'). + + The strings `now' or `today' are relative items corresponding to +zero-valued time displacement, these strings come from the fact a +zero-valued time displacement represents the current time when not +otherwise changed by previous items. They may be used to stress other +items, like in `12:00 today'. The string `this' also has the meaning +of a zero-valued time displacement, but is preferred in date strings +like `this thursday'. + + When a relative item causes the resulting date to cross a boundary +where the clocks were adjusted, typically for daylight saving time, the +resulting date and time are adjusted accordingly. + + The fuzz in units can cause problems with relative items. For +example, `2003-07-31 -1 month' might evaluate to 2003-07-01, because +2003-06-31 is an invalid date. To determine the previous month more +reliably, you can ask for the month before the 15th of the current +month. For example: + + $ date -R + Thu, 31 Jul 2003 13:02:39 -0700 + $ date --date='-1 month' +'Last month was %B?' + Last month was July? + $ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B!' + Last month was June! + + Also, take care when manipulating dates around clock changes such as +daylight saving leaps. In a few cases these have added or subtracted +as much as 24 hours from the clock, so it is often wise to adopt +universal time by setting the `TZ' environment variable to `UTC0' +before embarking on calendrical calculations. + + +File: coreutils.info, Node: Pure numbers in date strings, Next: Seconds since the Epoch, Prev: Relative items in date strings, Up: Date input formats + +27.7 Pure numbers in date strings +================================= + +The precise interpretation of a pure decimal number depends on the +context in the date string. + + If the decimal number is of the form YYYYMMDD and no other calendar +date item (*note Calendar date items::) appears before it in the date +string, then YYYY is read as the year, MM as the month number and DD as +the day of the month, for the specified calendar date. + + If the decimal number is of the form HHMM and no other time of day +item appears before it in the date string, then HH is read as the hour +of the day and MM as the minute of the hour, for the specified time of +day. MM can also be omitted. + + If both a calendar date and a time of day appear to the left of a +number in the date string, but no relative item, then the number +overrides the year. + + +File: coreutils.info, Node: Seconds since the Epoch, Next: Specifying time zone rules, Prev: Pure numbers in date strings, Up: Date input formats + +27.8 Seconds since the Epoch +============================ + +If you precede a number with `@', it represents an internal time stamp +as a count of seconds. The number can contain an internal decimal +point (either `.' or `,'); any excess precision not supported by the +internal representation is truncated toward minus infinity. Such a +number cannot be combined with any other date item, as it specifies a +complete time stamp. + + Internally, computer times are represented as a count of seconds +since an epoch--a well-defined point of time. On GNU and POSIX +systems, the epoch is 1970-01-01 00:00:00 UTC, so `@0' represents this +time, `@1' represents 1970-01-01 00:00:01 UTC, and so forth. GNU and +most other POSIX-compliant systems support such times as an extension +to POSIX, using negative counts, so that `@-1' represents 1969-12-31 +23:59:59 UTC. + + Traditional Unix systems count seconds with 32-bit two's-complement +integers and can represent times from 1901-12-13 20:45:52 through +2038-01-19 03:14:07 UTC. More modern systems use 64-bit counts of +seconds with nanosecond subcounts, and can represent all the times in +the known lifetime of the universe to a resolution of 1 nanosecond. + + On most systems, these counts ignore the presence of leap seconds. +For example, on most systems `@915148799' represents 1998-12-31 +23:59:59 UTC, `@915148800' represents 1999-01-01 00:00:00 UTC, and +there is no way to represent the intervening leap second 1998-12-31 +23:59:60 UTC. + + +File: coreutils.info, Node: Specifying time zone rules, Next: Authors of get_date, Prev: Seconds since the Epoch, Up: Date input formats + +27.9 Specifying time zone rules +=============================== + +Normally, dates are interpreted using the rules of the current time +zone, which in turn are specified by the `TZ' environment variable, or +by a system default if `TZ' is not set. To specify a different set of +default time zone rules that apply just to one date, start the date +with a string of the form `TZ="RULE"'. The two quote characters (`"') +must be present in the date, and any quotes or backslashes within RULE +must be escaped by a backslash. + + For example, with the GNU `date' command you can answer the question +"What time is it in New York when a Paris clock shows 6:30am on October +31, 2004?" by using a date beginning with `TZ="Europe/Paris"' as shown +in the following shell transcript: + + $ export TZ="America/New_York" + $ date --date='TZ="Europe/Paris" 2004-10-31 06:30' + Sun Oct 31 01:30:00 EDT 2004 + + In this example, the `--date' operand begins with its own `TZ' +setting, so the rest of that operand is processed according to +`Europe/Paris' rules, treating the string `2004-10-31 06:30' as if it +were in Paris. However, since the output of the `date' command is +processed according to the overall time zone rules, it uses New York +time. (Paris was normally six hours ahead of New York in 2004, but +this example refers to a brief Halloween period when the gap was five +hours.) + + A `TZ' value is a rule that typically names a location in the `tz' +database (http://www.twinsun.com/tz/tz-link.htm). A recent catalog of +location names appears in the TWiki Date and Time Gateway +(http://twiki.org/cgi-bin/xtra/tzdate). A few non-GNU hosts require a +colon before a location name in a `TZ' setting, e.g., +`TZ=":America/New_York"'. + + The `tz' database includes a wide variety of locations ranging from +`Arctic/Longyearbyen' to `Antarctica/South_Pole', but if you are at sea +and have your own private time zone, or if you are using a non-GNU host +that does not support the `tz' database, you may need to use a POSIX +rule instead. Simple POSIX rules like `UTC0' specify a time zone +without daylight saving time; other rules can specify simple daylight +saving regimes. *Note Specifying the Time Zone with `TZ': (libc)TZ +Variable. + + +File: coreutils.info, Node: Authors of get_date, Prev: Specifying time zone rules, Up: Date input formats + +27.10 Authors of `get_date' +=========================== + +`get_date' was originally implemented by Steven M. Bellovin +() while at the University of North Carolina at +Chapel Hill. The code was later tweaked by a couple of people on +Usenet, then completely overhauled by Rich $alz () and +Jim Berets () in August, 1990. Various revisions for +the GNU system were made by David MacKenzie, Jim Meyering, Paul Eggert +and others. + + This chapter was originally produced by Franc,ois Pinard +() from the `getdate.y' source code, and then +edited by K. Berry (). + + +File: coreutils.info, Node: Opening the software toolbox, Next: GNU Free Documentation License, Prev: Date input formats, Up: Top + +28 Opening the Software Toolbox +******************************* + +An earlier version of this chapter appeared in 2 (June 1994). It was +written by Arnold Robbins. + +* Menu: + +* Toolbox introduction:: Toolbox introduction +* I/O redirection:: I/O redirection +* The who command:: The `who' command +* The cut command:: The `cut' command +* The sort command:: The `sort' command +* The uniq command:: The `uniq' command +* Putting the tools together:: Putting the tools together + + +File: coreutils.info, Node: Toolbox introduction, Next: I/O redirection, Up: Opening the software toolbox + +Toolbox Introduction +==================== + +This month's column is only peripherally related to the GNU Project, in +that it describes a number of the GNU tools on your GNU/Linux system +and how they might be used. What it's really about is the "Software +Tools" philosophy of program development and usage. + + The software tools philosophy was an important and integral concept +in the initial design and development of Unix (of which Linux and GNU +are essentially clones). Unfortunately, in the modern day press of +Internetworking and flashy GUIs, it seems to have fallen by the +wayside. This is a shame, since it provides a powerful mental model +for solving many kinds of problems. + + Many people carry a Swiss Army knife around in their pants pockets +(or purse). A Swiss Army knife is a handy tool to have: it has several +knife blades, a screwdriver, tweezers, toothpick, nail file, corkscrew, +and perhaps a number of other things on it. For the everyday, small +miscellaneous jobs where you need a simple, general purpose tool, it's +just the thing. + + On the other hand, an experienced carpenter doesn't build a house +using a Swiss Army knife. Instead, he has a toolbox chock full of +specialized tools--a saw, a hammer, a screwdriver, a plane, and so on. +And he knows exactly when and where to use each tool; you won't catch +him hammering nails with the handle of his screwdriver. + + The Unix developers at Bell Labs were all professional programmers +and trained computer scientists. They had found that while a +one-size-fits-all program might appeal to a user because there's only +one program to use, in practice such programs are + + a. difficult to write, + + b. difficult to maintain and debug, and + + c. difficult to extend to meet new situations. + + Instead, they felt that programs should be specialized tools. In +short, each program "should do one thing well." No more and no less. +Such programs are simpler to design, write, and get right--they only do +one thing. + + Furthermore, they found that with the right machinery for hooking +programs together, that the whole was greater than the sum of the +parts. By combining several special purpose programs, you could +accomplish a specific task that none of the programs was designed for, +and accomplish it much more quickly and easily than if you had to write +a special purpose program. We will see some (classic) examples of this +further on in the column. (An important additional point was that, if +necessary, take a detour and build any software tools you may need +first, if you don't already have something appropriate in the toolbox.) + + +File: coreutils.info, Node: I/O redirection, Next: The who command, Prev: Toolbox introduction, Up: Opening the software toolbox + +I/O Redirection +=============== + +Hopefully, you are familiar with the basics of I/O redirection in the +shell, in particular the concepts of "standard input," "standard +output," and "standard error". Briefly, "standard input" is a data +source, where data comes from. A program should not need to either +know or care if the data source is a disk file, a keyboard, a magnetic +tape, or even a punched card reader. Similarly, "standard output" is a +data sink, where data goes to. The program should neither know nor +care where this might be. Programs that only read their standard +input, do something to the data, and then send it on, are called +"filters", by analogy to filters in a water pipeline. + + With the Unix shell, it's very easy to set up data pipelines: + + program_to_create_data | filter1 | ... | filterN > final.pretty.data + + We start out by creating the raw data; each filter applies some +successive transformation to the data, until by the time it comes out +of the pipeline, it is in the desired form. + + This is fine and good for standard input and standard output. Where +does the standard error come in to play? Well, think about `filter1' in +the pipeline above. What happens if it encounters an error in the data +it sees? If it writes an error message to standard output, it will just +disappear down the pipeline into `filter2''s input, and the user will +probably never see it. So programs need a place where they can send +error messages so that the user will notice them. This is standard +error, and it is usually connected to your console or window, even if +you have redirected standard output of your program away from your +screen. + + For filter programs to work together, the format of the data has to +be agreed upon. The most straightforward and easiest format to use is +simply lines of text. Unix data files are generally just streams of +bytes, with lines delimited by the ASCII LF (Line Feed) character, +conventionally called a "newline" in the Unix literature. (This is +`'\n'' if you're a C programmer.) This is the format used by all the +traditional filtering programs. (Many earlier operating systems had +elaborate facilities and special purpose programs for managing binary +data. Unix has always shied away from such things, under the +philosophy that it's easiest to simply be able to view and edit your +data with a text editor.) + + OK, enough introduction. Let's take a look at some of the tools, +and then we'll see how to hook them together in interesting ways. In +the following discussion, we will only present those command line +options that interest us. As you should always do, double check your +system documentation for the full story. + + +File: coreutils.info, Node: The who command, Next: The cut command, Prev: I/O redirection, Up: Opening the software toolbox + +The `who' Command +================= + +The first program is the `who' command. By itself, it generates a list +of the users who are currently logged in. Although I'm writing this on +a single-user system, we'll pretend that several people are logged in: + + $ who + -| arnold console Jan 22 19:57 + -| miriam ttyp0 Jan 23 14:19(:0.0) + -| bill ttyp1 Jan 21 09:32(:0.0) + -| arnold ttyp2 Jan 23 20:48(:0.0) + + Here, the `$' is the usual shell prompt, at which I typed `who'. +There are three people logged in, and I am logged in twice. On +traditional Unix systems, user names are never more than eight +characters long. This little bit of trivia will be useful later. The +output of `who' is nice, but the data is not all that exciting. + + +File: coreutils.info, Node: The cut command, Next: The sort command, Prev: The who command, Up: Opening the software toolbox + +The `cut' Command +================= + +The next program we'll look at is the `cut' command. This program cuts +out columns or fields of input data. For example, we can tell it to +print just the login name and full name from the `/etc/passwd' file. +The `/etc/passwd' file has seven fields, separated by colons: + + arnold:xyzzy:2076:10:Arnold D. Robbins:/home/arnold:/bin/bash + + To get the first and fifth fields, we would use `cut' like this: + + $ cut -d: -f1,5 /etc/passwd + -| root:Operator + ... + -| arnold:Arnold D. Robbins + -| miriam:Miriam A. Robbins + ... + + With the `-c' option, `cut' will cut out specific characters (i.e., +columns) in the input lines. This is useful for input data that has +fixed width fields, and does not have a field separator. For example, +list the Monday dates for the current month: + + $ cal | cut -c 3-5 + -|Mo + -| + -| 6 + -| 13 + -| 20 + -| 27 + + +File: coreutils.info, Node: The sort command, Next: The uniq command, Prev: The cut command, Up: Opening the software toolbox + +The `sort' Command +================== + +Next we'll look at the `sort' command. This is one of the most +powerful commands on a Unix-style system; one that you will often find +yourself using when setting up fancy data plumbing. + + The `sort' command reads and sorts each file named on the command +line. It then merges the sorted data and writes it to standard output. +It will read standard input if no files are given on the command line +(thus making it into a filter). The sort is based on the character +collating sequence or based on user-supplied ordering criteria. + + +File: coreutils.info, Node: The uniq command, Next: Putting the tools together, Prev: The sort command, Up: Opening the software toolbox + +The `uniq' Command +================== + +Finally (at least for now), we'll look at the `uniq' program. When +sorting data, you will often end up with duplicate lines, lines that +are identical. Usually, all you need is one instance of each line. +This is where `uniq' comes in. The `uniq' program reads its standard +input. It prints only one copy of each repeated line. It does have +several options. Later on, we'll use the `-c' option, which prints +each unique line, preceded by a count of the number of times that line +occurred in the input. + + +File: coreutils.info, Node: Putting the tools together, Prev: The uniq command, Up: Opening the software toolbox + +Putting the Tools Together +========================== + +Now, let's suppose this is a large ISP server system with dozens of +users logged in. The management wants the system administrator to +write a program that will generate a sorted list of logged in users. +Furthermore, even if a user is logged in multiple times, his or her +name should only show up in the output once. + + The administrator could sit down with the system documentation and +write a C program that did this. It would take perhaps a couple of +hundred lines of code and about two hours to write it, test it, and +debug it. However, knowing the software toolbox, the administrator can +instead start out by generating just a list of logged on users: + + $ who | cut -c1-8 + -| arnold + -| miriam + -| bill + -| arnold + + Next, sort the list: + + $ who | cut -c1-8 | sort + -| arnold + -| arnold + -| bill + -| miriam + + Finally, run the sorted list through `uniq', to weed out duplicates: + + $ who | cut -c1-8 | sort | uniq + -| arnold + -| bill + -| miriam + + The `sort' command actually has a `-u' option that does what `uniq' +does. However, `uniq' has other uses for which one cannot substitute +`sort -u'. + + The administrator puts this pipeline into a shell script, and makes +it available for all the users on the system (`#' is the system +administrator, or `root', prompt): + + # cat > /usr/local/bin/listusers + who | cut -c1-8 | sort | uniq + ^D + # chmod +x /usr/local/bin/listusers + + There are four major points to note here. First, with just four +programs, on one command line, the administrator was able to save about +two hours worth of work. Furthermore, the shell pipeline is just about +as efficient as the C program would be, and it is much more efficient in +terms of programmer time. People time is much more expensive than +computer time, and in our modern "there's never enough time to do +everything" society, saving two hours of programmer time is no mean +feat. + + Second, it is also important to emphasize that with the +_combination_ of the tools, it is possible to do a special purpose job +never imagined by the authors of the individual programs. + + Third, it is also valuable to build up your pipeline in stages, as +we did here. This allows you to view the data at each stage in the +pipeline, which helps you acquire the confidence that you are indeed +using these tools correctly. + + Finally, by bundling the pipeline in a shell script, other users can +use your command, without having to remember the fancy plumbing you set +up for them. In terms of how you run them, shell scripts and compiled +programs are indistinguishable. + + After the previous warm-up exercise, we'll look at two additional, +more complicated pipelines. For them, we need to introduce two more +tools. + + The first is the `tr' command, which stands for "transliterate." +The `tr' command works on a character-by-character basis, changing +characters. Normally it is used for things like mapping upper case to +lower case: + + $ echo ThIs ExAmPlE HaS MIXED case! | tr '[:upper:]' '[:lower:]' + -| this example has mixed case! + + There are several options of interest: + +`-c' + work on the complement of the listed characters, i.e., operations + apply to characters not in the given set + +`-d' + delete characters in the first set from the output + +`-s' + squeeze repeated characters in the output into just one character. + + We will be using all three options in a moment. + + The other command we'll look at is `comm'. The `comm' command takes +two sorted input files as input data, and prints out the files' lines +in three columns. The output columns are the data lines unique to the +first file, the data lines unique to the second file, and the data +lines that are common to both. The `-1', `-2', and `-3' command line +options _omit_ the respective columns. (This is non-intuitive and +takes a little getting used to.) For example: + + $ cat f1 + -| 11111 + -| 22222 + -| 33333 + -| 44444 + $ cat f2 + -| 00000 + -| 22222 + -| 33333 + -| 55555 + $ comm f1 f2 + -| 00000 + -| 11111 + -| 22222 + -| 33333 + -| 44444 + -| 55555 + + The file name `-' tells `comm' to read standard input instead of a +regular file. + + Now we're ready to build a fancy pipeline. The first application is +a word frequency counter. This helps an author determine if he or she +is over-using certain words. + + The first step is to change the case of all the letters in our input +file to one case. "The" and "the" are the same word when doing +counting. + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | ... + + The next step is to get rid of punctuation. Quoted words and +unquoted words should be treated identically; it's easiest to just get +the punctuation out of the way. + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | ... + + The second `tr' command operates on the complement of the listed +characters, which are all the letters, the digits, the underscore, and +the blank. The `\n' represents the newline character; it has to be +left alone. (The ASCII tab character should also be included for good +measure in a production script.) + + At this point, we have data consisting of words separated by blank +space. The words only contain alphanumeric characters (and the +underscore). The next step is break the data apart so that we have one +word per line. This makes the counting operation much easier, as we +will see shortly. + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | + > tr -s ' ' '\n' | ... + + This command turns blanks into newlines. The `-s' option squeezes +multiple newline characters in the output into just one. This helps us +avoid blank lines. (The `>' is the shell's "secondary prompt." This +is what the shell prints when it notices you haven't finished typing in +all of a command.) + + We now have data consisting of one word per line, no punctuation, +all one case. We're ready to count each word: + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | + > tr -s ' ' '\n' | sort | uniq -c | ... + + At this point, the data might look something like this: + + 60 a + 2 able + 6 about + 1 above + 2 accomplish + 1 acquire + 1 actually + 2 additional + + The output is sorted by word, not by count! What we want is the most +frequently used words first. Fortunately, this is easy to accomplish, +with the help of two more `sort' options: + +`-n' + do a numeric sort, not a textual one + +`-r' + reverse the order of the sort + + The final pipeline looks like this: + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | + > tr -s ' ' '\n' | sort | uniq -c | sort -n -r + -| 156 the + -| 60 a + -| 58 to + -| 51 of + -| 51 and + ... + + Whew! That's a lot to digest. Yet, the same principles apply. +With six commands, on two lines (really one long one split for +convenience), we've created a program that does something interesting +and useful, in much less time than we could have written a C program to +do the same thing. + + A minor modification to the above pipeline can give us a simple +spelling checker! To determine if you've spelled a word correctly, all +you have to do is look it up in a dictionary. If it is not there, then +chances are that your spelling is incorrect. So, we need a dictionary. +The conventional location for a dictionary is `/usr/dict/words'. On my +GNU/Linux system,(1) this is a is a sorted, 45,402 word dictionary. + + Now, how to compare our file with the dictionary? As before, we +generate a sorted list of words, one per line: + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | + > tr -s ' ' '\n' | sort -u | ... + + Now, all we need is a list of words that are _not_ in the +dictionary. Here is where the `comm' command comes in. + + $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | + > tr -s ' ' '\n' | sort -u | + > comm -23 - /usr/dict/words + + The `-2' and `-3' options eliminate lines that are only in the +dictionary (the second file), and lines that are in both files. Lines +only in the first file (standard input, our stream of words), are words +that are not in the dictionary. These are likely candidates for +spelling errors. This pipeline was the first cut at a production +spelling checker on Unix. + + There are some other tools that deserve brief mention. + +`grep' + search files for text that matches a regular expression + +`wc' + count lines, words, characters + +`tee' + a T-fitting for data pipes, copies data to files and to standard + output + +`sed' + the stream editor, an advanced tool + +`awk' + a data manipulation language, another advanced tool + + The software tools philosophy also espoused the following bit of +advice: "Let someone else do the hard part." This means, take +something that gives you most of what you need, and then massage it the +rest of the way until it's in the form that you want. + + To summarize: + + 1. Each program should do one thing well. No more, no less. + + 2. Combining programs with appropriate plumbing leads to results where + the whole is greater than the sum of the parts. It also leads to + novel uses of programs that the authors might never have imagined. + + 3. Programs should never print extraneous header or trailer data, + since these could get sent on down a pipeline. (A point we didn't + mention earlier.) + + 4. Let someone else do the hard part. + + 5. Know your toolbox! Use each program appropriately. If you don't + have an appropriate tool, build one. + + As of this writing, all the programs we've discussed are available +via anonymous `ftp' from: +`ftp://gnudist.gnu.org/textutils/textutils-1.22.tar.gz'. (There may be +more recent versions available now.) + + None of what I have presented in this column is new. The Software +Tools philosophy was first introduced in the book `Software Tools', by +Brian Kernighan and P.J. Plauger (Addison-Wesley, ISBN 0-201-03669-X). +This book showed how to write and use software tools. It was written in +1976, using a preprocessor for FORTRAN named `ratfor' (RATional +FORtran). At the time, C was not as ubiquitous as it is now; FORTRAN +was. The last chapter presented a `ratfor' to FORTRAN processor, +written in `ratfor'. `ratfor' looks an awful lot like C; if you know +C, you won't have any problem following the code. + + In 1981, the book was updated and made available as `Software Tools +in Pascal' (Addison-Wesley, ISBN 0-201-10342-7). Both books are still +in print and are well worth reading if you're a programmer. They +certainly made a major change in how I view programming. + + The programs in both books are available from Brian Kernighan's home +page (http://cm.bell-labs.com/who/bwk). For a number of years, there +was an active Software Tools Users Group, whose members had ported the +original `ratfor' programs to essentially every computer system with a +FORTRAN compiler. The popularity of the group waned in the middle 1980s +as Unix began to spread beyond universities. + + With the current proliferation of GNU code and other clones of Unix +programs, these programs now receive little attention; modern C +versions are much more efficient and do more than these programs do. +Nevertheless, as exposition of good programming style, and evangelism +for a still-valuable philosophy, these books are unparalleled, and I +recommend them highly. + + Acknowledgment: I would like to express my gratitude to Brian +Kernighan of Bell Labs, the original Software Toolsmith, for reviewing +this column. + + ---------- Footnotes ---------- + + (1) Redhat Linux 6.1, for the November 2000 revision of this article. + + +File: coreutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Opening the software toolbox, Up: Top + +Appendix A GNU Free Documentation License +***************************************** + + Version 1.1, March 2000 +* Menu: + +* How to use this License for your documents:: + + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + written document "free" in the sense of freedom: to assure everyone + the effective freedom to copy and redistribute it, with or without + modifying it, either commercially or noncommercially. Secondarily, + this License preserves for the author and publisher a way to get + credit for their work, while not being considered responsible for + modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work that contains a + notice placed by the copyright holder saying it can be distributed + under the terms of this License. The "Document", below, refers to + any such manual or work. Any member of the public is a licensee, + and is addressed as "you". + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter + section of the Document that deals exclusively with the + relationship of the publishers or authors of the Document to the + Document's overall subject (or to related matters) and contains + nothing that could fall directly within that overall subject. + (For example, if the Document is in part a textbook of + mathematics, a Secondary Section may not explain any mathematics.) + The relationship could be a matter of historical connection with + the subject or with related matters, or of legal, commercial, + philosophical, ethical or political position regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, whose contents can be viewed and edited directly + and straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup has been designed + to thwart or discourage subsequent modification by readers is not + Transparent. A copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML designed for human modification. + Opaque formats include PostScript, PDF, proprietary formats that + can be read and edited only by proprietary word processors, SGML + or XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies of the Document numbering more than + 100, and the Document's license notice requires Cover Texts, you + must enclose the copies in covers that carry, clearly and legibly, + all these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a publicly-accessible + computer-network location containing a complete Transparent copy + of the Document, free of added material, which the general + network-using public has access to download anonymously at no + charge using public-standard network protocols. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that version + gives permission. + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in the + Modified Version, together with at least five of the principal + authors of the Document (all of its principal authors, if it + has less than five). + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + D. Preserve all the copyright notices of the Document. + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified Version + under the terms of this License, in the form shown in the + Addendum below. + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + H. Include an unaltered copy of this License. + I. Preserve the section entitled "History", and its title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. + If there is no section entitled "History" in the Document, + create one stating the title, year, authors, and publisher of + the Document as given on its Title Page, then add an item + describing the Modified Version as stated in the previous + sentence. + J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. + M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. + N. Do not retitle any existing section as "Endorsements" or to + conflict in title with any Invariant Section. + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties-for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition + of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections entitled + "History" in the various original documents, forming one section + entitled "History"; likewise combine any sections entitled + "Acknowledgements", and any sections entitled "Dedications". You + must delete all sections entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, does not as a whole count as a + Modified Version of the Document, provided no compilation + copyright is claimed for the compilation. Such a compilation is + called an "aggregate", and this License does not apply to the + other self-contained works thus compiled with the Document, on + account of their being thus compiled, if they are not themselves + derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one + quarter of the entire aggregate, the Document's Cover Texts may be + placed on covers that surround only the Document within the + aggregate. Otherwise they must appear on covers around the whole + aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License provided that you also include the + original English version of this License. In case of a + disagreement between the translation and the original English + version of this License, the original English version will prevail. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + http://www.gnu.org/copyleft/. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + + + +File: coreutils.info, Node: How to use this License for your documents, Up: GNU Free Documentation License + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +If you have no Invariant Sections, write "with no Invariant +Sections" instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover +Texts being LIST"; likewise for Back-Cover Texts. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: coreutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top + +Index +***** + +[index] +* Menu: + +* !: Connectives for test. + (line 9) +* !=: String tests. (line 25) +* %: Numeric expressions. (line 15) +* %b: printf invocation. (line 32) +* &: Relations for expr. (line 17) +* *: Numeric expressions. (line 15) +* + <1>: Numeric expressions. (line 11) +* +: String expressions. (line 53) +* +PAGE_RANGE: pr invocation. (line 60) +* - <1>: su invocation. (line 53) +* - <2>: env invocation. (line 45) +* -: Numeric expressions. (line 11) +* - and Unix rm: rm invocation. (line 77) +* -, removing files beginning with: rm invocation. (line 65) +* --: Common options. (line 36) +* --across: pr invocation. (line 84) +* --address-radix: od invocation. (line 36) +* --adjustment: nice invocation. (line 34) +* --all <1>: uname invocation. (line 30) +* --all <2>: who invocation. (line 36) +* --all <3>: stty invocation. (line 26) +* --all <4>: du invocation. (line 21) +* --all <5>: df invocation. (line 32) +* --all <6>: Which files are listed. + (line 13) +* --all: unexpand invocation. (line 38) +* --all-repeated: uniq invocation. (line 67) +* --almost-all: Which files are listed. + (line 17) +* --apparent-size: du invocation. (line 24) +* --append: tee invocation. (line 25) +* --archive: cp invocation. (line 54) +* --author: What information is listed. + (line 10) +* --backup <1>: ln invocation. (line 55) +* --backup <2>: mv invocation. (line 50) +* --backup <3>: install invocation. (line 36) +* --backup <4>: cp invocation. (line 61) +* --backup: Backup options. (line 13) +* --before: tac invocation. (line 21) +* --binary <1>: md5sum invocation. (line 24) +* --binary: cat invocation. (line 20) +* --block-size <1>: du invocation. (line 45) +* --block-size <2>: df invocation. (line 40) +* --block-size: Block size. (line 138) +* --block-size=SIZE: Block size. (line 12) +* --body-numbering: nl invocation. (line 47) +* --boot: who invocation. (line 40) +* --bourne-shell: dircolors invocation. + (line 27) +* --buffer-size: sort invocation. (line 191) +* --bytes <1>: du invocation. (line 41) +* --bytes <2>: cut invocation. (line 26) +* --bytes <3>: wc invocation. (line 41) +* --bytes <4>: split invocation. (line 38) +* --bytes <5>: tail invocation. (line 36) +* --bytes <6>: head invocation. (line 24) +* --bytes: fold invocation. (line 23) +* --c-shell: dircolors invocation. + (line 33) +* --canonicalize: readlink invocation. (line 29) +* --canonicalize-existing: readlink invocation. (line 35) +* --canonicalize-missing: readlink invocation. (line 41) +* --changes <1>: chmod invocation. (line 28) +* --changes <2>: chgrp invocation. (line 17) +* --changes: chown invocation. (line 66) +* --characters: cut invocation. (line 34) +* --chars: wc invocation. (line 45) +* --check: sort invocation. (line 17) +* --check-chars: uniq invocation. (line 101) +* --classify: General output formatting. + (line 36) +* --color: General output formatting. + (line 21) +* --columns: pr invocation. (line 70) +* --command: su invocation. (line 39) +* --complement: cut invocation. (line 71) +* --count <1>: who invocation. (line 60) +* --count: uniq invocation. (line 53) +* --count-links: du invocation. (line 91) +* --crown-margin: fmt invocation. (line 34) +* --csh: dircolors invocation. + (line 33) +* --date <1>: Options for date. (line 11) +* --date: touch invocation. (line 62) +* --dead: who invocation. (line 44) +* --delimiter: cut invocation. (line 51) +* --delimiters: paste invocation. (line 43) +* --dereference <1>: stat invocation. (line 22) +* --dereference <2>: du invocation. (line 96) +* --dereference <3>: chgrp invocation. (line 27) +* --dereference <4>: chown invocation. (line 99) +* --dereference <5>: cp invocation. (line 121) +* --dereference: Which files are listed. + (line 77) +* --dereference-args: du invocation. (line 56) +* --dereference-command-line: Which files are listed. + (line 36) +* --dereference-command-line-symlink-to-dir: Which files are listed. + (line 41) +* --dictionary-order: sort invocation. (line 75) +* --digits: csplit invocation. (line 80) +* --directory <1>: ln invocation. (line 61) +* --directory <2>: rm invocation. (line 25) +* --directory <3>: install invocation. (line 44) +* --directory: Which files are listed. + (line 28) +* --dired: What information is listed. + (line 16) +* --double-space: pr invocation. (line 96) +* --elide-empty-files: csplit invocation. (line 89) +* --escape: Formatting the file names. + (line 11) +* --exact: shred invocation. (line 119) +* --exclude-from=FILE: du invocation. (line 144) +* --exclude-type: df invocation. (line 134) +* --exclude=PATTERN: du invocation. (line 138) +* --expand-tabs: pr invocation. (line 120) +* --fast: su invocation. (line 44) +* --field-separator: sort invocation. (line 207) +* --fields: cut invocation. (line 44) +* --file <1>: Options for date. (line 22) +* --file: stty invocation. (line 31) +* --file-system: stat invocation. (line 17) +* --file-type: General output formatting. + (line 73) +* --files0-from=FILE: du invocation. (line 62) +* --first-line-number: pr invocation. (line 198) +* --follow: tail invocation. (line 41) +* --footer-numbering: nl invocation. (line 75) +* --force <1>: ln invocation. (line 67) +* --force <2>: shred invocation. (line 91) +* --force <3>: rm invocation. (line 37) +* --force <4>: mv invocation. (line 55) +* --force: cp invocation. (line 96) +* --form-feed: pr invocation. (line 128) +* --format <1>: General output formatting. + (line 10) +* --format <2>: What information is listed. + (line 130) +* --format: od invocation. (line 76) +* --format=FORMAT <1>: seq invocation. (line 24) +* --format=FORMAT: stat invocation. (line 33) +* --from: chown invocation. (line 76) +* --full-time: What information is listed. + (line 100) +* --general-numeric-sort: sort invocation. (line 87) +* --group <1>: id invocation. (line 23) +* --group: install invocation. (line 53) +* --groups: id invocation. (line 27) +* --hardware-platform: uname invocation. (line 34) +* --header: pr invocation. (line 134) +* --header-numbering: nl invocation. (line 79) +* --heading: who invocation. (line 48) +* --help: Common options. (line 29) +* --hide-control-chars: Formatting the file names. + (line 23) +* --hide=PATTERN: Which files are listed. + (line 50) +* --human-readable <1>: du invocation. (line 75) +* --human-readable <2>: df invocation. (line 45) +* --human-readable <3>: What information is listed. + (line 116) +* --human-readable: Block size. (line 138) +* --idle: who invocation. (line 52) +* --ignore-backups: Which files are listed. + (line 23) +* --ignore-case <1>: join invocation. (line 57) +* --ignore-case <2>: uniq invocation. (line 57) +* --ignore-case: sort invocation. (line 81) +* --ignore-environment: env invocation. (line 45) +* --ignore-fail-on-non-empty: rmdir invocation. (line 17) +* --ignore-interrupts: tee invocation. (line 30) +* --ignore-leading-blanks: sort invocation. (line 70) +* --ignore-nonprinting: sort invocation. (line 114) +* --ignore=PATTERN: Which files are listed. + (line 63) +* --indent: pr invocation. (line 204) +* --indicator-style: General output formatting. + (line 36) +* --initial: expand invocation. (line 35) +* --inode: What information is listed. + (line 122) +* --inodes: df invocation. (line 54) +* --interactive <1>: ln invocation. (line 71) +* --interactive <2>: rm invocation. (line 42) +* --interactive <3>: mv invocation. (line 59) +* --interactive: cp invocation. (line 113) +* --iso-8601[=TIMESPEC]: Options for date. (line 30) +* --iterations=NUMBER: shred invocation. (line 96) +* --join-blank-lines: nl invocation. (line 87) +* --join-lines: pr invocation. (line 147) +* --keep-files: csplit invocation. (line 85) +* --kernel-name: uname invocation. (line 61) +* --kernel-release: uname invocation. (line 57) +* --kernel-version: uname invocation. (line 72) +* --key: sort invocation. (line 163) +* --length: pr invocation. (line 156) +* --line-bytes: split invocation. (line 44) +* --lines <1>: wc invocation. (line 53) +* --lines <2>: split invocation. (line 30) +* --lines <3>: tail invocation. (line 129) +* --lines: head invocation. (line 30) +* --link: cp invocation. (line 117) +* --literal: Formatting the file names. + (line 17) +* --local: df invocation. (line 65) +* --login <1>: su invocation. (line 53) +* --login: who invocation. (line 75) +* --lookup: who invocation. (line 80) +* --machine: uname invocation. (line 39) +* --max-depth=DEPTH: du invocation. (line 106) +* --max-line-length: wc invocation. (line 57) +* --max-unchanged-stats: tail invocation. (line 117) +* --merge <1>: sort invocation. (line 23) +* --merge: pr invocation. (line 164) +* --mesg: who invocation. (line 93) +* --message: who invocation. (line 93) +* --mode <1>: mknod invocation. (line 43) +* --mode <2>: mkfifo invocation. (line 21) +* --mode <3>: mkdir invocation. (line 24) +* --mode: install invocation. (line 59) +* --month-sort: sort invocation. (line 120) +* --name: id invocation. (line 31) +* --no-create: touch invocation. (line 58) +* --no-dereference <1>: du invocation. (line 102) +* --no-dereference <2>: chgrp invocation. (line 32) +* --no-dereference <3>: chown invocation. (line 104) +* --no-dereference <4>: ln invocation. (line 75) +* --no-dereference: cp invocation. (line 125) +* --no-file-warnings: pr invocation. (line 211) +* --no-group: What information is listed. + (line 110) +* --no-newline: readlink invocation. (line 46) +* --no-preserve-root <1>: chmod invocation. (line 43) +* --no-preserve-root <2>: chgrp invocation. (line 45) +* --no-preserve-root <3>: chown invocation. (line 117) +* --no-preserve-root: rm invocation. (line 52) +* --no-renumber: nl invocation. (line 108) +* --no-sync: df invocation. (line 69) +* --no-target-directory <1>: ln invocation. (line 109) +* --no-target-directory <2>: mv invocation. (line 99) +* --no-target-directory <3>: install invocation. (line 97) +* --no-target-directory <4>: cp invocation. (line 260) +* --no-target-directory: Target directory. (line 15) +* --nodename: uname invocation. (line 44) +* --null: du invocation. (line 112) +* --number: cat invocation. (line 52) +* --number-format: nl invocation. (line 95) +* --number-lines: pr invocation. (line 177) +* --number-nonblank: cat invocation. (line 37) +* --number-separator: nl invocation. (line 112) +* --number-width: nl invocation. (line 122) +* --numeric-sort: sort invocation. (line 128) +* --numeric-suffixes: split invocation. (line 52) +* --numeric-uid-gid: What information is listed. + (line 179) +* --omit-header: pr invocation. (line 240) +* --omit-pagination: pr invocation. (line 251) +* --one-file-system <1>: du invocation. (line 134) +* --one-file-system: cp invocation. (line 285) +* --only-delimited: cut invocation. (line 59) +* --operating-system: uname invocation. (line 53) +* --output: sort invocation. (line 171) +* --output-delimiter: cut invocation. (line 64) +* --output-duplicates: od invocation. (line 145) +* --output-tabs: pr invocation. (line 140) +* --owner: install invocation. (line 68) +* --page-increment: nl invocation. (line 83) +* --page_width: pr invocation. (line 269) +* --pages=PAGE_RANGE: pr invocation. (line 60) +* --parents <1>: rmdir invocation. (line 22) +* --parents <2>: mkdir invocation. (line 31) +* --parents: cp invocation. (line 167) +* --pid: tail invocation. (line 97) +* --portability <1>: pathchk invocation. (line 30) +* --portability: df invocation. (line 76) +* --prefix: csplit invocation. (line 62) +* --preserve: cp invocation. (line 130) +* --preserve-environment: su invocation. (line 64) +* --preserve-root <1>: chmod invocation. (line 38) +* --preserve-root <2>: chgrp invocation. (line 40) +* --preserve-root <3>: chown invocation. (line 112) +* --preserve-root: rm invocation. (line 47) +* --preserve-timestamps: install invocation. (line 74) +* --print-database: dircolors invocation. + (line 38) +* --print-type: df invocation. (line 109) +* --processor: uname invocation. (line 48) +* --quiet <1>: tty invocation. (line 18) +* --quiet <2>: chmod invocation. (line 34) +* --quiet <3>: chgrp invocation. (line 23) +* --quiet <4>: chown invocation. (line 72) +* --quiet <5>: readlink invocation. (line 52) +* --quiet <6>: csplit invocation. (line 100) +* --quiet <7>: tail invocation. (line 134) +* --quiet: head invocation. (line 36) +* --quote-name: Formatting the file names. + (line 30) +* --quoting-style: Formatting the file names. + (line 11) +* --read-bytes: od invocation. (line 63) +* --real: id invocation. (line 36) +* --recursive <1>: chmod invocation. (line 58) +* --recursive <2>: chgrp invocation. (line 63) +* --recursive <3>: chown invocation. (line 136) +* --recursive <4>: rm invocation. (line 58) +* --recursive <5>: cp invocation. (line 189) +* --recursive: Which files are listed. + (line 84) +* --reference <1>: Options for date. (line 74) +* --reference <2>: touch invocation. (line 81) +* --reference <3>: chmod invocation. (line 51) +* --reference <4>: chgrp invocation. (line 49) +* --reference: chown invocation. (line 121) +* --regex: tac invocation. (line 26) +* --remove: shred invocation. (line 109) +* --remove-destination: cp invocation. (line 201) +* --repeated: uniq invocation. (line 61) +* --reply <1>: mv invocation. (line 64) +* --reply: cp invocation. (line 178) +* --retry: tail invocation. (line 83) +* --reverse <1>: Sorting the output. (line 28) +* --reverse: sort invocation. (line 155) +* --rfc-2822: Options for date. (line 61) +* --rfc-822: Options for date. (line 61) +* --save: stty invocation. (line 41) +* --section-delimiter: nl invocation. (line 68) +* --sep-string: pr invocation. (line 225) +* --separate-dirs: du invocation. (line 129) +* --separator <1>: pr invocation. (line 216) +* --separator: tac invocation. (line 33) +* --serial: paste invocation. (line 34) +* --set: Options for date. (line 79) +* --sh: dircolors invocation. + (line 27) +* --shell: su invocation. (line 75) +* --show-all: cat invocation. (line 16) +* --show-control-chars <1>: Formatting the file names. + (line 77) +* --show-control-chars: pr invocation. (line 90) +* --show-ends: cat invocation. (line 46) +* --show-nonprinting <1>: pr invocation. (line 256) +* --show-nonprinting: cat invocation. (line 74) +* --show-tabs: cat invocation. (line 67) +* --si <1>: du invocation. (line 118) +* --si <2>: df invocation. (line 89) +* --si <3>: What information is listed. + (line 205) +* --si: Block size. (line 138) +* --silent <1>: tty invocation. (line 18) +* --silent <2>: chmod invocation. (line 34) +* --silent <3>: chgrp invocation. (line 23) +* --silent <4>: chown invocation. (line 72) +* --silent <5>: readlink invocation. (line 52) +* --silent <6>: csplit invocation. (line 100) +* --silent <7>: tail invocation. (line 134) +* --silent: head invocation. (line 36) +* --size: What information is listed. + (line 189) +* --size=BYTES: shred invocation. (line 103) +* --skip-bytes: od invocation. (line 55) +* --skip-chars: uniq invocation. (line 42) +* --skip-fields: uniq invocation. (line 31) +* --sleep-interval: tail invocation. (line 89) +* --sort: Sorting the output. (line 33) +* --spaces: fold invocation. (line 29) +* --sparse=WHEN: cp invocation. (line 205) +* --split-only: fmt invocation. (line 47) +* --squeeze-blank: cat invocation. (line 58) +* --stable: sort invocation. (line 185) +* --starting-line-number: nl invocation. (line 117) +* --status: md5sum invocation. (line 53) +* --strings: od invocation. (line 68) +* --strip: install invocation. (line 84) +* --strip-trailing-slashes <1>: mv invocation. (line 85) +* --strip-trailing-slashes: cp invocation. (line 238) +* --suffix <1>: ln invocation. (line 100) +* --suffix <2>: mv invocation. (line 90) +* --suffix <3>: install invocation. (line 88) +* --suffix <4>: cp invocation. (line 251) +* --suffix <5>: csplit invocation. (line 66) +* --suffix: Backup options. (line 50) +* --suffix-length: split invocation. (line 26) +* --summarize: du invocation. (line 125) +* --symbolic: ln invocation. (line 94) +* --symbolic-link: cp invocation. (line 243) +* --sync: df invocation. (line 96) +* --sysv: sum invocation. (line 31) +* --tabs <1>: unexpand invocation. (line 24) +* --tabs: expand invocation. (line 22) +* --tabsize: General output formatting. + (line 83) +* --tagged-paragraph: fmt invocation. (line 40) +* --target-directory <1>: ln invocation. (line 105) +* --target-directory <2>: mv invocation. (line 95) +* --target-directory <3>: install invocation. (line 93) +* --target-directory <4>: cp invocation. (line 256) +* --target-directory: Target directory. (line 31) +* --temporary-directory: sort invocation. (line 224) +* --terse: stat invocation. (line 28) +* --text: md5sum invocation. (line 63) +* --time <1>: touch invocation. (line 54) +* --time: Sorting the output. (line 14) +* --time-style: Formatting file timestamps. + (line 26) +* --total: du invocation. (line 50) +* --traditional: od invocation. (line 199) +* --type: df invocation. (line 103) +* --uniform-spacing: fmt invocation. (line 53) +* --unique <1>: uniq invocation. (line 96) +* --unique: sort invocation. (line 233) +* --universal: Options for date. (line 84) +* --unset: env invocation. (line 39) +* --update <1>: mv invocation. (line 72) +* --update: cp invocation. (line 265) +* --user: id invocation. (line 41) +* --utc: Options for date. (line 84) +* --verbose <1>: chmod invocation. (line 48) +* --verbose <2>: chgrp invocation. (line 55) +* --verbose <3>: chown invocation. (line 128) +* --verbose <4>: rmdir invocation. (line 32) +* --verbose <5>: readlink invocation. (line 56) +* --verbose <6>: mkdir invocation. (line 38) +* --verbose <7>: ln invocation. (line 114) +* --verbose <8>: shred invocation. (line 115) +* --verbose <9>: rm invocation. (line 62) +* --verbose <10>: mv invocation. (line 82) +* --verbose <11>: install invocation. (line 102) +* --verbose <12>: cp invocation. (line 275) +* --verbose <13>: split invocation. (line 55) +* --verbose <14>: tail invocation. (line 138) +* --verbose: head invocation. (line 40) +* --version: Common options. (line 33) +* --version-control <1>: ln invocation. (line 118) +* --version-control <2>: mv invocation. (line 104) +* --version-control <3>: install invocation. (line 106) +* --version-control <4>: cp invocation. (line 279) +* --version-control: Backup options. (line 56) +* --warn: md5sum invocation. (line 68) +* --width <1>: General output formatting. + (line 89) +* --width <2>: fold invocation. (line 35) +* --width <3>: pr invocation. (line 260) +* --width <4>: fmt invocation. (line 59) +* --width: od invocation. (line 152) +* --words: wc invocation. (line 49) +* --writable: who invocation. (line 93) +* --zero: shred invocation. (line 129) +* --zero-terminated: sort invocation. (line 247) +* -0: du invocation. (line 111) +* -1 <1>: General output formatting. + (line 10) +* -1 <2>: join invocation. (line 62) +* -1: comm invocation. (line 23) +* -2 <1>: join invocation. (line 65) +* -2: comm invocation. (line 23) +* -3: comm invocation. (line 23) +* -a <1>: uname invocation. (line 30) +* -a <2>: who invocation. (line 36) +* -a <3>: stty invocation. (line 26) +* -a <4>: tee invocation. (line 25) +* -a <5>: Connectives for test. + (line 12) +* -a <6>: du invocation. (line 21) +* -a <7>: df invocation. (line 32) +* -a <8>: touch invocation. (line 54) +* -a: cp invocation. (line 54) +* -A: Which files are listed. + (line 17) +* -a <1>: Which files are listed. + (line 13) +* -a <2>: unexpand invocation. (line 38) +* -a <3>: join invocation. (line 48) +* -a <4>: split invocation. (line 26) +* -a <5>: pr invocation. (line 84) +* -a: od invocation. (line 168) +* -A <1>: od invocation. (line 36) +* -A: cat invocation. (line 16) +* -b <1>: who invocation. (line 40) +* -b: File type tests. (line 10) +* -B: du invocation. (line 45) +* -b: du invocation. (line 41) +* -B: df invocation. (line 40) +* -b <1>: ln invocation. (line 55) +* -b <2>: mv invocation. (line 50) +* -b <3>: install invocation. (line 36) +* -b <4>: cp invocation. (line 61) +* -b <5>: dircolors invocation. + (line 27) +* -b: Formatting the file names. + (line 11) +* -B: Which files are listed. + (line 23) +* -b <1>: cut invocation. (line 26) +* -b <2>: sort invocation. (line 70) +* -b <3>: md5sum invocation. (line 24) +* -b <4>: csplit invocation. (line 66) +* -b <5>: split invocation. (line 38) +* -b <6>: fold invocation. (line 23) +* -b <7>: od invocation. (line 171) +* -b <8>: nl invocation. (line 47) +* -b <9>: tac invocation. (line 21) +* -b: cat invocation. (line 37) +* -B: cat invocation. (line 20) +* -b: Backup options. (line 13) +* -c <1>: su invocation. (line 39) +* -c <2>: File type tests. (line 13) +* -c <3>: stat invocation. (line 33) +* -c <4>: du invocation. (line 50) +* -c <5>: touch invocation. (line 58) +* -c <6>: chmod invocation. (line 28) +* -c <7>: chgrp invocation. (line 17) +* -c <8>: chown invocation. (line 66) +* -c <9>: install invocation. (line 40) +* -c: dircolors invocation. + (line 33) +* -C: General output formatting. + (line 15) +* -c <1>: Sorting the output. (line 14) +* -c <2>: cut invocation. (line 34) +* -c <3>: uniq invocation. (line 53) +* -c <4>: sort invocation. (line 17) +* -c: wc invocation. (line 41) +* -C: split invocation. (line 44) +* -c <1>: tail invocation. (line 36) +* -c <2>: head invocation. (line 24) +* -c <3>: pr invocation. (line 90) +* -c <4>: fmt invocation. (line 34) +* -c: od invocation. (line 174) +* -COLUMN: pr invocation. (line 70) +* -d <1>: Options for date. (line 11) +* -d <2>: who invocation. (line 44) +* -d: File type tests. (line 16) +* -D: du invocation. (line 56) +* -d <1>: touch invocation. (line 62) +* -d <2>: ln invocation. (line 61) +* -d <3>: rm invocation. (line 25) +* -d <4>: install invocation. (line 44) +* -d: cp invocation. (line 89) +* -D: What information is listed. + (line 16) +* -d <1>: Which files are listed. + (line 28) +* -d <2>: paste invocation. (line 43) +* -d: cut invocation. (line 51) +* -D: uniq invocation. (line 67) +* -d <1>: uniq invocation. (line 61) +* -d <2>: sort invocation. (line 75) +* -d <3>: split invocation. (line 52) +* -d <4>: pr invocation. (line 96) +* -d <5>: od invocation. (line 178) +* -d: nl invocation. (line 68) +* -e: File characteristic tests. + (line 9) +* -E: echo invocation. (line 63) +* -e <1>: echo invocation. (line 20) +* -e <2>: readlink invocation. (line 35) +* -e <3>: join invocation. (line 52) +* -e: pr invocation. (line 120) +* -E: cat invocation. (line 46) +* -e: cat invocation. (line 42) +* -ef: File characteristic tests. + (line 23) +* -eq: Numeric tests. (line 16) +* -f <1>: su invocation. (line 44) +* -f: Options for date. (line 22) +* -F: stty invocation. (line 31) +* -f <1>: File type tests. (line 19) +* -f <2>: stat invocation. (line 17) +* -f <3>: touch invocation. (line 72) +* -f <4>: chmod invocation. (line 34) +* -f <5>: chgrp invocation. (line 23) +* -f <6>: chown invocation. (line 72) +* -f <7>: readlink invocation. (line 29) +* -f: ln invocation. (line 67) +* -F: ln invocation. (line 61) +* -f <1>: shred invocation. (line 91) +* -f <2>: rm invocation. (line 37) +* -f <3>: mv invocation. (line 55) +* -f: cp invocation. (line 96) +* -F: General output formatting. + (line 36) +* -f <1>: Sorting the output. (line 21) +* -f <2>: cut invocation. (line 44) +* -f <3>: uniq invocation. (line 31) +* -f <4>: sort invocation. (line 81) +* -f: csplit invocation. (line 62) +* -F: tail invocation. (line 78) +* -f <1>: tail invocation. (line 41) +* -f: pr invocation. (line 128) +* -F: pr invocation. (line 128) +* -f <1>: od invocation. (line 181) +* -f: nl invocation. (line 75) +* -f FORMAT: seq invocation. (line 24) +* -G: id invocation. (line 27) +* -g <1>: id invocation. (line 23) +* -g: stty invocation. (line 41) +* -G: Access permission tests. + (line 31) +* -g <1>: Access permission tests. + (line 9) +* -g: install invocation. (line 53) +* -G: What information is listed. + (line 110) +* -g <1>: What information is listed. + (line 105) +* -g: sort invocation. (line 87) +* -ge: Numeric tests. (line 16) +* -gt: Numeric tests. (line 16) +* -H: who invocation. (line 48) +* -h: File type tests. (line 23) +* -H: du invocation. (line 80) +* -h: du invocation. (line 75) +* -H: df invocation. (line 50) +* -h: df invocation. (line 45) +* -H: chgrp invocation. (line 67) +* -h: chgrp invocation. (line 32) +* -H: chown invocation. (line 139) +* -h: chown invocation. (line 104) +* -H: cp invocation. (line 106) +* -h: What information is listed. + (line 116) +* -H: Which files are listed. + (line 36) +* -h <1>: pr invocation. (line 134) +* -h: nl invocation. (line 79) +* -H: Traversing symlinks. (line 18) +* -h: Block size. (line 138) +* -i <1>: env invocation. (line 45) +* -i <2>: uname invocation. (line 34) +* -i <3>: who invocation. (line 52) +* -i <4>: tee invocation. (line 30) +* -i <5>: df invocation. (line 54) +* -i <6>: ln invocation. (line 71) +* -i <7>: rm invocation. (line 42) +* -i <8>: mv invocation. (line 59) +* -i <9>: cp invocation. (line 113) +* -i: What information is listed. + (line 122) +* -I: Which files are listed. + (line 63) +* -i <1>: expand invocation. (line 35) +* -i <2>: join invocation. (line 57) +* -i <3>: uniq invocation. (line 57) +* -i <4>: sort invocation. (line 114) +* -i <5>: pr invocation. (line 140) +* -i <6>: od invocation. (line 184) +* -i: nl invocation. (line 83) +* -I TIMESPEC: Options for date. (line 30) +* -J: pr invocation. (line 147) +* -j: od invocation. (line 55) +* -k <1>: Access permission tests. + (line 12) +* -k <2>: du invocation. (line 85) +* -k <3>: df invocation. (line 59) +* -k <4>: General output formatting. + (line 61) +* -k <5>: sort invocation. (line 163) +* -k <6>: csplit invocation. (line 85) +* -k: Block size. (line 138) +* -l <1>: su invocation. (line 53) +* -l: who invocation. (line 75) +* -L <1>: File type tests. (line 23) +* -L <2>: stat invocation. (line 22) +* -L: du invocation. (line 96) +* -l <1>: du invocation. (line 91) +* -l: df invocation. (line 65) +* -L <1>: chgrp invocation. (line 72) +* -L <2>: chown invocation. (line 144) +* -L: cp invocation. (line 121) +* -l <1>: cp invocation. (line 117) +* -l: What information is listed. + (line 130) +* -L <1>: Which files are listed. + (line 77) +* -L: wc invocation. (line 57) +* -l <1>: wc invocation. (line 53) +* -l <2>: split invocation. (line 30) +* -l <3>: pr invocation. (line 156) +* -l <4>: od invocation. (line 187) +* -l: nl invocation. (line 87) +* -L: Traversing symlinks. (line 22) +* -le: Numeric tests. (line 16) +* -lt: Numeric tests. (line 16) +* -m <1>: su invocation. (line 64) +* -m <2>: uname invocation. (line 39) +* -m <3>: who invocation. (line 56) +* -m <4>: touch invocation. (line 77) +* -m <5>: readlink invocation. (line 41) +* -m <6>: mknod invocation. (line 43) +* -m <7>: mkfifo invocation. (line 21) +* -m <8>: mkdir invocation. (line 24) +* -m <9>: install invocation. (line 59) +* -m: General output formatting. + (line 67) +* -M: sort invocation. (line 120) +* -m <1>: sort invocation. (line 23) +* -m <2>: wc invocation. (line 45) +* -m: pr invocation. (line 164) +* -n <1>: nice invocation. (line 34) +* -n <2>: uname invocation. (line 44) +* -n <3>: id invocation. (line 31) +* -n <4>: String tests. (line 19) +* -n <5>: echo invocation. (line 17) +* -n <6>: readlink invocation. (line 46) +* -n: ln invocation. (line 75) +* -N: Formatting the file names. + (line 17) +* -n <1>: What information is listed. + (line 179) +* -n <2>: cut invocation. (line 55) +* -n <3>: sort invocation. (line 128) +* -n <4>: csplit invocation. (line 80) +* -n <5>: tail invocation. (line 129) +* -n: head invocation. (line 30) +* -N: pr invocation. (line 198) +* -n: pr invocation. (line 177) +* -N: od invocation. (line 63) +* -n <1>: nl invocation. (line 95) +* -n: cat invocation. (line 52) +* -n NUMBER: shred invocation. (line 96) +* -ne: Numeric tests. (line 16) +* -nt: File characteristic tests. + (line 15) +* -o <1>: uname invocation. (line 53) +* -o: Connectives for test. + (line 15) +* -O: Access permission tests. + (line 28) +* -o <1>: install invocation. (line 68) +* -o <2>: What information is listed. + (line 183) +* -o <3>: sort invocation. (line 171) +* -o <4>: pr invocation. (line 204) +* -o: od invocation. (line 190) +* -ot: File characteristic tests. + (line 19) +* -p <1>: su invocation. (line 64) +* -p <2>: uname invocation. (line 48) +* -p <3>: pathchk invocation. (line 30) +* -p: File type tests. (line 28) +* -P <1>: du invocation. (line 102) +* -P <2>: df invocation. (line 76) +* -P <3>: chgrp invocation. (line 76) +* -P: chown invocation. (line 148) +* -p <1>: rmdir invocation. (line 22) +* -p <2>: mkdir invocation. (line 31) +* -p <3>: install invocation. (line 74) +* -p: cp invocation. (line 130) +* -P: cp invocation. (line 125) +* -p <1>: dircolors invocation. + (line 38) +* -p: nl invocation. (line 108) +* -P: Traversing symlinks. (line 26) +* -q <1>: who invocation. (line 60) +* -q: readlink invocation. (line 52) +* -Q: Formatting the file names. + (line 30) +* -q <1>: Formatting the file names. + (line 23) +* -q <2>: csplit invocation. (line 100) +* -q <3>: tail invocation. (line 134) +* -q: head invocation. (line 36) +* -r <1>: uname invocation. (line 57) +* -r: Options for date. (line 74) +* -R: Options for date. (line 61) +* -r <1>: id invocation. (line 36) +* -r <2>: Access permission tests. + (line 15) +* -r: touch invocation. (line 81) +* -R <1>: chmod invocation. (line 58) +* -R <2>: chgrp invocation. (line 63) +* -R <3>: chown invocation. (line 136) +* -R: rm invocation. (line 58) +* -r <1>: rm invocation. (line 58) +* -r: cp invocation. (line 189) +* -R: cp invocation. (line 189) +* -r: Sorting the output. (line 28) +* -R: Which files are listed. + (line 84) +* -r <1>: sort invocation. (line 155) +* -r <2>: sum invocation. (line 25) +* -r <3>: pr invocation. (line 211) +* -r: tac invocation. (line 26) +* -s <1>: su invocation. (line 75) +* -s <2>: uname invocation. (line 61) +* -s <3>: Options for date. (line 79) +* -s <4>: who invocation. (line 64) +* -s <5>: tty invocation. (line 18) +* -s: File characteristic tests. + (line 12) +* -S <1>: File type tests. (line 31) +* -S: du invocation. (line 129) +* -s <1>: du invocation. (line 125) +* -s: readlink invocation. (line 52) +* -S: ln invocation. (line 100) +* -s: ln invocation. (line 94) +* -S <1>: mv invocation. (line 90) +* -S: install invocation. (line 88) +* -s: install invocation. (line 84) +* -S: cp invocation. (line 251) +* -s: cp invocation. (line 243) +* -S: Sorting the output. (line 33) +* -s <1>: What information is listed. + (line 189) +* -s <2>: paste invocation. (line 34) +* -s <3>: cut invocation. (line 59) +* -s: uniq invocation. (line 42) +* -S: sort invocation. (line 191) +* -s <1>: sort invocation. (line 185) +* -s <2>: sum invocation. (line 31) +* -s <3>: csplit invocation. (line 100) +* -s: fold invocation. (line 29) +* -S: pr invocation. (line 225) +* -s <1>: pr invocation. (line 216) +* -s <2>: fmt invocation. (line 47) +* -s: od invocation. (line 193) +* -S: od invocation. (line 68) +* -s <1>: nl invocation. (line 112) +* -s <2>: tac invocation. (line 33) +* -s: cat invocation. (line 58) +* -S: Backup options. (line 50) +* -s BYTES: shred invocation. (line 103) +* -su: su invocation. (line 25) +* -T: who invocation. (line 93) +* -t <1>: File type tests. (line 34) +* -t: stat invocation. (line 28) +* -T: df invocation. (line 109) +* -t: df invocation. (line 103) +* -T: ln invocation. (line 109) +* -t: ln invocation. (line 105) +* -T: mv invocation. (line 99) +* -t: mv invocation. (line 95) +* -T: install invocation. (line 97) +* -t: install invocation. (line 93) +* -T: cp invocation. (line 260) +* -t: cp invocation. (line 256) +* -T: General output formatting. + (line 83) +* -t <1>: Sorting the output. (line 37) +* -t <2>: unexpand invocation. (line 24) +* -t: expand invocation. (line 22) +* -T: sort invocation. (line 224) +* -t <1>: sort invocation. (line 207) +* -t: md5sum invocation. (line 63) +* -T: pr invocation. (line 251) +* -t <1>: pr invocation. (line 240) +* -t <2>: fmt invocation. (line 40) +* -t: od invocation. (line 76) +* -T: cat invocation. (line 67) +* -t: cat invocation. (line 63) +* -u <1>: env invocation. (line 39) +* -u <2>: Options for date. (line 84) +* -u <3>: who invocation. (line 69) +* -u <4>: id invocation. (line 41) +* -u <5>: Access permission tests. + (line 18) +* -u <6>: shred invocation. (line 109) +* -u <7>: mv invocation. (line 72) +* -u: cp invocation. (line 265) +* -U: Sorting the output. (line 49) +* -u <1>: Sorting the output. (line 42) +* -u <2>: uniq invocation. (line 96) +* -u <3>: sort invocation. (line 233) +* -u <4>: fmt invocation. (line 53) +* -u: cat invocation. (line 70) +* -v <1>: uname invocation. (line 72) +* -v <2>: chmod invocation. (line 48) +* -v <3>: chgrp invocation. (line 55) +* -v <4>: chown invocation. (line 128) +* -v <5>: rmdir invocation. (line 32) +* -v <6>: readlink invocation. (line 56) +* -v: mkdir invocation. (line 38) +* -V: ln invocation. (line 118) +* -v <1>: ln invocation. (line 114) +* -v <2>: shred invocation. (line 115) +* -v: rm invocation. (line 62) +* -V: mv invocation. (line 104) +* -v: mv invocation. (line 82) +* -V: install invocation. (line 106) +* -v: install invocation. (line 102) +* -V: cp invocation. (line 279) +* -v <1>: cp invocation. (line 275) +* -v <2>: Sorting the output. (line 56) +* -v <3>: tail invocation. (line 138) +* -v <4>: head invocation. (line 40) +* -v <5>: pr invocation. (line 256) +* -v <6>: od invocation. (line 145) +* -v <7>: nl invocation. (line 117) +* -v: cat invocation. (line 74) +* -w <1>: who invocation. (line 93) +* -w <2>: Access permission tests. + (line 21) +* -w <3>: General output formatting. + (line 89) +* -w <4>: uniq invocation. (line 101) +* -w <5>: md5sum invocation. (line 68) +* -w <6>: wc invocation. (line 49) +* -w: fold invocation. (line 35) +* -W: pr invocation. (line 269) +* -w <1>: pr invocation. (line 260) +* -w <2>: fmt invocation. (line 59) +* -w <3>: od invocation. (line 152) +* -w: nl invocation. (line 122) +* -WIDTH: fmt invocation. (line 59) +* -x <1>: Access permission tests. + (line 24) +* -x <2>: du invocation. (line 134) +* -x <3>: df invocation. (line 134) +* -x <4>: shred invocation. (line 119) +* -x <5>: cp invocation. (line 285) +* -x: General output formatting. + (line 79) +* -X: Sorting the output. (line 63) +* -x: od invocation. (line 196) +* -X FILE: du invocation. (line 144) +* -z <1>: String tests. (line 15) +* -z <2>: shred invocation. (line 129) +* -z <3>: sort invocation. (line 247) +* -z: csplit invocation. (line 89) +* .cshrc: su invocation. (line 44) +* /: Numeric expressions. (line 15) +* /bin/sh: su invocation. (line 12) +* /etc/passwd: su invocation. (line 12) +* /etc/shells: su invocation. (line 64) +* 128-bit checksum: md5sum invocation. (line 6) +* 16-bit checksum: sum invocation. (line 6) +* 4.2 file system type: df invocation. (line 121) +* <: Relations for expr. (line 22) +* <=: Relations for expr. (line 22) +* = <1>: Relations for expr. (line 22) +* =: String tests. (line 22) +* ==: Relations for expr. (line 22) +* >: Relations for expr. (line 22) +* >=: Relations for expr. (line 22) +* \( regexp operator: String expressions. (line 24) +* \+ regexp operator: String expressions. (line 28) +* \? regexp operator: String expressions. (line 28) +* \c: printf invocation. (line 23) +* \OOO: printf invocation. (line 57) +* \uhhhh: printf invocation. (line 62) +* \Uhhhhhhhh: printf invocation. (line 62) +* \xHH: printf invocation. (line 57) +* \| regexp operator: String expressions. (line 28) +* _POSIX2_VERSION: Standards conformance. + (line 19) +* abbreviations for months: Calendar date items. (line 38) +* access permission tests: Access permission tests. + (line 6) +* access permissions, changing: chmod invocation. (line 6) +* access time, changing: touch invocation. (line 54) +* access time, printing or sorting files by: Sorting the output. + (line 42) +* across columns: pr invocation. (line 84) +* across, listing files: General output formatting. + (line 79) +* adding permissions: Setting Permissions. (line 38) +* addition: Numeric expressions. (line 11) +* ago in date strings: Relative items in date strings. + (line 23) +* all repeated lines, outputting: uniq invocation. (line 67) +* alnum: Character sets. (line 87) +* alpha: Character sets. (line 90) +* alternate ebcdic, converting to: dd invocation. (line 62) +* always color option: General output formatting. + (line 27) +* am i: who invocation. (line 21) +* am in date strings: Time of day items. (line 21) +* and operator <1>: Relations for expr. (line 17) +* and operator: Connectives for test. + (line 12) +* append: dd invocation. (line 135) +* appending to the output file: dd invocation. (line 135) +* appropriate privileges <1>: nice invocation. (line 6) +* appropriate privileges <2>: hostname invocation. (line 6) +* appropriate privileges <3>: Setting the time. (line 6) +* appropriate privileges: install invocation. (line 68) +* arbitrary date strings, parsing: Options for date. (line 11) +* arbitrary text, displaying: echo invocation. (line 6) +* arithmetic tests: Numeric tests. (line 6) +* ASCII dump of files: od invocation. (line 6) +* ascii, converting to: dd invocation. (line 54) +* atime, changing: touch invocation. (line 54) +* atime, printing or sorting files by: Sorting the output. (line 42) +* attributes, file: Changing file attributes. + (line 6) +* authors of get_date: Authors of get_date. (line 6) +* auto color option: General output formatting. + (line 25) +* automounter file systems: df invocation. (line 32) +* b for block special file: mknod invocation. (line 26) +* background jobs, stopping at terminal write: Local. (line 41) +* backslash escapes <1>: echo invocation. (line 20) +* backslash escapes: Character sets. (line 14) +* backslash sequences for file names: Formatting the file names. + (line 11) +* backup files, ignoring: Which files are listed. + (line 23) +* backup options: Backup options. (line 6) +* backup suffix: Backup options. (line 50) +* backups, making <1>: ln invocation. (line 55) +* backups, making <2>: mv invocation. (line 50) +* backups, making <3>: install invocation. (line 36) +* backups, making <4>: cp invocation. (line 61) +* backups, making: Backup options. (line 13) +* backups, making only: cp invocation. (line 42) +* basename: basename invocation. (line 6) +* baud rate, setting: Special. (line 43) +* beeping at input buffer full: Input. (line 56) +* beginning of time: Time directives. (line 39) +* beginning of time, for POSIX: Seconds since the Epoch. + (line 13) +* Bellovin, Steven M.: Authors of get_date. (line 6) +* Berets, Jim: Authors of get_date. (line 6) +* Berry, K. <1>: Authors of get_date. (line 14) +* Berry, K.: Introduction. (line 19) +* binary and text I/O in cat: cat invocation. (line 20) +* binary input files: md5sum invocation. (line 24) +* blank: Character sets. (line 93) +* blank lines, numbering: nl invocation. (line 87) +* blanks, ignoring leading: sort invocation. (line 70) +* block (space-padding): dd invocation. (line 71) +* block size <1>: dd invocation. (line 31) +* block size: Block size. (line 6) +* block size of conversion: dd invocation. (line 35) +* block size of input: dd invocation. (line 25) +* block size of output: dd invocation. (line 28) +* block special check: File type tests. (line 10) +* block special files: mknod invocation. (line 11) +* block special files, creating: mknod invocation. (line 6) +* BLOCK_SIZE: Block size. (line 12) +* BLOCKSIZE: Block size. (line 12) +* body, numbering: nl invocation. (line 17) +* Bourne shell syntax for color setup: dircolors invocation. + (line 27) +* breaks, cause interrupts: Input. (line 10) +* breaks, ignoring: Input. (line 7) +* brkint: Input. (line 10) +* bs: dd invocation. (line 31) +* BSD sum: sum invocation. (line 25) +* BSD tail: tail invocation. (line 19) +* BSD touch compatibility: touch invocation. (line 72) +* bsN: Output. (line 55) +* bugs, reporting: Introduction. (line 12) +* built-in shell commands, conflicts with <1>: nice invocation. + (line 25) +* built-in shell commands, conflicts with <2>: pwd invocation. + (line 10) +* built-in shell commands, conflicts with: test invocation. (line 28) +* byte count: wc invocation. (line 6) +* byte-swapping: dd invocation. (line 90) +* c for character special file: mknod invocation. (line 29) +* C shell syntax for color setup: dircolors invocation. + (line 33) +* C-s/C-q flow control: Input. (line 38) +* calendar date item: Calendar date items. (line 6) +* case folding: sort invocation. (line 81) +* case translation: Local. (line 36) +* case, ignored in dates: General date syntax. (line 64) +* cat: cat invocation. (line 6) +* cbreak: Combination. (line 52) +* cbs: dd invocation. (line 35) +* CD-ROM file system type: df invocation. (line 125) +* cdfs file system type: df invocation. (line 125) +* change or print terminal settings: stty invocation. (line 6) +* changed files, verbosely describing: chgrp invocation. (line 17) +* changed owners, verbosely describing: chown invocation. (line 66) +* changing access permissions: chmod invocation. (line 6) +* changing file attributes: Changing file attributes. + (line 6) +* changing file ownership: chown invocation. (line 6) +* changing file timestamps: touch invocation. (line 6) +* changing group ownership <1>: chgrp invocation. (line 6) +* changing group ownership: chown invocation. (line 6) +* changing special permissions: Changing Special Permissions. + (line 6) +* character classes: Character sets. (line 74) +* character count: wc invocation. (line 6) +* character size: Control. (line 19) +* character special check: File type tests. (line 13) +* character special files: mknod invocation. (line 11) +* character special files, creating: mknod invocation. (line 6) +* characters, special: Characters. (line 6) +* check file types: test invocation. (line 6) +* checking for sortedness: sort invocation. (line 17) +* checksum, 128-bit: md5sum invocation. (line 6) +* checksum, 16-bit: sum invocation. (line 6) +* chgrp: chgrp invocation. (line 6) +* chmod: chmod invocation. (line 6) +* chown: chown invocation. (line 6) +* chroot: chroot invocation. (line 6) +* cksum: cksum invocation. (line 6) +* clocal: Control. (line 33) +* cntrl: Character sets. (line 96) +* color database, printing: dircolors invocation. + (line 38) +* color setup: dircolors invocation. + (line 6) +* color, distinguishing file types with: General output formatting. + (line 21) +* cols: Special. (line 27) +* COLUMNS: Special. (line 30) +* columns: Special. (line 27) +* COLUMNS: General output formatting. + (line 89) +* combination settings: Combination. (line 6) +* comm: comm invocation. (line 6) +* commands for controlling processes: Process control. (line 6) +* commands for delaying: Delaying. (line 6) +* commands for exit status: Conditions. (line 6) +* commands for file name manipulation: File name manipulation. + (line 6) +* commands for invoking other commands: Modified command invocation. + (line 6) +* commands for printing text: Printing text. (line 6) +* commands for printing the working context: Working context. (line 6) +* commands for printing user information: User information. (line 6) +* commands for redirection: Redirection. (line 6) +* commands for system context: System context. (line 6) +* commas, outputting between files: General output formatting. + (line 67) +* comments, in dates: General date syntax. (line 64) +* common field, joining on: join invocation. (line 6) +* common lines: comm invocation. (line 18) +* common options: Common options. (line 6) +* compare values: test invocation. (line 6) +* comparing sorted files: comm invocation. (line 6) +* comparison operators: Relations for expr. (line 22) +* concatenate and write files: cat invocation. (line 6) +* conditional executability: Conditional Executability. + (line 6) +* conditions: Conditions. (line 6) +* conflicts with shell built-ins <1>: nice invocation. (line 25) +* conflicts with shell built-ins <2>: pwd invocation. (line 10) +* conflicts with shell built-ins: test invocation. (line 28) +* connectives, logical <1>: Relations for expr. (line 6) +* connectives, logical: Connectives for test. + (line 6) +* context splitting: csplit invocation. (line 6) +* context, system: System context. (line 6) +* control characters, using ^C: Local. (line 51) +* control settings: Control. (line 6) +* controlling terminal: dd invocation. (line 161) +* conv: dd invocation. (line 48) +* conversion block size: dd invocation. (line 35) +* converting tabs to spaces: expand invocation. (line 6) +* converting while copying a file: dd invocation. (line 6) +* cooked: Combination. (line 37) +* Coordinated Universal Time: Options for date. (line 84) +* copying directories recursively: cp invocation. (line 76) +* copying existing permissions: Copying Permissions. (line 6) +* copying files: cat invocation. (line 6) +* copying files and directories: cp invocation. (line 6) +* copying files and setting attributes: install invocation. (line 6) +* core utilities: Top. (line 19) +* count: dd invocation. (line 44) +* cp: cp invocation. (line 6) +* crashes and corruption: sync invocation. (line 11) +* CRC checksum: cksum invocation. (line 6) +* cread: Control. (line 30) +* creating directories: mkdir invocation. (line 6) +* creating FIFOs (named pipes): mkfifo invocation. (line 6) +* creating links (hard only): link invocation. (line 6) +* creating links (hard or soft): ln invocation. (line 6) +* creating output file, avoiding: dd invocation. (line 98) +* creating output file, requiring: dd invocation. (line 102) +* crN: Output. (line 45) +* crown margin: fmt invocation. (line 34) +* crt: Combination. (line 74) +* crterase: Local. (line 22) +* crtkill: Local. (line 56) +* crtscts: Control. (line 36) +* csh syntax for color setup: dircolors invocation. + (line 33) +* csN: Control. (line 19) +* csplit: csplit invocation. (line 6) +* cstopb: Control. (line 27) +* ctime, printing or sorting by: Sorting the output. (line 14) +* ctlecho: Local. (line 51) +* current working directory, printing: pwd invocation. (line 6) +* cut: cut invocation. (line 6) +* cyclic redundancy check: cksum invocation. (line 6) +* data, erasing: shred invocation. (line 6) +* database for color setup, printing: dircolors invocation. + (line 38) +* date: date invocation. (line 6) +* date directives: Date directives. (line 6) +* date format, ISO 8601: Calendar date items. (line 30) +* date input formats: Date input formats. (line 6) +* date options: Options for date. (line 6) +* date strings, parsing: Options for date. (line 11) +* day in date strings: Relative items in date strings. + (line 15) +* day of week item: Day of week items. (line 6) +* dd: dd invocation. (line 6) +* dec: Combination. (line 77) +* decctlq: Combination. (line 63) +* delay for a specified time: sleep invocation. (line 6) +* delaying commands: Delaying. (line 6) +* deleting characters: Squeezing. (line 6) +* dereferencing symbolic links: ln invocation. (line 40) +* descriptor follow option: tail invocation. (line 41) +* destination directory <1>: ln invocation. (line 105) +* destination directory <2>: mv invocation. (line 95) +* destination directory <3>: install invocation. (line 93) +* destination directory <4>: cp invocation. (line 256) +* destination directory: Target directory. (line 15) +* destinations, multiple output: tee invocation. (line 6) +* device file, disk: df invocation. (line 19) +* df: df invocation. (line 6) +* DF_BLOCK_SIZE: Block size. (line 12) +* dictionary order: sort invocation. (line 75) +* differing lines: comm invocation. (line 18) +* digit: Character sets. (line 99) +* dir: dir invocation. (line 6) +* dircolors: dircolors invocation. + (line 6) +* direct: dd invocation. (line 141) +* direct I/O: dd invocation. (line 141) +* directives, date: Date directives. (line 6) +* directives, literal: Literal directives. (line 6) +* directives, time: Time directives. (line 6) +* directories, copying: cp invocation. (line 6) +* directories, copying recursively: cp invocation. (line 76) +* directories, creating: mkdir invocation. (line 6) +* directories, creating with given attributes: install invocation. + (line 44) +* directories, removing (recursively): rm invocation. (line 58) +* directories, removing empty: rmdir invocation. (line 6) +* directories, removing with unlink: rm invocation. (line 25) +* directory check: File type tests. (line 16) +* directory components, printing: dirname invocation. (line 6) +* directory deletion, ignoring failures: rmdir invocation. (line 17) +* directory deletion, reporting: rmdir invocation. (line 32) +* directory listing: ls invocation. (line 6) +* directory listing, brief: dir invocation. (line 6) +* directory listing, recursive: Which files are listed. + (line 84) +* directory listing, verbose: vdir invocation. (line 6) +* directory order, listing by: Sorting the output. (line 21) +* directory, stripping from file names: basename invocation. (line 6) +* dired Emacs mode support: What information is listed. + (line 16) +* dirname: dirname invocation. (line 6) +* disabling special characters: Characters. (line 13) +* disk allocation: What information is listed. + (line 189) +* disk device file: df invocation. (line 19) +* disk usage: Disk usage. (line 6) +* disk usage by file system: df invocation. (line 6) +* disk usage for files: du invocation. (line 6) +* diskette file system: df invocation. (line 129) +* displacement of dates: Relative items in date strings. + (line 6) +* displaying text: echo invocation. (line 6) +* displaying value of a symbolic link: readlink invocation. (line 6) +* division: Numeric expressions. (line 15) +* do nothing, successfully: true invocation. (line 6) +* do nothing, unsuccessfully: false invocation. (line 6) +* DOS file system: df invocation. (line 129) +* double spacing: pr invocation. (line 96) +* down columns: pr invocation. (line 70) +* dsusp: Characters. (line 53) +* dsync: dd invocation. (line 144) +* du: du invocation. (line 6) +* DU_BLOCK_SIZE: Block size. (line 12) +* ebcdic, converting to: dd invocation. (line 58) +* echo <1>: Local. (line 18) +* echo: echo invocation. (line 6) +* echoctl: Local. (line 51) +* echoe: Local. (line 22) +* echok: Local. (line 26) +* echoke: Local. (line 56) +* echonl: Local. (line 29) +* echoprt: Local. (line 46) +* effective uid and gid, printing: id invocation. (line 6) +* effective UID, printing: whoami invocation. (line 6) +* efs file system type: df invocation. (line 121) +* Eggert, Paul: Authors of get_date. (line 6) +* eight-bit characters <1>: Combination. (line 55) +* eight-bit characters: Control. (line 19) +* eight-bit input: Input. (line 23) +* ek: Combination. (line 22) +* empty files, creating: touch invocation. (line 18) +* empty lines, numbering: nl invocation. (line 87) +* entire files, output of: Output of entire files. + (line 6) +* env: env invocation. (line 6) +* environment variables, printing: printenv invocation. (line 6) +* environment, preserving: su invocation. (line 64) +* environment, printing: env invocation. (line 30) +* environment, running a program in a modified: env invocation. + (line 6) +* eof: Characters. (line 32) +* eol: Characters. (line 35) +* eol2: Characters. (line 38) +* epoch, for POSIX: Seconds since the Epoch. + (line 13) +* epoch, seconds since: Time directives. (line 39) +* equal string check: String tests. (line 22) +* equivalence classes: Character sets. (line 123) +* erase: Characters. (line 26) +* erasing data: shred invocation. (line 6) +* error messages, omitting <1>: chmod invocation. (line 34) +* error messages, omitting <2>: chgrp invocation. (line 23) +* error messages, omitting: chown invocation. (line 72) +* evaluation of expressions: expr invocation. (line 6) +* even parity: Control. (line 13) +* evenp: Combination. (line 9) +* exabyte, definition of: Block size. (line 116) +* examples of date: Examples of date. (line 6) +* examples of expr: Examples of expr. (line 6) +* exbibyte, definition of: Block size. (line 120) +* excl: dd invocation. (line 102) +* excluding files from du: du invocation. (line 138) +* executable file check: Access permission tests. + (line 24) +* executables and file type, marking: General output formatting. + (line 36) +* execute permission: Mode Structure. (line 14) +* execute permission, symbolic: Setting Permissions. (line 63) +* existence-of-file check: File characteristic tests. + (line 9) +* existing backup method: Backup options. (line 39) +* exit status commands: Conditions. (line 6) +* exit status of chroot: chroot invocation. (line 47) +* exit status of env: env invocation. (line 49) +* exit status of expr: expr invocation. (line 39) +* exit status of false: false invocation. (line 6) +* exit status of ls: ls invocation. (line 29) +* exit status of nice: nice invocation. (line 44) +* exit status of nohup: nohup invocation. (line 36) +* exit status of pathchk: pathchk invocation. (line 38) +* exit status of printenv: printenv invocation. (line 17) +* exit status of sort: sort invocation. (line 49) +* exit status of su: su invocation. (line 80) +* exit status of test: test invocation. (line 40) +* exit status of true: true invocation. (line 6) +* exit status of tty: tty invocation. (line 21) +* expand: expand invocation. (line 6) +* expr: expr invocation. (line 6) +* expression evaluation <1>: expr invocation. (line 6) +* expression evaluation: test invocation. (line 6) +* expressions, numeric: Numeric expressions. (line 6) +* expressions, string: String expressions. (line 6) +* extension, sorting files by: Sorting the output. (line 63) +* factor: factor invocation. (line 6) +* failure exit status: false invocation. (line 6) +* false: false invocation. (line 6) +* fascism: su invocation. (line 87) +* fdatasync: dd invocation. (line 116) +* ffN: Output. (line 63) +* field separator character: sort invocation. (line 207) +* fields, padding numeric: Padding. (line 6) +* FIFOs, creating: mkfifo invocation. (line 6) +* file attributes, changing: Changing file attributes. + (line 6) +* file characteristic tests: File characteristic tests. + (line 6) +* file contents, dumping unambiguously: od invocation. (line 6) +* file information, preserving: cp invocation. (line 130) +* file name manipulation: File name manipulation. + (line 6) +* file name pattern expansion, disabled: su invocation. (line 44) +* file names, checking validity and portability: pathchk invocation. + (line 6) +* file names, stripping directory and suffix: basename invocation. + (line 6) +* file offset radix: od invocation. (line 36) +* file ownership, changing: chown invocation. (line 6) +* file permissions, numeric: Numeric Modes. (line 6) +* file sizes: du invocation. (line 45) +* file space usage: du invocation. (line 6) +* file status: stat invocation. (line 6) +* file system disk usage: df invocation. (line 6) +* file system sizes: df invocation. (line 40) +* file system space, retrieving current data more slowly: df invocation. + (line 96) +* file system space, retrieving old data more quickly: df invocation. + (line 69) +* file system status: stat invocation. (line 6) +* file system types, limiting output to certain: df invocation. + (line 65) +* file system types, printing: df invocation. (line 109) +* file systems: stat invocation. (line 17) +* file systems and hard links: ln invocation. (line 6) +* file systems, omitting copying to different: cp invocation. (line 285) +* file timestamps, changing: touch invocation. (line 6) +* file type and executables, marking: General output formatting. + (line 36) +* file type tests: File type tests. (line 6) +* file type, marking: General output formatting. + (line 73) +* file types: Special file types. (line 9) +* file types, special: Special file types. (line 6) +* file utilities: Top. (line 19) +* files beginning with -, removing: rm invocation. (line 65) +* files, copying: cp invocation. (line 6) +* fingerprint, 128-bit: md5sum invocation. (line 6) +* first in date strings: General date syntax. (line 26) +* first part of files, outputting: head invocation. (line 6) +* flow control, hardware: Control. (line 36) +* flow control, software: Input. (line 43) +* flushing, disabling: Local. (line 32) +* fmt: fmt invocation. (line 6) +* fold: fold invocation. (line 6) +* folding long input lines: fold invocation. (line 6) +* footers, numbering: nl invocation. (line 17) +* force deletion: shred invocation. (line 91) +* formatting file contents: Formatting file contents. + (line 6) +* formatting of numbers in seq: seq invocation. (line 24) +* formatting times <1>: date invocation. (line 20) +* formatting times: pr invocation. (line 100) +* fortnight in date strings: Relative items in date strings. + (line 15) +* fsck: rm invocation. (line 25) +* fsync: dd invocation. (line 120) +* general date syntax: General date syntax. (line 6) +* general numeric sort: sort invocation. (line 87) +* get_date: Date input formats. (line 6) +* gibibyte, definition of: Block size. (line 99) +* gigabyte, definition of: Block size. (line 95) +* giving away permissions: Umask and Protection. + (line 12) +* globbing, disabled: su invocation. (line 44) +* GMT: Options for date. (line 84) +* grand total of disk space: du invocation. (line 50) +* graph: Character sets. (line 102) +* Greenwich Mean Time: Options for date. (line 84) +* group owner, default: Mode Structure. (line 27) +* group ownership of installed files, setting: install invocation. + (line 53) +* group ownership, changing <1>: chgrp invocation. (line 6) +* group ownership, changing: chown invocation. (line 6) +* group wheel, not supported: su invocation. (line 87) +* group, permissions for: Setting Permissions. (line 26) +* groups: groups invocation. (line 6) +* growing files: tail invocation. (line 41) +* hangups, immunity to: nohup invocation. (line 6) +* hard link check: File characteristic tests. + (line 23) +* hard link, defined: ln invocation. (line 32) +* hard links to directories: ln invocation. (line 61) +* hard links, counting in du: du invocation. (line 91) +* hard links, creating <1>: ln invocation. (line 6) +* hard links, creating: link invocation. (line 6) +* hard links, preserving: cp invocation. (line 89) +* hardware class: uname invocation. (line 39) +* hardware flow control: Control. (line 36) +* hardware platform: uname invocation. (line 34) +* hardware type: uname invocation. (line 39) +* hat notation for control characters: Local. (line 51) +* head: head invocation. (line 6) +* headers, numbering: nl invocation. (line 17) +* help, online: Common options. (line 29) +* hex dump of files: od invocation. (line 6) +* High Sierra file system: df invocation. (line 125) +* holes, copying files with: cp invocation. (line 205) +* HOME: su invocation. (line 18) +* horizontal, listing files: General output formatting. + (line 79) +* host processor type: uname invocation. (line 48) +* hostid: hostid invocation. (line 6) +* hostname <1>: hostname invocation. (line 6) +* hostname: uname invocation. (line 44) +* hour in date strings: Relative items in date strings. + (line 15) +* hsfs file system type: df invocation. (line 125) +* human-readable output <1>: du invocation. (line 75) +* human-readable output <2>: df invocation. (line 45) +* human-readable output <3>: What information is listed. + (line 116) +* human-readable output: Block size. (line 43) +* hup[cl]: Control. (line 23) +* hurd, author, printing: What information is listed. + (line 10) +* ibs: dd invocation. (line 25) +* icanon: Local. (line 11) +* icrnl: Input. (line 32) +* id: id invocation. (line 6) +* idle time: who invocation. (line 69) +* iexten: Local. (line 15) +* if: dd invocation. (line 17) +* iflag: dd invocation. (line 125) +* ignbrk: Input. (line 7) +* igncr: Input. (line 29) +* ignore file systems: df invocation. (line 32) +* ignoring case: sort invocation. (line 81) +* ignpar: Input. (line 13) +* imaxbel: Input. (line 56) +* immunity to hangups: nohup invocation. (line 6) +* implementation, hardware: uname invocation. (line 34) +* including files from du: du invocation. (line 62) +* indenting lines: pr invocation. (line 204) +* index: String expressions. (line 45) +* information, about current users: who invocation. (line 6) +* initial part of files, outputting: head invocation. (line 6) +* initial tabs, converting: expand invocation. (line 35) +* inlcr: Input. (line 26) +* inode number, printing: What information is listed. + (line 122) +* inode usage: df invocation. (line 54) +* inode, and hard links: ln invocation. (line 32) +* inodes, written buffered: sync invocation. (line 6) +* inpck: Input. (line 20) +* input block size: dd invocation. (line 25) +* input encoding, UTF-8: Input. (line 35) +* input settings: Input. (line 6) +* input tabs: pr invocation. (line 120) +* install: install invocation. (line 6) +* interactivity <1>: mv invocation. (line 64) +* interactivity: cp invocation. (line 178) +* intr: Characters. (line 20) +* invocation of commands, modified: Modified command invocation. + (line 6) +* isig: Local. (line 7) +* ISO 8601 date format: Calendar date items. (line 30) +* ISO/IEC 10646: printf invocation. (line 62) +* ispeed: Special. (line 16) +* istrip: Input. (line 23) +* items in date strings: General date syntax. (line 6) +* iterations, selecting the number of: shred invocation. (line 96) +* iuclc: Input. (line 48) +* iutf8: Input. (line 35) +* ixany: Input. (line 52) +* ixoff: Input. (line 43) +* ixon: Input. (line 38) +* join: join invocation. (line 6) +* kernel name: uname invocation. (line 61) +* kernel release: uname invocation. (line 57) +* kernel version: uname invocation. (line 72) +* kibibyte, definition of: Block size. (line 83) +* kibibytes for file sizes: du invocation. (line 85) +* kibibytes for file system sizes: df invocation. (line 59) +* kill <1>: kill invocation. (line 6) +* kill: Characters. (line 29) +* kilobyte, definition of: Block size. (line 78) +* Knuth, Donald E.: fmt invocation. (line 19) +* language, in dates: General date syntax. (line 40) +* last DAY <1>: Day of week items. (line 15) +* last DAY: Options for date. (line 11) +* last in date strings: General date syntax. (line 26) +* last part of files, outputting: tail invocation. (line 6) +* LC_ALL <1>: ls invocation. (line 17) +* LC_ALL: sort invocation. (line 40) +* LC_COLLATE <1>: Relations for expr. (line 22) +* LC_COLLATE <2>: join invocation. (line 11) +* LC_COLLATE <3>: comm invocation. (line 12) +* LC_COLLATE <4>: uniq invocation. (line 21) +* LC_COLLATE: sort invocation. (line 40) +* LC_CTYPE <1>: printf invocation. (line 62) +* LC_CTYPE: sort invocation. (line 70) +* LC_MESSAGES: pr invocation. (line 13) +* LC_NUMERIC <1>: printf invocation. (line 51) +* LC_NUMERIC <2>: sort invocation. (line 87) +* LC_NUMERIC: Block size. (line 57) +* LC_TIME <1>: date invocation. (line 11) +* LC_TIME <2>: Formatting file timestamps. + (line 30) +* LC_TIME <3>: sort invocation. (line 120) +* LC_TIME: pr invocation. (line 107) +* LCASE: Combination. (line 71) +* lcase: Combination. (line 71) +* lcase, converting to: dd invocation. (line 82) +* lchown <1>: chgrp invocation. (line 27) +* lchown: chown invocation. (line 99) +* leading directories, creating missing: install invocation. (line 44) +* leading directory components, stripping: basename invocation. + (line 6) +* left margin: pr invocation. (line 204) +* length: String expressions. (line 50) +* limiting output of du: du invocation. (line 106) +* line: Special. (line 37) +* line count: wc invocation. (line 6) +* line numbering: nl invocation. (line 6) +* line settings of terminal: stty invocation. (line 6) +* line-breaking: fmt invocation. (line 19) +* line-by-line comparison: comm invocation. (line 6) +* LINES: Special. (line 30) +* link: link invocation. (line 6) +* links, creating <1>: ln invocation. (line 6) +* links, creating: link invocation. (line 6) +* Linux file system types: df invocation. (line 121) +* literal directives: Literal directives. (line 6) +* litout: Combination. (line 59) +* ln: ln invocation. (line 6) +* ln format for nl: nl invocation. (line 98) +* lnext: Characters. (line 62) +* local file system types: df invocation. (line 121) +* local settings: Local. (line 6) +* logging out and continuing to run: nohup invocation. (line 6) +* logical and operator <1>: Relations for expr. (line 17) +* logical and operator: Connectives for test. + (line 12) +* logical connectives <1>: Relations for expr. (line 6) +* logical connectives: Connectives for test. + (line 6) +* logical or operator <1>: Relations for expr. (line 11) +* logical or operator: Connectives for test. + (line 15) +* logical pages, numbering on: nl invocation. (line 12) +* login name, printing: logname invocation. (line 6) +* login sessions, printing users with: users invocation. (line 6) +* login shell: su invocation. (line 18) +* login shell, creating: su invocation. (line 53) +* login time: who invocation. (line 11) +* LOGNAME: su invocation. (line 18) +* logname: logname invocation. (line 6) +* long ls format: What information is listed. + (line 130) +* lower: Character sets. (line 105) +* lowercase, translating to output: Output. (line 12) +* ls: ls invocation. (line 6) +* LS_BLOCK_SIZE: Block size. (line 12) +* LS_COLORS: dircolors invocation. + (line 16) +* machine type: uname invocation. (line 39) +* machine-readable stty output: stty invocation. (line 41) +* MacKenzie, D.: Introduction. (line 19) +* MacKenzie, David: Authors of get_date. (line 6) +* Makefiles, installing programs in: install invocation. (line 26) +* manipulating files: Basic operations. (line 6) +* manipulation of file names: File name manipulation. + (line 6) +* match: String expressions. (line 36) +* matching patterns: String expressions. (line 11) +* md5sum: md5sum invocation. (line 6) +* mebibyte, definition of: Block size. (line 92) +* megabyte, definition of: Block size. (line 88) +* merging files: paste invocation. (line 6) +* merging files in parallel: pr invocation. (line 6) +* merging sorted files: sort invocation. (line 23) +* message status: who invocation. (line 93) +* message-digest, 128-bit: md5sum invocation. (line 6) +* Meyering, J.: Introduction. (line 19) +* Meyering, Jim: Authors of get_date. (line 6) +* midnight in date strings: Time of day items. (line 21) +* min: Special. (line 7) +* minute in date strings: Relative items in date strings. + (line 15) +* minutes, time zone correction by: Time of day items. (line 29) +* MIT AI lab: su invocation. (line 92) +* mkdir: mkdir invocation. (line 6) +* mkfifo: mkfifo invocation. (line 6) +* mknod: mknod invocation. (line 6) +* modem control: Control. (line 33) +* modes and umask: Umask and Protection. + (line 6) +* modes of created directories, setting: mkdir invocation. (line 24) +* modes of created FIFOs, setting: mkfifo invocation. (line 21) +* modification time, sorting files by: Sorting the output. (line 37) +* modified command invocation: Modified command invocation. + (line 6) +* modified environment, running a program in a: env invocation. + (line 6) +* modify time, changing: touch invocation. (line 77) +* modifying scheduling priority: nice invocation. (line 6) +* month in date strings: Relative items in date strings. + (line 15) +* month names in date strings: Calendar date items. (line 38) +* months, sorting by: sort invocation. (line 120) +* months, written-out: General date syntax. (line 36) +* MS-DOS file system: df invocation. (line 129) +* mtime, changing: touch invocation. (line 77) +* multicolumn output, generating: pr invocation. (line 6) +* multiple changes to permissions: Multiple Changes. (line 6) +* multiplication: Numeric expressions. (line 15) +* multipliers after numbers: dd invocation. (line 175) +* mv: mv invocation. (line 6) +* name follow option: tail invocation. (line 41) +* name of kernel: uname invocation. (line 61) +* named pipe check: File type tests. (line 28) +* named pipes, creating: mkfifo invocation. (line 6) +* network node name: uname invocation. (line 44) +* newer files, copying only: cp invocation. (line 265) +* newer files, moving only: mv invocation. (line 72) +* newer-than file check: File characteristic tests. + (line 15) +* newline echoing after kill: Local. (line 26) +* newline, echoing: Local. (line 29) +* newline, translating to crlf: Output. (line 19) +* newline, translating to return: Input. (line 26) +* next DAY <1>: Day of week items. (line 15) +* next DAY: Options for date. (line 11) +* next in date strings: General date syntax. (line 26) +* NFS file system type: df invocation. (line 116) +* NFS mounts from BSD to HP-UX <1>: du invocation. (line 149) +* NFS mounts from BSD to HP-UX: What information is listed. + (line 197) +* nice: nice invocation. (line 6) +* nice value: nice invocation. (line 6) +* nl <1>: Combination. (line 18) +* nl: nl invocation. (line 6) +* nlN: Output. (line 39) +* no-op: true invocation. (line 6) +* nocreat: dd invocation. (line 98) +* noctty: dd invocation. (line 161) +* node name: uname invocation. (line 44) +* noerror: dd invocation. (line 95) +* noflsh: Local. (line 32) +* nofollow: dd invocation. (line 158) +* nohup: nohup invocation. (line 6) +* nohup.out: nohup invocation. (line 6) +* non-directories, copying as special files: cp invocation. (line 76) +* non-directory suffix, stripping: dirname invocation. (line 6) +* nonblock: dd invocation. (line 155) +* nonblocking I/O: dd invocation. (line 155) +* none backup method: Backup options. (line 31) +* none color option: General output formatting. + (line 23) +* none, sorting option for ls: Sorting the output. (line 49) +* nonempty file check: File characteristic tests. + (line 12) +* nonprinting characters, ignoring: sort invocation. (line 114) +* nonzero-length string check: String tests. (line 19) +* noon in date strings: Time of day items. (line 21) +* not-equal string check: String tests. (line 25) +* notrunc: dd invocation. (line 108) +* now in date strings: Relative items in date strings. + (line 33) +* numbered backup method: Backup options. (line 35) +* numbering lines: nl invocation. (line 6) +* numbers, written-out: General date syntax. (line 26) +* numeric expressions: Numeric expressions. (line 6) +* numeric field padding: Padding. (line 6) +* numeric modes: Numeric Modes. (line 6) +* numeric operations: Numeric operations. (line 6) +* numeric sequences: seq invocation. (line 6) +* numeric sort: sort invocation. (line 128) +* numeric tests: Numeric tests. (line 6) +* numeric uid and gid: What information is listed. + (line 179) +* obs: dd invocation. (line 28) +* ocrnl: Output. (line 16) +* octal dump of files: od invocation. (line 6) +* octal numbers for file modes: Numeric Modes. (line 6) +* od: od invocation. (line 6) +* odd parity: Control. (line 13) +* oddp: Combination. (line 14) +* of: dd invocation. (line 20) +* ofdel: Output. (line 34) +* ofill: Output. (line 30) +* oflag: dd invocation. (line 129) +* olcuc: Output. (line 12) +* older-than file check: File characteristic tests. + (line 19) +* one file system, restricting du to: du invocation. (line 134) +* one-line output format: df invocation. (line 76) +* onlcr: Output. (line 19) +* onlret: Output. (line 27) +* onocr: Output. (line 23) +* operating on characters: Operating on characters. + (line 6) +* operating on sorted files: Operating on sorted files. + (line 6) +* operating system name: uname invocation. (line 53) +* opost: Output. (line 9) +* option delimiter: Common options. (line 36) +* options for date: Options for date. (line 6) +* or operator <1>: Relations for expr. (line 11) +* or operator: Connectives for test. + (line 15) +* ordinal numbers: General date syntax. (line 26) +* ospeed: Special. (line 19) +* other permissions: Setting Permissions. (line 29) +* output block size: dd invocation. (line 28) +* output file name prefix <1>: csplit invocation. (line 62) +* output file name prefix: split invocation. (line 14) +* output file name suffix: csplit invocation. (line 66) +* output format: stat invocation. (line 33) +* output format, portable: df invocation. (line 76) +* output NUL-terminated lines: du invocation. (line 112) +* output of entire files: Output of entire files. + (line 6) +* output of parts of files: Output of parts of files. + (line 6) +* output settings: Output. (line 6) +* output tabs: pr invocation. (line 140) +* overwriting of input, allowed: sort invocation. (line 171) +* owned by effective gid check: Access permission tests. + (line 31) +* owned by effective uid check: Access permission tests. + (line 28) +* owner of file, permissions for: Setting Permissions. (line 23) +* owner, default: Mode Structure. (line 27) +* ownership of installed files, setting: install invocation. (line 68) +* p for FIFO file: mknod invocation. (line 23) +* pad character: Output. (line 34) +* pad instead of timing for delaying: Output. (line 30) +* padding of numeric fields: Padding. (line 6) +* paragraphs, reformatting: fmt invocation. (line 6) +* parenb: Control. (line 9) +* parent directories and cp: cp invocation. (line 167) +* parent directories, creating: mkdir invocation. (line 31) +* parent directories, creating missing: install invocation. (line 44) +* parent directories, removing: rmdir invocation. (line 22) +* parentheses for grouping: expr invocation. (line 31) +* parity: Combination. (line 10) +* parity errors, marking: Input. (line 16) +* parity, ignoring: Input. (line 13) +* parmrk: Input. (line 16) +* parodd: Control. (line 13) +* parsing date strings: Options for date. (line 11) +* parts of files, output of: Output of parts of files. + (line 6) +* pass8: Combination. (line 55) +* passwd entry, and su shell: su invocation. (line 12) +* paste: paste invocation. (line 6) +* Paterson, R.: Introduction. (line 19) +* PATH <1>: su invocation. (line 53) +* PATH: env invocation. (line 24) +* pathchk: pathchk invocation. (line 6) +* pattern matching: String expressions. (line 11) +* PC file system: df invocation. (line 129) +* pcfs: df invocation. (line 129) +* pebibyte, definition of: Block size. (line 113) +* permission tests: Access permission tests. + (line 6) +* permissions of installed files, setting: install invocation. + (line 59) +* permissions, changing access: chmod invocation. (line 6) +* permissions, copying existing: Copying Permissions. (line 6) +* permissions, for changing file timestamps: touch invocation. + (line 20) +* permissions, output by ls: What information is listed. + (line 148) +* petabyte, definition of: Block size. (line 109) +* phone directory order: sort invocation. (line 75) +* pieces, splitting a file into: split invocation. (line 6) +* Pinard, F. <1>: Authors of get_date. (line 14) +* Pinard, F.: Introduction. (line 19) +* pipe fitting: tee invocation. (line 6) +* Plass, Michael F.: fmt invocation. (line 19) +* platform, hardware: uname invocation. (line 34) +* pm in date strings: Time of day items. (line 21) +* portable file names, checking for: pathchk invocation. (line 6) +* portable output format: df invocation. (line 76) +* POSIX: Introduction. (line 11) +* POSIX output format: df invocation. (line 76) +* POSIXLY_CORRECT <1>: printf invocation. (line 42) +* POSIXLY_CORRECT <2>: echo invocation. (line 68) +* POSIXLY_CORRECT <3>: sort invocation. (line 179) +* POSIXLY_CORRECT <4>: pr invocation. (line 107) +* POSIXLY_CORRECT <5>: Standards conformance. + (line 6) +* POSIXLY_CORRECT: Common options. (line 11) +* POSIXLY_CORRECT, and block size: Block size. (line 12) +* pr: pr invocation. (line 6) +* prime factors: factor invocation. (line 6) +* print: Character sets. (line 108) +* print name of current directory: pwd invocation. (line 6) +* print system information: uname invocation. (line 6) +* print terminal file name: tty invocation. (line 6) +* printenv: printenv invocation. (line 6) +* printf: printf invocation. (line 6) +* printing all or some environment variables: printenv invocation. + (line 6) +* printing color database: dircolors invocation. + (line 38) +* printing current user information: who invocation. (line 6) +* printing current usernames: users invocation. (line 6) +* printing groups a user is in: groups invocation. (line 6) +* printing real and effective uid and gid: id invocation. (line 6) +* printing text: echo invocation. (line 6) +* printing text, commands for: Printing text. (line 6) +* printing the current time: date invocation. (line 6) +* printing the effective UID: whoami invocation. (line 6) +* printing the host identifier: hostid invocation. (line 6) +* printing the hostname: hostname invocation. (line 6) +* printing user's login name: logname invocation. (line 6) +* printing, preparing files for: pr invocation. (line 6) +* priority, modifying: nice invocation. (line 6) +* processes, commands for controlling: Process control. (line 6) +* prompting, and ln: ln invocation. (line 71) +* prompting, and mv: mv invocation. (line 34) +* prompting, and rm: rm invocation. (line 11) +* prompts, forcing: mv invocation. (line 59) +* prompts, omitting: mv invocation. (line 55) +* prterase: Local. (line 46) +* ptx: ptx invocation. (line 6) +* punct: Character sets. (line 111) +* pure numbers in date strings: Pure numbers in date strings. + (line 6) +* pwd: pwd invocation. (line 6) +* quit: Characters. (line 23) +* quoting style: Formatting the file names. + (line 34) +* radix for file offsets: od invocation. (line 36) +* ranges: Character sets. (line 46) +* raw: Combination. (line 43) +* read errors, ignoring: dd invocation. (line 95) +* read from stdin and write to stdout and files: tee invocation. + (line 6) +* read permission: Mode Structure. (line 8) +* read permission, symbolic: Setting Permissions. (line 57) +* read system call, and holes: cp invocation. (line 205) +* readable file check: Access permission tests. + (line 15) +* readlink: readlink invocation. (line 6) +* real uid and gid, printing: id invocation. (line 6) +* recursive directory listing: Which files are listed. + (line 84) +* recursively changing access permissions: chmod invocation. (line 58) +* recursively changing file ownership: chown invocation. (line 136) +* recursively changing group ownership: chgrp invocation. (line 63) +* recursively copying directories: cp invocation. (line 76) +* redirection: Redirection. (line 6) +* reformatting paragraph text: fmt invocation. (line 6) +* regular expression matching: String expressions. (line 11) +* regular file check: File type tests. (line 19) +* relations, numeric or string: Relations for expr. (line 6) +* relative items in date strings: Relative items in date strings. + (line 6) +* release of kernel: uname invocation. (line 57) +* remainder: Numeric expressions. (line 15) +* remote hostname: who invocation. (line 11) +* removing empty directories: rmdir invocation. (line 6) +* removing files after shredding: shred invocation. (line 109) +* removing files or directories: rm invocation. (line 6) +* removing files or directories (via the unlink syscall): unlink invocation. + (line 6) +* removing permissions: Setting Permissions. (line 42) +* repeated characters: Character sets. (line 67) +* repeated lines, outputting: uniq invocation. (line 61) +* repeated output of a string: yes invocation. (line 6) +* restricted deletion flag: Mode Structure. (line 47) +* restricted shell: su invocation. (line 64) +* return, ignoring: Input. (line 29) +* return, translating to newline <1>: Output. (line 16) +* return, translating to newline: Input. (line 32) +* reverse sorting <1>: Sorting the output. (line 28) +* reverse sorting: sort invocation. (line 155) +* reversing files: tac invocation. (line 6) +* rm: rm invocation. (line 6) +* rmdir: rmdir invocation. (line 6) +* rn format for nl: nl invocation. (line 101) +* root as default owner: install invocation. (line 68) +* root directory, allow recursive destruction: rm invocation. (line 52) +* root directory, allow recursive modification <1>: chmod invocation. + (line 43) +* root directory, allow recursive modification <2>: chgrp invocation. + (line 45) +* root directory, allow recursive modification: chown invocation. + (line 117) +* root directory, disallow recursive destruction: rm invocation. + (line 47) +* root directory, disallow recursive modification <1>: chmod invocation. + (line 38) +* root directory, disallow recursive modification <2>: chgrp invocation. + (line 40) +* root directory, disallow recursive modification: chown invocation. + (line 112) +* root directory, running a program in a specified: chroot invocation. + (line 6) +* root, becoming: su invocation. (line 6) +* rows: Special. (line 22) +* rprnt: Characters. (line 56) +* RTS/CTS flow control: Control. (line 36) +* running a program in a modified environment: env invocation. + (line 6) +* running a program in a specified root directory: chroot invocation. + (line 6) +* rz format for nl: nl invocation. (line 104) +* Salz, Rich: Authors of get_date. (line 6) +* same file check: File characteristic tests. + (line 23) +* sane: Combination. (line 26) +* scheduling priority, modifying: nice invocation. (line 6) +* screen columns: fold invocation. (line 14) +* seconds since the epoch: Time directives. (line 39) +* section delimiters of pages: nl invocation. (line 68) +* seek: dd invocation. (line 41) +* self-backups: cp invocation. (line 42) +* send a signal to processes: kill invocation. (line 6) +* sentences and line-breaking: fmt invocation. (line 19) +* separator for numbers in seq: seq invocation. (line 30) +* seq: seq invocation. (line 6) +* sequence of numbers: seq invocation. (line 6) +* set-group-id check: Access permission tests. + (line 9) +* set-user-id check: Access permission tests. + (line 18) +* setgid: Mode Structure. (line 41) +* setting permissions: Setting Permissions. (line 46) +* setting the hostname: hostname invocation. (line 6) +* setting the time: Setting the time. (line 6) +* setuid: Mode Structure. (line 38) +* setup for color: dircolors invocation. + (line 6) +* sh syntax for color setup: dircolors invocation. + (line 27) +* SHELL: su invocation. (line 18) +* SHELL environment variable, and color: dircolors invocation. + (line 16) +* shell utilities: Top. (line 19) +* shred: shred invocation. (line 6) +* SI output <1>: du invocation. (line 118) +* SI output <2>: df invocation. (line 89) +* SI output <3>: What information is listed. + (line 205) +* SI output: Block size. (line 43) +* simple backup method: Backup options. (line 44) +* SIMPLE_BACKUP_SUFFIX: Backup options. (line 50) +* single-column output of files: General output formatting. + (line 10) +* size: Special. (line 30) +* size for main memory sorting: sort invocation. (line 191) +* size of file to shred: shred invocation. (line 103) +* size of files, reporting: What information is listed. + (line 189) +* size of files, sorting files by: Sorting the output. (line 33) +* skip: dd invocation. (line 38) +* sleep: sleep invocation. (line 6) +* socket check: File type tests. (line 31) +* software flow control: Input. (line 43) +* sort: sort invocation. (line 6) +* sort field: sort invocation. (line 163) +* sort stability: sort invocation. (line 29) +* sort zero-terminated lines: sort invocation. (line 247) +* sort's last-resort comparison: sort invocation. (line 29) +* sorted files, operations on: Operating on sorted files. + (line 6) +* sorting files: sort invocation. (line 6) +* sorting ls output: Sorting the output. (line 6) +* space: Character sets. (line 114) +* sparse files, copying: cp invocation. (line 205) +* special characters: Characters. (line 6) +* special file types: Special file types. (line 6) +* special files: mknod invocation. (line 11) +* special settings: Special. (line 6) +* specifying sets of characters: Character sets. (line 6) +* speed: Special. (line 40) +* split: split invocation. (line 6) +* splitting a file into pieces: split invocation. (line 6) +* splitting a file into pieces by context: csplit invocation. (line 6) +* squeezing blank lines: cat invocation. (line 58) +* squeezing repeat characters: Squeezing. (line 6) +* Stallman, R.: Introduction. (line 19) +* standard input: Common options. (line 41) +* standard output: Common options. (line 41) +* start: Characters. (line 44) +* stat: stat invocation. (line 6) +* status time, printing or sorting by: Sorting the output. (line 14) +* sticky: Mode Structure. (line 47) +* sticky bit check: Access permission tests. + (line 12) +* stop: Characters. (line 47) +* stop bits: Control. (line 27) +* strftime and date: date invocation. (line 20) +* string constants, outputting: od invocation. (line 68) +* string expressions: String expressions. (line 6) +* string tests: String tests. (line 6) +* strip directory and suffix from file names: basename invocation. + (line 6) +* stripping non-directory suffix: dirname invocation. (line 6) +* stripping symbol table information: install invocation. (line 84) +* stripping trailing slashes <1>: mv invocation. (line 85) +* stripping trailing slashes: cp invocation. (line 238) +* stty: stty invocation. (line 6) +* su: su invocation. (line 6) +* substitute user and group ids: su invocation. (line 6) +* substr: String expressions. (line 40) +* subtracting permissions: Setting Permissions. (line 42) +* subtraction: Numeric expressions. (line 11) +* successful exit: true invocation. (line 6) +* suffix, stripping from file names: basename invocation. (line 6) +* sum: sum invocation. (line 6) +* summarizing files: Summarizing files. (line 6) +* super-user, becoming: su invocation. (line 6) +* superblock, writing: sync invocation. (line 6) +* supplementary groups, printing: groups invocation. (line 6) +* susp: Characters. (line 50) +* swab (byte-swapping): dd invocation. (line 90) +* swap space, saving text image in: Mode Structure. (line 47) +* swtch: Characters. (line 41) +* symbol table information, stripping: install invocation. (line 84) +* symbolic (soft) links, creating: ln invocation. (line 6) +* symbolic link check: File type tests. (line 23) +* symbolic link to directory, controlling traversal of: Traversing symlinks. + (line 6) +* symbolic link to directory, never traverse <1>: chgrp invocation. + (line 76) +* symbolic link to directory, never traverse <2>: chown invocation. + (line 148) +* symbolic link to directory, never traverse: Traversing symlinks. + (line 26) +* symbolic link to directory, traverse each that is encountered <1>: chgrp invocation. + (line 72) +* symbolic link to directory, traverse each that is encountered <2>: chown invocation. + (line 144) +* symbolic link to directory, traverse each that is encountered: Traversing symlinks. + (line 22) +* symbolic link to directory, traverse each that is specified on the command line <1>: chgrp invocation. + (line 67) +* symbolic link to directory, traverse each that is specified on the command line <2>: chown invocation. + (line 139) +* symbolic link to directory, traverse each that is specified on the command line: Traversing symlinks. + (line 18) +* symbolic link, defined: ln invocation. (line 40) +* symbolic links and pwd: pwd invocation. (line 6) +* symbolic links, changing group: chgrp invocation. (line 32) +* symbolic links, changing owner <1>: chgrp invocation. (line 27) +* symbolic links, changing owner: chown invocation. (line 76) +* symbolic links, copying: cp invocation. (line 89) +* symbolic links, copying with: cp invocation. (line 243) +* symbolic links, dereferencing: Which files are listed. + (line 36) +* symbolic links, dereferencing in du: du invocation. (line 96) +* symbolic links, dereferencing in stat: stat invocation. (line 22) +* symbolic links, following: dd invocation. (line 158) +* symbolic links, permissions of: chmod invocation. (line 10) +* symbolic modes: Symbolic Modes. (line 6) +* sync <1>: sync invocation. (line 6) +* sync: dd invocation. (line 152) +* sync (padding with nulls): dd invocation. (line 111) +* synchronize disk and memory: sync invocation. (line 6) +* synchronized data and metadata I/O: dd invocation. (line 152) +* synchronized data and metadata writes, before finishing: dd invocation. + (line 120) +* synchronized data reads: dd invocation. (line 144) +* synchronized data writes, before finishing: dd invocation. (line 116) +* syslog: su invocation. (line 29) +* system context: System context. (line 6) +* system information, printing: uname invocation. (line 6) +* system name, printing: hostname invocation. (line 6) +* System V sum: sum invocation. (line 31) +* tab stops, setting: expand invocation. (line 22) +* tabN: Output. (line 51) +* tabs: Combination. (line 66) +* tabs to spaces, converting: expand invocation. (line 6) +* tac: tac invocation. (line 6) +* tagged paragraphs: fmt invocation. (line 40) +* tail: tail invocation. (line 6) +* tandem: Input. (line 43) +* target directory <1>: ln invocation. (line 105) +* target directory <2>: mv invocation. (line 95) +* target directory <3>: install invocation. (line 93) +* target directory <4>: cp invocation. (line 256) +* target directory: Target directory. (line 6) +* tebibyte, definition of: Block size. (line 106) +* tee: tee invocation. (line 6) +* telephone directory order: sort invocation. (line 75) +* temporary directory: sort invocation. (line 224) +* terabyte, definition of: Block size. (line 102) +* TERM: su invocation. (line 53) +* terminal check: File type tests. (line 34) +* terminal file name, printing: tty invocation. (line 6) +* terminal lines, currently used: who invocation. (line 11) +* terminal settings: stty invocation. (line 6) +* terminal, using color iff: General output formatting. + (line 25) +* terse output: stat invocation. (line 28) +* test: test invocation. (line 6) +* text image, saving in swap space: Mode Structure. (line 47) +* text input files: md5sum invocation. (line 63) +* text utilities: Top. (line 19) +* text, displaying: echo invocation. (line 6) +* text, reformatting: fmt invocation. (line 6) +* this in date strings: Relative items in date strings. + (line 33) +* time <1>: Special. (line 11) +* time: touch invocation. (line 62) +* time directives: Time directives. (line 6) +* time formats <1>: date invocation. (line 20) +* time formats: pr invocation. (line 100) +* time of day item: Time of day items. (line 6) +* time setting: Setting the time. (line 6) +* time style: Formatting file timestamps. + (line 26) +* time units: sleep invocation. (line 11) +* time zone correction: Time of day items. (line 29) +* time zone item <1>: Time zone items. (line 6) +* time zone item: General date syntax. (line 44) +* time, printing or setting: date invocation. (line 6) +* TIME_STYLE: Formatting file timestamps. + (line 106) +* timestamps of installed files, preserving: install invocation. + (line 74) +* timestamps, changing file: touch invocation. (line 6) +* TMPDIR: sort invocation. (line 55) +* today in date strings: Relative items in date strings. + (line 33) +* tomorrow: Options for date. (line 11) +* tomorrow in date strings: Relative items in date strings. + (line 29) +* topological sort: tsort invocation. (line 6) +* tostop: Local. (line 41) +* total counts: wc invocation. (line 12) +* touch: touch invocation. (line 6) +* tr: tr invocation. (line 6) +* trailing slashes: Trailing slashes. (line 6) +* translating characters: Translating. (line 6) +* true: true invocation. (line 6) +* truncating output file, avoiding: dd invocation. (line 108) +* tsort: tsort invocation. (line 6) +* tty: tty invocation. (line 6) +* Twenex: su invocation. (line 92) +* two-way parity: Control. (line 9) +* type size: od invocation. (line 112) +* TZ <1>: Specifying time zone rules. + (line 6) +* TZ <2>: Options for date. (line 84) +* TZ <3>: date invocation. (line 16) +* TZ <4>: who invocation. (line 26) +* TZ <5>: stat invocation. (line 111) +* TZ <6>: touch invocation. (line 41) +* TZ <7>: Formatting file timestamps. + (line 18) +* TZ: pr invocation. (line 113) +* u, and disabling special characters: Characters. (line 13) +* ucase, converting to: dd invocation. (line 85) +* ufs file system type: df invocation. (line 121) +* umask and modes: Umask and Protection. + (line 6) +* uname: uname invocation. (line 6) +* unblock: dd invocation. (line 76) +* unexpand: unexpand invocation. (line 6) +* Unicode: printf invocation. (line 62) +* uniq: uniq invocation. (line 6) +* unique lines, outputting: uniq invocation. (line 96) +* uniquify files: uniq invocation. (line 6) +* uniquifying output: sort invocation. (line 233) +* unlink <1>: unlink invocation. (line 6) +* unlink: rm invocation. (line 25) +* unprintable characters, ignoring: sort invocation. (line 114) +* unsorted directory listing: Sorting the output. (line 21) +* upper: Character sets. (line 117) +* uppercase, translating to lowercase: Input. (line 48) +* use time, changing: touch invocation. (line 54) +* use time, printing or sorting files by: Sorting the output. (line 14) +* USER: su invocation. (line 18) +* user id, switching: su invocation. (line 6) +* user information, commands for: User information. (line 6) +* user name, printing: logname invocation. (line 6) +* usernames, printing current: users invocation. (line 6) +* users: users invocation. (line 6) +* UTC: Options for date. (line 84) +* utmp <1>: who invocation. (line 15) +* utmp <2>: users invocation. (line 14) +* utmp: logname invocation. (line 6) +* valid file names, checking for: pathchk invocation. (line 6) +* vdir: vdir invocation. (line 6) +* verbose ls format: What information is listed. + (line 130) +* verifying MD5 checksums: md5sum invocation. (line 53) +* version number, finding: Common options. (line 33) +* version of kernel: uname invocation. (line 72) +* version, sorting option for ls: Sorting the output. (line 56) +* version-control Emacs variable: Backup options. (line 24) +* VERSION_CONTROL <1>: ln invocation. (line 55) +* VERSION_CONTROL <2>: mv invocation. (line 50) +* VERSION_CONTROL <3>: install invocation. (line 36) +* VERSION_CONTROL <4>: cp invocation. (line 61) +* VERSION_CONTROL: Backup options. (line 13) +* vertical sorted files in columns: General output formatting. + (line 15) +* vtN: Output. (line 59) +* wc: wc invocation. (line 6) +* week in date strings: Relative items in date strings. + (line 15) +* werase: Characters. (line 59) +* wheel group, not supported: su invocation. (line 87) +* who: who invocation. (line 6) +* who am i: who invocation. (line 21) +* whoami: whoami invocation. (line 6) +* word count: wc invocation. (line 6) +* working context: Working context. (line 6) +* working directory, printing: pwd invocation. (line 6) +* wrapping long input lines: fold invocation. (line 6) +* writable file check: Access permission tests. + (line 21) +* write permission: Mode Structure. (line 11) +* write permission, symbolic: Setting Permissions. (line 60) +* write, allowed: who invocation. (line 93) +* wtmp <1>: who invocation. (line 15) +* wtmp: users invocation. (line 14) +* xcase: Local. (line 36) +* xdigit: Character sets. (line 120) +* XON/XOFF flow control: Input. (line 38) +* year in date strings: Relative items in date strings. + (line 15) +* yes: yes invocation. (line 6) +* yesterday: Options for date. (line 11) +* yesterday in date strings: Relative items in date strings. + (line 29) +* yottabyte, definition of: Block size. (line 131) +* Youmans, B.: Introduction. (line 19) +* zero-length string check: String tests. (line 15) +* zettabyte, definition of: Block size. (line 123) +* |: Relations for expr. (line 11) + + + +Tag Table: +Node: Top7431 +Node: Introduction20029 +Node: Common options21588 +Node: Exit status24237 +Node: Backup options24967 +Node: Block size27032 +Node: Target directory31936 +Node: Trailing slashes35417 +Node: Traversing symlinks36438 +Node: Treating / specially37509 +Ref: Treating / specially-Footnote-138775 +Node: Special built-in utilities38844 +Node: Standards conformance39977 +Node: Output of entire files41486 +Node: cat invocation42019 +Node: tac invocation44722 +Node: nl invocation45984 +Node: od invocation49863 +Node: Formatting file contents56327 +Node: fmt invocation56778 +Node: pr invocation59591 +Node: fold invocation72682 +Node: Output of parts of files74191 +Node: head invocation74699 +Node: tail invocation76268 +Node: split invocation83175 +Node: csplit invocation85305 +Node: Summarizing files89417 +Node: wc invocation89945 +Node: sum invocation91947 +Node: cksum invocation93352 +Node: md5sum invocation94492 +Node: Operating on sorted files97839 +Node: sort invocation98443 +Ref: sort invocation-Footnote-1115516 +Node: uniq invocation116068 +Node: comm invocation119969 +Node: tsort invocation121297 +Node: tsort background124331 +Node: ptx invocation126094 +Node: General options in ptx128898 +Node: Charset selection in ptx129610 +Node: Input processing in ptx130512 +Node: Output formatting in ptx136206 +Node: Compatibility in ptx142772 +Node: Operating on fields within a line146000 +Node: cut invocation146404 +Node: paste invocation149730 +Node: join invocation151058 +Node: Operating on characters154957 +Node: tr invocation155393 +Node: Character sets157111 +Node: Translating161339 +Node: Squeezing163430 +Node: expand invocation166497 +Node: unexpand invocation168070 +Node: Directory listing169932 +Node: ls invocation170418 +Ref: ls invocation-Footnote-1172232 +Node: Which files are listed172454 +Node: What information is listed175819 +Node: Sorting the output183659 +Node: More details about version sort185979 +Node: General output formatting187478 +Node: Formatting file timestamps190887 +Node: Formatting the file names196117 +Node: dir invocation199032 +Node: vdir invocation199467 +Node: dircolors invocation199869 +Node: Basic operations201349 +Node: cp invocation201969 +Node: dd invocation213682 +Node: install invocation220670 +Node: mv invocation224764 +Node: rm invocation229008 +Node: shred invocation231845 +Node: Special file types238658 +Node: link invocation240154 +Node: ln invocation241160 +Node: mkdir invocation246082 +Node: mkfifo invocation247662 +Node: mknod invocation248651 +Node: readlink invocation250394 +Node: rmdir invocation252135 +Node: unlink invocation253409 +Node: Changing file attributes254368 +Node: chown invocation255181 +Node: chgrp invocation260951 +Node: chmod invocation263705 +Node: touch invocation265879 +Node: Disk usage269992 +Node: df invocation270684 +Node: du invocation275981 +Node: stat invocation281634 +Node: sync invocation284705 +Node: Printing text285632 +Node: echo invocation286006 +Node: printf invocation288183 +Node: yes invocation292890 +Node: Conditions293502 +Node: false invocation294093 +Node: true invocation294838 +Node: test invocation296149 +Node: File type tests298109 +Node: Access permission tests298991 +Node: File characteristic tests299876 +Node: String tests300641 +Node: Numeric tests301306 +Node: Connectives for test302103 +Node: expr invocation302456 +Node: String expressions304694 +Node: Numeric expressions307277 +Node: Relations for expr307915 +Node: Examples of expr309115 +Node: Redirection309843 +Node: tee invocation310288 +Node: File name manipulation311353 +Node: basename invocation311801 +Node: dirname invocation312475 +Node: pathchk invocation313111 +Node: Working context314464 +Node: pwd invocation315108 +Node: stty invocation315782 +Node: Control318542 +Node: Input319302 +Node: Output320778 +Node: Local322034 +Node: Combination323616 +Node: Characters325778 +Node: Special327332 +Node: printenv invocation328698 +Node: tty invocation329461 +Node: User information330167 +Node: id invocation330819 +Node: logname invocation332069 +Node: whoami invocation332696 +Node: groups invocation333183 +Node: users invocation333907 +Node: who invocation334854 +Node: System context337735 +Node: date invocation338225 +Node: Time directives339849 +Node: Date directives341191 +Node: Literal directives343462 +Node: Padding343749 +Node: Setting the time344568 +Node: Options for date345558 +Node: Examples of date348596 +Ref: %s-examples350056 +Node: uname invocation352043 +Node: hostname invocation354283 +Node: hostid invocation354896 +Node: Modified command invocation355583 +Node: chroot invocation356220 +Node: env invocation358340 +Node: nice invocation360419 +Node: nohup invocation363457 +Node: su invocation365140 +Node: Process control369611 +Node: kill invocation369834 +Node: Delaying374200 +Node: sleep invocation374397 +Node: Numeric operations375208 +Node: factor invocation375540 +Node: seq invocation376878 +Node: File permissions380699 +Node: Mode Structure381293 +Node: Symbolic Modes384427 +Node: Setting Permissions385436 +Node: Copying Permissions387987 +Node: Changing Special Permissions388789 +Node: Conditional Executability390425 +Node: Multiple Changes391058 +Node: Umask and Protection392722 +Node: Numeric Modes393827 +Node: Date input formats395636 +Node: General date syntax397989 +Node: Calendar date items400702 +Node: Time of day items402707 +Node: Time zone items404767 +Node: Day of week items406009 +Node: Relative items in date strings407006 +Node: Pure numbers in date strings409816 +Node: Seconds since the Epoch410805 +Node: Specifying time zone rules412438 +Node: Authors of get_date414810 +Node: Opening the software toolbox415570 +Node: Toolbox introduction416242 +Node: I/O redirection418965 +Node: The who command421799 +Node: The cut command422696 +Node: The sort command423759 +Node: The uniq command424463 +Node: Putting the tools together425153 +Ref: Putting the tools together-Footnote-1437110 +Node: GNU Free Documentation License437184 +Node: How to use this License for your documents455693 +Node: Index457100 + +End Tag Table diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/ChangeLog new file mode 100644 index 0000000..6a33a3f --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/ChangeLog @@ -0,0 +1,5709 @@ +2005-01-04 Paul Eggert + + * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional + definitions to be after all include files, to avoid collisions. + Problem reported by Bob Proulx. + +2005-01-04 Bob Proulx + + * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify + offsetof() macro construct to avoid compile failure with native HP-UX + 11.0 ANSI C compiler. + +2005-01-03 Paul Eggert + + * utimens.c (futimens): Robustify the previous patch, by checking + for known valid error numbers rather than observed invalid ones. + +2005-01-03 Jim Meyering + + * utimens.c (futimens): Account for the fact that futimes + can also fail with errno == ENOSYS in that case. + Patch from Dmitry V. Levin. + +2005-01-03 Paul Eggert + + * utimens.c (futimens) [HAVE_FUTIMES]: Fall back on utimes if + futimes fails with errno == ENOENT. Problem reported by + Dmitry V. Levin. + +2005-01-02 Jim Meyering + + * version-etc.c (version_etc_copyright): Update copyright date. + +2004-12-31 Jim Meyering + + * openat.c (rpl_openat): Correct comment. + Call free_cwd, to avoid leaking a file descriptor. + +2004-12-23 Paul Eggert + + * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no + need to extend the stack. + (YYINITDEPTH): New macro, so that the initial stack isn't overly + large. + +2004-12-19 Paul Eggert + + * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not + HAVE_DECL_STRTOLD. + + * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H. + Remove now-obsolete comment about AIX. + * getdate.y: Include only if HAVE_ALLOCA. + (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA. + (YYMAXDEPTH): New macro. + +2004-12-11 Jim Meyering + + * chdir-long.c: Fail via #error if PATH_MAX is not defined, since + this file is now compiled only on systems that define PATH_MAX. + +2004-12-08 Paul Eggert + + * getdate.y (textint): New member "negative". + (time_zone_hhmm): New function. + Expect 14 shift-reduce conflicts, not 13. + (o_colon_minutes): New rule. + (time, zone): Use it to add support for +HH:MM, UTC+HH:MM. + (yylex): Set the "negative" member of signed numbers. + +2004-12-06 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Begin removing .c and .h file + names, as they are added to AC_LIBSOURCES directives in the + corresponding m4/*.m4 files. + +2004-12-05 Jim Meyering + + Currently, fpending.m4 punts (by defining PENDING_OUTPUT_N_BYTES + to 1) if it doesn't find a valid expression for the replacement + function. Before this change, that might have gone undetected + for some time. Now, we'll catch it close to the source. + + * t-fpending.c: New file. Test the __fpending function. + This ensures that if there is an error in the definition of the + PENDING_OUTPUT_N_BYTES expression, we'll find about it right away; + that value is used only in the rare event that close_stdout's + fclose fails with EBADF. + * Makefile.am (unit-test): New target. + (check): Depend on it. + (noinst_PROGRAMS): Define. + (LDADD): Define. + * Makefile.am (unit-test): Depend on t-fpending. + Make the target .PHONY. + +2004-12-02 Paul Eggert + + * openat.c: Include "openat.h" before other include files. + Include "exitfail.h". + (openat): Remove #undef; no longer needed now that we include openat.h + first. + (rpl_openat): Add comment about mode_t promotion. Simplify + code a bit by moving initializations around. Use exit_failure + rather than EXIT_FAILURE. + * openat.h: Add copyright and authorship notice. + (AT_FDCWD): Use the same value Solaris 9 uses, except of type + 'int' not 'unsigned int'. + + * save-cwd.c: Include "save-cwd.h" before other include files. + (O_DIRECTORY): Remove; not needed here, since "." must be + a directory. All uses removed. + (save_cwd): Use __sgi || __sun, not sun || __sun. __sun is + universal on Suns, and we also need to test for IRIX. + Revamp code to use 'if' rather than '#if'. + Avoid unnecessary comparison of cwd->desc to 0. + +2004-12-01 Paul Eggert + + * hard-locale.c: Assume exists. + Include "strdup.h". + (GLIBC_VERSION): New macro. + (hard_locale): Assume setlocale exists. + Rewrite to avoid #ifdef. + Use strdup rather than malloc + strcpy. + * human.c: Assume exists. + (human_readable): Assume localeconv exists. + +2004-11-30 Paul Eggert + + * getcwd.c (is_ENAMETOOLONG): New macro. + (__getcwd.c): Don't restore errno; glibc doesn't. + [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd + first, falling back to our code only if its results look suspicious. + Ensure that the resulting buffer is only as large as necessary. + + * readutmp.c: Include readutmp.h first. + Include , since readutmp.h no longer does that. + * readutmp.h: Don't include , + , ; not needed to establish interface. + (errno): Remove decl. + (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed. + (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME, + UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros. + +2004-11-30 Jim Meyering + + Change the name of the robust chdir function from chdir to chdir_long. + * save-cwd.c: Include chdir-long.h rather than chdir.h. + (restore_cwd): Use chdir_long, not chdir. + * chdir-long.c: Renamed from chdir.c. + * chdir-long.h: Renamed from chdir.h. + [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd. + * Makefile.am (libfetish_a_SOURCES): Reflect name changes. + + * chdir.c (O_DIRECTORY): Define, if necessary. + (memchrcspn): Tiny wrapper around memchr. + (rpl_chdir): Use memchrcspn rather than strcspn. + +2004-11-28 Jim Meyering + + * openat.c (rpl_openat): Also accept optional mode parameter. + * openat.h (rpl_openat): Adjust prototype. + + * save-cwd.c: Include "chdir.h", so that if save_cwd/getcwd + saves a name longer than PATH_MAX, restore_cwd's chdir can use it. + + * Makefile.am (libfetish_a_SOURCES): Add chdir.h and openat.h. + + This is a robust version of chdir, in that it can handle directory + names longer than PATH_MAX. + * chdir.c, chdir.h: New file. + * openat.c, openat.h: New files. + +2004-11-25 Paul Eggert + + Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using + HP's ANSI C compiler. + * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl. + Declaring int functions causes warnings on some modern systems and + shouldn't be needed to compile on ancient ones. + * same.c (MIN) [defined MIN]: Don't define, since it's already + defined. + + * mempcpy.c, mempcpy.h: New files, taken from gnulib. + * Makefile.am: (libfetish_a_SOURCES): Add getcwd.h, mempcpy.h. + * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but + with the following changes. + (__set_errno): Parenthesize properly. + Include . + (MIN, MAX, MATCHING_INO): New macros. + (__getcwd): Define with prototype, not K&R form. + Use heuristics to allocate default buffer on stack if possible. + If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2) + behavior, and to avoid the PATH_MAX limit when computing + ../../../../... + Use MATCHING_INO to compare inode number to file. + Check for arithmetic overflow in size calculations. + Fix bug in reallocation of dot array that caused getcwd to fail + on directories nested deeper than 75. + Be more careful about saving errno on error. + Do not use realloc; use only free+malloc, as this is a bit + more flexible and avoids a needless copy operation. + Do not inspect st_dev and st_ino for symbolic links; POSIX + doesn't specify the latter. + Check for closedir errors. + Avoid needless casts. + Use "#ifdef weak_alias" around weak_alias, to be like other + glibc code. + The following changes to getcwd.c have effect only when used in + gnulib; they have no effect inside glibc proper. + (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove, + as alloca isn't used. + (alloca, __alloca): Likewise. + [!_LIBC]: Include "getcwd.h", "mempcpy.h". + Include , , , + unconditionally, as gnulib assumes C89 or better. + Do not include . + (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove + no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or + better. + (NULL) [!defined NULL]: Remove; we assume C89 or better. + Include in a way that is compatible with modern Autoconf. + (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN): + New macros, if not already defined. + Include if _LIBC, not if __GNU_LIBRARY__. + Use "_LIBC", not "defined _LIBC", for consistency. + (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has + a mempcpy module. + (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros. + (GETCWD_RETURN_TYPE): Remove. All uses replaced by char *. + * xgetcwd.c: David MacKenzie's old code was removed, so give + credit only to Jim Meyering and adjust the copyright dates. + Do not include , , , + , , "pathmax.h". + Instead, include "xgetcwd.h" (first) and "getcwd.h". + (INITIAL_BUFFER_SIZE): Remove. + (xgetcwd): Rely on getcwd, since we now depend on a reliable one. + +2004-11-23 Paul Eggert + + * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros. + (futimens): New function, which uses futimes if available. + (futimens, utimens): Support timespec==NULL, with same semantics + as utime and utimens. + * utimens.h (futimens): New decl. + +2004-11-23 Sergey Poznyakoff + + * getopt_.h: Re-addition of __getopt_argv_const caused + redefinition warnings. To avoid them, include the defines + in `#if !defined __need_getopt ... #endif'. The only place + where __getopt_argv_const is used is in definitions + of getopt_long and getopt_long_only below, which are as well + protected by `#ifndef __need_getopt'. + [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef + __need_getopt after including and These + headers might have defined it. + +2004-11-23 Jim Meyering + + * closeout.c: Revert last change, since it seems EBADF is always + defined. + +2004-11-22 Jim Meyering + + * closeout.c (EBADF): Fail with `#error ...' if it's not defined, + asking the user to report the problem. + +2004-11-17 Paul Eggert + + * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc + might fail. Problem reported by Yoann Vandoorselaere. + * calloc.c (rpl_calloc): Defend against buggy calloc implementations + that mishandle size_t overflow. + +2004-11-16 Paul Eggert + + * xgetcwd.c: Include , for PATH_MAX. + (xgetcwd): Set errno correctly when failing. + Work around Solaris 9 bug: getcwd sets errno==ERANGE even though + the failure is actually due to a PATH_MAX problem. + + Further getopt changes to make it more likely that glibc will + buy the changes back. + * getopt.c (POSIXLY_CORRECT): New constant. + (getopt): Use it, so to preserve glibc semantic + * getopt1.c (getopt_long, getopt_long_only): Arg is char * const * + when compiling for libc. + * getopt_.h (__getopt_argv_const): Bring it back. + (getopt_long, getopt_long_only): Use it. + + * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal): + New arg POSIXLY_CORRECT. All callers changed. + (getopt): Argv is now char * const *, as per standard. + (_getopt_internal_r, _getopt_internal): Argv is now char **, + not char *__getopt_argv_const *. + * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only, + _getopt_long_only_r): Likewise. + * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise. + * getopt_int.h (_getopt_internal, _getopt_internal_r, + _getopt_long_r, _getopt_long_only_r): Likewise. + * getopt_.h (__getopt_argv_const): Remove. + (getopt): Argv is now char * const *, as per standard. + + * canon-host.c: Include "strdup.h". + (canon_host): Use getaddrinfo if available, so that IPv6 works. + Use strdup instead of malloc/strcpy to duplicate strings. + + * getdate.y (tORDINAL): New token. + (day, relunit): Allow it for relative times. + (relative_time_table): Use tORDINAL for ordinals. + +2004-11-15 Paul Eggert + + * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit. + (human_space_before_unit): New constant. + * human.c (human_readable): Support it. + +2004-11-14 Jim Meyering + + * closeout.c (close_stdout): Don't fail just because stdout was + closed initially, since some programs don't write to stdout in the + normal course of operation (other than --version and --help), and + we don't want this function to make e.g. `cp 1 2 >&-' fail. + But do fail if it was closed and someone has tried to write to it. + E.g., printf foo >&- + + * __fpending.c, __fpending.h: Restore these files. + They're useful after all. + * Makefile.am (libfetish_a_SOURCES): Add __fpending.h. + +2004-11-11 Paul Eggert + + * getopt.c, getopt1.c, getopt_.h, getopt_int.h: + Sync from gnulib. + +2004-11-10 Paul Eggert + + * allocsa.h, mbswidth.c, mktime.c, readlink.c, getdate.y, + quotearg.c, strftime.c: Sync from gnulib. + +2004-11-06 Jim Meyering + + * __fpending.c, __fpending.h: Remove files. + + * Makefile.am (libfetish_a_SOURCES): Remove __fpending.h, now + that it's no longer used. + + Ensure that no close failure goes unreported. + * closeout.c (close_stdout): Always close stdout. I.e., don't + return early when it seems there's nothing to flush. + Don't include __fpending.h. + +2004-11-03 Paul Eggert + + * unsetenv.c: New file, from gnulib. Needed for new getdate.y. + * Makefile.am (libfetish_a_SOURCES): Remove setenv.c. + * xreadlink.c: Sync from gnulib. + +2004-11-03 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add setenv.c and setenv.h. + +2004-11-02 Paul Eggert + + * getdate.y, getpass.c, setenv.h: Sync from gnulib. + +2004-10-29 Paul Eggert + + * getdate.y, getpagesize.h, mktime.c: Sync from gnulib. + +2004-10-24 Paul Eggert + + * mktime.c (leapyear): Arg is long int, not int. + Change imported from gnulib. + +2004-10-17 Paul Eggert + + Sync from gnulib. + * diacrit.c, diacrit.h: Add copyright notice. + * getpass.c (fflush_unlocked, flockfile, funlockfile) + (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map + to real functions. + +2004-10-13 Jim Meyering + + * fts.c (fts_read): When about to fail (by returning NULL) due + to a failed fchdir or failed fts_safe_changedir call, set + `sp->fts_cur = p'. Do this by removing the explicit `return NULL;' + statements and setting p->fts_errno so execution falls through + to the common-case code below. Otherwise, after such a failure, + calling fts_close would attempt to free an already-freed buffer. + Reported by Luis Lopez Lopez in http://bugs.debian.org/276352. + +2004-10-04 Paul Eggert + + Sync from gnulib. + + * xalloc.h (xmemdup): Renamed from xclone. + * xmalloc.c (xmemdup): Likewise. + * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC, + XFREE): Remove these long-obsolescent macros. + * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c + * xstrdup.c: Remove. + + * argmatch.c, closeout.c, error.c, exclude.c, getdate.y, + getndelim2.c, getpass.c, getusershell.c, linebuffer.c, + md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c, + regex.c, sha1.c, version-etc.c, yesno.c: + Include "unlocked-io.h" only if USE_UNLOCKED_IO. + * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now + the includer's responsibility. + +2004-10-03 Paul Eggert + + Sync from gnulib. + * dirfd.h, getpagesize.h: Add copyright notice. + * vasnprintf.c: (VASNPRINTF): Set errno=EOVERFLOW if the output is + too long. + * vasnprintf.h: Doc fix. + * vasprintf.c: Don't include . + (vasprintf): Rely on vasnprintf to set errno=EOVERFLOW. + +2004-09-23 Paul Eggert + + * modechange.c (mode_compile): Don't decrement a pointer that + points to the start of a string, as the C Standard says the + resulting behavior is undefined. + +2004-09-22 Jim Meyering + + * getopt.c: Remove extraneous spaces before TAB. + * getopt_.h: Likewise. + + * backupfile.c: Remove trailing blanks. + * euidaccess.c: Likewise. + +2004-09-13 Paul Eggert + + * backupfile.h (enum backuptype): Rename none -> no_backups, + simple -> simple_backups, numbered_existing -> + numbered_existing_backups, numbered -> numbered_backups + to avoid shadowing problems. All uses changed. + * argmatch.c (enum backuptype): Likewise. + * backupfile.c (check_extension, numbered_backup): + Rename locals to avoid shadowing 'basename'. + * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than + once. + +2004-09-02 Paul Eggert + + Port to diet libc. Problem reported by Felix von Leitner in + + * fts.c (fts_stat, fts_open, fts_read): Use "unsigned short int" + rather than the unportable "u_short", and similarly for u_int. + * fts_.h (FTSENT): Likewise. + +2004-08-19 Paul Eggert + + * getopt.c, getopt1.c: Sync from gnulib. + * getopt_.h: Renamed from getopt.h (this syncs from gnulib). + * Makefile.am (libfetish_a_SOURCES): Remove getopt.c, getopt.h, + getopt1.c, getopt_int.h. + (BUILT_SOURCES, EXTRA_DIST, all-local, $(lib_OBJECTS), getopt.h, + MOSTLYCLEANFILES): Add current gnulib snippet for getopt. + * .cppi-disable: Add getopt_.h, getopt_int.h. + * .cvsignore: Add getopt.h. + +2004-08-18 Paul Eggert + + * userspec.c: Don't use , so that we don't use alloca on + strings on unbounded length. alloca's performance benefits aren't + that important here. + (V_STRDUP): Remove. + (parse_with_separator): New function, with most of the internals + of the old parse_user_spec. Allow user to omit both user and group, + for compatibility with FreeBSD. + Clone only the user name, not the entire spec. + Do not set *uid, *gid unless entirely successful. + Avoid memory leak in some failing cases. + Fix regression for USER.GROUP reported by Dmitry V. Levin in + + (parse_user_spec): Rewrite to use parse_with_separator. + +2004-08-11 Paul Eggert + + * fts.c (O_DIRECTORY): Define to 0 if the system doesn't define. + + * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2. + + * obstack.c: Include and if available. + (union fooround): Use uintmax_t, not long int. + The rest is a merge from libc: + [defined _LIBC]: Include . + (_obstack) [defined _LIBC]: Remove after 2.3.4. + + * xgethostname.c: Do not include error.h. (merge from gnulib). + + * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing + wmemchr or wmemcpy. Problem reported by Robert Dahlem + for Reliant Unix 5.43. + +2004-08-09 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Add getpass.h. + * getpass.h: New file. + * .cpp-disable: Add it. + * getpass.c [!_LIBC]: Include it. + + * obstack.h (obstack_empty_p): + Don't assume that chunk->contents is suitably aligned. + * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk): + Likewise. Problem reported by Benno in + . + + * chown.c (rpl_chown): Work even if the file is writeable but not + readable. This could be improved further but it'd take some work. + * fts.c (diropen): New function. + (fts_open, fts_read, fts_children, fts_safe_changedir): + Use it, so that the code works even if the directory + is writeable but not readable. We'd like it to work even if + the directory is merely executable, but I don't know how to do + that portably. + + * xalloc-die.c: New file. + * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove. + All uses removed. + * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise. + Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c. + (_, N_, xalloc_die): Move to xalloc-die.c. + * userspec.c (parse_user_spaec): Use xstrdup rather than strdup, + so that we needn't mess with xalloc_msg_memory_exhausted. + + * sha1.h (sha1_ctx): Renamed from sha_ctx. + (sha1_init_ctx): Renamed from sha_init_ctx. + (sha1_process_block): Renamed from sha_process_block. + (sha1_process_bytes): Renamed from sha_process_bytes. + (sha1_finish_ctx): Renamed from sha_finish_ctx. + (sha1_read_ctx): Renamed from sha_read_ctx. + (sha1_stream): Renamed from sha_stream. + (sha1_buffer): Renamed from sha_buffer. + * sha1.c: Likewise. + +2004-08-07 Paul Eggert + + * canonicalize.h, cycle-check.h, stat-macros.h, strdup.h, + strftime.h, xnanosleep.c: Merge from gnulib. + +2004-08-05 Paul Eggert + + Merge with gnulib and deal with some minor cleanups resulting. + + * .cppi-disable: Change fnmatch.h to fnmatch_.h. + * .cvsignore: Add fnmatch.h, poll.h, stdbool.h, sysexit.h. + Remove safe-lstat.c, safe-lstat.h, safe-stat.c, safe-stat.h. + + * backupfile.h, closeout.h, full-write.h, mbswidth.h, xalloc.h: + Add extern "C" wrappers for C++. + + * dirname.h (IS_ABSOLUTE_FILE_NAME): Port to DOS. + + * gettime.c (gettime): Fall back on `time' if `gettimeofday' + doesn't work. + * settime.c: Include , for stime (on Solaris 8, anyway). + (ENOSYS): Define if not defined. + (settime): Fall back on stime if it exists and settimeofday fails. + But don't bother with fallbacks if a method fails with errno == EPERM. + + * obstack.h: Add white space. + + * printf-parse.c, printf-parse.h, vasnprintf.c: Merge changes from + gnulib, but rewrite to avoid "xsize.h". + +2004-08-04 Paul Eggert + + * mountlist.c (SIZE_MAX): Define after including files, to avoid + a collision on OpenBSD 3.4. + + * fts.c (LONGEST_MODIFIER): New macro. + (PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro. + (find_matching_ancestor): Use it for dev_t and ino_t. + + * getndelim2.c: Sync from gnulib. + + * error.c: Work around bug in OpenBSD 3.4 sterror_r: it + sometimes returns a positive errno value even when it succeeds. + (print_errno_message) [!LIBC]: Fall back on strerror if + __strerror_r fails. + +2004-08-02 Paul Eggert + + * canonicalize.c (errno): Remove decl; we now assume C89 or better. + * chown.c (errno): Likewise. + * closeout.c (errno): Likewise. + * dup-safer.c (errno): Likewise. + * dup2.c (errno): Likewise. + * exclude.c (errno): Likewise. + * fopen-safer.c (errno): Likewise. + * ftruncate.c (errno): Likewise. + * full-write.c (errno): Likewise. + * getcwd.c (errno): Likewise. + * lchown.c (errno): Likewise. + * memcoll.c (errno): Likewise. + * nanosleep.c (errno): Likewise. + * putenv.c (errno): Likewise. + * rmdir.c (errno): Likewise. + * same.c (errno): Likewise. + * savedir.c (errno): Likewise. + * setenv.c (errno): Likewise. + * stat.c (errno): Likewise. + * utime.c (errno): Likewise. + * xgetcwd.c (errno): Likewise. + * xmemcoll.c (errno): Likewise. + * xreadlink.c (errno): Likewise. + * xstrtol.c (errno): Likewise. + * canonicalize.h (enum canonicalize_mode_t): Reformat comments to + fit in 80 columns. + * fileblocks.c (textutils_fileblocks_unused): Make it a typedef + instead of an int, to save a few bytes in the object file. + * getdate.y (lookup_word): Rewrite to avoid cast. + * getloadavg.c: Include . + (getloadavg_initialized): Use bool for booleans. + * hard-locale.c (hard_locale): Return bool, not int. + * hard-locale.h (hard_locale): Likewise. Include . + * hash.c (hash_string): Rewrite to avoid cast. + * human.h: Use Autoconf-suggested pattern for inttypes and stdint. + * strtiomax.c: Likewise. + * xstrtol.h: Likewise. + * nanosleep.c: Include stdbool.h. + (rpl_nanosleep): Usee bool for booleans. + * quotearg.c: Include stdbool.h. + (quotearg_buffer_restyled): Use bool for booleans. + * readtokens.c (readtoken): Rewrite to avoid casts. + * same.c (same_name): Return bool, not int. + * same.h (same_name): Likewise. Include . + * version-etc.c (version_etc_va): Use size_t for sizes. + * xnanosleep.c: Include limits.h, stdbool.h. + (CHAR_BIT): Remove. + (timespec_subtract, xnanosleep): Use bool for booleans. + * xstrtoimax.c: Just include xstrtol.h rather than rolling our + own include pattern. + * xstrtoumax.c: Likewise. + * xstrtol.c (__xstrtol): Rewrite to avoid casts. + * yesno.c: Include yesno.h first. + (yesno): Return bool, not int. + * yesno.h (yesno): Likewise. Include . + + * xstrtod.h (xstrtod): Return bool, not int. Invert the + sense of the boolean. All uses changed. + * xstrtod.c (xstrtod): Likewise. + * nanosleep.c: Include stdbool.h. Use bool for booleans. + + * xgethostname.c: Don't include or "exit.h"; + no longer needed. + (errno): Remove decl; we now assume C89 or better. + Include unistd.h if available, for gethostname. + (ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with + existing errno values if any. + (gethostname): Remove decl, since unistd.h declares it (or doesn't, + in which case it's an older system and it should just work). + (xgethostname): Don't assume host name length is less than INT_MAX. + Exit if malloc fails, just as the comment says. + + * save-cwd.c: Include . + (errno): Remove decl; we now assume C89 or better. + (save_cwd): Use bool for booleans. + (save_cwd, restore_cwd): Return -1 on failure, not 1, since we set + errno on failure. + + * readutmp.h (UT_USER): Parenthesize properly. + (UT_USER_SIZE): New constant. + (read_utmp): Don't assume that the number of users is less than + INT_MAX. + * readutmp.c (read_utmp): Likewise. + Check for integer overflow in size calculations. + Return -1 (not 1) on failure, since we set errno in that case. + + * posixtm.c (posix_time_parse): Don't assume that the length of + the string being parsed is <= UINT_MAX. + + * mountlist.h (read_file_system_list): Accept bool flag, not int. + * mountlist.c (read_file_system_list): Likewise. + * mountlist.h: Include . + * mountlist.c (errno): Remove decl; we now assume C89 or better. + (xatoi): Remove; replaced by strtoul. Hence device numbers can now + go up to ULONG_MAX. + + * isdir.c: Remove; no longer needed. + * Makefile.am (libfetish_a_SOURCES): Remove isdir.c. + + * fts_.h: Add an FSF copyright notice, since our changes are becoming + nontrivial. + * fts.c: Likewise. + * fts_.h: Include stddef.h, for ptrdiff_t. + (FTS.fts_nitems): Now size_t, not int, for hosts that allow more + than INT_MAX entries in a directory. + (FTS_ROOTPARENTLEVEL): Parenthesize properly. + (FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more + than INT_MAX levels deep on 64-bit hosts. + (FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like + the Hurd that don't have arbitrary limits on directory entry lengths. + (FTSENT.fts_statp): Now an array, not a pointer, so that we don't + have to play unportable games with pointer arithmetic. Keep it array + for the benefit of user code that assumes it is a pointer. + * fts.c: Include stdint.h if available, as Autoconf suggests. + (ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp + is an array. + (fts_alloc, fts_palloc, fts_sort, fts_load, fts_build): + Use size_t for sizes. + (fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build, + fts_palloc): + Use bool when appropriate. + (SIZE_MAX, TYPE_SIGNED): New macros. + (fts_read): Use u_short for instructions. + (fts_build): Use ptrdiff_t for levels. Don't assume file name lengths + fit into int. Don't assume nlink_t is signed. + (find_matching_ancestor): Don't assume dev, ino fit in int. + (fts_stat): Use function prototype; required for bool arg. + (fts_sort): Detect integer overflow in size calculations. + (fts_alloc): Simplify allocation code, now that fts_statp is an array + and not a pointer. + + * fsusage.h: Include . + (struct fs_usage): Use uintmax_t for block sizes, so that they're + not limited to INT_MAX. + Use bool for booleans. + * fsusage.c: Use Autoconf-suggested pattern for inttypes and stdint. + Include unistd.h, for lseek. + + * fnmatch.c: Include . + (errno): Remove decl; we now assume C89 or better. + * fnmatch_loop.c (EXT, FCT): Use bool when appropriate. + (FCT): Use size_t, not unsigned int, for sizes. + (EXT): Use size_t, not int, for sizes. + + * stripslash.c (strip_trailing_slashes): Now returns bool. + * dirname.h (strip_trailing_slashes): Likewise. + Include . + * dirname.c (dir_name): Use bool when appropriate. + + * argmatch.h (argmatch, __xargmatch_internal, argmatch_invalid): + Use ptrdiff_t, not int, when counting arguments, to allow more + than INT_MAX arguments. + * argmatch.c: Likewise. Use bool when appropriate. + +2004-08-01 Paul Eggert + + * safe-read.c (errno): Remove decl; we now assume C89 or better. + (safe_rw): Don't work around Tru64 bug unless the bug symptoms + manifest themselves. This allows us to do proper reads and writes + on other hosts, e.g., "dd" with a block size greater than 2**31. + + * md5.c (UNALIGNED_P): Use size_t; in practice, this is just as + good as uintptr_t in checking for alignments, and has fewer + configuration hassles. + * sha1.c (UNALIGNED_P): Likewise. + * md5.h: Don't include . Include if available, + as it defines symbols like UINT32_MAX on Solaris 8. + (md5_uint32): Assume uint32_t exists; Autoconf will define it + otherwise (if the host has a 32-bit unsigned type, anyway). + * memchr.c: Don't include inttypes.h or stdint.h. + (UNALIGNED_P): Remove. + (__memchr): Use size_t, not uintptr_t, to test alignment. + * memrchr.c: Likewise, for __memrchr. + +2004-07-30 Paul Eggert + + * makepath.h: Include . + (make_path, make_dir): Use bool, not int, since we're not setting + errno. + Use mode_t for modes, not int. All uses changed. + * makepath.c: Likewise. + (errno): Remove decl; no longer needed since we assume C89. + +2004-07-29 Paul Eggert + + * modechange.c: Include . + (mode_compile): Use bool when appropriate. + + * memchr.c (UNALIGNED_P): Use sizeof, not alignof, for better + performance on m68k-linux. Reported by Andreas Schwab in + . + * memrchr.c (UNALIGNED_P): Likewise. + +2004-07-28 Paul Eggert + + * userspec.c: Include , "inttostr.h". + (V_STRDUP): Don't assume the string's length fits in int. + (ISDIGIT): unsigned -> unsigned int + (is_number): Define only ifdef __DJGPP__; not needed elsewhere. + Use bool instead of int where appropriate. + Do not allow empty strings. + (parse_user_spec): Parse numbers as decimal integers, even if + they have a leading 0. Don't assume uids and gids fit in int. + + * memchr.c: Include , not and . + (LONG_MAX_32_BITS): Remove. + Include and if available. + (alignof, UNALIGNEDP): New macro, portable to all C89 hosts. + (__memchr): Don't assume unsigned long int is either 4 or 8 bytes; + let it be any number of bytes greater than or equal to 4. + * memrchr.c: Likewise, with __memrchr. + + * md5.h: Include if HAVE_STDINT_H || _LIBC, not + ifdef _LIBC. + (md5_uint32): Use uint32_t if available. Simplify fallback ifdefs. + * md5.c: Don't include or ; + suffices with C89 or better. + (alignof): New macro, portable to all C89 hosts. + (UNALIGNED): Use it. Use uintptr_t if available, and assume + everything is unaligned otherwise; this is more portable than + assuming 'unsigned long int' will always work. + * sha1.c: Likewise. + + * getugroups.c: Include . + (EOVERFLOW): Define if not defined. + (getgroups): Return -1 with errno=EOVERFLOW if an integer overflow + occurs. + +2004-07-27 Paul Eggert + + * euidaccess.c [HAVE_LIBGEN_H]: Include , for + eaccess on Solaris and SVR4-like systems. + (euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS. + + cycle-check integer overflow fixup. + + * cycle-check.h: Remove now-inaccurate comment about the files + you need to include first. You don't need to include any files + other than the usual config.h. + Include and if available, for uintmax_t. + Remove 'struct stat;' not needed since we know sys/stat.h has + been included by dev-ino.h. + (struct cycle_check_state): Change chdir_counter to uintmax_t, + not size_t, since it isn't limited by object sizes. + Change magic from long unsigned int to int; that's good enough + for our use. + * cycle-check.c (is_zero_or_power_of_two): Renamed from + is_power_of_two, to reflect better what it really does. + All uses changed. Arg is now uintmax_t, not unsigned int + (it should have been unsigned long int -- that was a bug). + (cycle_check): Check for integer overflow in cycle count, + and report a cycle if that happens, as it must be a cycle + by this point. + + backupfile.c rewrite to avoid arbitrary limits on lengths of + numeric backup extensions. + + * addext.c: Remove; no longer needed. + * Makefile.am (libfetish_a_SOURCES): Remove addext.c. + * backupfile.h (addext): Remove decl. + * backupfile.c: Include "backupfile.h" first. + Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h. + (CLOSEDIR, INT_STRLEN_BOUND): Remove. + (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro. + (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro. + (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we + also look at _XOPEN_NAME_MAX, for better performance on modern + hosts that support only file names of length 255 or more. + (ISDIGIT): unsigned -> unsigned int + (max_backup_version, version_number): Remove. + (check_extension): New function. Similar to the old addext, but + static, assumes that the extension has already been added, + and a bit more careful on DOS hosts. + (numbered_backup): New function. It does what max_backup_version + and version_number used to do, but it doesn't use integer arithmetic + to calculate extensions so it doesn't overflow. + (find_backup_file_name): Rewrite to use these new functions. + This has a new optimization: we needn't call pathconf if the + new numbered backup name has the same length as the old. + Also, use xmalloc rather than malloc, so that the caller + needn't worry about memory exhaustion. + +2004-07-25 Paul Eggert + + * euidaccess.c [!defined LIBC]: Included group-member.h, stat-macros.h. + (S_IXUSR, S_IXGRP, S_IXOTH, S_IROTH, S_IWOTH, S_IXOTH): + Remove; now done by stat-macros.h. + (NGROUPS_MAX, group_member): Remove; now done by group-member.h. + No need to include . + (errno): Remove decl; we now assume C89 or better. + (access, getuid, getgid, geteuid, getegid, stat) [defined _LIBC]: + New macros. + (uid, gid, have_ids): Remove these static variables. + They weren't accurate for programs that also invoked setreuid etc. + (euidaccess) [defined EFF_ONLY_OK || defined ACC_SELF || + HAVE_DECL_EACCSS]: Use builtin substitutes. + [defined _LIBC]: Ignore __libc_enable_secure; it's not a + correct optimization for programs run as root that later + invoke setreuid. + [no builtin substitutes && HAVE_DECL_SETREGID && + PREFER_NONREENTRANT_EUIDACCESS]: + Use setreuid+setregid to get the correct answer. + [no builtin substitutes && ! (HAVE_DECL_SETREGID && + PREFER_NONREENTRANT_EUIDACCESS)]: + Don't assume that the stat macros have their historical values, + as POSIX doesn't require this. + [defined TEST]: Include ; don't include errno.h + twice; include rather than "error.h". + +2004-07-23 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Add fcntl-safer.h, + open-safer.c. + * fcntl-safer.h, open-safer.c: New files. + +2004-07-12 Paul Eggert + + * c-strtod.c (STRTOD_L): New macro. + (C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the + code is reentrant on platforms that have strtod_l. + + * getloadavg.c: Include , , even + if HAVE_GETLOADAVG is defined, so that the test program can work. + (errno): Remove declaration; not needed in C89 or later. + Include "c-strtod.h". + Do not include locale.h or define setlocale; no longer needed. + Include . + (INT_STRLEN_BOUND): New macro. + (getloadavg): Use it to compute buffer size. + Don't assume that buffer will be properly terminated by 'read'. + Use c_strtod instead of setlocale. + (main) [defined TEST]: Return int, not void. + +2004-07-11 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Add c-strtold.c. + * c-strtold.c: New file. + * c-strtod.c: Include first. + (C_STRTOD, DOUBLE, STRTOD): New macros. + (c_strtod): Use them. + * c-strtod.h (c_strtold): New decl. + +2004-07-07 Jim Meyering + + Don't infloop when MAXSYMLINKS is not defined. + Detect symlink loops much earlier (albeit lazily) on systems + with MAXSYMLINKS defined to a large value. + + * canonicalize.c: Include "cycle-check.h". + (canonicalize_filename_mode): Don't try to detect loops by counting + symlink-hops. Instead, use the cycle-check module. + + * cycle-check.h: Include stdbool.h. + Forward-declare `struct stat'. + + * canonicalize.c (canonicalize_filename_mode): Remove do-while(0) loop. + Replace each corresponding `break' stmt with `continue'. + +2004-07-06 Jim Meyering + + * canonicalize.c: Include "stat-macros.h". + (canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that + S_ISLNK is guaranteed to be defined (via stat-macros.h). + +2004-04-03 Dmitry V. Levin + + * Makefile.am (libfetish_a_SOURCES): Add canonicalize.c + unconditionally. + * canonicalize.h (canonicalize_mode_t): New type. + * canonicalize.c: Include "file-type.h". + (canonicalize_filename_mode): New function, based on + canonicalize_file_name, supports three canonicalize modes. + (canonicalize_file_name) + [!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it. + +2004-07-05 Jim Meyering + + * path-concat.c (path_concat): Improve comment. From Paul Eggert. + +2004-07-02 Paul Eggert + + * canonicalize.c (canonicalize_file_name): Assume that path_concat + never returns NULL. + * path-concat.c (mempcpy): Don't define if a system header defines it. + Don't include stdio.h, stdlib.h, unistd.h, strdup.h. + (longest_relative_suffix): New function. + (path_concat): Use it. Assume first argument is not NULL. + Port to DOS. Omit redundant separators. + Report an error instead of returning NULL. + Use mempcpy instead of memcpy. + (xpath_concat): Remove: not declared or used. + +2004-06-30 Paul Eggert + + * dirname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from + FILESYSTEM_PREFIX_LEN. All uses changed. + * mountlist.h (read_file_system_list): Renamed from + read_filesystem_list. All definitions and uses changed. + +2004-06-24 Jim Meyering + + * obstack.h (obstack_base): Fix parentheses. From Paul Eggert. + +2004-06-20 Jim Meyering + + * obstack.h (obstack_base): Cast to (void *), per documentation. + + * yesno.h: New file. + * yesno.c: Include "yesno.h". + * Makefile.am (libfetish_a_SOURCES): Add yesno.h. + +2004-06-19 Jim Meyering + + * filemode.c: Remove all S_IS* and S_IF* definitions. + Instead, just include "stat-macros.h". + * stat.c: Likewise. + * rmdir.c: Likewise. + * makepath.c: Likewise. + * lchown.c: Likewise. + * isdir.c: Likewise. + * canonicalize.c: Likewise. + + Add S_IS* definitions from filemode.c. + * stat-macros.h (S_ISCTG): Define to zero if not already defined. + (S_ISOFD): Likewise. + (S_ISOFL): Likewise. + +2004-06-11 Paul Eggert + + * readutmp.c (extract_trimmed_name): Don't apply strchr to a + non-string; this leads to undefined behavior. + +2004-05-18 Paul Eggert + + * fts.c (fts_stat, fts_alloc): Always allocate and use a struct + stat, even if the user isn't interested in the results. + This prevents a core dump in cycle_check when FTS_NOSTAT is set. + * lchown.c (lchown): Return EOPNOTSUPP if not supported; this + is what POSIX-2004 specifies. + * lchown.h (EOPNOTSUPP): Define if not defined. + (ENOSYS): Remove. + +2004-06-06 Jim Meyering + + * getdate.y: Update from gnulib. + +2004-05-25 Paul Eggert + + * xreadlink.c: Include xreadlink.h first, to catch .h file + dependency problems. + (xreadlink): Accept new arg SIZE, for efficiency. + All decls and uses changed. + * xreadlink.h: Include , for size_t. + * canonicalize.c (canonicalize_file_name): Update use of xreadlink. + +2004-06-01 Jim Meyering + + * xmalloc.c: Update from gnulib. + +2004-05-30 Jim Meyering + + * alloca_.h: Remove trailing blank. + +2004-05-29 Jim Meyering + + * dirname.h (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Define. + + * calloc.c: New file. + +2004-05-21 Jim Meyering + + * alloca.c, alloca_.h, fnmatch.c: Update from gnulib. + * localcharset.c, regex.c: Likewise. + +2004-05-20 Jim Meyering + + * obstack.c, obstack.h: Update from gnulib. + +2004-05-16 Paul Eggert + + * getline.c, getndelim2.c, getndelim2.h: Sync with gnulib. + +2004-05-11 Jim Meyering + + Prior to this change, rm required read access to the current + directory on most systems (ones with the fchdir function). + + * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only + fails, try write-only, and finally, resort to using xgetcwd. + +2004-05-07 Jim Meyering + + Update from gnulib. + * obstack.c (_): Define only if not already defined. + * obstack.h (obstack_finish): Rename local: s/value/__value/. + +2004-05-03 Jim Meyering + + * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown. + +2004-05-01 Jim Meyering + + * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]: + Wrap old code with this conditional. + [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown + function that does not dereference symlinks. + +2004-04-18 Paul Eggert + + * nanosleep.c (suspended): Change its type from int to + sig_atomic_t volatile. + (first_call): Make it private to rpl_nanosleep, and have it + be zero initially as that's a bit faster. + (my_usleep): Round up fractional times instead of truncating them, + as this is the usual meaning for 'sleep'. + +2004-04-20 Jim Meyering + + * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory. + +2004-04-18 Jim Meyering + + * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure, + don't leak memory and do call END_UTMP_ENT. + +2004-04-13 Jim Meyering + + * quotearg.c, quotearg.h: Remove trailing blanks. + +2004-04-12 Jim Meyering + + * inttostr.h: Update from gnulib. + +2004-03-27 Paul Eggert + + * utimecmp.c, utimecmp.h: New files. + * Makefile.am (libfetish_a_SOURCES): Add utimecmp.c, utimecmp.h. + +2004-04-09 Jim Meyering + + * stat-macros.h: New file, with contents from file-type.h + and coreutils' system.h. + * Makefile.am (libfetish_a_SOURCES): Add stat-macros.h. + * file-type.c: Include "stat-macros.h". + * file-type.h (file_type): Move all macro defiitions to new file, + stat-macros.h. + +2004-03-30 Paul Eggert + + * cloexec.c, cloexec.h, config.charset, file-type.c, file-type.h: + * getloadavg.c, getndelim2.c, getusershell.c, group-member.c: + * human.c, path-concat.c, printf-args.c, printf-args.h: + * quotearg.c, quotearg.h, setenv.c, strdup.c: + * userspec.c, userspec.h, vasprintf.c: Sync from gnulib. + + * allocsa.c, allocsa.h, strdup.h: New files, from gnulib. + * Makefile.am (libfetish_a_SOURCES): Add allocsa.c, allocsa.h, + and strdup.h. + +2004-03-30 Jim Meyering + + * getloadavg.c: Merge changes from emacs (via gnulib). + +2004-03-28 Paul Eggert + + Fix some gotchas encountered when porting to Solaris 8, using + the Forte 6u2 compiler. + + * canonicalize.c [HAVE_UNISTD_H]: Include , + for resolvepath declaration. + * fts.c: Include dirfd.h, for dirfd. + +2004-02-25 Paul Eggert + + * human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE. + +2004-03-23 Paul Eggert + + * readtokens0.c (readtokens0): Return true on success rather + than on failure. All callers changed. This also happens to fix a + portability bug on pre-C99 hosts, where (bool) INTEGER sometimes + returns false even when INTEGER is nonzero. + +2004-03-23 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add getopt_int.h. + * getopt_int.h: New file, from gnulib. + * getopt.c, getopt.h, getopt1.c: Sync from gnulib. + * getopt.c, getopt.h: Remove space(s) before TAB. + + * mbswidth.c, mbswidth.h: Sync from gnulib. + +2004-03-21 Jim Meyering + + * readtokens0.c, readtokens0.h: New files. + * Makefile.am (libfetish_a_SOURCES): Add readtokens0.c and readtokens0.h + + * readtokens.c (readtoken): Don't leak 64 bytes when reading + an empty input stream. + + * readtokens.c: Include . + (readtoken): Use `size_t' rather than int/long. + All callers adjusted. + Use `bool' rather than `int' where appropriate. + Use memset rather than an explicit loop. + Use x2nrealloc rather than xrealloc. + Allow the use of `\0' as a delimiter. + (readtokens): Likewise. + * readtokens.h (readtoken, readtokens): Update prototypes. + +2004-02-29 Paul Eggert + + * getdate.h: Include stdbool.h, and timespec.h instead of + the usual dance. + (get_date): Change signature to support fractional time stamps. + All callers changed. + * getdate.y: Include "getdate.h" first, as we can now + assume C89 and don't need to worry about 'const'. + Similarly, include "unlocked-io.h" near start, not in middle. + Include . + (textint.value): Use long int rather than int. + (textint.digits): Use size_t rather than int. + (BILLION, LOG10_BILLION): New constants. + (parser_control): New member rel_ns. Members day_ordinal, + time_zone, month, day, hour, minutes, rel_year, rel_month, + rel_day, rel_hour, rel_minutes, rel_seconds + are now long int, not int. Member seconds is now struct timespec, + not int. New member timespec_seen. Members dates_seen, days_seen, + local_zones_seen, rels_seen, times_seen, zones_seen are now size_t, + not int. + (%union.intval): Now long int, not int. + New member timespec. + (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens. + (seconds, signed_seconds, unsigned_seconds): New nonterminals. + (spec): Now is a timespec or an item list. + (timespec, items): New nonterminals. + (time, rel, relunit, number, get_date): + Add support for fractional seconds. + (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax. + (gmtime, localtime, mktime): Remove decls; not needed with C89. + (to_hour): First arg is now long int, not int. + (to_year): Returns long int, not int. + Don't treat year -70 like 70. + (tm_diff): Returns long int, not int. + (lookup_word): Use bool instead of int when appropriate. + (yylex): Use size_t for count, not int. + Detect overflow when parsing large integer constants. + Add support for fractions. + (get_date): Make pointers 'const' if possible. + Use more-portable code to detect integer overflow. + (main) [TEST]: Adjust to above changes. Test for localtime failure. + Don't use ctime; it's not reliable if the year has >4 digits. + +2004-03-15 Jim Meyering + + `date --date="21:04 +0100" +%S' would print the seconds value + from the current time, rather than `00'. + * getdate.y: For a date string like `10:23 +0100', + set the number of seconds to zero. Reported by Marc Haber. + +2004-03-04 Jim Meyering + + * cloexec.c (set_cloexec_flag) [ ! (F_GETFD && F_SETFD)]: + Return true, not false. + +2004-03-03 Paul Eggert + + * cloexec.c: Include "cloexec.h" first, and before . + (set_cloexec_flag): Use bool for booleans. All uses changed. + If F_GETFD returns a negative number (not just -1), report a + failure. Don't use F_SETFD if the flags are already right. + Don't report a failure with F_SETFD unless it returns -1. + * cloexec.h: Include . + Adjust signature to use `bool' rather than `int'. + * getloadavg.c (getloadavg): Use `true', not `1'. + +2004-03-02 Dmitry V. Levin + + * cloexec.c: New file. + The set_cloexec_flag implementation imported from GNU C Library + Reference Manual. + * cloexec.h: New file. + * getloadavg.c: Include "cloexec.h". + (getloadavg): Use set_cloexec_flag instead of manual fcntl call. + * Makefile.am (libfetish_a_SOURCES): Add cloexec.c, cloexec.h. + +2004-02-23 Paul Eggert + + * userspec.c: Don't include "posixver.h". + (parse_user_spec): Fall back on USER.GROUP parsing, regardless + of POSIX version, as POSIX 1003.1-2001 allows that behavior as a + compatible extension. Simplify code by removing a boolean int + that was always nonzero if a string was nonnull. + +2004-02-05 Jim Meyering + + * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define. + (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise. + From coreutils' system.h. + +2004-01-29 Jim Meyering + + * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h. + +2004-01-21 Paul Eggert + + * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]: + Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE. + * argmatch.h: Comment fix to match the above. + * long-options.c (parse_long_options): Use prototype + for usage function arg. Pass it EXIT_SUCCESS rather than 0, + for clarity. + * obstack.c (obstack_exit_failure) [!defined _LIBC]: + Now a macro referring to exit_failure, instead of a separate + variable. Include "exitfail.h" to get it. + * xstrtol.h: Include "exitfail.h". + (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2. + +2004-01-21 Jim Meyering + + * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal + so as not to conflict with a different-sized __mktime_internal + function in GNU libc. + +2004-01-16 Jim Meyering + + Merge from gnulib. + * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED, + rather than HAVE_GETC_UNLOCKED. + +2003-10-08 Paul Eggert + + Merge from gnulib. + + * unlocked-io.h: Include , so that the caller + doesn't have to include before us. + (clearerr_unlocked, feof_unlocked, ferror_unlocked, + fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked, + fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked, + putc_unlocked, putchar_unlocked): Define to the unlocked counterpart + if not declared, so that we can use getpass.c code from libc without + rewriting it. + (flockfile, ftrylockfile, funlockfile): New macros. + +2004-01-14 Paul Eggert + + Merge from gnulib. + + * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided + with like-named macro in fnmatch.c. + (EXT): Use an internal constant instead. + + Merge fnmatch patches from glibc. + * fnmatch.c (mbsinit): Remove define. + Add libc_hidden_ver (__fnmatch, fnmatch). + * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate. + Adjust to renaming of collseq_table_lookup to __collseq_table_lookup. + +2003-11-24 Paul Eggert + + Merge from gnulib. + + * alloca.c: Remove dependency on xalloc module. + (xalloc_die): Remove. + (memory_full) [!defined emacs]: New macro. + [!defined emacs]: Don't include xalloc.h. + (alloca): Invoke memory_full, not xalloc_die, if malloc fails or + address arithmetic overflows. Change datatypes a bit to avoid + unnecessary casts. + +2004-01-14 Paul Eggert + + * posixver.c: Include posixver.h. + +2004-01-12 Jim Meyering + + * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new, + optional configure-time default. + +2004-01-10 Jim Meyering + + * version-etc.c (version_etc_copyright): Update copyright date. + +2003-12-20 Jim Meyering + + * fts.c [!_LIBC]: Undefine, then define-away __P. + +2003-12-19 Jim Meyering + + Rewrite fts to use a hash table or O(1)-mem cycle-detection + code rather than the tree-based tsearch functions. + * fts_.h: Include hash.h and cycle-check.h. + (FTS_TIGHT_CYCLE_CHECK): New value. + (FTS_OPTIONMASK): Adjust to include the new value. + (FTS_NAMEONLY, FTS_STOP): Increase to allow room for new value. + (struct FTS) [active_dir_ht]: New member. Replaces fts_dir_signatures. + (struct FTS) [cycle_state]: New member. + * fts.c: Don't include . + [HAVE_INTTYPES_H]: Include . + (tdestroy, tfind, tsearch): Remove definitions. + (struct Active_dir): Rename from `known_object'. + (AD_compare, AD_hash): New functions. + (enter_dir, leave_dir): Rewrite to manipulate a hash table + rather than a tree. + (fts_open): Initialize hash table or cycle_state buffer. + (free_node): Remove function. + (find_matching_ancestor): Renamed/rewritten from look_up_active_dir. + (fts_cross_check): Adapt to use new data structure. + + * Makefile.am (libfetish_a_SOURCES): Remove search_.h. + (DISTCLEANFILES): Remove definition. + +2003-12-18 Jim Meyering + + Rewrite cycle detection code to work properly. + Add some framework (compiled out by default) to test it. + * fts.c (Dprintf, ENTER_DIR, LEAVE_DIR): Define. + (add_object): Remove function. Rewritten as... + (enter_dir): New function. + (leave_dir, free_node): New functions. + (fts_read): Ensure that we call ENTER_DIR or LEAVE_DIR, + as appropriate, before returning. + (look_up_active_dir, fts_cross_check) [FTS_DEBUG]: New functions. + (fts_stat): Don't perform the cycle check here. + Now it's done via enter_dir. + +2003-12-12 Jim Meyering + + * fts_.h (FTS) [fts_dir_signatures]: Add comment. + +2003-12-03 Paul Eggert + + * getgroups.c (getgroups): xmalloc takes one argument, not two. + Bug reported by Alfred M. Szmidt. + +2003-12-02 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Reflect sha -> sha1 renaming. + + * sha1.c: File renamed from sha.c. + * sha1.h: File renamed from sha.h. + Use SHA1_H, not _SHA_H in #ifndef condition. + + * sha.c: Add FSF Copyright. + * sha.h: Correct stale references to MD5 and `16 bytes'. + Patch by Ulrich Drepper. + + * sha.h: Add FSF Copyright. Remove reference to Scott Miller, + since this file is now nearly identical to md5.h. + + * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code. These + days, gcc-3.x does better all by itself. Patch from Dean Gaudet: + http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html + +2003-11-29 Jim Meyering + + * c-strtod.c (c_strtod): Save and restore original LC_NUMERIC setting, + in case it was different from the environment-derived value. + Patch by Paul Eggert. + Include "xalloc.h" for declaration of xstrdup. + +2003-11-24 Paul Eggert + + Parse floating-point operands and options in the C locale. + POSIX requires this for printf, and we might as well be + consistent elsewhere (tail, sleep, seq). + + * Makefile.am (libfetish_a_SOURCES): Add c-strtod.c, c-strtod.h. + * c-strtod.c, c-strtod.h: New files. + * xstrtod.h (xstrtod): Accept an extra arg, specifying the + conversion function. + * xstrtod.c (xstrtod): Likewise. All callers changed to + include c-strtod.h and use c_strtod. Don't include stdlib.h; no + longer needed. + + * xnanosleep.c: Don't include xstrtod.h; it's not needed. + +2003-11-22 Jim Meyering + + * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/. + +2003-11-21 Jim Meyering + + * xreadlink.c (xreadlink): Correct outdated comment. + +2003-11-17 Jim Meyering + + On systems without utime and without a utimes function capable of + dealing with a NULL struct utimbuf* argument, this utime replacement + could -- in unusual circumstances -- leak a file descriptor. + * utime.c: Include and . + (utime_null): Be sure to close `fd' and to preserve errno. + Reported by Geoff Collyer via Arnold Robbins. + +2003-11-13 Jim Meyering + + * xalloc.h, xstrtol.c: Update from gnulib. + +2003-11-11 Jim Meyering + + * ftw.c, ftw_.h: Remove files. No longer used. + +2003-11-09 Jim Meyering + + * root-dev-ino.c, root-dev-ino.h: New files. + * Makefile.am (libfetish_a_SOURCES): Add root-dev-ino.c root-dev-ino.h. + + * dev-ino.h: Include and . + +2003-11-06 Jim Meyering + + * free.c: New file, from gnulib. + +2003-10-31 Paul Eggert + + * mountlist.h (struct mount_entry.me_type_malloced): New member. + * mountlist.c (SIZE_MAX): Define if not defined already. + (read_filesystem_list): Set and use me_type_malloced. + Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or + whatever the type happens to be), for brevity and consistency. + Check for size calculation overflow on Alphas running OSF/1. + +2003-10-31 Jim Meyering + + * hash.c: Include "xalloc.h" for use of xalloc_oversized. + + * linebuffer.c: Include for declaration of memset. + + * alloca.c, linebuffer.c, xmalloc.c, xalloc.h: Update from gnulib. + * exclude.c, getgroups.c, quotearg.c, stdbool_.h: Update from gnulib. + * hash.c, hash-pjw.h: Update from gnulib. + +2003-10-25 Jim Meyering + + * hash.c, hash.h: Update from gnulib. + * hash-pjw.c, hash-pjw.h: Likewise. + * obstack.c, obstack.h: Likewise. + +2003-10-25 Jim Meyering + + * fts_.h: Include only if _LIBC. + [!_LIBC]: Define-away __THROW, __BEGIN_DECLS, __END_DECLS. + +2003-10-19 Jim Meyering + + * vasnprintf.c (vasnprintf): Work around losing snprintf on + e.g. HPUX 10.20. + +2003-09-25 Jim Meyering + Bruno Haible + + [Update from gnulib] + This lets translators provide better translations for the + "Written by ..." part of --version output. + * version-etc.h: Include stdarg.h. + (version_etc_copyright): Declare as readonly. + (version_etc): Make this function variadic with a NULL-terminated list + of author name strings. + (version_etc_va): New declaration. + * version-etc.c: Include stdarg.h, stdlib.h. + (version_etc_copyright): Declare as readonly. + (version_etc_va): New function. Provide a different translatable string + for each possible number of authors < 10. Abbreviate when there are 10 + authors or more. + (version_etc): Make this function variadic. Call version_etc_va. + Suggestion from Gary V. Vaughan. + + * long-options.h (parse_long_options): Change prototype: the authors + string is moved to the end and becomes variadic. + * long-options.c: Include stdarg.h. + (parse_long_options): Make this function variadic, too. + Call version_etc_va, not version_etc. + +2003-10-17 Jim Meyering + + * xfts.c, xfts.h: New files. + This factors out code used by du.c, chmod.c, and chown-core.c. + * Makefile.am (libfetish_a_SOURCES): Add xfts.c and xfts.h. + + * error.h: Update from gnulib. + * getpass.c: Likewise. + * fnmatch.c: Likewise. + * fnmatch_loop.c: Likewise. + +2003-10-16 Jim Meyering + + * xmalloc.c: Include , for declarations of memset and memcpy. + + * getgroups.c: Update from gnulib. + * readutmp.c: Fix indentation, from gnulib. + * exclude.c: Update from gnulib. + * xgethostname.c: Include xgethostname.h. + * xgethostname.h: New file, from gnulib. + * Makefile.am (libfetish_a_SOURCES): Add xgethostname.h. + +2003-10-15 Jim Meyering + + * userspec.h: New file. + * userspec.c: Include "userspec.h". + * Makefile.am (libfetish_a_SOURCES): Add userspec.h. + +2003-10-14 Paul Eggert + + Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't + properly diagnosed. + * human.c, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoul.c, xstrtoumax.c: + Sync with gnulib. + +2003-10-13 Paul Eggert + + * xalloc.h, xmalloc.c, xstrdup.c: Import latest version from gnulib. + +2003-09-29 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c. + +2003-10-02 Jim Meyering + + Don't require that the maximum length of a file name + encountered in a traversal fit in an `unsigned short', + and fix some portability bugs (don't depend on gcc). + + * fts.c: Include "fts_.h", not . + (ALIGNBYTES) [!(__GNUC__ >= 2)]: Add a definition that works with + compilers that don't have __alignof__. + (MAX): Use a definition that doesn't depend on gcc. + (fts_build): Make `len' and `maxlen' be of type size_t, not int. + Test for overflow in a less type-dependent manner. + Test HAVE_STRUCT_DIRENT_D_TYPE, rather than + defined DT_DIR && defined _DIRENT_HAVE_D_TYPE. + (fts_palloc): Test for overflow in a less type-dependent manner. + (fts_safe_changedir): Use stat, not stat64. + Use fstat, not __fxstat64(_STAT_VER. + + * fts_.h [FTS] (fts_pathlen): Change type from int to size_t. + [FTSENT] (fts_pathlen): Change type from u_short to size_t. + (fts_level): Change type from u_short to int. + + * Makefile.am (libfetish_a_SOURCES): Add fts.c fts_.h. + Remove ftw_.h. + +2003-09-29 Paul Eggert + + * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]: + Fix arg typo in previous patch. + +2003-09-28 Jim Meyering + + * error.c: Update from gnulib. + +2003-09-19 Jim Meyering + + * version-etc.h: (version_etc): Rename parameter, authors, + to written_by. + * version-etc.c: (version_etc): Likewise. + Combine fprintf and following putc('\n'. + + * version-etc.c, version-etc.h: Revert yesterday's changes. + * long-options.c, long-options.h: Likewise. + +2003-09-18 Jim Meyering + + This lets translators provide better translations for the + `Written by ...' part of --version output. + * version-etc.c: Include stdarg.h, stdlib.h, string.h, and xalloc.h. + (version_etc): Make this function variadic, + with a NULL-terminated list of author name strings. + (version_etc_va): New function. + Suggestion from Gary V. Vaughan. + * version-etc.h (version_etc_va): Declare it. + + * long-options.c: Include stdarg.h. + (parse_long_options): Make this function variadic (authors), too. + Call version_etc_va, not version_etc. + * long-options.h (parse_long_options): Update prototype. + +2003-09-16 Paul Eggert + + * linebuffer.c (readlinebuffer): Return NULL immediately upon + input error, instead of returning NULL the next time we are called + (and therefore losing track of errno). + +2003-09-15 Paul Eggert + + * getndelim2.c (getndelim2): Don't trash errno when a read + fails, so that the caller gets the proper errno. + + * readutmp.c (read_utmp): Likewise. + Check for fstat error. Close stream and free storage + when failing. + +2003-09-14 Jim Meyering + + * argmatch.c: Update from gnulib. + + * Makefile.am (libfetish_a_SOURCES): Add exit.h, strndup.h, + time_r.c, time_r.h. + +2003-09-13 Jim Meyering + + * setenv.c, strcspn.c, strdup.c, strndup.c, strnlen.c, strpbrk.c: + * strstr.c, strtod.c, strtoimax.c, tempname.c, unicodeio.c, userspec.c: + * vasprintf.h, xgethostname.c, xreadlink.c, xstrdup.c, xstrndup.c: + * xstrndup.h, xstrtod.c, xstrtol.c, yesno.c: Update from gnulib. + * strndup.h: New file, from gnulib. + * exit.h: New file, from GNU gettext, via gnulib. + +2003-09-06 Paul Eggert + + * time_r.c, time_r.h: New files. + + * mktime.c (my_mktime_localtime_r): Remove; all uses changed to + __localtime_r. + (__localtime_r) [!defined _LIBC]: New macro. Include . + (__mktime_internal) [!defined _LIBC]: Now extern, not static. + + * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to + __gmtime_r. + (my_strftime_localtime_r): Remove; all uses changed to __localtime_r. + (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros. + Include . + +2003-09-13 Jim Meyering + + * strtol.c: Update from gnulib. + +2003-09-12 Paul Eggert + + * argmatch.c, xgethostname.c, xmalloc.c: Include exit.h. + * obstack.c [!defined _LIBC]: Likewise. + * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h + * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise. + * exitfail.c: Don't include stdlib.h; no longer needed. + +2003-09-12 Paul Eggert + + * error.c (error_tail): Assume vprintf. + +2003-09-09 Paul Eggert + + More K&R removal. + + * getloadavg.c (getloadavg, main): Define via prototypes. + + * getopt.h (struct option.name): Assume C89, and use 'const'. + (getopt, etopt_long, getopt_long_only, _getopt_internal) + [defined __GNU_LIBRARY__]: Assume C89, so we can always declare + with a prototype. + * getopt.c (const): Remove macro. + Include unconditionally. + (my_index): Remove; all uses changed to strchr. + (strlen): Remove decl. + (exchange): Remove forward decl; no longer needed. + (exchange, _getopt_initialize, _getopt_internal, getopt, main): + Define with prototype. + * getopt1.c (const): Remove macro. + (getopt_long, getopt_long_only, main): Define with prototype. + + * getugroups.c: Include unconditionally. + + * getusershell.c: Include unconditionally. + (getusershell, setusershell, endusershell, readname, main): + Define with prototypes. + + * group-member.c: Include group-member.h first. + Include unconditionally. + + * hard-locale.c: Include hard-locale.h first. + Include , unconditionally. + + * hash.c (free, malloc): Remove decls. + Include unconditionally. + + * human.c: Include , unconditionally. + (getenv): Do not declare. + + * idcache.c: Include unconditionally. + + * long-options.c: Include long-options.h first, to test interface. + Include unconditionally. + + * makepath.c: Include makepath.h first, to test interface. + Include and unconditionally. + + * linebuffer.c: Include . + (free): Remove decl. + + * malloc.c: Include , for malloc; don't bother with stddef.h. + rpl_malloc returns void *, not char *. + * realloc.c (rpl_realloc): Likewise. Also, define with a prototype. + + * md5.h: Include unconditionally. + (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case. + (__P): Remove; all uses removed. + * md5.c: Include "md5.h" first. + (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream, + md5_buffer, md5_process_bytes, md5_process_block): + Define with prototypes. + * sha.h (__P): Remove all uses. (It wasn't defined??) + * sha.c: Include "sha.h" first. + Include , unconditionally. + + * memchr.c (__ptr_t): Remove; all uses changed to void *. + * memcmp.c (__ptr_t): Likewise. + * memrchr.c (__ptr_t): Likewise. + * memchr.c, memcmp.c, memcoll.c, memrchr.c: + Include unconditionally. + * memchr.c, memrchr.c: Include unconditionally. + * memchr.c: Include unconditionally. + * memchr.c (LONG_MAX): Remove. + * memrchr.c (LONG_MAX): Likewise. + * memchr.c (__memchr): Define via a prototype. + * memrchr.c (__memrchr): Likewise. + * memcmp.c (__P): Remove, and remove all uses. + (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment): + Remove forward decls; no longer needed. + * memcpy.c, memmove.c, memset.c: Include . + Use types required by C89 in prototype. + + * mkdir.c: Include , unconditionally. + * savedir.c: Likewise. + * mkdir.c (free): Remove decl. + * rmdir.c (rmdir): Define with a prototype. + * savedir.c: Include savedir.h first, to test interface. + + * mktime.c (STDC_HEADERS): Remove. + Include , unconditionally. + + * modechange.c: Include unconditionally. + (malloc): Remove decl. + + * mountlist.c: Include , unconditionally. + (free): Remove decl. + + * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]: + Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H. + (This type really should be intptr_t, but that's a C99ism.) + (_obstack_memcpy): Remove: all uses changed to memcpy. + Include unconditionally. + (struct obstack): Assume __STDC__ for types of members + chunkfun, freefun, extra_arg. + (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1, + _obstack_memory_used, obstack_alloc_failed_handler, obstack_init, + obstack_begin, obstack_specify_allocation, + obstack_specify_allocation_with_arg, obstack_chunkfun, + obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]: + Remove unprototyped decls and the macros that use them. + * obstack.c (POINTER): Remove. All uses changed to void *. + (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN, + _obstack_begin, _obstack_begin_1, _obstack_allocated_p) + (defined __STDC__ && __STDC__)]: + Remove nonprototyped code. + Include unconditionally. + (_obstack_begin, _obstack_begin_1, _obstack_newchunk, + _obstack_allocated_p, _obstack_free, obstack_free, + _obstack_memory_used, print_and_abort): + Define using prototypes. + (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base, + obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0, + obstack_finish, obstack_grow, obstack_grow0, obstack_make_room, + obstack_next_free, obstack_object_size, obstack_room) [0]: + Remove unused, unprototyped code. + + * path-concat.c: Include , unconditionally. + + * physmem.c (physmem_total, physmem_available, main): Define + with prototypes. + + * posixtm.c: Include , unconditionally. + (main): Define with a prototype. + + * posixver.c (getenv): Remove decl. + + * putenv.c (malloc): Returns void *, not char *. + Include unconditionally. + (strchr, memcpy, NULL): Do not define. + + * readtokens.c: Include readtokens.h first, to test interface. + Include , unconditionally. + (init_tokenbuffer): Define with a prototype. + + * regex.c (PARAMS): Remove. All uses removed. + All uses of _RE_ARGS removed, too. + Include , , , + unconditionally. + (bzero): Assume memset exists. + (memcmp, memcpy, NULL): Remove. + (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed + char, or assignments to local vars of type signed char. + (init_syntax_once, PREFIX(extract_number_and_incr), + PREFIX(print_partial_compiled_pattern), + PREFIX(print_compiled_pattern), PREFIX(print_double_string), + convert_mbs_to_wcs, print_fastmap, re_set_syntax, + PREFIX(regex_grow_registers), PREFIX(regex_compile), + PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1), + PREFIX(insert_op2), PREFIX(at_begline_loc_p), + PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space, + wcs_compile_range, byte_compile_range, truncate_wchar, + PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers, + re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2, + count_mbs_length, wcs_re_match_2_internal, + byte_re_match_2_internal, PREFIX(group_match_null_string_p), + PREFIX(alt_match_null_string_p), + PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate), + re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror, + regfree, PREFIX(extract_number)): Define with prototype. Remove + now-unnecessary declaration, if any. + (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec, + regcomp, regexec): + Remove now-unnecessary casts among pointer types. + * regex.h (_RE_ARGS): Remove. All uses removed. + + * rename.c: Include , unconditionally. + (free): Remove decl. + + * rpmatch.c: Include unconditionally. + + * save-cwd.c: Include unconditionally. + * xgetcwd.c: Likewise. + + * stat.c: Include , unconditionally. + (free): Remove decl. + + The following changes are not K&R related: + + * group-member.h: Include , so that this file is + self-contained. + * makepath.h: Likewise. + + * getusershell.c (readname, default_index, line_size, readname): + Use size_t, not int, for sizes. + (readname): If the size overflows, report an error instead of + looping forever. + +2003-09-09 Derek Robert Price + + * getndelim2.c: Assume stdlib.h per the C89 spec. + +2003-09-08 Paul Eggert + + Assume C89 or better; remove K&R cruft. + A few of these changes were first proposed by Derek Robert Price + in . + + * addext.c: Include unconditionally. + * backupfile.c: Include , unconditionally. + Don't declare getenv or malloc. + + * alloca.c: Include , unconditionally. + (POINTER_TYPE, pointer): Remove; all uses changed to void *. + (NULL): Remove. + (find_stack_direction, alloca): Use prototypes. + + * atexit.c (atexit): Define using a prototype. + + * basename.c, dirname.c, stripslash.c: + Include unconditionally. + + * bcopy.c: Include . + (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'. + + * canon-host.c: Include , unconditionally. + + * error.h (error, error_at_line, error_print_progname) + [! (defined (__STDC__) && __STDC__)]: Remove decls. + * error.c: Include error.h first, to check interface. + Include , , unconditionally. + (VA_START): Remove; all uses changeed to va_start. + (exit, strerror): Remove decls. + (error_print_progname): Prototype uncondionally. + Don't include ; no longer needed. + (private_strerror): Remove. + (error_tail): Always define. + (error, error_at_line): Assume C89 or better; always use prototypes. + + * euidaccess.c (main): Define with a prototype. + + * exclude.c: Include , unconditionally. + + * exitfail.c: Include unconditionally. + + * fnmatch_.h (__P): Remove. All uses changed to assume prototypes. + * fnmatch.c: Include fnmatch.h first, to test interface. + Include , , unconditionally. + (getenv): Remove decl. + (fnmatch): Define using a prototype. + * fnmatch_loop.c (FCT): Remove forward decl; no longer needed. + (FCT): Define using a prototype. + + * getdate.y: Include , unconditionally. + + * gethostname.c: Include . + (gethostname): Define with prototype. Length is size_t, not int. + +2003-09-08 Paul Eggert + + * utime.c [!HAVE_UTIMES_NULL]: Include , . + (utime_null): Fix typo: 'st' was sometimes called 'sb'. + +2003-09-09 Jim Meyering + + * getversion.c: Remove unused file. Reported by Paul Eggert. + +2003-09-03 Paul Eggert + + * human.c (human_readable): Fix bug that rounded 10501 to 10k. + Bug reported by Lute Kamstra in + . + + * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow", + "yesterday", "today", and "now" rather than tMINUTE_UNIT. Of + course with correspondingly smaller numbers for tomorrow and + yesterday. From Tadayoshi Funaba. Originally installed into + sh-utils on 1999-08-07, but the patch was mistakenly reverted by + the next change to that shared file (but this time in fileutils) + on 1999-08-29. + +2003-08-18 Paul Eggert + + * same.c: Include and unconditionally, + as we're now assuming that part of hosted C89. + (free) [!HAVE_DECL_FREE]: Remove decl; no longer needed. + (same_name): Invoke pathconf on destination, not source, as + that's a bit clearer even if they are the same dir. + +2003-08-18 Jim Meyering + + * getopt.h: Remove space before TAB. + +2003-08-17 Paul Eggert + + * same.c: Include , . + (_POSIX_NAME_MAX): Define if not defined. + (MIN): New macro. + (same_name): If file names are silently truncated, report + that the file names are the same if they are the same after + the silent truncation. + +2003-08-16 Paul Eggert + + Merge from gnulib. + * Makefile.am (libfetish_a_SOURCES): Remove getndelim2.c, + getndelim2.h, xstrtoimax.c. Add localcharset.h. + (CLEANFILES, SUFFIXES): Initialize to empty. + (EXTRA_DIST): Add getndelim2.c, getndelim2.h. + (install-exec-local): Use $(GLIBC21), not @GLIBC21@. + Do not mkdir libdir if not glibc21. + (charset.alias): @host@ -> $(host). + (SUFFIXES, .sin.sed, CLEANFILES): Reorder rules + to match gnulib module suggestions. + * localcharset.h, readlink.c: New files, from gnulib. + * asnprintf.c, asnprintf.c, asprintf.c, backupfile.h, + canon-host.c, config.charset, dirname.h, euidaccess.c, exclude.c, + fsusage.h, full-write.c, getloadavg.c, getndelim2.h, gettext.h, + group-member.h, hard-locale.h, hash.c, hash.h, hash-pjw.c, + localcharset.c, long-options.h, makepath.h, malloc.c, mbswidth.c, + mbswidth.h, md5.h, memcasecmp.c, memcasecmp.h, memcoll.h, + mkstemp.c, modechange.h, mountlist.h, path-concat.h, pathmax.h, + physmem.h, posixtm.h, printf-args.c, printf-args.h, + printf-parse.c, printf-parse.h, putenv.c, quote.h, readutmp.h, + ref-add.sin, ref-del.sin, safe-read.c, savedir.h, setenv.c, + setenv.h, stdbool_.h, strnlen.c, strpbrk.c, strtoimax.c, + strverscmp.h, tempname.c, unicodeio.c, unicodeio.h, + unistd-safer.h, unlocked-io.h, vasnprintf.c, vasnprintf.h, + vasprintf.c, vasprintf.h, version-etc.h, xgethostname.c, + xmemcoll.c, xstrtoimax.c, xstrtoumax.c: Sync with gnulib. + +2003-08-15 Paul Eggert + + * physmem.c: Include "physmem.h" before system includes. + +2003-08-10 Jim Meyering + + * utimens.c (utimens): Revert most of last change. + Test HAVE_WORKING_UTIMES instead of HAVE_UTIMES. + +2003-08-09 Jim Meyering + + * utimens.c (utimens): Test HAVE_UTIME, not HAVE_UTIMES. + Prefer utime, since it works and utimes doesn't on some systems. + FIXME: Revert the above change once we have a working utimes + replacement function. + +2003-08-06 Paul Eggert + + * Makefile.am (libeftish_a_SOURCES): Add utimens.c, utimens.h. + * utimens.c, utimens.h: New files. + +2003-08-09 Jim Meyering + + * unicodeio.c (unicode_to_mb): Change to `Solaris 5.7' in comment. + * putenv.c: Likewise. + + * fatal.c, fatal.h: Remove unused files. + + * Makefile.am: Use the e.g., `$(FNMATCH_H)' notation for AC_SUBST'd + variable names, rather than @FNMATCH_H@. + Likewise for $(ALLOCA_H). + (fnmatch.h): Use `$@' in the commands, in place of the three copies + of the literal target, `fnmatch.h'. + (alloca.h): Likewise. + +2003-08-08 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Remove fnmatch_.h. + (lib_OBJECTS): New macro, for convenience when cutting and + pasting Makefile.am templates from gnulib. + (EXTRA_DIST): Remove fnmatch_loop.c. + (BUILT_SOURCES): Append $(FNMATCH_H). + * Makefile.am: Import the following changes from gnulib templates + for alloca and fnmatch): + (all-local $(lib_OBJECTS)): New dependencies. + (alloca.h): Use alloca.h-t for temporary. + (EXTRA_DIST): Append fnmatch_.h, fnmatch_loop.c. + (fnmatch.h): New rule. + (MOSTLYCLEANFILES): Add fnmatch.h, fnmatch.h-t. + (DISTCLEANFILES): Remove fnmatch.h + +2003-08-08 Jim Meyering + + * mountlist.c (read_filesystem_list) [MOUNTED_GETFSSTAT]: + Use MNT_NOWAIT, rather than MNT_WAIT. Otherwise, `df DIR' could + hang on OSF/1 5.1 for DIR on both local and remote file systems. + Reported by (and fix confirmed by) Nelson H. F. Beebe. + +2003-08-07 Jim Meyering + + * regex.h (RE_SYNTAX_POSIX_AWK): Remove SPACE in SPACE-TAB sequence. + +2003-08-05 Paul Eggert + + Merge getline from gnulib. + * getline.h, getline.c: Merge from gnulib. + * getndelim2.h, getndelim2.c: New files, from gnulib. + * getdelim2.c, getdelim2.h: Remove. + * Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and + getdelim2.h to getndelim2.c and getndelim2.h. + +2003-08-04 Paul Eggert + + * regex.c, regex.h: Sync with gnulib. + +2003-08-03 Paul Eggert + + * stdbool_.h (_Bool): Use a #define, not a typedef. + +2003-07-31 Paul Eggert + + * bumpalloc.h: Remove. + * Makefile.am (libfetish_a_SOURCES): Remove bumpalloc.h. + +2003-07-28 Jim Meyering + + * stdbool_.h: Renamed from stdbool.hin. + * Makefile.am: Reflect renaming: stdbool.hin -> stdbool_.h. + * stdbool.hin: Remove file. + +2003-07-28 Paul Eggert + + * stdbool.hin (_Bool): Make it signed char, instead of + an enum type, so that it's guaranteed to promote to int. + +2003-07-23 Jim Meyering + + * xstrndup.h: New file. + * xstrndup.c: New file, factored out of dircolors.c from coreutils. + * Makefile.am (libfetish_a_SOURCES): Add xstrndup.c and xstrndup.h. + +2003-07-23 Jim Meyering + + * lstat.c, save-cwd.c, stat.c, utime.c, xgethostname.c: Normalize + naming of Sun operating systems in comments, e.g., SunOS4 -> SunOS 4, + Solaris5.9 -> Solaris 9. From Paul Eggert. + +2003-07-22 Paul Eggert + + * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and + over-parenthesization in macros. + +2003-07-18 Paul Eggert + + * closeout.h (close_stdout_set_status, close_stdout_status): Remove. + * closeout.c: Likewise. Include "closeout.h" right after config.h, + to test that it can stand by itself. Include "exitfail.h". + Clients should set exit_failure instead. + (EXIT_FAILURE): Remove; no longer needed. Do not include . + +2003-07-18 Andreas Schwab + + * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno. + +2003-07-17 Paul Eggert + + * xalloca.h, xmalloc.c, xmemcoll.c, xmemcoll.h: + Merge with gnulib. Use a single exit_failure variable rather + than a separate one for each module. + +2003-07-16 Jim Meyering + + * Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid + warning from automake -Wall. + +2003-07-14 Jim Meyering + + * save-cwd.h: Add copyright. + +2003-07-13 Jim Meyering + + * xgethostname.c: Include for declaration of free. + (xgethostname): Return NULL, rather than exiting, upon any + non-malloc/realloc error. + +2003-07-12 Jim Meyering + + * Makefile.am (BUILT_SOURCES): Use `BUILT_SOURCES += $(STDBOOL_H)' + rather than `all-local: $(STDBOOL_H)'. The latter didn't force + creation of stdbool.h before most other targets. + Likewise for $(ALLOCA_H). + + Don't emit diagnostics. Let callers do that. + * save-cwd.c: Don't include "error.h". + (save_cwd): Don't call error. Ensure that errno is valid + when returning nonzero. + + * obstack.h: Update from gnulib. + + * makepath.c (make_path): Enclose diagnostic in _(...). + +2003-07-10 Jim Meyering + + * userspec.c: Include "posixver.h". + (parse_user_spec): Accept `.' as a separator only + in pre-POSIX-200112 mode. + + * Makefile.am (libfetish_a_SOURCES): Add these: + printf-args.h, printf-parse.h, vasprintf.h, vasnprintf.h. + + Now that a program (`who') uses asprintf, we need all of these: + * asnprintf.c, asprintf.c, printf-args.c, printf-args.h, printf-parse.c: + * printf-parse.h, vasnprintf.c, vasnprintf.h, vasprintf.c, vasprintf.h: + New files, from gnulib. + + * alloca_.h, getpass.c, memrchr.c, obstack.h, posixver.c, + strftime.c, strnlen.c, strverscmp.c: Switch from LGPL to GPL. + +2003-07-09 Jim Meyering + + * mktime.c: Update from gnulib. + FIXME: but still need to adjust m4/mktime.c so that this fixed + version is used when needed. + + Fix the bug that would make `du /' omit the `/' on the last line. + E.g., `du --exclude '[^/]*' -x /' would print only "4\t\n" for me. + * ftw.c (ftw_dir): Don't clobber the leading `/'. + Reported by Chris Lesniewski as http://bugs.debian.org/200542. + +2003-07-04 Jim Meyering + + Update from gnulib. + * xreadlink.c: Include unconditionally, instead of + having it depend on HAVE_SYS_TYPES_H. + +2003-06-18 Jim Meyering + + * inttostr.h (PARAMS): Remove. All uses removed. + + Merge in change from gnulib. + * makepath.c: Remove block of alloca-related code in favor + of an unconditional `#include '. + + * xalloc.h: Include . + Remove unnecessary parentheses. + Use `1990-2000' notation in Copyright line until Emacs' + copyright-update function learns how to handle a comma-separated + list of years that spans a line boundary. + + * Makefile.am (libfetish_a_SOURCES): Add getdelim2.c and getdelim2.h. + + * getline.c (getdelim2): Move this function into its own file. + * getdelim2.c: Extracted from getline.c. + + * linebuffer.c, linebuffer.h: Update from gnulib. + + * getdelim2.c, getdelim2.h: New files. + * getstr.c, getstr.h: Remove files. + + * same.h: Update from gnulib. + * xstrtol.h: Update from gnulib. + +2003-06-17 Paul Eggert + + Assume C89, so PARAMS isn't needed. + * backupfile.h (PARAMS): Remove. All uses removed. + * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h, + group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h, + makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h, + path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h, + save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h, + unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h, + xstrtol.h: Likewise. + * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h, same.h, + * strverscmp.h: Do not include config.h; no longer needed. + Anyway, config.h should always be included before any other file. + +2003-06-17 Jim Meyering + + * getline.c: Update from gnulib. + + Merge in changes from gnulib. + * hash.c: Include unconditionally. + Include . + (CHAR_BIT): Don't define. + +2003-06-09 John David Anglin + + * acl.c: Include before . + Required on Ultrix 4.3. + +2003-05-20 Derek Price + + * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary. + +2003-06-10 Jim Meyering + + * getdate.y: Also accept dates of the form May-23-2003. + Suggestion from Karl Berry. + +2003-06-09 Jim Meyering + + * gettimeofday.c: Also undefine gmtime. + (rpl_gmtime): New function. Suggestion from Paul Eggert. + +2003-06-08 Jim Meyering + + * getline.h: Update from gnulib. + + Clean up, as part of merge with emacs version of strftime.c. + * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]: + Remove function, now that we can rely on a working tzset function. + [!_LIBC]: Ensure that the required autoconf test has been run. + * gettimeofday.c: Also undef tzset. + (rpl_tzset): New function, for use by new macro, gl_FUNC_TZSET_CLOBBER. + +2003-06-07 Jim Meyering + + * readtokens.h: Add copyright notice. + Include . + Remove definition and uses of __P. + + * readtokens.c: Put `Free Software Foundation, Inc.' in place of + my name in the copyright comment. + (init_tokenbuffer): Remove unnecessary parentheses around malloc. + + Update from gnulib. + * getdate.y: Include alloca.h unconditionally. + * xmemcoll.h: Include . + + * Makefile.am (MOSTLYCLEANFILES): Add alloca.h and alloca.ht. + (MOSTLYCLEANFILES): Add stdbool.ht. + + * human.c: Include , once again, for declaration of sprintf. + + Update from gnulib. + * tempname.c: Include unconditionally. + Include as an alternative to . + * strtoimax.c: Include as an alternative to . + * xstrtol.h: Likewise. + * xstrtoimax.c: Likewise. + * xstrtoumax.c: Likewise. + + Update from gnulib. + * strcasecmp.c: Include , not . + * savedir.c: Include . + (NULL): Don't define, since does that. + +2003-06-06 Jim Meyering + + Update from gnulib. + * rpmatch.c: Include without checking for HAVE_LIMITS_H. + Include unconditionally. + (NULL): Don't define, since does that. + * rename.c: #undef rename before defining rpl_rename. + [HAVE_CONFIG_H]: Guard inclusion of config.h. + * putenv.c: Include rather than , + as we merely need size_t. + * realloc.c: Likewise. + * quote.c: Don't include or ; not needed. + * modechange.c: Include . + (NULL): Don't define, since does that. + * memcoll.h: Include , to get size_t. + * memcoll.c: Include "memcoll.h", which gets us size_t and checks + our interface, instead of including + (memcoll): Fall back on a simple algorithm using + memcmp if strcoll doesn't work. + * memcasecmp.h: Include . + * memcasecmp.c: Don't include . + + From gnulib. + * alloca_.h: New file. + * Makefile.am (EXTRA_DIST): Add alloca_.h. + (all-local $(lib_OBJECTS)): Depend on $(ALLOCA_H). + (alloca.h): New rule. + + * addext.c: Update from gnulib. + * backupfile.c: Likewise. + * config.charset: Likewise. + * dirname.h: Likewise. + * fsusage.c: Likewise. + * userspec.c: Likewise. + * xreadlink.c: Likewise. + * xstrtol.c: Likewise. + * __fpending.h: Likewise. + + * md5.c: Include and unconditionally. + (memcpy): Remove definition. + + * posixtm.c: Include unconditionally. + +2003-06-05 Jim Meyering + + From gnulib. + * mktime.c: Assume freestanding C89 or better. + (HAVE_LIMITS_H): Remove. Assume it's 1. + (__P): Remove; not used. + (CHAR_BIT, INT_MIN, INT_MAX): Remove; defines them. + (mktime, not_equal_tm, print_tm, check_result, + main): Use prototypes. Use const * where appropriate. + (main): Fix typo in testing code that uncovered by above changes. + (Local Variables): Remove -DHAVE_LIMITS_H from compile-command. + +2003-06-04 Paul Eggert + + Merge human.c etc. from gnulib. + * exclude.c, human.c, human.h: Merge from gnulib. + * cycle-check.c, cycle-check.h, src/system.h: + Include unconditionally. + +2003-06-02 Jim Meyering + + * stdbool.hin: New file. From gnulib. + * Makefile.am (MOSTLYCLEANFILES): Initialize. + (stdbool.h): New rule. + (all-local $(lib_OBJECTS)): Depend on $(STDBOOL_H) + (MOSTLYCLEANFILES): Add stdbool.h. + (EXTRA_DIST): Add stdbool.h. + +2003-05-30 Jim Meyering + + * addext.c: Update from gnulib. + * mktime.c: Likewise. + +2003-05-29 Jim Meyering + + Make the %r format directive honor any locale setting. + * strftime.c: (my_strftime) [!defined _NL_CURRENT && HAVE_STRFTIME]: + Use underlying_strftime for %r. + +2003-05-15 Jim Meyering + + * getopt.h: Remove a space before a TAB. + +2003-05-13 Jim Meyering + + * setenv.c (setenv): Don't apply cast to argument of free. + * putenv.c (rpl_putenv): Likewise. + * alloca.c (alloca): Likewise. + +2003-05-12 Jim Meyering + + * ftw.c (ftw_startup): Always call free_cwd after restore_cwd. + Reported by Matti Aarnio as + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90563. + Forwarded by Tim Waugh. + + * strftime.c (my_strftime): Let the `-' (no-pad) flag affect + the space-padded-by-default conversion specifiers, %e, %k, %l. + +2003-05-07 Paul Eggert + + * xnanosleep.c (timespec_subtract): Don't modify the 2nd arg. + Work even if X-Y overflows when subtracting. Make explicit the + assumption that tv_nsec must be in range. + (clock_get_realtime): Remove. All callers changed to invoke gettime, + for simplicity. + (xnanosleep): Check for gettime failure every time. + +2003-05-06 Jim Meyering + + * xnanosleep.c (clock_get_realtime): Use gettime.c's gettime function, + rather than an inferior, open-coded version that would fail on + AIX systems due to clock_gettime failing with errno == ENOSYS. + Reported by Jérôme Zago. + +2003-05-05 Jim Meyering + + Avoid array overrun. + * ftw.c (nftw_arr): Update to reflect complete list of members. + (ftw_arr): Likewise + Reported by Olatunji Oluwabukunmi Ruwase. + + Make it less likely that the above can happen again. + * ftw.c (struct dummy): Ensure that at least the number of + initializers matches the number of members in the corresponding enum. + * ftw_.h (enum Ftw_option): Name this previously-anonymous enum. + (enum Ftw_option) [FTW_N_MEMBERS]: New member. + +2003-05-04 Jim Meyering + + * setenv.c (__set_errno, LOCK, UNLOCK): Define. + (unsetenv): Update from GNU libc. + Ifdef-out this function, since the only caller + is putenv.c and that file now has its own copy. + + This avoids a core dump on systems without GNU putenv, + when running `env -u SOME_ALREADY_UNSET_VARIABLE'. + * putenv.c (__set_errno, LOCK, UNLOCK): Define. + (unsetenv): New static function, from GNU libc. + (rpl_putenv): Use it. + +2003-05-02 Jim Meyering + + * canonicalize.c (canonicalize_file_name) [!HAVE_RESOLVEPATH]: + A memory-allocation error could result in heap corruption. Fix it + by also updating `dest' when rpath may be changed by xrealloc. + +2003-04-15 Jim Meyering + + * getloadavg.c: Remove (or replace-with-TAB(s) to retain alignment) + each sequence of spaces before a TAB character. + * md5.c, getopt.c, getopt.h, obstack.h, strftime.c: Likewise. + +2003-04-11 Jim Meyering + + * readutmp.c: Include and unconditionally. + + * canonicalize.c, exclude.c, getgroups.c, getusershell.c: + * group-member.c, idcache.c, mountlist.c, readtokens.c, readutmp.c: + * bumpalloc.h: Remove anachronistic casts of xmalloc, xrealloc, + and xcalloc return values. + + * xalloc.h (PARAMS): Remove definitions and uses. + (XMALLOC, XCALLOC, XREALLOC): Remove unnecessary casts. + + * xmalloc.c: Remove use of PARAMS. + +2003-04-10 Jim Meyering + + * canonicalize.c (canonicalize_file_name) [HAVE_RESOLVEPATH]: Remove + stray semicolon that caused `readlink --canonical RELATIVE_NAME' to + fail on e.g., Solaris systems. Reported by Bruce Korb. + (canonicalize_file_name): Return NULL immediately if resolvepath fails. + Otherwise, `readlink --canonical /no-such-file' would exhaust + virtual memory on some systems (e.g. Solaris). + (canonicalize_file_name): Always free `extra_buf' before returning. + (canonicalize_file_name): NUL-terminate the result. + +2003-04-05 Jim Meyering + + * Makefile.am (DEFS): Use += notation rather than `DEFS = ... @DEFS@'. + Use $(VAR) rather than @VAR@, now that we can rely on automake to + emit a definition for each substituted variable. + +2003-03-26 Richard Dawe + + * dirname.c [TEST_DIRNAME]: Update build instructions for test. + Add test-cases for DOS filenames. Declare program_name. + (main): Set up program_name. + +2003-03-22 Jim Meyering + + * strftime.c (widen): Cast alloca return value to proper type. + + * fnmatch_loop.c + (NEW_PATTERN): Cast alloca return value to proper type. + Otherwise, it wouldn't compile with at least /bin/cc on + ymp-cray-unicos9.0.2.X. + Combine two mostly-identical uses of alloca into one. + Thanks to the Cray-Cyber project for access to a Cray Y-MP. + +2003-03-19 Jim Meyering + + DJGPP doesn't have S_ISLNK, so provide a replacement. + * ftw.c (S_IFMT): Define, if necessary. + [STAT_MACROS_BROKEN]: Undefine S_ISLNK. + (S_ISLNK): Define, if necessary. + Based on a patch from Rich Dawe. + + * exclude.h (PARAMS): Remove definition and uses. + * exclude.c: Remove uses of `PARAMS'. + + * fnmatch_.h: Don't define __const. + (fnmatch): Use const, not __const in prototype. + From Paul Eggert. + +2003-03-17 Richard Dawe + + * fchdir-stub.c: New file: trivial stub for fchdir. + +2003-03-18 Jim Meyering + + * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any + error from mntctl. + Use mntctl's return value to drive the entry-processing loop, since + we can't rely on the value of the vmt_length member in the last + entry. On some systems doing so could result in exhausting + virtual memory. Based in part on a patch from Mike Jetzer. + + * quote.c (quote_n): Fix typo in comment. + +2003-03-17 Jim Meyering + + * raise.c (raise): Rename from rpl_raise. + Without that change, systems lacking raise (SunOS 4) would not be + able to link programs using raise. Reported by Volker Borchert. + + * ftw.c (FTW_STAT): Rename from `STAT', to avoid conflict + with STAT definition from on AIX 5.1. + Suggestion from Mike Jetzer and Petter Reinholdtsen. + + * fchown-stub.c (fchown): Put function type on its own line. + * readlink-stub.c (readlink): Likewise. + * lstat-stub.c (lstat): Likewise. + +2003-03-14 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Remove definition -- + before it pointed to ../src/ansi2knr. Some of these files + have required an ANSI (c89) compiler for a year or two. + (libfetish_a_SOURCES): Remove unused files: c-stack.c, c-stack.h. + +2003-02-04 Dmitry V. Levin + + * stat.c: Include "xalloc.h". + +2003-03-13 Paul Eggert + + Merge changes from Bison. + * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to + (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5 + when compiling Bison 1.875's `bitset bset = obstack_alloc + (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe. + +2003-01-30 Richard Dawe + + * fchown-stub.c: New file: trivial stub for fchown. + * lstat-stub.c: New file: trivial stub for lstat. + * readlink-stub.c: New file: trivial stub for readlink. + +2003-03-09 Paul Eggert + + * argmatch.c (EXIT_FAILURE): Define if the system doesn't. + Reported by Bruce Becker; see: + http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html + +2003-03-03 Paul Eggert + Bruno Haible + + * mbswidth.h: Include . Needed for UnixWare 7.1.1. + Reported by John Hughes, see + http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html + +2003-03-09 Jim Meyering + + * ftw.c: Include "save-cwd.h". + (ftw_startup): Avoid use of getcwd, if possible. + Instead, use fopen/fchdir via save_cwd/restore_cwd. + +2003-03-08 Jim Meyering + + * xnanosleep.c: Don't use `defined' in a #define directive. + +2003-03-07 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Remove mmap-stack.h. + + * mmap-stack.c, mmap-stack.h: Remove files. + + * getcwd.c: #undef getcwd only after *all* included header files. + Declare getcwd unconditionally. The problem was that same.h + included config.h, and that defined getcwd to rpl_getcwd a second + time (after the original #undef), and led to the rpl_getcwd + function calling itself endlessly. This was the cause of at least + the `du' test failures on IRIX 6.5, reported by Nelson Beebe. + + * same.h (same_name): Remove unnecessary inclusion of config.h. + It also happened to lead to infinite recursion in getcwd.c. + (PARAMS): Remove definition and use. + +2003-03-06 Jim Meyering + + * ftw.c (ftw_startup): Declare `func' parameter to be of type + NFTW_FUNC_T, not void* which may be smaller on 64-bit systems. + Remove now-unnecessary cast. + (FTW_NAME): Cast func argument to type `NFTW_FUNC_T'. + +2003-03-05 Jim Meyering + + * physmem.c (ARRAY_SIZE): Define it. + +2003-03-04 Jim Meyering + + * makepath.c (CLEANUP_CWD): Call error here, now that restore_cwd + no longer does it. + + * save-cwd.h (restore_cwd): Update prototype. + * save-cwd.c (restore_cwd): Remove two parameters. + Simplify. Don't call error upon failure. Let callers do that. + (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4 + when auditing is enabled. But don't bother updating the #if. + + * xgetcwd.c (xgetcwd): Improve comment. + + * getcwd.c: New file. + +2003-02-28 Jim Meyering + + * ftw.c (ftw_startup): Return -1 if alloca fails. + +2003-02-28 Jim Meyering + + * fts.c (fts_children): If opening `.' fails, set the fts_child + member to NULL before returning. From NetBSD. + + * fts.c (fts_children): If fchdir fails, close file descriptor + before returning. From NetBSD. + +2003-02-27 Jim Meyering + + * physmem.c (physmem_total, physmem_available): Add comments. + From Kaveh Ghazi. + + * physmem.c: Merge in portability changes from gcc/libiberty + to support AIX, Tru64, and Windows. See the ChangeLog there + for credits and details. Thanks to Kaveh Ghazi for helping + to keep these files in sync. + +2003-02-24 Jim Meyering + + * fts_.h [__USE_FILE_OFFSET64]: Remove #error directive. + + (fts_open): Initialize local, tmp, to pacify gcc. + + * fts_.h [struct FTS] (fts_dir_signatures): New, opaque member. + * fts.c: Include . + (struct known_object): Define. + (object_compare, add_object, find_object): New functions, like + those in ftw.c. + (fts_open): Initialize new member. + (fts_close): Free memory allocated for new member. + (fts_stat): Detect a cycle in O(logN) time per directory processed. + + * fts.c [HAVE_CONFIG_H]: Include . + Conditionalize inclusion of . + Conditionalize inclusion of vs . + Include autoconf-recommended block of dirent/NAMELEN-related + definitions and includes. Use NAMLEN throughout, rather than + _D_EXACT_NAMLEN. + [_LIBC] (close, closedir, fchdir, open, opendir): Define. + [_LIBC] (readdir, tdestroy, tfind, tsearch): Define. + Remove `__' prefix from all uses of the above. This will help + to merge *BSD changes. + [!_LIBC] (internal_function): Define. + [! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define lstat. + (__set_errno): Define if not already defined. + + * fts.c: (fts_open): If fts_alloc returns NULL, don't dereference it. + (fts_read): If fts_safe_changedir fails because it is not + able to chdir into a subdirectory, then inform the caller. + + * fts.c, fts_.h: New files, directly from glibc. + +2003-02-23 Jim Meyering + + * fts_.h (struct _ftsent) [fts_level]: Change type from short to int, + so it can handle a root-relative file name longer than 32K bytes. + [fts_pathlen, fts_namelen]: Rearrange members to decrease size of + this struct from 84 to 80 bytes. + +2003-02-21 Jim Meyering + + * mmap-stack.h: Undefine HAVE_MMAP_STACK, thus disabling + this code on all systems. + + Merge in some changes from GNU libc. + * md5.h (md5_uintptr): Define. + + * ftw.c: Include before . + This is required for Apple Darwin 6.3 (MacOS 10.2.3). + Patch by Nelson Beebe. + +2003-02-19 Jim Meyering + + * md5.c: Merge in some clean-up and optimization changes from glibc. + * sha.c: Apply those same changes here, too. + +2003-02-18 Jim Meyering + + * md5.c (md5_stream) [BLOCKSIZE]: Move definition to top of file. + Ensure that it is a multiple of 64. + Rearrange loop exit tests so as to avoid performing an + additional fread after encountering an error or EOF. + * sha.c (sha_stream): Likewise. + Reported by Michael Bacarella. + + * Makefile.am (CLEANFILES): Remove ftw.h and search.h. + (DISTCLEANFILES): Add them here. + Add fnmatch.h, too. + + * sha.c (sha_stream): Rearrange loop exit tests so as to avoid + performing an additional fread after encountering an error or EOF. + +2003-02-17 Jim Meyering + + * mmap-stack.h (RUN_WITH_BIG_STACK_4): Define. + + * physmem.c: Undo most of last change. + Use sysmp instead, since it provides a cleaner interface. + From Kaveh Ghazi. + +2003-02-16 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add mmap-stack.h. + + * mmap-stack.c (MAP_ANONYMOUS): Use MAP_ANON, if possible. + Initialize `fd' to -1, so Solaris' mmap works with MAP_ANON. + +2003-02-15 Jim Meyering + + * mmap-stack.c, mmap-stack.h: New files. + Let the caller run a function with a larger (mmap'd) stack. + + Add Irix6 support to physmem.c. + * physmem.c (irix_sysget): New function. + (IRIX_SYSGET_TOTAL, IRIX_SYSGET_AVAILABLE): New macros. + (physmem_total, physmem_available): Use them. + (main) [DEBUG]: New function. + +2003-02-11 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add euidaccess.h. + * euidaccess.c: Include "euidaccess.h". + * euidaccess.h: New file. + +2003-02-08 Jim Meyering + + * ftw.c (ftw_startup): Don't shadow outer declaration of save_err. + Merge inconsequential changes from libc. + + * ftw.c (ftw_startup): When using FTW_CHDIR, always remember + the current directory, not just when DIR contains a slash. + Reported by Manoj Srivastava via Michael Stone as Debian bug #180228. + +2003-02-07 Jim Meyering + + Merge inconsequential changes from libc. + * ftw.c: Include limits.h earlier. + Move PATH_MAX definition `down' a little; add comment. + Rename local, saved_errno to save_err. + +2003-02-06 Jim Meyering + + Support for pruning. + * ftw_.h (FTW_DPRE) [enum]: New member and definition. + (struct FTW) [skip]: New member. + + * search_.h (__restrict): Define to `restrict' or to nothing. + + * fsusage.c: Remove declaration of statfs. + It conflicted with one from OSF/1 5.1 in . + Reported by Nelson Beebe. + +2003-02-05 Jim Meyering + + Fix a heap-corruption bug that affected Solaris systems. + * ftw.c: Include . + (PATH_MAX): Define to 1024, if not already defined. + (process_entry): Allocate enough space to hold the resulting + file name. Don't presume that 2*dirbufsize is enough. + (ftw_startup): Always use PATH_MAX to compute buffer size, now that + it is guaranteed to be defined. + Nelson Beebe reported that du would sometimes segfault on Solaris. + + * ftw.c (process_entry): When using FTW_DEPTH, call `func', the + user-supplied callback, once for the current directory before calling + ftw_dir, in case that part of the hierarchy should be pruned. + `func' does that by setting `data->skip'. + (ftw_startup): Likewise. + +2003-02-02 Jim Meyering + + * ftw.c (lstat) [!_LIBC && !LSTAT_FOLLOWS_SLASHED_SYMLINK]: + Define to rpl_lstat. + +2003-01-25 Jim Meyering + + * ftw.c (ISSLASH, FILESYSTEM_PREFIX_LEN) [_LIBC]: Define. + (base_name): New function. + (ftw_startup): Don't strip trailing slashes. + Use base_name to find the offset of the basename. + +2003-01-25 Jim Meyering + + * ftw.c (object_compare): Compare inode numbers before device numbers. + The former is much more likely to differ for any two given file objects. + +2003-01-23 Jim Meyering + + * tsearch.c [HAVE_CONFIG_H]: Include . + Add autoconf-recommended block of alloca-related code. + Cast each use of alloca to the required type, (node**). + + * ftw.c: Add autoconf-recommended block of alloca-related code. + [!_LIBC] (__getcwd): Define to xgetcwd and declare xgetcwd. + +2003-01-22 Jim Meyering + + * ftw.c (find_object): Don't use c99-style struct initializer. + + * ftw_.h: Change all uses of __const to const. + * search_.h: Likewise. + + * Makefile.am (CLEANFILES): Add generated files: ftw.h search.h. + + * ftw.c (process_entry): Handle FTW_DCHP. + (ftw_dir): Handle FTW_DCH. + + * ftw_.h [!_LIBC && !__USE_XOPEN_EXTENDED]: Define __USE_XOPEN_EXTENDED + and FTW_H_STANDALONE. + [anon enum] (FTW_DCH, FTW_DCHP): New members. + (FTW_DCH, FTW_DCHP): Define. + + * ftw.c: Include autoconf-recommended block of dirent/NAMELEN + related definitions and includes. Use NAMELEN throughout, + rather than _D_EXACT_NAMLEN. + [_LIBC]: Define NAMELEN to _D_EXACT_NAMLEN. + (stpcpy): Declare, if necessary. + (mempcpy): Define, if necessary. + [!_LIBC] (__stpcpy, __mempcpy): Define. + [!_LIBC] (LXSTAT, XSTAT): Define. + +2003-01-21 Jim Meyering + + * tsearch.c: New file, from GNU libc. + [! weak_alias]: Define __-prefixed names to publicized ones. + [! defined _LIBC] (weak_alias, internal_function): Define-away. + [defined weak_alias]: Guard each use of weak_alias. + +2003-01-20 Jim Meyering + + * canonicalize.c: Include "path-concat.h". + + * search_.h: New file, from GNU libc. + + * Makefile.am (libfetish_a_SOURCES): Use ftw_.h here, too. + (libfetish_a_SOURCES): Add search_.h. + * ftw_.h: Rename from ftw.h. + + * obstack.h (obstack_object_size): Declare temporary, __o, + to be const, in order to avoid warnings. + (obstack_room): Likewise. + (obstack_empty_p): Likewise. + + Merge in changes from GNU libc + * error.c: Eliminate many `#ifdef USE_IN_LIBIO' conditionals. + +2003-01-19 Ulrich Drepper + + From GNU libc. + * strftime.c (my_strftime): Handle very large width + specifications for numeric values correctly. Improve checks for + overflow. + +2003-01-19 Jim Meyering + + * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions. + (nl_get_alt_digit) [! defined my_strftime]: Define. + (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of + _nl_get_alt_digit and _nl_get_walt_digit. + + * strftime.c (my_strftime): Merge in locale-related changes from libc. + These changes have no effect outside of _LIBC. + +2003-01-14 Jim Meyering + + * same.c (same_name): Declare *_basename locals to be `const'. + Consolidate declarations and initializations of *_base* locals. + +2003-01-11 Bruno Haible + + * same.c (same_name): Reorder tests so as to avoid calling stat() + when a string comparison is sufficient. + +2003-01-11 Bruno Haible + + * readtokens.c (readtoken): Cast character to 'unsigned char', not + 'unsigned int'. + +2003-01-14 Jim Meyering + + * ftw.c: Merge in Ulrich's and my changes from libc. + +2003-01-12 Jim Meyering + + * ftw.c (ftw_startup): Rename local-shadowing local to pacify gcc. + Also work on systems that have `struct direct', using autoconf's + AC_HEADER_DIRENT. + Tweak comments. + + * ftw.h, ftw.c: New files, from glibc/io. + + * Makefile.am (libfetish_a_SOURCES): Add ftw.h. + +2003-01-11 Jim Meyering + + * makepath.c: Don't test HAVE_ERRNO_H. It's not necessary. + + * canonicalize.c: Don't test HAVE_ERRNO_H. It's not necessary. + Don't test HAVE_STDDEF_H. It's not necessary. + Use definition of PTR_INT_TYPE from obstack.h. + +2002-12-01 Dmitry V. Levin + + * canonicalize.c: New file. + The readlink-based implementation imported from GNU C Library. + The resolveip-based implementation imported from src/df.c (show_point). + * canonicalize.h: New file. + * Makefile.am (libfetish_a_SOURCES): Add canonicalize.h. + +2003-01-10 Jim Meyering + + * save-cwd.h: Remove uses of PARAMS. + +2002-11-30 Dmitry V. Levin + + * xgetcwd.h: New file. + * Makefile.am (libfetish_a_SOURCES): Add xgetcwd.h. + * save-cwd.c: Include "xgetcwd.h". + * xgetcwd.c: Likewise. + +2002-11-30 Dmitry V. Levin + + * getgroups.c: Don't declare functions declared by xalloc.h. + Include "xalloc.h" instead. + * group-member.c: Likewise. + * idcache.c: Likewise. + * readutmp.c: Likewise. + +2003-01-08 Jim Meyering + + * full-write.c: Undefine and define-away `const' after inclusion + of errno.h, not before. Suggestion from Bruno Haible. + +2003-01-06 Jim Meyering + + * full-write.c: Rework so that it may serve to define full_read, too. + * full-read.c: Simply #define FULL_READ and include full-write.c. + + * Makefile.am (libfetish_a_SOURCES): Add full-read.c and full-read.h. + * full-read.c, full-read.h: New files. + + Update from gnulib. + + 2002-12-10 Paul Eggert + Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7. + * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS): + Choose values that are less likely to collide with system fnmatch + options. + * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not + defined (e.g., a pure POSIX system). + (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME + instead of FNM_FILE_NAME, for compatibility with pure POSIX systems. + + Update from gnulib. + + * utime.c (utime_null): Use SAFE_READ_ERROR. + (utime_null): No need to call ftruncate if the file was nonempty. + * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE. + * canon-host.c (strdup): Remove unused declaration. + * fsusage.c: Include full_read.h. + (get_fs_usage): Use full_read instead of safe_read. + Patches by Bruno Haible. + +2003-01-04 Jim Meyering + + * version-etc.c: Update copyright date. + +2002-12-31 Jim Meyering + + * dev-ino.h: New file. + * cycle-check.c: New file. + * cycle-check.h: New file. + * Makefile.am (libfetish_a_SOURCES): Add cycle-check.c, cycle-check.h, + and dev-ino.h. + +2002-12-21 Jim Meyering + + * stime.c: Remove file (for real, this time). + +2002-12-15 Jim Meyering + + * strftime.h: New file, for declaration of nstrftime. + * Makefile.am (libfetish_a_SOURCES): Add strftime.h. + +2002-12-09 Jim Meyering + + * unlocked-io.h: Sync from gnulib. + +2002-12-06 Jim Meyering + + * unlocked-io.h: New file, but with proper copyright notice and + attribution. Note: this is *not* the same as the file in gnulib. + This uses #if HAVE_FUNC_UNLOCKED for each `FUNC', rather than + HAVE_DECL_FUNC_UNLOCKED. This usage is consistent with the autoconf + macro in ../m4/jm-glibc-io.m4. Modulo comments, this file still + contains exactly what was generated by gen-uio. + +2002-12-04 Paul Eggert + + Do not generate unlocked-io.h automatically, since it's easier to + maintain it by hand. + + * gen-uio: Remove. + * Makefile.am: Add copyright notice. + (libfetish_a_SOURCES): Add unlocked-io.h. + (BUILT_SOURCES, all-local): Remove unlocked-io.h. + (DISTCLEANFILES, io_functions): Remove macros. + (EXTRA_DIST): Remove gen_uio. + (unlocked-io.h): Remove rule. + +2002-12-05 Paul Eggert + + * alloca.c [defined emacs]: Include "lisp.h". + (xalloc_die) [defined emacs]: New macro. + (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE. + [! defined emacs]: Include . + (POINTER_TYPE) [!defined POINTER_TYPE]: New macro. + (pointer): Typedef to POINTER_TYPE *. + (malloc): Remove decl; we now always use xmalloc. + (alloca): Use old-style definition, since Emacs needs this. + Check for arithmetic overflow when computing combined size. + +2002-12-04 Jim Meyering + + Reflect the fact that stat.c and lstat.c are no longer generated. + * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c. + (DISTCLEANFILES): Likewise. + (EXTRA_DIST): Likewise. + (all_local): Don't depend on stat.c or lstat.c. + (stat.c, lstat.c): Remove rules. + (EXTRA_DIST): Remove xstat.in. + + * xstat.in: Remove file. Contents moved into stat.c. + * stat.c: Rework so that it may serve to define rpl_lstat, too. + * lstat.c: Simply #define LSTAT and include stat.c. + + * safe-read.c: Rework so that it may serve to define safe_write, too. + * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c. + +2002-12-03 Jim Meyering + + * safe-read.h: Update from gnulib (add comments, include stddef.h). + +2002-12-02 Jim Meyering + + * safe-read.c (EINTR): Define. + (safe_read): Rewrite to iterate IFF the read fails with EINTR. + +2002-12-01 Jim Meyering + + * safe-read.c: Merge from gnulib. + (safe_read): Also exit the loop when read returns zero. + (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define. + + * Makefile.am (libfetish_a_SOURCES): Add safe-write.c and safe-write.h. + + * strtoll.c: Update from gnulib (trivial changes). + * strdup.c: Likewise. + * strpbrk.c: Likewise. + * strstr.c: Likewise. + * tempname.c: Likewise. + * obstack.c: Likewise. + * getopt.c: Likewise. + * getopt1.c: Likewise. + * getopt.h: Likewise. + * quote.h: Update from gnulib: add Copyright comment. + * quote.c: Likewise. + +2002-11-28 Jim Meyering + + * mktime.c: Merge from gnulib/libc, for a slightly uglier solution. + + Merge some more, in preparation for merge back into libc. + * error.c (_): Define only if not already defined. + Move definition to follow all #include directives. + Include unlocked-io.h only if !_LIBC. + + Merge in changes from libc. + * error.c [_LIBC]: Include . + [USE_IN_LIBIO]: Include + (fflush): Tweak definition to use INTUSE. + (putc): Define. + +2002-11-23 Jim Meyering + + From gnulib, by Bruno Haible + * closeout.c: Include gettext.h instead of . + * makepath.c: Likewise. + * rpmatch.c: Likewise. + * userspec.c: Likewise. + * version-etc.c: Likewise. + * xmemcoll.c: Likewise. + * error.c [!_LIBC]: Include gettext.h instead of . + + * mbswidth.h: Update from gnulib. + * mbswidth.c: Likewise. + * localcharset.c: Likewise. + * config.charset: Likewise. + * unicodeio.c: Likewise. + +2002-11-22 Paul Eggert + + * quotearg.h: Allow multiple inclusion by surrounding with + "#ifndef QUOTEARG_H_". Include , for size_t, + so that we can be included first. + (PARAMS): Remove; we now assume C89 or later. All uses removed. + * quotearg.c: Include quotearg.h immediately after config.h. + No need to include stddef.h or sys/types.h any more. + Surround local include files with "", not "<>". + Assume HAVE_LIMITS_H unconditionally, as we assume C89. + Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX, + HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS. + (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC. + (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT. + (ISPRINT): Remove; no longer needed now that we assume C89. + + (clone_quoting_options, quotearg_buffer, quotearg_n_options): + Preserve errno. + + (quotearg_buffer_restyled, quotearg_n, quotearg_n_style, + quotearg_char): Use SIZE_MAX rather than + (size_t) -1 when we are talking about "infinity". + + (quotearg_buffer_restyled): Fix bug when quoting trigraphs. + +2002-11-22 Jim Meyering + + From gnulib. + * strstr.c: Don't include . It's unnecessary. + +2002-11-21 Bruno Haible + + Remove case insensitive option matching. + * argmatch.h (argcasematch): Remove declaration. + (ARGCASEMATCH): Remove macro. + (__xargmatch_internal): Remove case_sensitive argument. + (XARGMATCH): Update. + (XARGCASEMATCH): Remove macro. + * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove + case_sensitive argument. + (argcasematch): Remove function. + (__xargmatch_internal): Remove case_sensitive argument. + (main): Use XARGMATCH instead of XARGCASEMATCH. + + * argmatch.c: Include gettext.h instead of and . + +2002-11-21 Bruno Haible + + * xmalloc.c: Change compile-time error message. Add comment about + required autoconf version. + * xmalloc.c: Include gettext.h instead of . + (textdomain): Remove definition. + +2002-11-21 Jim Meyering + + * strdup.c (strdup): Merge in changes from gnulib; mainly to + use memcpy rather than strcpy. + + * strcspn.c: Update from gnulib. + + * sig2str.c (str2signum): Use unsigned, not size_t, for type of index. + + * quotearg.c: Use `"'s when including quotearg.h and xalloc.h, + not the `<...>' notation. + Include and declare errno if necessary. + + * README: Update from gnulib. + +2002-11-20 Paul Eggert + + Merge argmatch cleanups from Bison. Assume C89. + + * argmatch.c: Include config.h here, not in argmatch.h. + Include stdlib.h, for EXIT_FAILURE. + Always include , since we assume C89. + (EXIT_FAILURE): Remove pre-C89 bug workaround. + * argmatch.h: Do not include or . + Include instead, since it's all we need for size_t. + (PARAMS): Remove. All uses removed. + (ARRAY_CARDINALITY): Do not bother to #undef. + (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg, + ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH): + Remove unnecessary parentheses. + (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH): + Insert necessary parentheses. + (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros. + (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT. + +2002-11-19 Jim Meyering + + Be careful not to clobber errno. + * quotearg.c (quotearg_buffer_restyled): If mbrtowc returns + `(size_t) -1' (at which point it would also set errno to EILSEQ), + then restore errno to its previous value. + Reported by Phillip Jones via Tim Waugh as + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76334. + + Avoid a link-time failure on some Linux systems. + * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise). + (__mon_yday): Declare with the STATIC attribute. + (__mktime_internal): Likewise. + Based on a report from Greg Schafer. + +2002-11-14 Jim Meyering + + * long-options.c: Don't include libintl.h, and don't define `_' -- + they're not used. + * same.c: Likewise. + +2002-11-10 Jim Meyering + + * raise.c: New file. + +2002-11-08 Paul Eggert + + * human.c (human_readable): Revamp to avoid warning about unused + variable 'amt'. Unfortunately this means using some gotos. + +2002-11-08 Jim Meyering + + * human.c (human_readable): Avoid warnings from gcc -Wshadow. + +2002-11-06 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add inttostr.h. + +2002-10-07 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c, + umaxtostr.c. + (EXTRA_DIST): Add inttostr.c. + * inttostr.c, inttostr.h, imaxtostr.c, offtostr.c, umaxtostr.c: + New files, taken from GNU tar. + + * human.c, human.h: Rewrite to support locale-specific + notations like thousands separators. + Specify what includer of include.h must include beforehand. + (human_group_digits, human_suppress_point_zero, human_autoscale, + human_base_1024, human_SI, human_B): New enum values. + (human_readable): Rename from human_readable_inexact; put the + options before the sizes. All uses changed. The old human_readable + function has been removed; use inttostr.h instead. + (human_options): Renamed from human_block_size, with new signature + that allows block sizes up to UINTMAX_MAX. All callers changed. + +2002-10-13 Jim Meyering + + * xnanosleep.c (initialized): Remove declaration now that it's unused. + +2002-10-12 Paul Eggert + + * xnanosleep.c: There's no need to futz with the rounding mode, + since the code should work properly even in the default rounding mode. + (): Do not include. + (#pragma STDC FENV_ACCESS ON): Remove. + (xnanosleep): Don't futz with rounding state. + +2002-10-06 Jim Meyering + + * safe-read.c (safe_read): Change type of function + from ssize_t to size_t. + * safe-read.h: Update prototype. + (SAFE_READ_ERROR): Define. + +2002-09-28 Jim Meyering + + * makepath.c (make_path): Restore umask *before* creating the final + component. + +2002-09-25 Paul Eggert + + * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include . + (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro. + (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than + int. Work more efficiently if X is the same width as uintmax_t. + Do not compare X to -1, to avoid bogus compiler warning. + (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast. + Don't assume that f_frsize and f_bsize are the same type. + +2002-09-25 Jim Meyering + + * fsusage.c: Remove unneeded parentheses around operands of `defined'. + + * safe-read.c (safe_read): Make comment more precise: + upon error, it returns -1. + +2002-09-22 Jim Meyering + + * makepath.c (make_path): Minor reformatting. + +2002-09-14 Paul Eggert + + * xnanosleep (xnanosleep): Return -1 on failure, not 1, + for consistency with nanosleep. Check errno after nanosleep + returns -1. + +2002-09-11 Jim Meyering + + * xnanosleep.c, xnanosleep.h: New files, factored out of sleep.c. + * Makefile.am (libfetish_a_SOURCES): Add them. + +2002-09-04 Jim Meyering + + * addext.c (addext): Add a cast to avoid gcc's warning about + `comparison between signed and unsigned'. + + * sig2str.c (str2signum, sig2str): Declare loop index variables to be + of type size_t so that they match type of upper bound, thus avoiding + warning about `comparison between signed and unsigned'. + +2002-08-31 Jim Meyering + + * mktime.c: Update from GNU libc. + * obstack.c: Likewise. + * getopt.c: Likewise. + * getopt1.c: Likewise. + +2002-08-05 Paul Eggert + + Fix some minor time-related bugs with POSIX time arguments. + Some valid time stamps were being rejected (notably -1, and + time stamps before 1900 on 64-bit hosts). And some invalid + time stamps were being accepted, e.g. September 31. + + * posixtm.h (posixtime): Return bool instead of time_t, so + that we can return (time_t) -1 successfully. + * posixtm.c: Likewise. + [HAVE_STDBOOL_H]: Include . + (bool, false, true) [!HAVE_STDBOOL_H]: New type. + (t): Remove static var. + (year, posix_time_parse): Now takes struct tm * arg to modify, instead + of static var. All uses changed. + (year): Do not reject years before 1900; they can occur with + 64-bit time_t. + (posix_time_parse): Do not check for out-of-range components; + that is now the caller's responsibility, since our checks were + only approximations. + (posixtime): Use mktime to check for out-of-range components, + since it knows them exactly. + If mktime returns (time_t) -1, check whether an error actually occurred + by invoking localtime on -1. + (main) [TEST_POSIXTIME]: Check for input data errors, and report + posixtime failures better. + Improve the test data (in comments only). + +2002-07-27 Jim Meyering + + * readutmp.h: If we have both utmpx.h and utmp.h, and there exists + the utmp.ut_exit member, but not the utmpx.ut_exit member, then + undefine HAVE_UTMPX_H. For AIX 4.3.3. Doing all this in cpp is + a big kludge; someday we'll put the brains in an autoconf macro. + (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define. + +2002-07-20 Jim Meyering + + * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC + and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC. + + * gettext.h: Upgrade to gettext-0.11.3. + +2002-07-13 Bruno Haible + + * xstat.in: Include . + * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning + on FreeBSD. + +2002-07-09 Jim Meyering + + * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy + ones. At least on GNU/Linux systems, `auto' means something else. + From Michael Stone. + +2002-07-01 Jim Meyering + + * c-stack.c: Include sys/time.h. + From Volker Borchert. + +2002-06-11 Paul Eggert + + * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT): + New macro. Use it uniformly instead of + (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H). + It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1 + reported by Vin Shelton. + +2002-06-22 Jim Meyering + + * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about + redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h. + +2002-06-22 Paul Eggert + + * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]: + Do not assume SA_SIGINFO behavior. + Bug reported by Jim Meyering on NetBSD 1.5.2. + +2002-06-22 Jim Meyering + + * c-stack.c, c-stack.h: New files, from diffutils-2.8.2. + + * exitfail.c, exitfail.h: Likewise. + * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h. + + * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place + of fnmatch.h. + (EXTRA_DIST): Add fnmatch_loop.c. + (libfetish_a_SOURCES): Add c-stack.c and c-stack.h. + + * fnmatch_loop.c: New file, from diffutils-2.8.2. + * fnmatch.c: Update from diffutils-2.8.2. + * fnmatch_.h: New file. From diffutils-2.8.2. + * fnmatch.h: Remove file. + +2002-06-18 Paul Eggert + + * file-type.h: Report an error if neither S_ISREG nor + S_IFREG is defined, instead of using a test specific to glibc + 2.2. This should be safe, since POSIX requires S_ISREG and + Unix Version 7 had S_IFREG. We don't need to check for + since we don't use any symbols that it defines. + +2002-06-15 Jim Meyering + + * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef. + For GNU libc 2.2 and newer, ensure that and + have been included before this file. + +2002-06-13 Richard Dawe + + * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t, + so that each temporary file name is unique and valid in the first + 8 characters, for operation under DOS. + +2002-06-15 Jim Meyering + + Work even with DJGPP 2.03, which lacks support for symlinks. + From Richard Dawe. + * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK + is defined. + * lchown.c (S_ISLNK): Likewise. + +2002-06-14 Jim Meyering + + * file-type.h: Use the version from diffutils-2.8.2. + * file-type.c: Likewise. + +2002-05-27 Jim Meyering + + Fix a problem seen only on nonconforming systems whereby ls.c's + use of localtime, and then of gettimeofday would cause trouble: + the localtime call used to initialize rpl_gettimeofday's save + mechanism would clobber ls's current local time information so + that in any long listing the first file would always be listed + with date 1970-01-01. Analysis by Volker Borchert. + + * gettimeofday.c (localtime): Undefine. + (rpl_localtime): New function. + +2002-05-22 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h. + * file-type.h: New file. + * file-type.c (file_type): New file/function. Extracted from diffutils. + +2002-04-29 Paul Eggert + + * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1. + +2002-04-28 Paul Eggert + + * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid + depending on and WTERMSIG. Default to 64 instead + of 127, since 64 is the largest conceivable number for ancient + nonstandard hosts. + * sig2str.c: Do not include ; no longer needed. + +2002-04-28 Jim Meyering + + * sig2str.c (WTERMSIG): Remove definition (unused). + +2002-04-28 Paul Eggert + + * sig2str.h, sig2str.c: New files. + * Makefile.am (libfetish_a_SOURCES): Add sig2str.h. + +2002-04-24 Jim Meyering + + * gettext.h: New file, from Gettext. + * Makefile.am (INCLUDES): Remove -I../intl. + (libfetish_a_SOURCES): Add gettext.h. + +2002-04-16 Jim Meyering + + * readutmp.h (UT_TYPE): Remove definition (now in who.c). + (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define. + (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define. + +2002-04-12 Jim Meyering + + * dirfd.h (dirfd): Elide prototype if dirfd is a macro. + +2002-03-10 Jim Meyering + + * makepath.c (make_path): Remove a comma from a diagnostic. + Suggestion from Santiago Vila. + +2002-03-08 Jim Meyering + + * rename.c: Mention that this wrapper is needed also on + mips-dec-ultrix4.4 systems. + +2002-03-02 Jim Meyering + + * gettime.c (gettime): Test HAVE_CLOCK_GETTIME, + not HAVE_CLOCK_SETTIME. + +2002-02-27 Paul Eggert + + * nanosleep.h: Rename to.... + * timespec.h: New name for nanosleep.h. All uses changed. + + * gettime.c: New file. + * settime.c: New file. + * stime.c: Remove. + + * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c, + timespec.h. Remove nanosleep.h. + +2002-02-25 Paul Eggert + + * acl.c, acl.h: New files. + * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c. + +2002-02-24 Jim Meyering + + * strnlen.c (strnlen): Define-away/undef so that an inconsistent + prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't + cause trouble. Reported by Nelson Beebe. + +2002-02-23 Paul Eggert + + * path-concat.c (xpath_concat): Reorder code to pacify + compilers that don't know that xalloc_die never returns. + +2002-02-20 Jim Meyering + + * getdate.c: Regenerate using bison-1.33. + +2002-02-15 Paul Eggert + + * posixver.c, posixver.h: New files. + * Makefile.am (libfetish_a_SOURCES): Add them. + +2002-02-02 Paul Eggert + Bruno Haible + + * unicodeio.h (print_unicode_char): Add exit_on_error argument. + (fwrite_success_callback): New declaration. + * unicodeio.c (unicode_to_mb): New function, extracted from + print_unicode_char. Call failure callback instead of error. + (fwrite_success_callback): New function. + (exit_failure_callback): New function. + (fallback_failure_callback): New function. + (print_unicode_char): Call unicode_to_mb. + +2002-01-26 Jim Meyering + + * Makefile.am (getdate$U.o): Depend on unlocked-io.h. + +2002-01-22 Jim Meyering + + * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES). + Otherwise, some versions of automake would omit the rule that makes + Makefile from Makefile.in. + +2001-01-21 Paul Eggert + + * xmemcoll.h, xmemcoll.c: New files. + * Makefile.am (libfetish_a_SOURCES): Add them. + * memcoll.c: Include errno.h, and declare errno if not defined. + (memcoll): Set errno to zero if there is no error. + + * quotearg.c (quotearg_buffer_restyled): + Fix bug with quoting buffers containing NUL when backslashing escapes. + This bug was exposed by the other changes in this patch. + (quotearg_n_options): New arg ARGSIZE. + All callers changed. + (quoting_options_from_style): New function. + (quotearg_n_style): Use it. + (quotearg_n_style_mem): New function. + + * quotearg.h (quotearg_n_style_mem): New function. + +2002-01-16 Jim Meyering + + * getdate.y: Add three semicolons, each just before a closing brace. + Bison (as of version 1.31) no longer papers over that mistake. + +2002-02-14 Paul Eggert + + * backupfile.c (ISDIGIT): Comment fix. + * getdate.y (ISDIGIT): Likewise. + * posixtm.c (ISDIGIT, year): Likewise. + * strverscmp.c (ISDIGIT): Likewise. + * userspec.c (ISDIGIT): Likewise. + +2002-01-05 Jim Meyering + + * version-etc.c (version_etc_copyright): Update copyright year. + +2001-01-19 Paul Eggert + + * closeout.c (close_stdout_status): If ferror (stdout), do + not silently exit merely because the output buffer happens to + have nothing pending. + +2001-12-18 Paul Eggert + + See the big note in ../ChangeLog. + * human.c (suffixes): Prefer K to k for 1024. + (generate_suffix_backwards): New function. + (human_readable_inexact): Use it. + * xstrtol.c (__xstrtol): If there is no number but there + is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary. + Accept 'K' as well as 'k'. + +2001-12-15 Jim Meyering + + * regex.h (__restrict_arr): Update from libc. + + * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs + as `remote' if the name starts with `//'. Suggested by Michael Stone. + (STREQ): Define. + +2001-12-10 Jim Meyering + + * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc, + Instead, include "xalloc.h". + (initbuffer): Don't cast xmalloc return value to char*. + (readline): Reword comment. + Don't cast xrealloc return value to char* + Return NULL, not 0. + +2001-12-09 Jim Meyering + + * modechange.c (mode_compile): Add cast to avoid pedantic warning about + `signed and unsigned type in conditional expression'. + * posixtm.c (posix_time_parse): Likewise. + + * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning. + + * readtokens.c (readtoken): Declare an index to be of type unsigned + to avoid a pedantic warning. + + * getstr.c: Don't include assert.h. + (getstr): Remove warning-evoking assertions. + Return -1 if offset parameter is out of bounds. + Change the type of a local from int to size_t. + + * strftime.c (my_strftime_localtime_r): Include this function + definition in the `#if ! HAVE_TM_GMTOFF' block. + + * xgethostname.c: Remove declarations of xmalloc and xrealloc. + Include xalloc.h instead. + +2001-12-02 Jim Meyering + + * tempname.c: Don't declare getenv, thus reverting the change of + 2001-11-18. It's no longer necessary, now that stdlib.h is always + included. + + * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded, + __unbounded, and __ptrvalue. Reported by Uwe H. Steinfeld. + +2001-11-30 Akim Demaille + + * xstrdup.c: Include xalloc.h, so that xstrdup is declared + before being defined. + +2001-11-27 Paul Eggert + + * quotearg.h (quotearg_n, quotearg_n_style): + First arg is int, not unsigned. + * quotearg.c (quotearg_n, quotearg_n_style): Likewise. + (SIZE_MAX, UINT_MAX): New macros. + (quotearg_n_options): Abort if N is negative. + Avoid overflow check on hosts where size_t is 64 bits and int + is 32 bits, as overflow is impossible there. + Fix off-by-one typo that caused unnecessary reallocation. + +2001-11-27 Jim Meyering + + * tempname.c: Merge with version from libc. + * regex.c: Likewise. + + * tempname.c: Include stdlib.h unconditionally. On some old systems + for which STDC_HEADERS is 0, it was not included, resulting in a + warning about an integer-to-pointer conversion problem with getenv. + Reported by Volker Borchert. + +2001-11-26 Jim Meyering + + * gtod.h: Remove file. + * Makefile.am (libfetish_a_SOURCES): Remove gtod.h. + * gettimeofday.c: Don't include gtod.h. + (GTOD_init): Remove function. + (rpl_gettimeofday): Do its job here instead, rather than aborting. + Suggestion from Volker Borchert. + +2001-11-23 Jim Meyering + + * hash.h (struct hash_table): Don't define here. Merely declare it. + * hash.c (struct hash_table): Define it here instead. + +2001-11-22 Jim Meyering + + * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif. + +2001-11-18 Paul Eggert + + * tempname.c (TMP_MAX): Remove; no longer needed. + (TEMPORARIES): New macro. + (__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This + removes an artificial limitation (e.g. HP-UX 10.20, where + TMP_MAX is 17576). + +2001-11-18 Jim Meyering + + * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning + on SunOS 4. + + * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those + files will be created before anything else. + +2001-11-17 Jim Meyering + + * modechange.c (mode_adjust): Fix error introduced on 1999-04-26 + that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable + rather than group writable. Patch by Juan F. Codagnone. + + * readtokens.c: Remove explicit declarations of xmalloc and xrealloc, + Instead, include "xalloc.h". + + * mountlist.c: Include unlocked-io.h after all system headers. + Remove explicit declarations of xmalloc, xrealloc, + and xstrdup. Instead, include "xalloc.h". + + * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h. + * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise. + * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise. + + * regex.c, sha.c, version-etc.c, yesno.c: Likewise. + Reported by Padraig Brady. + + * mkstemp.c: #undef mkstemp. + Include config.h. + (rpl_mkstemp): Rename from mkstemp. + Protoize. + +2001-11-16 Jim Meyering + + * physmem.c [HAVE_SYS_PSTAT_H]: Include . + (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to + determine the amount of total physical memory, use pstat_getstatic. + HPUX-11 doesn't define _SC_PHYS_PAGES. + (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]: + If sysconf couldn't be used to determine the amount of available + physical memory, use both pstat_getstatic and pstat_getdynamic. + Based on a patch from Bob Proulx. + +2001-11-05 Jim Meyering + + * xstat.in (slash_aware_lstat): Correct a misleading comment. + +2001-11-03 Jim Meyering + + * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args + in argmatch_to_argument call. + + * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an + argument. + + * hash.c (hash_clear): Fix a bug that could lead to an infloop or + e.g., a fault due to an attempt to free a NULL pointer. + +2001-11-01 Jim Meyering + + * dirfd.c, dirfd.h: New files. + * Makefile.am (libfetish_a_SOURCES): Add dirfd.h. + + * hash.c (hash_print) [TESTING]: Clean up. + +2001-10-22 Paul Eggert + + * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__, + to avoid a warning if -Wall. + +2001-10-21 Paul Eggert + + * regex.c (uintptr_t): Remove macro and decl; it's config.h's job. + +2001-10-21 Jim Meyering + + * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise, + this code would end up calling gettext even in packages built + with --disable-nls. + * getopt.c (_): Likewise. + * regex.c (_): Likewise. + +2001-10-20 Paul Eggert + + * error.c (strerror_r): Do not declare unless !_LIBC. + Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P. + Use strerror_r that is only a macro, even if it is not a function. + (strerror): Check for HAVE_DECL_STRERROR before declaring. + (private_strerror): Use prototypes, not old-style function definition. + (print_errno_message): New function. + Support the POSIX 'int'-flavored strerror_r, as well as the traditional + char*-flavored one. + (error_tail, error, error_at_line): Use it. + +2001-10-11 Jim Meyering + + * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ... + and quote_n (1, ... to avoid clobbering a buffer. + +2001-10-05 Jim Meyering + + * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h. + * hash-pjw.c: New file (factored out of fileutils' remove.c). + * hash-pjw.h: New file. + +2001-09-30 Jim Meyering + + * mountlist.c [MOUNTED_GETFSSTAT]: + Include , for Apple Darwin. + Include sys/mount.h and sys/fs_types.h only if available. + (FS_TYPE): Define. + (read_filesystem_list): Use FS_TYPE. + +2001-09-29 Paul Eggert + + * exclude.c (excluded_filename): 0 -> false, since it's + a boolean context. + +2001-09-28 Paul Eggert + + Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which + #defines strtoimax. Also treat the other strto* functions + like strtoimax. + + * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL. + (strtoul): Do not declare if HAVE_DECL_STRTOUL. + (strtoimax, strtoumax): Do not declare if already defined as a macro. + +2001-09-26 Jim Meyering + + Most macros in unlocked-io.h had the wrong number of arguments. + * gen-uio: New script. + (USE_UNLOCKED_IO): Define to 1 if not already defined. + * unlocked-io.hin: Remove file. + * Makefile.am (unlocked-io.h): Rewrite to use a separate script, + rather than trying to embed it here. + (EXTRA_DIST): Add gen-uio. Remove unlocked-io.hin + Reported by Padraig Brady. + +2001-09-25 Volker Borchert + + * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'. + +2001-09-23 Jim Meyering + + * mountlist.c: Remove useless parentheses in #if directives. + (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when + the deprecated MOUNTED symbol is no longer defined in mntent.h. + +2001-09-22 Jim Meyering + + * localcharset.c: Update from latest gettext. + * config.charset: Likewise. + +2001-09-20 Jim Meyering + + * xstrtol.c (strtoimax): Guard declaration with + `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'. + The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0) + have their own, conflicting declaration of strtoimax in sys/inttypes.h. + (strtoumax): Likewise, for completeness (it wasn't necessary). + +2001-09-06 Paul Eggert + + * strtoimax.c (HAVE_LONG_LONG): + Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned. + (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base), + to work around bug in IBM C compiler. + +2001-09-16 Jim Meyering + + * mkdir.c: New file. + +2001-09-04 Paul Eggert + + * xgetcwd.c: Revert some of the previous change; intead, + fix the HAVE_GETCWD_NULL code to behave more like the + !HAVE_GETCWD_NULL code used to. + + Include "xalloc.h". + (xgetcwd): Do not return NULL when memory is exhausted; instead, + invoke xalloc_die. + +2001-09-04 Paul Eggert + + * xreadlink.c (xreadlink): Omit size_t* arg. All uses changed. + Use ssize_t, not int, to store result of readlink. + Check for ssize_t overflow as well as size_t overflow, + as POSIX says the result of readlink is implementation-defined + when ssize_t overflows. + Remove unnecessary cast to char*. + Use free+malloc instead of realloc, as the storage doesn't need + to be preserved and it's clearer and can be more efficient that way. + (SIZE_MAX, SSIZE_MAX): New macros, if doesn't declare. + * xreadlink.h (xreadlink): Update prototype. + +2001-09-03 Paul Eggert + + * exclude.c (fnmatch_no_wildcards): Fix confusion between + usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was + spotted by Jim Meyering. + +2001-09-03 Jim Meyering + + * xreadlink.c (xreadlink): Preserve errno around `free' during failure. + +2001-09-03 Paul Eggert + + * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more + like the HAVE_GETCWD_NULL code. + Include pathmax.h if not HAVE_GETCWD. + Do not include xalloc.h. + (INITIAL_BUFFER_SIZE): New symbol. + Do not use xmalloc / xrealloc, since the caller is responsible for + handling errors. Preserve errno around `free' during failure. + Do not overrun buffer when using getwd. + +2001-09-03 Paul Eggert + + * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined + __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0). + +2001-09-02 Jim Meyering + + * error.c: Update from GNU libc. + +2001-09-01 Jim Meyering + + * xreadlink.c: New file. + * xreadlink.h: New file. + * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h. + + * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it + doesn't conflict with sparc Solaris 7's definition in + /usr/include/sys/int_types.h. + + * exclude.c: Use `""', not `<>' to #include non-system header files. + (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp + and strncasecmp as r-values. Unixware didn't have declarations. + +2001-08-31 Jim Meyering + + * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication. + Use an initial, malloc'd, buffer of length 128 rather than + a statically allocated one of length 1024. + +2001-08-30 Paul Eggert + + * xgetcwd.c: Don't include pathmax.h. + Include stdlib.h and unistd.h if available. + Include xalloc.h. + (xmalloc, xstrdup, free): Remove decls. + (xgetcwd): Don't assume sizes fit in unsigned. + Check for overflow when computing sizes. + Simplify reallocation code. + +2001-08-28 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c. + + * strtoimax.c: Renamed from strtoxmax.c, removing the + old strtoimax.c. + + Also, make the following further changes to make this file's + configuration more similar to that of strtol.c: + (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed. + (strtoumax, uintmax_t, strtoull, strtol): Remove. + (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED. + (strtoimax): Renamed from strtoumax. All uses of unsigned values + changed to signed values. + + And make the following changes as well: + Fix copyright notice, as 1999 was missing. + (verify): New macro. + (strtoimax): Check sizes at compile-time, not run-time. + Prefer strtol to strtoll if both work. + (main): Remove; it was not that useful and was a pain to maintain. + + * strtoumax.c: Include strtoimax.c, not strtouxmax.c. + +2001-08-30 Paul Eggert + + * savedir.c (savedir): Remove size parameter, as POSIX says that + a directory's st_size can have an arbitrary value, so the old + usage could waste an arbitrary amount of memory. All uses + changed. + * savedir.h: Update prototype. + +2001-08-30 Paul Eggert + + * xstrtol.c (strtoimax): New decl. + +2001-08-28 Paul Eggert + + * xstrtol.h: Add copyright notice. + (_DECLARE_XSTRTOL): Improve quality of diagnostic for + LONGINT_INVALID_SUFFIX_CHAR. + +2001-08-30 Paul Eggert + + * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct + tm to be declared. + +2001-08-30 Paul Eggert + + * hash.c: Remove '2001' from copyright notice. + +2001-08-30 Paul Eggert + + * full-write.h: New file. + * Makefile.am (libfetish_a_SOURCES): Add full-write.h. + * full-write.c: Correct credits, as cccp.c no longer + exists and anyway it was so heavily changed from the old cccp + code as to be unrecognizable. Include full-write.h. + (full_write) Return size_t, with short writes meaning failure. + All callers changed. This fixes a bug with large buffers + on 64-bit hosts. + * utime.c: Include full-write.h. + +2001-08-30 Paul Eggert + + Merge 'exclude' changes from tar 1.13.22. + This fixes one or two unlikely storage allocation overflow bugs, + but doesn't change user-visible behavior otherwise. + +2001-08-30 Paul Eggert + + * exclude.c (bool): Declare, perhaps by including stdbool.h. + (): Include only if HAVE_SYS_TYPES_H. + (, , , , ): + Include if available. + (): Include + (SIZE_MAX): Define if or doesn't. + (verify): New macro. Use it to verify that EXCLUDE macros do not + collide with FNM macros. + (struct patopts): New struct. + (struct exclude): Use it, as exclude patterns now come with options. + (new_exclude): Support above changes. + (new_exclude, add_exclude_file): + Initial size must now be a power of two to simplify overflow checking. + (free_exclude, fnmatch_no_wildcards): New function. + (excluded_filename): No longer requires options arg, as the options + are determined by add_exclude. Now returns bool, not int. + (excluded_filename, add_exclude): + Add support for the fancy new exclusion options. + (add_exclude, add_exclude_file): Now takes int options arg. + Check for arithmetic overflow when computing sizes. + (add_exclude_file): xrealloc might modify errno, so don't + realloc until after errno might be used. + + * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS): + New macros. + (free_exclude): New decl. + (add_exclude, add_exclude_file): Now takes int options arg. + (excluded_filename): No longer requires options arg, as the options + are determined by add_exclude. Now returns bool, not int. + +2001-08-30 Paul Eggert + + * alloca.c (alloca): Arg is of type size_t, not unsigned. + +2001-08-27 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c + + * version-etc.c (N_): Remove definition. + Revert most of last change. + Instead, simply don't mark the `Copyright...' string for translation. + Based on advice from Paul Eggert. + + * strtoxmax.c: Tweak comment. + +2001-08-26 Jim Meyering + + * version-etc.c (version_etc_copyright_fmt): Replace literal year + of copyright with `%s' so translators don't get an untranslated + message in 2002. + (COPYRIGHT_YEAR): Define. + (version_etc): Use fprintf rather than fputs. + Suggestion from Ulrich Drepper. + + * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c. + + * strtoll.c: New file, from GNU libc. + * xstrtoimax.c: New file. + + * xstrtol.h: Add xstrtoimax. + * strtoumax.c: New file. Simply include "strtoumax.c". + * strtoimax.c: New file. Likewise, but first define STRTOUXMAX_SIGNED. + + * strtoumax.c: Factor to work both for unsigned and signed types, ... + * strtoxmax.c: ... then renamed to this. + +2001-08-13 Paul Eggert + + * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice. + Port to Solaris 8, where 'sed' requires a space after the 'r' + command, and where sh dislikes "$/". Clean up the spacing a bit. + Redirect output to $tmp just once. + +2001-08-12 Paul Eggert + + * addext.c (): Include. + (errno): Declare if not defined. + (addext): Work correctly when pathconf returns -1 and leaves + errno alone because there is no limit. Also, work even if + pathconf returns a value greater than SIZE_MAX. + +2001-08-12 Jim Meyering + + * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]: + Simply `return getcwd (NULL, 0);'. + [! (defined __GLIBC__ && __GLIBC__ >= 2)]: + Use 1300 as initial value for length, not PATH_MAX. + + * pathmax.h: Clean up cpp syntax. + +2001-08-12 Jim Meyering + + * gettimeofday.c: New file. + * gtod.h: New file. + * Makefile.am (libfetish_a_SOURCES): Add gtod.h. + +2001-08-04 Jim Meyering + + * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt, + to get in sync with glibc. + +2001-08-03 Paul Eggert + + The following changes are from gettext 0.10.39 as maintained by + Bruno Haible. + + * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID): + Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID + with inverted sense. All uses changed. + + * mbswidth.c: Don't include . + Include and unconditionally. + (iswcntrl, mbsinit, ISCNTRL): New macros. + (mbsnwidth): Use K&R style function declarations. + Don't bother checking for MB_LEN_MAX == 1, since the compiler + can optimize it when MB_CUR_MAX == 1. + The width of control characters is zero, not 1. + +2001-07-15 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add unlocked-io.hin. + (BUILT_SOURCES): Add unlocked-io.h. + (io_functions): Define. + (unlocked-io.h): New rule. + (DISTCLEANFILES): Add unlocked-io.h. + (all-local): Depend on unlocked-io.h, to ensure it is created. + + * unlocked-io.hin: New file + + * regex.c: Update from glibc. + +2001-07-05 Jim Meyering + + * Makefile.am (noinst_HEADERS): Remove definition, per new automake + recommendation. + (libfetish_a_SOURCES): Put all .h files here instead. + Remove a thus-exposed (better checks in automake) duplicate and + two unnecessary .h files. + +2001-06-11 Jim Meyering + + * regex.c: Update from GNU libc. + +2001-05-27 Jim Meyering + + * readutmp.h (UT_TYPE): Define. + +2001-05-24 Jim Meyering + + * argmatch.c: Include "quote.h". + (argmatch_invalid): Remove explicit `' quotes. Instead, use the + quote function. Reported by Göran Uddeborg. + +2001-05-20 Alexandre Duret-Lutz + + * dirname.c (dir_name): Compute append_dot using path, not newpath + which is not yet declared. + +2001-05-11 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): + Add strftime.c, since we now compile it on all hosts. + + * strftime.c (my_strftime): + Define to nstrftime if emacs, but only if my_strftime is not defined. + (extra_args, extra_args_spec, extra_args_spec_iso): Rename from + ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively. + Add one more extra argument: a nanoseconds value. + All uses changed. + (ns): New macro. + (my_strftime function): Add %N format. + (emacs_strftimeu): Renamed from emacs_strftime, + with extra ut argument. + +2001-05-11 Paul Eggert + + dirname code cleanup. base_name now behaves more compatibly + with POSIX basename when given file names that have trailing + slashes, and similarly for dir_name. Add new primitives + base_len and dir_len. Put the directory-name-related decls + into dirname.h. + + * addext.c (ISSLASH, base_name): Remove; now in dirname.h. + * backupfile.c (base_name): Likewise. + * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise. + * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise. + * makepath.c (strip_trailing_slashes): Likewise. + * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH): + Likewise. + * rename.c (strip_trailing_slashes): Likewise. + * same.c (base_name): Likewise. + * stripslash.c (ISSLASH): Likewise. + + * addext.c: Include after size_t is defined. + * backupfile.c: Likewise. + + * addext.c (addext): Use base_len to trim redundant + trailing slashes instead of doing it ourselves. + But do not trim the last slash if it is not redundant. + + * backupfile.c (find_backup_file_name, + max_backup_version): Use base_len instead of rolling it ourselves. + Handle the case of "" and (on DOS) "C:" correctly. + + * basename.c: Do not include , ; no longer needed. + Include , . + (base_name): Allow file names ending in slashes, other than names + that are all slashes. In this case, return the basename followed + by the slashes. This is more general, and can be used in places + where the original base_name purposely had an assertion failure. + (base_len): New function. + + * dirname.c: Include instead of . + Do not include ; no longer needed. + Include xalloc.h. + (memrchr): Remove decl. + (dir_name_r): Remove. + (dir_len): Renamed from dirlen. All callers changed. + Rewrite in terms of base_name, for simplicity and consistency. + (dir_name): Never return NULL. All callers changed. + Do not include in test program; no longer needed. + return 0; is fine for test program. + + * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN): + New macros. + (base_name, base_len, dir_len, strip_trailing_slashes): New decls. + + * path-concat.c (path_concat): Use base_len to compute + base length, not strlen; this means we cannot rely on memcpy + to null-terminate. + + * same.c (STREQ): Remove. + (same_name): Handle the case where the basename ends in trailing '/'. + + * stripslash.c (strip_trailing_slashes): Return nonzero if + a slash was stripped. Do not strip the last slash after a + file system prefix. + +2001-04-08 Jim Meyering + + * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is + recomputed; that's necessary when the offset spans a DST transition. + Patch by David J. MacKenzie. Reported by Hon-Yin Kok. + +2001-04-02 Jim Meyering + + * regex.h, regex.c: Update from GNU libc. + +2001-03-19 Paul Eggert + + * version-etc.c (version_etc_copyright): Update to 2001. + +2001-03-16 Paul Eggert + + * tempname.c (uint64_t): Define to uintmax_t if + not defined, and if UINT64_MAX is not defined. + Required at least for Vax Ultrix4.3, which doesn't define uint64_t. + Reported by John David Anglin. + +2001-03-10 Bruno Haible + + * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve + alias if codeset is empty. + * config.charset (BeOS): Use wildcard syntax. + +2001-03-13 Jim Meyering + + * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: + Don't insert a backslash when concatenating e.g., `C:' and `foo'. + From Bruno Haible. + +2001-03-06 Bruno Haible + + * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL). + Don't return NULL. + * unicodeio.c (print_unicode_char): Simplify accordingly. + +2001-03-06 Bruno Haible + + * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add + support for DOS/DJGPP. + +2001-02-28 Paul Eggert + + * Makefile.am (libfetish_a_SOURCES): + Add dup-safer.c, fopen-safer.c. + (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h. + + * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files. + +2001-02-25 Paul Eggert + + The mkstemp replacement is taken from glibc 2.2.2, with some + portability fixes for use outside glibc, as follows: + + * tempname.c (struct_stat64): New macro. + (direxists, __gen_tempname): Use it. + This avoids a portability problem with Solaris 8. + + * tempname.c (): Include if HAVE_CONFIG_H. + (, , ): + Include only if STDC_HEADERS || _LIBC. + (): Include only if HAVE_FCNTL_H || _LIBC. + (): Include only if HAVE_UNISTD_H || _LIBC. + (): Include only if HAVE_SYS_TIME_H || _LIBC. + (__set_errno): Define this macro if doesn't. + (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE): + Define these macros if doesn't. + (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR): + Define these macros if + doesn't. Ignore S_ISDIR if STAT_MACROS_BROKEN. + (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64, + __xstat64): Define if not _LIBC. + (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC). + (__gen_tempname): Invoke gettimeofday only if + HAVE_GETTIMEOFDAY || _LIBC; + otherwise, fall back on plain "time". + Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600. + + * mkstemp.c (__GT_FILE): Define to zero if not defined. + + * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2. + +2001-02-17 Jim Meyering + + * strtoul.c: Sync from GNU libc. Use double quotes, not <...> + around included file name. + + * strnlen.c (__strnlen): Merge in a change from GNU libc. + + * strftime.c: Update from GNU libc (the only changes were to comments). + +2001-02-13 Bruno Haible + + * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash. + +2001-02-17 Paul Eggert + + * mbswidth.c, quotearg.c (mbrtowc, mbsinit): + Remove workaround macros for hosts that have mbrtowc but not + mbstate_t, as we now insist on proper declarations for both + before using mbrtowc. + +2001-02-17 Jim Meyering + + * regex.c: Update from libc. + +2001-02-16 Paul Eggert + + * alloca.c (malloc): Undef before defining, since stdlib.h + may have defined it. Needed for Encore Umax-3.0.9.16b systems. + Reported by Mark Hounschell via Paul Eggert. + +2001-01-30 Bruno Haible + + * config.charset: Update for FreeBSD 4.2. + +2001-01-26 Jim Meyering + + * quotearg.c: Include stddef.h. + * quote.c: Include stddef.h. + Reported by Axel Kittenberger. + + * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking + line in double quotes so that it evokes a better diagnostic. + [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise. + Reported by Axel Kittenberger. + +2001-01-15 Bruno Haible + + * unicodeio.c (print_unicode_char): Cast the second iconv() arg, + to avoid a warning. Add back 'const' to inptr. + +2001-01-16 Jim Meyering + + * basename.c: Include , needed by assert on SunOS 4. + From Bruno Haible. + +2001-01-14 Jim Meyering + + * rename.c: New file. From Volker Borchert. + Include stdlib.h, string.h or strings.h, and xalloc.h. + Use strip_trailing_slashes rather than open-coding it. + +2001-01-03 Paul Eggert + + * strftime.c: Sync with glibc time/strftime.c 1.81. + +2001-01-03 Jim Meyering + + * unicodeio.c (print_unicode_char): Remove `const' from declaration of + local `inptr' to avoid warning with some system declarations of iconv. + +2000-12-29 Paul Eggert + + * modechange.c: Do not assume that mode_t uses the + traditional octal encoding. E.g. "chmod 1 FOO" should set + the other-execute bit of FOO even if S_IXOTH != 1. + + (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH, + WOTH, XOTH, ALLM): New macros. + (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, + S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH): + Use them. + (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID. + (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above. + (mode_compile): + No need to use uintmax_t; unsigned long is long enough. + Don't bother to get suffix since we don't use it. + +2000-12-24 Jim Meyering + + * hash.c (is_prime): Return explicit boolean values. + (hash_get_first): Return NULL to appease Irix5.6's 89. + Reported by Nelson Beebe. + +2000-10-31 Bruno Haible + + * localcharset.c (locale_charset): Add support for Win32. + +2000-12-18 Paul Eggert + + * physmem.h, physmem.c: New files. + + * Makefile.am (libfetish_a_SOURCES): Add physmem.c. + (noinst_HEADERS): Add physmem.h. + + * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and + 't' for compatibility with Solaris 8 sort. + +2000-12-18 Bruno Haible + + * config.charset: Add support for BeOS. + +2000-12-16 Jim Meyering + + * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define + SHELLS_FILE to a file name that's useful on djgpp systems. + Include stdlib.h. + (ADDITIONAL_DEFAULT_SHELLS): Define. + (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS. + Based mostly on a patch from Prashant TR. + +2000-12-16 Jim Meyering + + This bug had a serious impact on chown: `chown N:M FILE' (for integer + N and M) would have treated it like `chown N:N FILE'. + + * userspec.c (parse_user_spec): Fix typo: s/u/g/. + +2000-10-31 Bruno Haible + + * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII, + CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257 + to the list of canonical encodings. Rename EUC-CN to GB2312. + +2000-12-08 Andreas Schwab + + * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an + invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set. + +2000-12-07 Jim Meyering + + * stripslash.c (ISSLASH): Define. + (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'. + From Prashant TR. + + * dirname.c (FILESYSTEM_PREFIX_LEN): Define. + (dir_name_r): Declare this function as static. + [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd + manifest itself on a name containing a mix of slashes and + backslashes. + Make this function work with names starting with a DOS-style + drive letter and colon prefix. + (dir_name): Append `.' if necessary. + Based mostly on patches from Prashant TR and Eli Zaretskii. + + * dirname.h (dir_name_r): Remove prototype. + +2000-12-05 Jim Meyering + + * dirname.c (dir_name_r): Add `const' in a few local declarations. + +2000-12-04 Jim Meyering + + * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc. + Also include memory.h, stdlib.h, unistd.h if appropriate. + Reported by Andreas Jaeger (conflicting declaration of malloc). + +2000-12-02 Jim Meyering + + * closeout.h: Make idempotent, to avoid some obscure warnings. + +2000-12-01 Paul Eggert + + * memrchr.c: Include before any system include file. + +2000-11-29 Paul Eggert + + * dirname.c (dir_name_r): Fix typo: int -> size_t. + +2000-11-26 Jim Meyering + + * memcoll.c: Include sys/types.h. From Werner Almesberger. + +2000-11-22 Paul Eggert + + * strftime.c (my_strftime): Do not invoke mbrlen with a + size of (size_t) -1; it's not portable. + +2000-11-17 Akim Demaille + + * obstack.h: Formatting changes. + (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would + prevent type checking. + (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't + cast the value to (void *): assigning a `foo *' to a `void *' + variable is valid. + (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int. + +2000-11-17 Jim Meyering + + * strstr.c: Update from GNU libc. + +2000-11-16 Jim Meyering + + * strverscmp.c: Incorporate weak-alias-related changes from glibc. + +2000-11-11 Jim Meyering + + * error.c: Add a couple #includes, merging from GNU libc version. + +2000-11-10 Jim Meyering + + * obstack.h: Update from GNU libc. + * obstack.c: Likewise. + +2000-11-06 Paul Eggert + + * getusershell.c (setusershell): Use rewind rather than + fseek/fseeko, to avoid configuration hassles with fseeko. + Don't bother opening SHELLS_FILE if shellstream is NULL; + it's not necessary. + +2000-11-05 Jim Meyering + + * makepath.h (make_dir): Declare. + * makepath.c (make_dir): Remove `static' attribute. + Tweak a comment. + +2000-11-04 Alexandre Duret-Lutz + + * hash.c (hash_get_next): Fix a thinko: when ENTRY is the + last one in a bucket, advance to the next bucket. + +2000-11-02 Vesselin Atanasov + + * fnmatch.c: Do not comment out all the code if we are using + the GNU C library, because in some cases we are replacing buggy + code in the GNU C library itself. + +2000-10-30 Paul Eggert + + * error.h, getline.h, modechange.h: + Remove "2000" from Copyright line, as the file hasn't been + changed this year other than in the copyright notice. + + * xalloc.h: Add "2000" to Copyright line, as this file + was changed this year. + +2000-10-30 Paul Eggert + + * fnmatch.c (FOLD): Do not assume that characters are unsigned. + (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs, + e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero. + +2000-10-29 Greg Louis + + * regex.h (__restrict_arr): Move definition out of #ifndef block. + Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but + doesn't define __restrict_arr. + +2000-10-29 Jim Meyering + + * xstat.in: Fix grammar in comment. + +2000-10-28 Jim Meyering + + * memchr.c: Update from libc. + Adjust for portability: + [HAVE_STDLIB_H]: Include stdlib.h. + [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h. + Undef __memchr, too. + [!weak_alias]: Define __memchr to memchr. + + * regex.c: Update from libc. + * regex.h: Likewise. + * getopt1.c: Likewise. + * memcmp.c: Likewise. + + * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko. + Avoid using fseek, when possible -- it's broken by design. + Patch by Ulrich Drepper. + +2000-10-26 Jim Meyering + + * strftime.c: Update from libc. + +2000-10-25 Jim Meyering + + * obstack.c: Update from libc. + +2000-10-23 Jim Meyering + + * hard-locale.c (hard_locale): Revert last change -- it was simply + wrong. That set_locale call must not have any side effects. + From Paul Eggert. + +2000-10-22 Jim Meyering + + * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC. + [CYCLIC]: Remove now-unused definition. + + * save-cwd.c (O_DIRECTORY): Define, if needed. + (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".". + Suggestion from Ulrich Drepper. + +2000-10-21 Jim Meyering + + * dirname.c (dir_name_r): New function, factored out of dir_name. + (dir_name): Use dir_name_r. + * dirname.h (dir_name_r): Declare it. + +2000-10-21 Jim Meyering + + * dirname.c (memrchr): Declare if necessary. + (dir_name): Remove the restriction that there be no + trailing slashes. Now, this code skips past them, effectively + ignoring them. + [TEST_DIRNAME] (main): New unit tests. + + * memrchr.c: New file from GNU libc. + Undef __memrchr, too. + [!weak_alias]: Define __memrchr to memrchr. + Guard weak_alias use with `#ifdef weak_alias'. + +2000-10-17 Jim Meyering + + * quote.h (PARAMS): Define and use. + Reported by Akim Demaille. + + * getopt.c: Update from libc. + +2000-10-16 Jim Meyering + + * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale. + From Jan Fedak. + +2000-09-25 Jim Meyering + + * md5.h (rol): Define (from GnuPG). + + * sha.c: Give credit (GnuPG) where due. + (M): Use rol rather than open-coding it. + Add a FIXME comment. + +2000-09-21 Jim Meyering + + * userspec.c (parse_user_spec): Remove debugging printf I'd added. + Reported by Michael Stone. + +2000-09-20 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add sha.c. + (noinst_HEADERS): Add sha.h. + Based on code from Scott G. Miller and from GnuPG. + +2000-09-15 Jim Meyering + + * regex.c: Update from libc. + +2000-09-10 Jim Meyering + + * getopt.c (_getopt_internal): Update from glibc. + +2000-09-09 Jim Meyering + + * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't + think it should be used as a general replacement for isascii. + * fnmatch.c: Likewise. + * mbswidth.c: Likewise + * regex.c: Likewise. + + Don't use atoi. + * userspec.c: Include sys/param.h and limits.h. + Include xstrtol.h. + (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define. + (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define. + (parse_user_spec): Use xstrtoul, not atoi when converting numeric + UID, GID. Check range. + +2000-09-06 Jim Meyering + + * getopt.c (_getopt_internal): Update from glibc. + +2000-08-30 Jim Meyering + + * strftime.c: Merge in changes from GNU libc. + +2000-08-26 Jim Meyering + + * closeout.c: Include "__fpending.h". + (close_stdout_status): Return right away if there's nothing to flush. + + * Makefile.am (noinst_HEADERS): Add __fpending.h. + * __fpending.c: New file. + * __fpending.h: New file. + +2000-08-07 Paul Eggert + + Standardize on "memory exhausted" instead of "Memory exhausted" + or "virtual memory exhausted". + * obstack.c (print_and_abort): Use "memory exhausted", not + "virtual memory exhausted". + * same.c (same_name): Invoke xalloc_die instead of printing + our own message. + * userspec.c (parse_user_spec): Likewise. + * bumpalloc.h: comment fix + * same.c, userspec.c: Include xalloc.h. + + * xalloc.h (xalloc_msg_memory_exhausted): Now char const[], + not char *const and pointing to a constant array. + * xmalloc.c (xalloc_msg_memory_exhausted): Likewise. + (xrealloc): Comment fix. + + * userspec.c (parse_user_spec): + Don't translate a message until just before returning, + to avoid unnecessary translation. + +2000-08-07 Jim Meyering + + * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h, + chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c, + fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h, + getgroups.c, gethostname.c, getopt.h, group-member.c, + hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c, + linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c, + memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h, + pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c, + stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c, + strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c, + utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c, + yesno.c: Back out Copyright date changes for each file with no change + this year. This eases coordination with other programs using the same + source code modules. From Paul Eggert. + +2000-08-03 Greg McGary + + * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER, + ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros. + (EXTEND_BUFFER): Use them. + +2000-08-01 Jim Meyering + + * dirname.c (ISSLASH): Define. + (BACKSLASH_IS_PATH_SEPARATOR): Define. + (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which + both `\' and `/' may be use as path separators. + Based on a patch from Prashant TR. + +2000-07-31 Paul Eggert + + * quotearg.c (quotearg_n_options): Don't make the initial + slot vector a constant, since it might get modified. + +2000-07-31 Jim Meyering + + * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'. + * obstack.c (print_and_abort): Likewise. + +2000-07-30 Paul Eggert + + * quotearg.c (quotearg_n_options): Preallocate a slot 0 + buffer, so that the caller can always quote one small + component of a "memory exhausted" message in slot 0. + From a suggestion by Jim Meyering. + +2000-07-30 Jim Meyering + + * makepath.c (make_path): Quote the other instance, too. + + * quotearg.c (N_STATIC_SLOTVECS): Define. + (STATIC_BUF_SIZE): Define. + (quotearg_n_options): Use only statically allocated storage when + N < N_STATIC_SLOTVECS and the length of the quoted result is smaller + than STATIC_BUF_SIZE. + +2000-07-29 Jim Meyering + + * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS. + * dirname.c (dir_name): Likewise. + + * basename.c (base_name): Use ISSLASH rather than comparing against `/'. + + * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const. + (dir_name): Assert that there are no trailing slashes. + +2000-07-18 Bruno Haible + + * mbswidth.h (mbswidth): Add a flags argument. + (mbswidth): New declaration. + (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros. + * mbswidth.c (mbswidth): Add a flags argument. + (mbsnwidth): New function. + +2000-07-24 Jim Meyering + + * mbswidth.c: Remove useless #else. From Bruno Haible. + +2000-07-23 Paul Eggert + + * mbswidth.c (_XOPEN_SOURCE): + Don't define; this causes problems on Solaris 7. + (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare. + +2000-07-23 Paul Eggert + + * quotearg.c: + Include even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), + so that mbstate_t is always defined. + + Do not inspect MB_LEN_MAX, since it's incorrectly defined to + be 1 in at least one GCC installation, and this configuration + error is likely to be common. Ignoring MB_LEN_MAX hurts + performance on hosts that have mbrtowc but have only unibyte + locales, but I assume these hosts are rare. + +2000-07-23 Paul Eggert + + * quotearg.c: Streamline by invoking multibyte code only if needed. + : Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX. + (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX). + (quotearg_buffer_restyled): If a unibyte locale, don't bother to + invoke multibyte primitives. + +2000-07-23 Jim Meyering + + * basename.c (base_name): Add an assertion. + +2000-07-15 Bruno Haible + + * quotearg.c: When the system forces us to redefine mbstate_t, + shadow its mbsinit function. + +2000-07-16 Bruno Haible + + * mbswidth.h: New file. + * mbswidth.c: New file. + * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c. + (noinst_HEADERS): Add mbswidth.h. + +2000-07-17 Bruno Haible + + * config.charset: Add support for FreeBSD. Improve support for HP-UX + and IRIX 6. + +2000-07-15 Jim Meyering + + * makepath.c: Include quote.h. + (make_path): Convert "`%s'" in format strings to "%s", and wrap each + corresponding argument in a `quote (...)' call. + Give better diagnostics. + + * Makefile.am (libfetish_a_SOURCES): Add quote.c. + (noinst_HEADERS): Add quote.h. + + * quote.c (quote, quote_n): New file. Two functions taken verbatim + from tar's src/misc.c. + * quote.h: New file. Prototypes for same. + +2000-07-10 Paul Eggert + + From a suggestion by Bruno Haible. + * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition. + Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT, + to decide whether to define the BeOS workaround macro; + this adjusts to the change to AC_MBSTATE_T. + +2000-07-13 Paul Eggert + + * quotearg.h (enum quoting style): New enum clocale_quoting_style. + + * quotearg.c (quoting_style_args, quoting_style_vals, + quotearg_buffer_restyled): Add support for + clocale_quoting_style. Undo previous change to + locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}" + and "{RIGHT QUOTATION MARK}" msgids. + +2000-07-05 Paul Eggert + + The old behavior of quoting `like this' doesn't look good with + newer, ISO-style fonts. See: + http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html + + Instead, quote "like this" by default. Let the translator + tailor the locale-specific quoting behavior by providing + translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}. + + * quotearg.c (N_): New macro. + (gettext_default): New function. + (quotearg_buffer_restyled): Use + gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and + gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote. + +2000-07-09 Jim Meyering + + * Most files: Update copyright dates to include 2000. + +2000-07-08 Jim Meyering + + * xgethostname.c (ENAMETOOLONG): Define to an unlikely value + if not defined. + (xgethostname): Remove now-unnecessary #ifdef. + Move declaration of `err' into loop where it's used. + +2000-07-05 Bruno Haible + + * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug + by allocating a larger buffer. Test the gethostname return value for + being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname + returns an error and ENAMETOOLONG isn't defined. + +2000-07-05 Paul Eggert + and Bruno Haible + + * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't. + +2000-07-05 Bruno Haible + + * quotearg.c (struct quoting_options): Simplify quote_these_too + dimension. + +2000-07-03 Jim Meyering + + * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen. + Reported by Bruno Haible. + +2000-07-04 Jim Meyering + + * quotearg.c: Make inclusion of independent of whether + HAVE_MBRTOWC is set. Required at least for irix-5.6, which + lacks mbrtowc. + +2000-07-03 Paul Eggert + and Bruno Haible + + * quotearg.c (mbrtowc): + Assign to *pwc, and return 1 only if result is nonzero. + (iswprint): Use ISPRINT when substituting our own mbrtowc. + +2000-07-03 Jim Meyering + + * readutmp.h: [HAVE_UTMPX_H]: Include if HAVE_UTMP_H. + This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20. + From Bob Proulx. + +2000-07-02 Jim Meyering + + * quotearg.c (mbstate_t): Don't define here. + +2000-07-02 Jim Meyering + + * nanosleep.c (SIGCONT): Define if not already defined. + +2000-06-17 Bruno Haible + + * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV, + per change in ../m4/ls-mntd-fs.m4. + (read_filesystem_list): Ignore symbolic links. + +2000-06-29 Jim Meyering + + * same.c: Include or , as appropriate, + for declaration of strcmp. + + * long-options.c: Include , for declaration of exit. + + * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]: + Avoid warning by casting result to `char *' to remove `const'. + +2000-06-17 Bruno Haible + + * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c. + +2000-06-26 Paul Eggert + + savedir now sets errno on failure and invokes xmalloc to get memory. + Fix a couple of other minor bugs while we're at it. + + * savedir.c (): Do not include; there's no need. + (NAMLEN): Remove macro. + (malloc, realloc): Remove decls. + (stpcpy): Likewise. + ("xalloc.h"): Include. + (NAME_SIZE_DEFAULT): New macro. + (savedir): Use xmalloc / xrealloc to allocate memory. + Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero. + Skip "" directory entries. + Use strlen to calculate directory entry length, since the old method + is rarely used these days and isn't worth supporting. + Don't use a pointer after freeing it. + Check for integer overflow when calculating allocation size. + Use memcpy to copy entries, instead of stpcpy. + Set errno properly when returning NULL. + Check for readdir error. + +2000-06-26 Jim Meyering + + * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort. + +2000-06-17 Bruno Haible + + * getusershell.c (xmalloc, xrealloc): Remove functions. + Include xalloc.h. + Don't include . Don't declare malloc, realloc. + +2000-06-23 Bruno Haible + + * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency. + +2000-06-24 Jim Meyering + + * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r. + +2000-06-21 Jim Meyering + + * getpass.c: New file, from Bruno Haible. Required for BeOS. + +2000-06-19 Paul Eggert + + * quotearg.c: Include after , for Solaris 2.5. + (mbrtowc, mbstate_t): Define substitutes if + HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT. + (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT, + not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H). + +2000-06-17 Bruno Haible + + * xgetcwd.c (xgetcwd): If the required pathname length is smaller + than 1024, return a memory chunk of least possible size, instead + of size PATH_MAX + 2. In the loop, increment the size proportionally. + Use free/xmalloc instead of xrealloc to avoid copying for very long + paths. + +2000-06-17 Bruno Haible + + * canon-host.c (canon_host): Use malloc and memcpy to copy an + address, not strdup. Include and don't declare free(). + +2000-06-17 Bruno Haible + + * path-concat.c (path_concat): Don't access dir[-1] if dir is + the empty string. + +2000-06-21 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Add getstr.c. + (noinst_HEADERS): Add getstr.h. + + * getline.c (getstr): Move into a separate file. + * getstr.c (getstr): New file, extracted from getline.c, with + the following changes: new parameter, delim2; both delim[12] + parameters have type `int', not `char'. The latter would lose + with 8-bit delimiters. + * getstr.h: New file. + +2000-06-19 Jim Meyering + + * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define. + +2000-06-18 Jim Meyering + + * mkdir.c: Remove file, due mainly to copyright incompatibility. + Besides, these days every porting target provides a mkdir function. + + * strnlen.c: Include memory.h, string.h, and/or strings.h as needed. + (this snippet comes from src/system.h). + +2000-06-15 Paul Eggert + + * human.c (adjust_value): New function. + (human_readable_inexact): Apply rounding style even when + printing approximate values. + +2000-06-14 Paul Eggert + + * human.c (human_readable_inexact): Allow an input block + size that is not a multiple of the output block size, and vice versa. + Reported by Piergiorgio Sartor. + +2000-06-14 Paul Eggert + + * getdate.y (get_date): Apply relative times after time + zone indicator, not before. Reported by Todd A. Jacobs. + +2000-06-13 Jim Meyering + + * Makefile.am (all-local): Depend on lstat.c and stat.c. + + * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c. + +2000-06-12 Paul Eggert + + * xstat.in: Include in lstat, to declare "free". + +2000-06-04 Paul Eggert + + * strnlen.c: Include if HAVE_CONFIG_H. + +2000-06-04 Jim Meyering + + * getugroups.c (getugroups): Cast -1 to gid_t, for systems like + SunOS 4.1.4 for which gid_t is an unsigned type. + +2000-06-03 Jim Meyering + + * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr. + +2000-05-26 Bruno Haible + + * Makefile.am (install-exec-local): On systems with glibc-2.1 or + newer, don't install charset.alias. + * config.charset: Change the Linux/glibc rules so they become empty + on glibc-2.1 or newer. + +2000-06-02 Jim Meyering + + * mountlist.c: Back out last change. Instead, do this... + * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy + member using the same `ignore'-testing code. + * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored + fs_type strings. + From Mark D. Roth. + +2000-05-29 Jim Meyering + + * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts + with the `ignore' attribute. Based on a patch from Mark D. Roth. + +2000-05-22 Jim Meyering + + * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block. + +2000-05-18 Jim Meyering + + * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list + back, too, since it may have been modified by allocate_entry. + (hash_delete): Rewrite to use neither the assignment operator + nor the comma operator in an if-expression. + +2000-05-15 Paul Eggert + + * closeout.c: + , , , (STDOUT_FILENO): + Remove; no longer needed. + "quotearg.h": Add include. + (file_name): Do not bother to explicitly initialize to NULL; it's less + efficient on some hosts. + (close_stdout_status): Remove test as to whether stdout was already + closed; it breaks for the case "echo x | sort >&-". + Quote file name colons. + Do not assume that _("write error") lacks format strings. + +2000-05-15 Jim Meyering + + * version-etc.c (version_etc_copyright): Update the copyright string + used in all --version output. + +2000-05-14 Jim Meyering + + * closeout.c (close_stdout_set_file_name): New function. + (close_stdout_status): Use new file-scoped global. + Return right away if fstat says the stdout file descriptor is invalid. + * closeout.h (close_stdout_set_file_name): Declare. + +2000-05-10 Jim Meyering + + * closeout.c [default_exit_status]: New file-scoped variable. + (close_stdout_set_status): New function. + * closeout.h (close_stdout_set_status): Declare. + +2000-05-08 Jim Meyering + + * long-options.c: Don't include closeout.h. + (parse_long_options): Don't call close_stdout for --version. + +2000-05-06 Jim Meyering + + * strnlen.c: Undefine __strnlen and strnlen. + [!weak_alias]: Define __strnlen to strnlen. + + * atexit.c: New file, from libiberty. + +2000-05-06 Jim Meyering + + * closeout.c (close_stdout_status): Also check for errors on the + stderr stream. + +2000-05-05 Bruno Haible + + * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy + instead of xmalloc, xrealloc, path_concat. + (locale_charset): Treat empty environment variables as absent. + (DIRECTORY_SEPARATOR, ISSLASH): New macros. + +2000-05-04 Jim Meyering + + * getopt.c: Update from glibc. + * obstack.c: Likewise. + * obstack.h: Likewise. + * regex.c: Likewise. NB: K&R compiler support is dropped for this file + + * regex.h: Likewise. + * strndup.c: Likewise. + * strnlen.c: New file, from glibc. + +2000-05-01 Jim Meyering + + * full-write.c (full_write): Remove `FIXME' part of comment. + +2000-04-29 Jim Meyering + + * path-concat.c: Declare strdup only if it's not defined. + * canon-host.c: Likewise. + +2000-04-28 Jim Meyering + + * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid + redefinition warning on some systems (HPUX). Otherwise, regex.h is + included first, then limits.h is included by locale.h by libintl.h. + From John David Anglin. + +2000-04-25 Jim Meyering + + * makepath.c (S_IRWXUGO): Define. + (make_path): Always perform explicit chmod if MODE specifies any + of the `special' permission bits. Prompted by a bug report against + install from Mate Wierdl and Joost van Baal. + +2000-04-18 Jim Meyering + + * README: New file. + + * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define + getpagesize. For BeOS. Based on a patch from Bruno Haible. + +2000-04-17 Jim Meyering + + * strftime.c (my_strftime) [strftime]: Declare strftime here, since + the definition of it to rpl_strftime also defined-away the system's + declaration. + +2000-04-15 Jim Meyering + + Use `C' to denote so-called `contiguous' files, the same way + that tar does. + * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define. + (ftypelet): Use S_ISCTG. + From Michael Deutschmann. + +2000-04-14 Jim Meyering + + * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime. + +2000-04-08 Jim Meyering + + * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3 + names don't conflict. Reported by Eli Zaretskii. + +2000-03-28 Bruno Haible + + * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv + bug. Deal with the different error behavior of Irix iconv. + +2000-04-07 Jim Meyering + + * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h, + to work around system header problems on AIX 3.2.5. From Bruno Haible. + +2000-04-05 Jim Meyering + + Portability tweaks required for ultrix4.3. + * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent. + * readutmp.c: Include sys/types.h before sys/stat.h. + * canon-host.c: Declare strdup. + * path-concat.c: Likewise. + From John David Anglin. + +2000-04-04 Jim Meyering + + Be more DOS 8.3-friendly. + * ref-add.sin: Renamed from ref-add.sed.in. + * ref-del.sin: Renamed from ref-del.sed.in. + * Makefile.am: Reflect renaming. + Reported by Eli Zaretskii. + + Use a temporary file name that won't clash with `charset.alias' + in the DOS 8.3 name space. + * Makefile.am (charset_tmp): Define. + (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t. + (uninstall-local): Likewise. + Reported by Eli Zaretskii. + +2000-03-29 Paul Eggert + + * time/strftime.c (my_strftime): Make sure we call the system + strftime, not ourselves, when invoking the underlying strftime. + +2000-03-24 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in. + (charset_alias): Define. + (install-exec-local): Factor out common code. + (uninstall-local): Split lines longer than 80. + (ref-add.sed, ref-del.sed): Remove rules... (do the following instead) + (SUFFIXES): Define. + (.sed.in.sed): New rule. Don't redirect directly to $@. + (CLEANFILES): Add ref-add.sed and ref-del.sed. + +2000-03-19 Bruno Haible + + * config.charset: Output a line containing "Packages using this file". + * ref-add.sed.in, ref-del.sed.in: New files. + * Makefile.am (install-exec-local, uninstall-local, ref-add.sed, + ref-del.sed): New rules. + +2000-03-17 Jim Meyering + + * unicodeio.c (): Include only #if HAVE_STRING_H. + Otherwise, include + +2000-03-17 Bruno Haible + + * unicodeio.c (utf8_wctomb): New function. + (print_unicode_char): Pass the Unicode character to iconv in UTF-8 + format instead of in UCS-4 with platform dependent endianness. + +2000-03-07 Paul Eggert + + * savedir.c (savedir): Work even if directory size is + negative; this can happen with some screwy NFS configurations. + +2000-03-06 Jim Meyering + + * localcharset.c (get_charset_aliases): Don't try to free file_name + if it's NULL (because we ran out of memory). From Bruno Haible. + +2000-03-05 Jim Meyering + + * localcharset.c ("path-concat.h"): Include. + (get_charset_aliases): Use path_concat instead of ANSI string + concatenation. + + * unicodeio.h (PARAMS): Define. + Use it to guard prototype. + +2000-03-04 Jim Meyering + + * Makefile.am (install-exec-local): Create $(libdir) before installing + into it. + (uninstall-local): Uncomment this rule so `make distcheck' works + once again. + + * unicodeio.c (): Include it. + (errno): Declare if not defined. + + * localcharset.c: Add Bruno's comment justifying use of volatile. + + * config.charset: New version, incorporating remarks from a linux + i18n mailing list. From Bruno Haible. + +2000-03-02 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add config.charset. + +2000-03-01 Jim Meyering + + * localcharset.c: Guard some #includes with `#if HAVE_...'. + * unicodeio.c: Likewise. + +2000-02-02 Bruno Haible + + * config.charset: New file. + * localcharset.c: New file. + * unicodeio.h, unicodeio.c: New files. + * Makefile.am (DEFS): Add -DLIBDIR=... + (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c. + (noinst_HEADERS): Add unicodeio.h. + (all-local, install-exec-local, charset.alias): New targets. + +2000-02-28 Paul Eggert + + * quotearg.c (ALERT_CHAR): New macro. + (quotearg_buffer_restyled): Use it. + +2000-02-27 Jim Meyering + + * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/. + Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'. + + * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H', + not `#if STDC_HEADERS'. + Declare malloc if needed. + + * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..' + now that autoconf always defines the HAVE_DECL_ symbols. + * human.c: Likewise. + * same.c: Likewise. + * strtoumax.c: Likewise. + + * backupfile.c: Arrange for cpp to fail if the configure-time + declaration check was not run. + * hash.c: Likewise. + * human.c: Likewise. + * same.c: Likewise. + * strtoumax.c: Likewise. + + * userspec.c (parse_user_spec): If there is no `:' but there is a `.', + then first look up the entire `.'-containing string as a login name. + +2000-02-18 Paul Eggert + + * getdate.y: Handle two-digit years with leading zeros correctly. + (textint): New typedef. + (parser_control): Member year changed from int to textint. + All uses changed. + (YYSTYPE): Removed; replaced by %union with int and textint members. + (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN, + tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER, + tYEAR_UNIT, tZONE, o_merid): Now of type . + (tSNUMBER, tUNUMBER): Now of type . + (date, number, to_year): Use width of number in digits, not its value, + to determine whether it's a 2-digit year, or a 2-digit time. + (yylex): Store number of digits of numeric tokens. + Reported by John Kendall. + + (parser_control): Changed from struct parser_control to typedef (for + consistency). All uses changed. + + (tID): Removed; not used. + (yylex): Return '?' for unknown identifiers, rather than (unused) tID. + +2000-02-14 Paul Eggert + + * getpagesize.h (getpagesize): Port to VMS for Alpha; + adapted from changes to grep getpagesize.h by Martin P.J. Zinser. + +2000-02-12 Jim Meyering + + * userspec.c (ISDIGIT): Define it. + (isdigit): Remove definition. + (is_number): Use ISDIGIT, not isdigit. + : Include. + (_ and N_): Define. + (parse_user_spec): Mark translatable strings. + +2000-02-10 Jim Meyering + + With these changes, nanosleep.[ch] are finally enough like the other + lib/* replacement files to compile on a few more losing systems. + + * nanosleep.h: Don't include config.h. + Remove prototype from declaration of nanosleep. + (PARAMS): Remove now-unneeded definition. + * nanosleep.c: #undef nanosleep. + (rpl_nanosleep): Rename from nanosleep. + +2000-02-03 Jim Meyering + + * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION', + rather than with `#if HAVE_UTMPNAME'. + +2000-02-01 Jim Meyering + + * readutmp.h (UT_USER): Add parens. From Andreas Schwab. + +2000-01-31 Jim Meyering + + * nanosleep.h (nanosleep): Guard declaration with + `#if ! HAVE_DECL_NANOSLEEP'. + Without this, OFS gets a redeclaration error for rpl_nanosleep, due to + the declaration in that vendor's sys/timers.h. + Reported by Christian Krackowizer. + + * quotearg.c (ISASCII): Add #undef and move definition to follow + inclusion of wctype.h to work around Solaris 2.6 namespace pollution. + (ISPRINT): Likewise. + Reported by Tom Tromey. + +2000-01-30 Jim Meyering + + * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding + uses of ->ut_name. The latter doesn't work with new Linux header files + where only utmpx.ut_user is declared. + + * readutmp.h (UT_USER): Define. + +2000-01-23 Jim Meyering + + * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of + obstack.c. + +2000-01-22 Jim Meyering + + * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul. + [! HAVE_DECL_STRTOULL]: Declare strtoull. + Required for some AIX systems. Reported by Christian Krackowizer. + [TESTING] (main): New function. + + 1997-10-17 Eli Zaretskii + * dirname.c (dir_name): Support for DOS-style file names with drive + letters. + + * quotearg.c [HAVE_WCTYPE_H]: Include for decl of iswprint. + + * strverscmp.c (ISDIGIT): Define. + (strverscmp): Use ISDIGIT, not isdigit. + +2000-01-17 Paul Eggert + + * nanosleep.c (nanosleep): + Don't use SA_INTERRUPT to decide whether to call sigaction, as + POSIX.1 doesn't require SA_INTERRUPT and some systems + (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead; + it's been part of POSIX.1 since day 1 (in 1988). + +2000-01-17 Jim Meyering + + * interlock: Remove unused file. Reported by François Pinard. + +2000-01-16 Paul Eggert + + * quotearg.c (quotearg_buffer_restyled): Do not quote + alert, backslash, formfeed, and vertical tab unnecessarily in + shell quoting style. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/README b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/README new file mode 100644 index 0000000..100b99d --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/README @@ -0,0 +1,3 @@ +The files in this directory are used in many GNU packages, +including coreutils, diffutils, and tar. +The autoconf tests required for these files are in ../m4. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/TODO b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/TODO new file mode 100644 index 0000000..4b3fe85 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/lib/TODO @@ -0,0 +1,32 @@ +Things to do to hash.c: + +Always use curly braces around statements in if/else/while/do/etc. +that span more than a line -- even around multiline simple statements +or single-line simple statements preceded by a comment line. + +Never have lines longer than 80 chars. + +Remove ^L characters. We don't want/need such crutches. +Get a good (smart) pagination filter. I have one (a perl script) +that usually does a decent job for me -- I called it something +like stdc-print and think I sent you an early verison. + +I don't like the name `cursor'. I much prefer short names +like `p' for index variables. I doubt I'll change all of them, +but thought you should know why some will probably end up changing. + +#define USE_OBSTACK somewhere + +Fix this comment. Depending on system and application... +Mention fragmentation. + +#if USE_OBSTACK + + /* Whenever obstacks are used, it is possible to allocate all overflowed + + entries into a single stack, so they all can be freed in a single + + operation. It is not clear if the speedup is worth the trouble. */ + + struct obstack entry_stack; + +#endif + + +assert (bucket_limit - bucket == n_buckets) ? + +remove.c: s/done/successful or ok diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/m4/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/m4/ChangeLog new file mode 100644 index 0000000..7614b20 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/m4/ChangeLog @@ -0,0 +1,3417 @@ +2005-01-04 Jim Meyering + + * chown.m4 (gl_FUNC_CHOWN): When cross-compiling, assume that chown + is sane and DOES follow symlinks. Besides, testing 20 different + systems found no broken chown implementations. + Prompted by a change in rsync's copy of this macro. + +2005-01-03 Paul Eggert + + * ullong_max.m4: New file. + * jm-macros.m4 (gl_MACROS): Require gl_ULLONG_MAX. + +2005-01-03 Jim Meyering + + * mkstemp.m4 (gl_FUNC_MKSTEMP): Don't `cd' into the temporary + subdirectory. That would make the subsequent AC_TRY_RUN macro fail, + for lack of the ./confdefs.h file. Instead, use the temporary + directory name as a prefix on the template string. + Include for the declaration of close. + Remove `.tmp' suffix; mkstemp requires that XXXXXX be a suffix. + +2004-12-23 Paul Eggert + + * getdate.m4 (gl_GETDATE): Remove AC_FUNC_ALLOCA. + +2004-12-21 Jim Meyering + + * mkstemp.m4 (gl_FUNC_MKSTEMP): Remove temporary directory right + away, rather than waiting for configure's at-exit trap code to do it. + Suggestion from Stepan Kasal. + +2004-12-20 Jim Meyering + + * mkstemp.m4: Do the `cd' in a subshell. + + * mkstemp.m4: Rather than using "conftestXXXXXX" as the mkstemp + template, use a temporary directory and an 8.3-friendly template + to avoid trouble on systems like DJGPP. + Reported by Juan M. Guerrero via Stepan Kasal. + +2004-12-19 Paul Eggert + + * c-strtod.m4 (gl_C99_STRTOLD): New macro. + (gl_C_STRTOD): Use it instead of AC_CHECK_DECLS_ONCE(strtold). + +2004-12-10 Jim Meyering + + * chdir-long.m4 (gl_FUNC_CHDIR_LONG: Arrange to compile chdir-long.c + only on systems that define PATH_MAX. + +2004-12-07 Paul Eggert + + * ls-mntd-fs.m4 (AC_FUNC_GETMNTENT): Fix typo in previous change: + spurious "-l"s. Problem reported by Stepan Kasal. + +2004-12-06 Paul Eggert + + * ls-mntd-fs.m4 (AC_FUNC_GETMNTENT): New macro, to work around bug + in Autoconf 2.59. Problem reported by Mark D. Baushke. + +2004-12-06 Jim Meyering + + * save-cwd.m4 (gl_SAVE_CWD): Use AC_LIBSOURCES. + Use AC_LIBOBJ(save-cwd). + * chdir-long.m4 (gl_FUNC_CHDIR_LONG): Use AC_LIBSOURCES. + Use AC_LIBOBJ(chdir-long). + * mempcpy.m4 (gl_FUNC_MEMPCPY): Use AC_LIBSOURCES. + * lchown.m4 (gl_FUNC_LCHOWN): Likewise. + * openat.m4 (gl_FUNC_OPENAT): Likewise. + (gl_PREREQ_GETCWD): Use AC_REQUIRE. + +2004-12-02 Paul Eggert + + * openat.m4: Add copyright notice. + (gl_FUNC_OPENAT): Require gl_USE_SYSTEM_EXTENSIONS, since Solaris + requires __EXTENSIONS__ to be defined when compiling pedantically, + if you want AT_FDCWD. + +2004-12-01 Paul Eggert + + * hard-locale.m4 (gl_HARD_LOCALE): Assume locale.h and setlocale + exist. + * human.m4 (gl_HUMAN): Assume locale.h and localeconv exist. + * jm-macros.m4 (gl_MACROS): Assume localeconv exists. + +2004-11-30 Paul Eggert + + * getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): + Define HAVE_PARTLY_WORKING_GETCWD if getcwd is partly working. + + * readutmp.m4 (gl_READUTMP): Don't check for sys/param.h. + +2004-11-30 Jim Meyering + + * chdir-long.m4: Rename from chdir.m4. + * jm-macros.m4 (gl_MACROS): Reflect renaming. + +2004-11-28 Jim Meyering + + * chdir.m4: New file. + * openat.m4: New file. + * jm-macros.m4 (gl_MACROS): Require gl_FUNC_CHDIR. + +2004-11-25 Paul Eggert + + * mempcpy.m4: New file, taken from gnulib. + * getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Renamed from + GL_FUNC_GETCWD_PATH_MAX for consistency. All uses changed. + Use the _ONCE methods, for efficiency. + Check for fcntl.h. In test program, include + and if available. Remove old K&R cruft from + test program. Check for common errors in GNU/Linux, + OpenBSD, and Solaris. Just set gl_cv_func_getcwd_path_max; + don't do AC_LIBOBJ, as that's getcwd.m4's job. + * getcwd.m4 (gl_FUNC_GETCWD_NULL): Renamed from + AC_FUNC_GETCWD_NULL. All used changed. Change cache variable + name accordingly. + (gl_FUNC_GETCWD, gl_PREREQ_GETCWD): New macros. Revamp to + accommodate new getcwd.c. + * jm-macros.m4 (gl_MACROS): Don't require GL_FUNC_GETCWD_PATH_MAX. + * prereq.m4 (gl_PREREQ): Add gl_FUNC_MEMPCPY. + * xgetcwd.m4 (gl_XGETCWD): Replace with gl_FUNC_GETCWD, since + that's all we need now. + +2004-11-23 Paul Eggert + + * utimens.m4 (gl_UTIMENS): Check for futimes function. + +2004-11-23 Sergey Poznyakoff + + * getopt.m4 (gl_GETOPT): Check if GETOPT_H is already set, in + order not to spoil the result of an eventual previous invocation + of gl_GETOPT_SUBSTITUTE. + +2004-11-17 Paul Eggert + + * calloc.m4 (_AC_FUNC_CALLOC_IF): Check for buggy calloc implementations + that mishandle size_t overflow. + +2004-11-16 Paul Eggert + + * canon-host.m4 (gl_CANON_HOST): Check for getaddrinfo. + +2004-11-13 Jim Meyering + + * jm-macros.m4: Do require gl_FUNC_FPENDING. + * fpending.m4: Restore file. + +2004-11-11 Paul Eggert + + * getopt.m4: Sync from gnulib. + +2004-11-06 Jim Meyering + + * jm-macros.m4: Don't require gl_FUNC_FPENDING. + * fpending.m4: Remove file. + +2004-11-03 Paul Eggert + + * setenv.m4: New file, from gnulib. + * prereq.m4 (gl_PREREQ): Require gt_FUNC_SETENV. + * uint32_t.m4: Sync from gnulib. + +2004-11-02 Paul Eggert + + * getpass.m4: Sync from gnulib. + +2004-10-29 Paul Eggert + + * getpagesize.m4: Sync from gnulib. + +2004-10-17 Paul Eggert + + * jm-macros.m4 (gl_MACROS): Check for mbrlen, for pathchk. + (gl_CHECK_ALL_TYPES): Require AC_TYPE_MBSTATE_T, for pathchk. + + Sync from gnulib. + * getopt.m4 (gl_GETOPT): Detect and reject the incompatible BSD + implementation of getopt_long. + +2004-10-04 Paul Eggert + + Sync from gnulib. + + * xalloc.m4 (gl_PREREQ_XSTRDUP): Remove. All uses removed. + + * unlocked-io.m4: Add copyright notice. + (gl_FUNC_GLIBC_UNLOCKED_IO): Define USE_UNLOCKED_IO. + +2004-10-03 Paul Eggert + + Sync from gnulib. + * mbswidth.m4: Add copyright notice. + * vasnprintf.m4 (gl_FUNC_VASNPRINTF): Require gl_EOVERFLOW. + * eoverflow.m4: New file. + +2004-08-19 Paul Eggert + + * getopt.m4: Sync from gnulib. + +2004-08-11 Paul Eggert + + * obstack.m4 (gl_PREREQ_OBSTACK): Require + gl_AC_HEADER_INTTYPES_H, gl_AC_HEADER_STDINT_H, gl_AC_TYPE_UINTMAX_T. + + * fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Check for wmemchr and wmemcpy. + +2004-08-09 Paul Eggert + + * sha1.m4: Renamed from sha.m4. + (gl_SHA1): Renamed from gl_SHA. All uses changed. + +2004-08-08 Simon Josefsson + + * getpass.m4 (gl_FUNC_GETPASS, gl_FUNC_GETPASS_GNU): + Check getpass declaration. + +2004-08-07 Paul Eggert + + * canonicalize.m4, getcwd-path-max.m4, strdup.m4: Merge from gnulib. + +2004-08-05 Paul Eggert + + Merge from gnulib. + + * alloca.m4 (gl_FUNC_ALLOCA): Define HAVE_ALLOCA_H always, + for backward compatibility with older code. We need our own + alloca.h if _AIX is defined. Define HAVE_ALLOCA if we discover + it under some other name, and our alloca.h will define it. + * backupfile.m4, calloc.m4, strtoimax.m4, strtoumax.m4: + Bump serial number only. + * dirfd.m4, intmax_t.m4, inttypes_h.m4, mbrtowc.m4, stdint_h.m4, + uintmax_t.m4: Finish renaming jm_ to gl_. + * dos.m4 (gl_AC_DOS): Check for _WIN32, __WIN32__, and __MSDOS__. + * host-os.m4: s/KNetBSD/kNetBSD/g and s/KFreeBSD/kFreeBSD/g. + * prereq.m4 (gl_PREREQ): Add gl_GETTIME, AC_FUNC_CALLOC. + * gettime.m4: New file. + * settime.m4: Require gl_TIMESPEC; check for settimeofday, stime. + * unlocked-io.m4: Remove -*- autoconf -*-. + * xalloc.m4: No longer require AC_FUNC_CALLOC, AC_FUNC_MALLOC, + AC_FUNC_REALLOC. + +2004-08-04 Paul Eggert + + OpenBSD porting fixes. + * boottime.m4: Add copyright notice. + (GNULIB_BOOT_TIME): Include sys/param.h before testing + for sys/sysctl.h. + * fsusage.m4: Add copyright notice. + (gl_FSUSAGE): Include sys/param.h before checking for sys/mount.h. + * jm-macros.m4: Include copyright notice. + (gl_MACROS): Use the _ONCE variants when appropriate. + Include sys/param.h before testing for sys/sysctl.h and sys/mount.h. + * ls-mntd-fs.m4: Include copyright notice. + (gl_LIST_MOUNTED_FILE_SYSTEMS): Include sys/param.h before + testing for sys/mount.h. + * stat-prog.m4: Include copyright notice. + (cu_PREREQ_STAT_PROG): Use the _ONCE variants when appropriate. + Include sys/param.h before testing for sys/mount.h. + +2004-08-01 Paul Eggert + + * jm-macros.m4 (gl_CHECK_ALL_TYPES): + Require gl_AC_TYPE_UINTPTR_T instead of using AC_CHECK_TYPE + on uintptr_t. Require gl_AC_TYPE_UINT32_T. + * md5.m4 (gl_MD5): Require gl_AC_TYPE_UINT32_T. + * uint32_t.m4, uintptr_t.m4: New files. + +2004-07-28 Paul Eggert + + * md5.m4 (gl_MD5): Do not require AC_C_INLINE, since it doesn't + use inline any more. Require AC_C_BIGENDIAN, though. + * sha.m4 (gl_SHA): Require AC_C_BIGENDIAN. + +2004-07-27 Paul Eggert + + * euidaccess.m4 (gl_PREREQ_EUIDACCESS): Don't bother checking for + unistd.h, as autoconf does this for us. Check for libgen.h. + Also look for eaccess within -lgen, which is where it is in + Solaris. Set LIB_EACCESS accordingly. + + * backupfile.m4 (gl_BACKUPFILE): AC_REQUIRE + gl_CHECK_TYPE_STRUCT_DIRENT_D_INO instead of invoking it directly. + Do not require AC_FUNC_CLOSEDIR_VOID. + +2004-07-25 Paul Eggert + + * jm-macros.m4 (gl_MACROS): Remove test for setreuid and setregid, + as test.c no longer uses them directly. + + * euidaccess.m4 (gl_FUNC_NONREENTRANT_EUIDACCESS): New macro. + (gl_FUNC_EUIDACCESS): Use AC_CHECK_DECLS_ONCE, not AC_CHECK_DECLS. + (gl_PREREQ_EUIDACCESS): Check for eaccess and setregid decls. + Require AC_HEADER_STAT. + + * prereq.m4 (gl_PREREQ): Invoke gl_FUNC_NONREENTRANT_EUIDACCESS, + not gl_FUNC_EUIDACCESS. + +2004-07-23 Paul Eggert + + * prereq.m4 (gl_PREREQ): Add gl_FCNTL_SAFER. + * fcntl-safer.m4: New file. + +2004-07-12 Paul Eggert + + * c-strtod.m4 (gl_C_STRTOD): Add gl_USE_SYSTEM_EXTENSIONS. + +2004-07-11 Paul Eggert + + * c-strtod.m4: New file. + * prereq.m4 (gl_PREREQ): Add gl_C_STRTOLD. + +2004-04-03 Dmitry V. Levin + + * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME): + Do not add canonicalize.c here. + +2004-07-02 Paul Eggert + + * path-concat.m4 (gl_PATH_CONCAT): Don't require gl_AC_DOS, the + prerequisite modules now handle the DOS stuff. + Don't check for unistd.h. + +2004-06-30 Paul Eggert + + * dos.m4 (gl_AC_DOS): Define FILE_SYSTEM_PREFIX_LEN, not + FILESYSTEM_PREFIX_LEN. Generate + FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX, not + FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX. Generate + FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR, not + FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR. + * ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Renamed from + gl_LIST_MOUNTED_FILESYSTEMS. All uses changed. + +2004-06-25 Jim Meyering + + * afs.m4 (gl_AFS): Use AC_ARG_WITH instead of ancient, hard-coded + AC_MSG_CHECKING/AC_MSG_RESULT etc. From Tim Waugh. + +2004-06-15 Paul Eggert + + * getcwd-path-max.m4 (GL_FUNC_GETCWD_PATH_MAX): Fix typo: getcwd + was being replaced when it shouldn't have been, and vice versa. + +2004-06-09 Jim Meyering + + * calloc.m4 (AC_FUNC_CALLOC): Remove use of AN_FUNCTION. + +2004-06-07 Jim Meyering + + * jm-macros.m4 (gl_MACROS): Check for the directio function. + +2004-06-01 Jim Meyering + + * stdbool.m4: Update from gnulib. + +2004-05-29 Jim Meyering + + * xalloc.m4 (gl_PREREQ_XMALLOC): Require AC_FUNC_CALLOC. + * calloc.m4 (AC_FUNC_CALLOC, _AC_FUNC_CALLOC_IF): New file/macros. + +2004-05-21 Jim Meyering + + * free.m4: Update from gnulib (fix reversed test). + +2004-05-03 Jim Meyering + + Temporary work-around for the problem reported here: + http://sources.redhat.com/ml/bug-automake/2004/msg00339.html + + * gettext.m4 (AM_GNU_GETTEXT): Don't require AM_INTL_SUBDIR. + (AM_INTL_SUBDIR): Comment out definition. + +2004-05-01 Jim Meyering + + * jm-mktime.m4: Remove file. This is now part of mktime.m4. + * glibc.m4, c-stack.m4, xsize.m4, size_max.m4: Remove unused files. + * printf-posix.m4, lcmessage.m4: Likewise. + * gettextext.m4, intdiv0.m4, intmax.m4: Likewise. + + * jm-macros.m4 (gl_MACROS): Move fchown-checking code to chown.m4. + * chown.m4 (gl_PREREQ_CHOWN): Check for fcntl.h. + See if we need an fchown replacement. + (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): New macro. + (gl_FUNC_CHOWN): Require gl_FUNC_CHOWN_FOLLOWS_SYMLINK, + and use the replacement function if we detect either defect. + +2004-04-22 Paul Eggert + + * jm-macros.m4 (gl_MACROS): Check for tcgetpgrp. + +2004-04-23 Jim Meyering + + * jm-macros.m4: Don't check for values.h; it's no longer used. + +2004-04-20 Jim Meyering + + Change UTILS_ to gl_ in AC_DEFINE'd names. + Change utils_- and jm_-prefixed variables, too. + * mkdir-slash.m4 (gl_FUNC_MKDIR_TRAILING_SLASH): Renamed from + UTILS_FUNC_MKDIR_TRAILING_SLASH. + * mkstemp.m4 (gl_FUNC_MKSTEMP): Renamed from UTILS_FUNC_MKSTEP. + * host-os.m4 (gl_HOST_OS): Renamed from UTILS_HOST_OS. + + * dirfd.m4 (gl_FUNC_DIRFD): Rename from UTILS_FUNC_DIRFD. + Don't emit trailing blanks. + Also rename jm_-prefixed variables to have gl_ prefix. + + * jm-macros.m4: Reflect the renamings. + * prereq.m4: Likewise. + +2004-04-19 Jim Meyering + + * readutmp.m4 (gl_PREREQ_READUTMP): Require gl_FUNC_FREE, + now that readutmp.c may call `free (0)'. + +2004-04-14 Jim Meyering + + * Makefile.am: Remove file. With automake-1.8.3, it's no longer needed. + * Makefile.am.in: Likewise. + * Makefile.in: Likewise. + + * stat-prog.m4 (cu_PREREQ_STAT_PROG): Don't use AC_CHECK_HEADERS to + check for inttypes.h. Instead, require gt_HEADER_INTTYPES_H. + + * jm-macros.m4: Require cu_PREREQ_STAT_PROG. + + * prereq.m4: Move prerequisite function for src/stat.c to ... + * stat-prog.m4 (cu_PREREQ_STAT_PROG): New file. Contents from prereq.m4. + +2004-04-13 Jim Meyering + + Change `jm_' in AC_DEFINE'd names to `gl_'. Update all uses. + + * afs.m4, allocsa.m4, assert.m4, backupfile.m4, bison.m4: + * check-decl.m4, chown.m4, d-ino.m4, d-type.m4, dirname.m4: + * dos.m4, error.m4, fpending.m4, fstypename.m4, fsusage.m4: + * ftruncate.m4, getdate.m4, getgroups.m4, gettext.m4, glibc21.m4: + * group-member.m4, human.m4, intmax.m4, intmax_t.m4, inttostr.m4: + * inttypes_h.m4, jm-macros.m4, jm-mktime.m4, jm-winsz1.m4: + * jm-winsz2.m4, lchown.m4, lib-check.m4, link-follow.m4, longlong.m4: + * ls-mntd-fs.m4, lstat.m4, makepath.m4, mbrtowc.m4, mbswidth.m4: + * memchr.m4, memcmp.m4, mkstemp.m4, mountlist.m4, nanosleep.m4: + * path-concat.m4, perl.m4, prereq.m4, putenv.m4, quotearg.m4: + * regex.m4, stat.m4, stdint_h.m4, strftime.m4, strtoimax.m4: + * strtoll.m4, strtoull.m4, strtoumax.m4, timespec.m4, uintmax_t.m4: + * ulonglong.m4, unlink-busy.m4, unlocked-io.m4, uptime.m4, utimbuf.m4: + * utime.m4, utimens.m4, utimes-null.m4, vasnprintf.m4, xstrtoimax.m4: + * xstrtol.m4, xstrtoumax.m4: Change jm_ to gl_ in AC_DEFINE'd names. + +2004-03-27 Paul Eggert + + * utimecmp.m4: New file. + * prereq.m4 (jm_PREREQ): Require gl_UTIMECMP. + +2004-04-07 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Check for fdatasync within + -lrt and -lposix4, so that it can be used in Solaris 2.5.1 and later. + +2004-03-30 Paul Eggert + + * c-stack.m4, getline.m4, getndelim2.m4, mbswidth.m4, po.m4, + strdup.m4, xsize.m4: Sync from gnulib. + + * allocsa.m4, cloexec.m4, eealloc.m4, inttostr.m4, mbstate_t.m4: + New files, from gnulib. + + * prereq.m4 (jm_PREREQ): Add gl_ALLOCSA, gl_CLOEXEC, gl_INTTOSTR. + +2004-03-31 Jim Meyering + + * prereq.m4: Require AC_FUNC_MALLOC, not jm_FUNC_MALLOC. + Require AC_FUNC_REALLOC, not jm_FUNC_REALLOC. + * xalloc.m4: Likewise. + + * realloc.m4: Remove file, since now it does no more than + AC_REQUIRE([AC_FUNC_REALLOC]), and that can be done via + the `configure.ac' section of module/realloc. + * malloc.m4: Likewise, but for AC_FUNC_MALLOC. + +2004-02-29 Paul Eggert + + * clock_time.m4 (gl_CLOCK_TIME): Require AC_GNU_SOURCE. + * getdate.m4 (gl_GETDATE): Remove time-related stuff. + Require AM_STDBOOL_H and gl_TIMESPEC instead. + Require gl_CLOCK_TIME. + +2004-03-07 Paul Eggert + + * Makefile.am.in (Makefile.am): + Don't use $<, as it doesn't work with Solaris make. + +2004-01-29 Jim Meyering + + Avoid a configure-time warning about sys/ucred.h on OSF V4.0. + * ls-mntd-fs.m4: Test for sys/ucred.h separately, since + on some systems one must include before it. + Reported by Christian Krackowizer. + +2004-01-16 Jim Meyering + + * onceonly.m4: Sync with version from gettext-0.13.1. + +2003-10-08 Paul Eggert + + Merge from gnulib. + + * getpass.m4 (gl_PREREQ_GETPASS): Check for stdio_ext.h. + +2003-08-26 Bruno Haible + + Merge from gnulib. + + * fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Remove AC_DEFINE of fnmatch here. + This avoids havoc on compilers for which '#define fnmatch rpl_fnmatch' + followed by '#define fnmatch fnmatch_posix' gives an error. + +2004-01-14 Paul Eggert + + * posixv.m4 (gl_POSIXVER): Require gl_DEFAULT_POSIX2_VERSION. + +2004-01-13 Jim Meyering + + * gettext.m4, lib-ld.m4, lib-prefix.m4, nls.m4, po.m4: + Update from gettext-0.13.1. + * intmax.m4, isc-posix.m4, printf-posix.m4, size_max.m4, xsize.m4: + New files. From gettext-0.13.1. + +2004-01-11 Paul Eggert + + * posixver.m4 (gl_DEFAULT_POSIX2_VERSION): Move + the documentation from 'configure' into 'config.hin', + so that 'configure --help' isn't burdened by it and + we don't have to worry about its formatting there. + Reword the documentation so that it's more succinct + and can be run together into a single paragraph. + +2004-01-12 Jim Meyering + + * posixver.m4 (gl_DEFAULT_POSIX2_VERSION): New macro. + +2003-12-20 Jim Meyering + + * jm-macros.m4: Don't require UTILS_SYS_OPEN_MAX. + + * open-max.m4 (UTILS_SYS_OPEN_MAX): Remove file. No longer used. + + * lib-check.m4 (jm_LIB_CHECK): Do not set LIB_CRYPT to the + value, $ac_cv_search_crypt, if it's "none required". + +2003-12-19 Jim Meyering + + * clock_time.m4 (gl_CLOCK_TIME): Don't set LIB_CLOCK_GETTIME + if no library is required. + +2003-12-18 Jim Meyering + + * search-libs.m4 (AC_SEARCH_LIBS): Remove file/macro, now that + this replacement is no longer needed. Besides, this macro has + no effect with autoconf-2.58, since `undefine' in package-supplied + .m4 files is no longer honored. Reported by Andreas Schwab. + + Remove now-unnecessary (and unused) files. They also used `undefine'. + * isc-posix.m4 (AC_ISC_POSIX): Remove file. + * getloadavg.m4 (gl_FUNC_GETLOADAVG): Remove file. + * prereq.m4 (jm_PREREQ): Require AC_FUNC_GETLOADAVG, + not gl_FUNC_GETLOADAVG. + +2003-11-08 Jim Meyering + + * inttypes.m4: Sync from gnulib (this file was previously empty, + to work around some sort of problem). + +2003-11-08 Alexandre Duret-Lutz + + * nanosleep.m4 (jm_FUNC_NANOSLEEP): Do not set LIB_NANOSLEEP to the + value, $ac_cv_search_nanosleep, if it's "none required". + +2003-11-05 Paul Eggert + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Check for uintptr_t. + +2003-11-05 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require gl_FUNC_FREE. + * free.m4: New file, from gnulib. + + * exitfail.m4, host-os.m4, strndup.m4: Update from gnulib. + + * jm-macros.m4 (jm_MACROS): Require autoconf-2.58. + (AC_LANG_SOURCE): Remove definition, now that we require autoconf-2.58. + +2003-10-13 Paul Eggert + + * xalloc.m4: Import latest version from gnulib. + +2003-10-06 Jim Meyering + + * ftw.m4: Remove now-unused file. + +2003-10-05 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Don't require AC_FUNC_FTW. + +2003-09-17 Paul Eggert + + Update from gnulib. + * extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Call AC_BEFORE first, + to avoid spurious warnings like "AC_RUN_IFELSE was called before + gl_USE_SYSTEM_EXTENSIONS" from autoreconf. + +2003-09-12 Paul Eggert + + More patches to assume C89 or better. + + * mkstemp.m4 (jm_PREREQ_TEMPNAME): Do not require standard C headers. + * strdup.m4 (gl_PREREQ_STRDUP): Likewise. + * userspec.m4 (gl_USERSPEC): Likewise. + * xalloc.m4 (gl_PREREQ_XMALLOC): Likewise. + * xstrtod.m4 (gl_XSTRTOD): Likewise. + * xstrtol.m4 (gl_PREREQ_XSTRTOL): Likewise. + * strftime.m4 (_jm_STRFTIME_PREREQS): Don't check for limits.h, + memcpy, memset. + (jm_FUNC_GNU_STRFTIME): Don't require standard C headers. + * strtod.m4 (gl_FUNC_STRTOD): Do not check for float.h. + * strtoimax.m4 (gl_PREREQ_STRTOIMAX): Do not check for stdlib.h, strtol. + * strtol.m4 (gl_FUNC_STRTOL): Do not check for limits.h. + * userspec.m4 (gl_USERSPEC): Do not check for string.h. + * xstrtol.m4 (gl_PREREQ_XSTRTOL): Do not check for string.h, strtol, + strtoul. + +2003-09-12 Paul Eggert + + * error.m4 (gl_ERROR): Don't check for vprintf. + Require AC_FUNC_STRERROR_R rather than invoking it. + +2003-09-12 Paul Eggert + + * check-decl.m4 (jm_CHECK_DECLS): Include , + unconditionally. + * closeout.m4 (gl_CLOSEOUT): Don't check for stdlib.h. + * gettimeofday.m4 (AC_FUNC_GETTIMEOFDAY_CLOBBER): + Include , unconditionally. + * lstat.m4 (gl_PREREQ_LSTAT): Don't check for stdlib.h, free. + * readdir.m4 (GL_FUNC_READDIR): Don't check for string.h. + * readutmp.m4 (gl_PREREQ_READUTMP): Don't check for standard C headers + or for string.h. + * strtoumax.m4 (gl_PREREQ_STRTOUMAX): Don't check for stdlb.h + or strtoul. + * extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Require AC_AIX + and AC_MINIX, too, so that their extensions are available. + + * prereq.m4 (jm_PREREQ_ADDEXT): Remove. All uses removed. + This macro has been superseded by gl_BACKUPFILE. + +2003-09-12 Jim Meyering + + * prereq.m4 (jm_PREREQ): Require gl_READTOKENS, gl_MD5, gl_MAKEPATH, + gl_LONG_OPTIONS, and gl_IDCACHE, gl_GETUGROUPS. + * readtokens.m4: New file, from gnulib + * md5.m4: Likewise. + * makepath.m4: Likewise. + * long-options.m4: Likewise. + * idcache.m4: Likewise. + * getugroups.m4: Likewise. + +2003-09-11 Paul Eggert + + More patches to assume C89 or better. + * strndup.m4 (gl_PREREQ_STRNDUP): Remove STDC_HEADERS check. + * strnlen.m4 (gl_PREREQ_STRNLEN): Don't check for memory.h, + string.h, memchr, STDC_HEADERS. + +2003-09-10 Bruno Haible + + * strcspn.m4 (gl_PREREQ_STRCSPN): Remove check. + * strpbrk.m4 (gl_PREREQ_STRPBRK): Remove check. + * strstr.m4 (gl_PREREQ_STRSTR): Remove check. + * unicodeio.m4 (gl_UNICODEIO): Remove check. + * xreadlink.m4 (gl_XREADLINK): Remove check. + * yesno.m4 (gl_YESNO): Remove check. + +2003-09-09 Paul Eggert + + * getcwd.m4 (AC_FUNC_GETCWD_NULL): Don't check for stdlib.h. + * getopt.m4 (gl_GETOPT): Don't check for string.h. + * getusershell.m4 (gl_PREREQ_GETUSERSHELL): Do not check for stdlib.h. + * group-member.m4 (gl_PREREQ_GROUP_MEMBER): Do not require standard C + headers. + * hard-locale.m4 (gl_HARD_LOCALE): Do not check for stdlib.h, + string.h. + * hash.m4 (gl_HASH): Do not check for stdlib.h, malloc, free. + * human.m4 (gl_HUMAN): Do not check for stdlib.h, string.h, getenv. + * sha.m4 (gl_SHA): Don't check for standard Cheaders, memcpy. + * memchr.m4 (jm_PREREQ_MEMCHR): Don't check for limits.h, stdlib.h. + * memcmp.m4 (gl_PREREQ_MEMCMP): Don't check for string.h. + * memcoll.m4 (gl_MEMCOLL): Likewise. + * memrchr.c (gl_PREREQ_MEMRCHR): Don't check for limits.h. + * mkdir-slash.m4 (gl_PREREQ_MKDIR): Don't check for stdlib.h, + string.h, free. + * mktime.m4 (gl_PREREQ_MKTIME): Don't check for standard C headers. + * modechange.m4 (gl_MODECHANGE): Don't check for standard C headers. + * mountlist.m4 (gl_PREREQ_MOUNTLIST_EXTRA): Don't check for standard + C headers, or for string.h. + * obstack.m4 (gl_OBSTACK): Don't check for stddefe.h, string.h. + (gl_PREREQ_OBSTACK): Don't check for stdlib.h. + * path-concat.m4 (gl_PATH_CONCAT): Don't check for standard C + headers, memory.h, stdlib.h, string.h, strings.h. + * posixtm.m4 (gl_POSIXTM): Don't check for stdlib.h, string.h. + * posixver.m4 (gl_POSIXVER): Don't check for getenv. + * putenv.m4 (gl_PREREQ_PUTENV): Don't check for string.h, memcpy, + strchr. + * regex.m4 (jm_PREREQ_REGEX): Do not check for limits.h, string.h. + * rename.m4 (gl_PREREQ_RENAME): Do not check for stdlib.h, string.h, + free. + * rpmatch.m4 (gl_PREREQ_RPMATCH): Don't check for standard C headers. + * save-cwd.m4 (gl_SAVE_CWD): Don't check for standard C headers. + * savedir.m4 (gl_SAVEDIR): Don't check for standard C headers. + * xgetcwd.m4 (gl_XGETCWD): Don't check for stdlib.h. + +2003-09-09 Derek Robert Price + + * getndelim2.m4 (gl_PREREQ_GETNDELIM2): Assume stdlib.h per the + C89 spec. + +2003-09-08 Paul Eggert + + Assume C89 or better; remove K&R cruft. + * alloca.m4 (gl_PREREQ_ALLOCA): Don't check for stdlib.h, string.h. + * backupfile.m4 (gl_BACKUPFILE): Don't check for stdlib.h, + string.h, getenv, malloc. + * dirname.m4 (gl_DIRNAME): Don't check for string.h or C standard + headers. + * canon-host.m4 (gl_CANON_HOST): Don't check for string.h, stdlib.h. + * error.m4 (jm_PREREQ_ERROR): Do not require STDC headers, and + do not check for strerror. + * exclude.m4: Do not check for stdlib.h, string.h, strings.h. + * exitfail.m4 (gl_EXITFAIL): Do not check for stdlib.h. + * fnmatch.m4 (gl_PREREQ_FNMATCH_EXTRA): Remove. All uses removed. + * getdate.m4 (gl_GETDATE): Don't check for stdlib.h or string.h. + +2003-08-27 Jim Meyering + + * mkstemp.m4: Require that the system mkstemp be able to create + 70 temporary files, not just 30. Tru64 V4.0F's mkstemp function + would fail after 32. Reported by Danny Levinson. Details here: + http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00124.html + +2003-08-19 Jim Meyering + + * lib-ld.m4: Revert yesterday's change, per Bruno's request here: + http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00155.html + +2003-08-18 Paul Eggert + + * same.m4 (gl_SAME): Do not check for stdlib.h or string.h or free. + Check for pathconf. + +2003-08-18 Jim Meyering + + * getloadavg.m4: Use [\t ], not [ \t] (where \t is a literal TAB). + * lib-ld.m4: Likewise. + * po.m4: Likewise. + +2003-08-18 Paul Eggert + and Jim Meyering + + It turns out that we need AM_NLS and AM_PO_SUBDIRS after all; + otherwise po/POTFILES and po/Makefile aren't built by 'configure'. + I'm not sure why I didn't catch this earlier; most likely some + leftover build files. Sorry about that. + * gettextext.m4 (AM_NLS, AM_PO_SUBDIRS): Remove definitions. + * nls.m4, po.m4: New files, taken from gnulib / gettext. + +2003-08-16 Paul Eggert + + Sync with gnulib. + + * gettextext.m4: New file. + + * atexit.m4, backupfile.m4, canon-host.m4, clock_time.m4, + closeout.m4, dirname.m4, dup2.m4, euidaccess.m4, exclude.m4, + exitfail.m4, file-type.m4, fileblocks.m4, filemode.m4, getdate.m4, + gethostname.m4, getloadavg.m4, getopt.m4, getpagesize.m4, + getpass.m4, getusershell.m4, hard-locale.m4, hash.m4, malloc.m4, + memchr.m4, memcpy.m4, memmove.m4, memrchr.m4, memset.m4, + modechange.m4, mountlist.m4, obstack.m4, path-concat.m4, + pathmax.m4, physmem.m4, posixtm.m4, posixver.m4, quote.m4, + quotearg.m4, readlink.m4, readutmp.m4, realloc.m4, rmdir.m4, + rpmatch.m4, safe-read.m4, safe-write.m4, same.m4, save-cwd.m4, + savedir.m4, settime.m4, sha.m4, sig2str.m4, stdio-safer.m4, + stpcpy.m4, strcase.m4, strcspn.m4, strdup.m4, strndup.m4, + strnlen.m4, strpbrk.m4, strstr.m4, strtod.m4, strtoimax.m4, + strtol.m4, strtoll.m4, strtoul.m4, strtoull.m4, strtoumax.m4, + strverscmp.m4, ulonglong.m4, unicodeio.m4, unistd-safer.m4, + userspec.m4, xalloc.m4, xgetcwd.m4, xreadlink.m4, xstrtod.m4, + xstrtol.m4, yesno.m4: New files, from gnulib. + + * acl.m4, check-decl.m4, chown.m4, c-stack.m4, d-ino.m4, + d-type.m4, fileblocks.m4, fsusage.m4, ftruncate.m4, getcwd.m4, + getgroups.m4, getline.m4, getndelim2.m4, gettext.m4, + gettimeofday.m4, group-member.m4, host-os.m4, iconv.m4, + intmax_t.m4, inttypes-pri.m4, jm-macros.m4, lchown.m4, lib-ld.m4, + lib-link.m4, lib-prefix.m4, longdouble.m4, longlong.m4, + ls-mntd-fs.m4, lstat.m4, mbrtowc.m4, mbswidth.m4, memcmp.m4, + mkdir-slash.m4, mkstemp.m4, nanosleep.m4, onceonly.m4, prereq.m4, + progtest.m4, putenv.m4, readdir.m4, rename.m4, stat.m4, tzset.m4, + utimbuf.m4, utime.m4, vasnprintf.m4, xstrtoimax.m4, xstrtoumax.m4: + Sync with gnulib. + +2003-08-15 Jim Meyering + + * utimes.m4 (gl_FUNC_UTIMES): Use `conftest.utimes' as the test + file name, not `x'. The former will be removed automatically. + +2003-08-13 Jim Meyering + + * README: Remove file. + * Makefile.am.in: Simplify. + (Makefile.am): Remove README. + +2003-08-10 Jim Meyering + + * utimes.m4 (gl_FUNC_UTIMES): New file. + * utimens.m4: Require gl_FUNC_UTIMES. + Don't check for utime or utimes. + + * utimes.m4: Removed. + * utimes-null.m4: Renamed from utimes.m4. + +2003-08-06 Paul Eggert + + * prereq.m4 (jm_PREREQ): Require gl_UTIMENS. + * utimens.m4: New file. + +2003-08-08 Paul Eggert + + * vasnprintf.m4 (gl_PREREQ_VASNPRINTF): + Solaris 2.5.1 needs -lw to get the wcslen function. + +2003-08-08 Paul Eggert + + Use new gnulib 'extensions' module. + * extensions.m4, unlocked-io.m4: New files, from gnulib. + * gnu-source.m4, jm-glibc-io.m4: Remove. + * timespec.m4: Merge from gnulib. + +2003-08-08 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Replace jm_INCLUDED_REGEX([lib/regex.c]) + with gl_REGEX. + Replace jm_FUNC_MKTIME with gl_FUNC_MKTIME. + Remove redundant AC_FUNC_FNMATCH_GNU, jm_FUNC_MKTIME. + Remove AC_FUNC_VPRINTF. + Add gl_ERROR. + +2003-08-05 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than + checking for getdelim. + (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather + than rolling our own. + Merge getline from gnulib. + * getline.m4: Merge from gnulib. + * getndelim2.m4, ssize_t.m4: New files, from gnulib. + +2003-08-04 Paul Eggert + + * regex.m4: Merge with gnulib. + (gl_REGEX): New macro. + (jm_INCLUDED_REGEX): Don't assume Latin-1 encoding of source code. + * restrict.m4: Merge with gnulib. + (gl_C_RESTRICT): Renamed from ACX_C_RESTRICT. All uses changed. + Rename cache vars to gl_cv_*. Incorporate latest Autoconf CVS tricks. + +2003-08-05 Paul Eggert + + * gnu-source.m4: New file, taken from gnulib, with support + added for __EXTENSIONS__ a la Solaris. + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Call gl_TIMESPEC rather + than jm_CHECK_TYPE_STRUCT_TIMESPEC. + * st_mtim.m4: Sync with gnulib (white space change only). + * timespec.m4: Sync with gnulib, except also require + AC_GNU_SOURCE. + +2003-08-05 Paul Eggert + + * prereq.m4 (jm_PREREQ_PHYSMEM, jm_PREREQ_STAT): Ignore headers + that are present but cannot be compiled. This avoids spurious warnings + on Solaris 9 sparc with Forte Developer 7 C 5.4. + +2003-08-04 Paul Eggert + + Merge fnmatch module from gnulib. + * fnmatch.m4: New file, from gnulib. + * jm-macros.m4 (jm_MACROS): Require gl_FUNC_FNMATCH_GNU + instead of AC_FUNC_ERROR_AT_LINE. + +2003-08-04 Paul Eggert + + * error.m4: Sync from gnulib. + +2003-07-23 Jim Meyering + + * lstat.m4, mkstemp.m4, regex.m4, stat.m4: Normalize naming of Sun + operating systems in comments, e.g., SunOS4 -> SunOS 4, + Solaris5.9 -> Solaris 9. From Paul Eggert. + +2003-07-18 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Invoke gl_MEMCOLL. + * memcoll.m4: New file, from gnulib. + Based on a patch from Andreas Schwab. + +2003-07-14 Jim Meyering + + * Makefile.am.in: Correct comment on first line. + +2003-07-12 Jim Meyering + + * jm-macros.m4 (OPTIONAL_BIN_ZCRIPTS): Remove unused variable. + +2003-07-10 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require gl_FUNC_VASPRINTF and + gl_FUNC_VASNPRINTF. + + * longdouble.m4, signed.m4, vasnprintf.m4, vasprintf.m4, wchar_t.m4: + * wint_t.m4: New files, in support of new asprintf use. From gnulib. + + * stdint_h.m4: New file. + * inttypes_h.m4: New file. + * uintmax_t.m4: New file. + * intmax_t.m4: New file. + * inttypes.m4: Remove file. Use intmax_t.m4 and uintmax_t.m4 + from gnulib, instead. + +2003-06-09 Jim Meyering + + * tzset.m4 (gl_FUNC_TZSET_CLOBBER): Also define gmtime. + * gettimeofday.m4 (AC_FUNC_GETTIMEOFDAY_CLOBBER): Likewise. + Suggestion from Paul Eggert. + +2003-06-08 Jim Meyering + + * tzset.m4 (gl_FUNC_TZSET_CLOBBER): New file/macro. + Used by strftime.m4. + * strftime.m4 (_jm_STRFTIME_PREREQS): Require gl_FUNC_TZSET_CLOBBER. + +2003-06-07 Jim Meyering + + * strftime.m4: Update from gnulib. + * tm_gmtoff.m4: New file, used by strftime.m4. + * mktime.m4: New file. From gnulib. + +2003-06-06 Jim Meyering + + * jm-macros.m4: Require gl_FUNC_ALLOCA. + * alloca.m4: New file, from gnulib. + + * stdbool.m4: Update from gnulib. + +2003-06-04 Paul Eggert + + Merge human.c etc. from gnulib. + * human.m4: New file, from gnulib. + * prereq.m4 (jm_PREREQ): Use gl_HUMAN, not jm_PREREQ_HUMAN. + (jm_prereq_HUMAN): Remove. + +2003-06-02 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require AM_STDBOOL_H. + +2003-05-26 Jim Meyering + + * dirfd.m4 (UTILS_FUNC_DIRFD): Merge in change from gnulib, + fixing an M4 quoting bug. + + * lib-ld.m4 (AC_LIB_PROG_LD_GNU): Use TAB-SP, not SP-TAB + when setting IFS. + * progtest.m4 (AM_PATH_PROG_WITH_TEST): Likewise. + +2003-05-06 Jim Meyering + + * getcwd-path-max.m4 (GL_FUNC_GETCWD_PATH_MAX): Check for the + declaration of getcwd *before* checking for the getcwd kernel bug. + Otherwise, configure-time `checking ...' messages would be intermixed. + +2003-05-02 Jim Meyering + + * readdir.m4 (GL_FUNC_READDIR): Revive dead file. Change name to + have GL_ (not jm_) prefix. Adjust cache variables similarly. + Create 500 rather than just 300 files, to exercise bug on + Darwin6.5, too. + * jm-macros.m4 (jm_MACROS): Require GL_FUNC_READDIR. + +2003-04-25 Jim Meyering + + * getcwd-path-max.m4 (GL_FUNC_GETCWD_PATH_MAX): If PATH_MAX + is not defined, don't run the test, and don't use the wrapper. + Otherwise, on the Hurd, it would take a long time to create + and remove a hierarchy about 4000 levels deep. + Based on a patch from Robert Millan. + +2003-04-22 Jim Meyering + + Aesthetics. + * gettext.m4: Change an occurrence of [ \t] to [\t ]. + +2003-04-07 Jim Meyering + + * prereq.m4 (jm_PREREQ_STAT): Add prerequisites and #includes + for Ultrix 4.4. + +2003-04-02 Jim Meyering + + * perl.m4 (jm_PERL): Use $am_missing_run, not undefined $missing_dir. + +2003-03-19 Jim Meyering + + * ftw.m4 (AC_FUNC_FTW): Require AC_HEADER_STAT. + +2003-03-17 Richard Dawe + + * jm-macros.m4 (jm_MACROS): Include $(EXEEXT) in DF_PROG's program + name, since automake only adds $(EXEEXT) to programs in its *_PROGRAMS. + Arrange to compile the corresponding stub function if fchdir is missing. + +2003-03-18 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Move the MOUNTED_VMOUNT + test to precede the MOUNTED_GETMNTENT1 tests, since otherwise, AIX 5.1 + systems would end up using the latter. MOUNTED_GETMNTENT1 support + is inadequate on such systems: 1) detecting whether a file system + is remote doesn't work 2) the MOUNTED_VMOUNT code reports the + HOSTNAME:/MOUNT_POINT, while the MOUNTED_GETMNTENT1 code reports + merely /MOUNT_POINT. Reported by Mike Jetzer. + +2003-03-17 Jim Meyering + + * dirfd.m4 (UTILS_FUNC_DIRFD): Test the cache variable, not one + that is guaranteed to be `no'. Use `no_such_member' to indicate + that condition, rather than `-1' which is slightly misleading. + Change the name of the cache variable to have the gl_ prefix. + Prompted by a patch from Richard Dawe for DJGPP. + +2003-03-14 Jim Meyering + + * prereq.m4 (jm_PREREQ): Also forbid the gl_[A-Z] prefix. + Don't require jm_PREREQ_C_STACK. + +2003-03-13 Paul Eggert + + [from gnulib] + * onceonly.m4 (m4_quote): New macro. + (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE): + Quote AC_FOREACH variable-expansions properly. + +2003-03-13 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Arrange to compile the corresponding stub + function if any of the following is missing: fchown, lstat, readlink. + From Richard Dawe. + +2003-03-07 Jim Meyering + + * jm-macros.m4 (AC_LANG_SOURCE(C)): New macro, undefine, then define + using the latest version from cvs. This avoids problems with #line + directives using a vendor (Sun) compiler. + + * jm-macros.m4: Don't require AC_SYS_MMAP_STACK. + * mmap-stack.m4 (AC_SYS_MMAP_STACK): Remove file. + +2003-03-06 Jim Meyering + + * getcwd-path-max.m4 (GL_FUNC_GETCWD_PATH_MAX): Check for + declaration of getcwd. + +2003-03-04 Jim Meyering + + * getcwd-path-max.m4 (GL_FUNC_GETCWD_PATH_MAX): New macro. + * jm-macros.m4: Require GL_FUNC_GETCWD_PATH_MAX. + + `df /some/mount-point' no longer hangs when an unrelated hard-mount + is unavailable + * fsusage.m4 [__GLIBC__]: GNU libc's statvfs stats each mount point in + /proc/mounts until it finds one with matching device number. This is + unnecessary when the FILE argument *is* a mount point. No stat call + is necessary in that case. So, disable the statvfs-testing code on + systems with GNU libc. Reported by Andrei Gaponenko via Tim Waugh + as RedHat bug# 84846. + +2003-02-27 Jim Meyering + + * prereq.m4 (jm_PREREQ_PHYSMEM): Also check for `table' function. + Reported by Kaveh Ghazi. + + * prereq.m4 (gl_SYS__SYSTEM_CONFIGURATION): New function. + (jm_PREREQ_PHYSMEM): Check for new headers and functions. + Use gl_SYS__SYSTEM_CONFIGURATION. + With suggestions from Kaveh Ghazi. + +2003-02-19 Jim Meyering + + * c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Limit stack size + to 1MB, so as not to render systems with no stack size limit (e.g., + linux-2.2.x) unusable. Suggestion and code from Bruno Haible. + +2003-02-17 Jim Meyering + + * prereq.m4 (jm_PREREQ_PHYSMEM): Undo last change, since + Kaveh Ghazi found a better way to get the required information. + Add check for sys/sysmp.h. + +2003-02-15 Jim Meyering + + * mmap-stack.m4: New file. + + * jm-macros.m4: Require AC_SYS_MMAP_STACK. + + Add Irix6 support to physmem.c. + * prereq.m4 (jm_PREREQ_PHYSMEM): Also check for sys/sysget.h + and sys/sysinfo.h. + Also check for sysget. + Reported by Kaveh Ghazi. + +2003-02-12 Jim Meyering + + * restrict.m4 (ACX_C_RESTRICT): Remove #ifndef -- so now this + macro also checks for support when using a C++ compiler. + Also, remove the test for SGI's __restrict. + Suggested by Steven G. Johnson. + + * regex.m4 (jm_PREREQ_REGEX): Require ACX_C_RESTRICT. + + * restrict.m4 (ACX_C_RESTRICT): Minor syntactic changes: + Split long lines, use AC_COMPILE_IFELSE, indent, use `case' + instead of nested `if's, remove unnecessary quotes. + + * restrict.m4 (ACX_C_RESTRICT): New macro. + Copied directly from the URL in the comments. + By Steven G. Johnson. + +2003-02-09 Jim Meyering + + * check-decl.m4 (jm_CHECK_DECLS): Add euidaccess. + +2003-02-03 Jim Meyering + + * c-stack.m4: Include . On some systems, + it is required for the definition of _SC_PAGESIZE. + +2003-02-02 Jim Meyering + + * onceonly.m4: New file. From gnulib. + + * regex.m4 (jm_PREREQ_REGEX): New function, from gnulib. + (jm_INCLUDED_REGEX): Use it. + * prereq.m4 (jm_PREREQ_REGEX): Remove. + +2003-01-31 Jim Meyering + + * open-max.m4 (UTILS_SYS_OPEN_MAX): New file/macro. + * jm-macros.m4 (jm_MACROS): Require UTILS_SYS_OPEN_MAX. + +2003-01-29 Jim Meyering + + * regex.m4: Detect broken re_search in e.g. glibc-2.2.93. + +2003-01-23 Jim Meyering + + * dirfd.m4 (UTILS_FUNC_DIRFD): Correct typo: s/-1/no/ that kept this + from working on systems without dirfd (at least Irix and OSF1/Tru64). + + Merge in change by Bruno Haible from gnulib. + * dirfd.m4 (UTILS_FUNC_DIRFD): Invoke some AC_EGREP_CPP requirements. + +2003-01-16 Jim Meyering + + * regex.m4: The `regex' struct is both input and output. + Initialize it before each use. Patch by Tim Waugh. + +2003-01-15 Jim Meyering + + * jm-macros.m4: Require AC_FUNC_FTW. + +2003-01-12 Jim Meyering + + * ftw.m4: New file. + +2003-01-11 Jim Meyering + + * canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME): New file and macro. + * jm-macros.m4: Require AC_FUNC_CANONICALIZE_FILE_NAME. + (jm_MACROS): No longer check for resolvepath or canonicalize_file_name. + +2002-12-15 Jim Meyering + + * jm-glibc-io.m4n: Remove now-unused file. + * Makefile.am.in (Makefile.am): Remove jm-glibc-io.m4 + and jm-glibc-io.m4n. + +2002-12-11 Jim Meyering + + * jm-glibc-io.m4: Maintain this file manually rather than generating it. + Generating it caused too much trouble. From gnulib. + +2002-11-19 Jim Meyering + + * jm-macros.m4: Require Autoconf-2.56. + +2002-09-30 Akim Demaille + + * prereq.m4: Use AC_REQUIRE everywhere it is possible. + (jm_PREREQ_CANON_HOST): Remove duplicates. + +2002-11-10 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Add AC_REPLACE_FUNCS(raise). + +2002-10-30 Paul Eggert + + * getgroups.m4 (jm_FUNC_GETGROUPS): + Fix typo: cv_func_getgroups_works -> ac_cv_func_getgroups_works. + +2002-10-07 Paul Eggert + + * prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv, + AC_HEADER_STDBOOL. No need to check for limits.h since it's in + freestanding C89. No need to check for stdlib.h or string.h since + autoconf does this now. + +2002-10-12 Paul Eggert + + * jm-macros.m4 (jm_CHECK_ALL_HEADERS): Remove fenv.h. + +2002-09-29 Jim Meyering + + * gettext.m4 (AM_INTL_SUBDIR): Don't require gt_HEADER_INTTYPES_H. + It's not necessary with autoconf-2.54. + +2002-09-28 Jim Meyering + + * getgroups.m4 (jm_FUNC_GETGROUPS): Rewrite to use AC_FUNC_GETGROUPS + and (if needed) to call AC_LIBOBJ and to set GETGROUPS_LIB. + * jm-macros.m4 (jm_MACROS): Don't set GETGROUPS_LIB here; now it's + done via getgroups.m4's wrapper function. + + * strerror_r.m4: Remove file -- now it's part of autoconf-2.54. + Reported by Akim Demaille. + +2002-09-25 Jim Meyering + + * gettext.m4: Upgrade to gettext-0.11.5. + +2002-09-07 Bruno Haible + + * host-os.m4 (UTILS_HOST_OS): Add a case for freebsd*-gnu*. + +2002-09-17 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require gt_INTTYPES_PRI. + * inttypes-pri.m4 (gt_INTTYPES_PRI): New file, mostly from gettext. + +2002-09-16 Jim Meyering + + * prereq.m4: Forbid symbols matching ^jm_[A-Z]. + (jm_PREREQ_QUOTEARG): Add jm_FUNC_MEMCMP. + From Akim Demaille. + + * error.m4 (jm_PREREQ_ERROR): Check for libintl.h. + Reported by Akim Demaille. + +2002-09-13 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require autoconf-2.54. + +2002-09-09 Jim Meyering + + * getloadavg.m4: Remove file -- now it's part of autoconf-2.53c. + * jm-macros.m4: Use AC_CONFIG_LIBOBJ_DIR(lib) to tell the new + AC_FUNC_GETLOADAVG where to find getloadavg.c. + +2002-09-03 Jim Meyering + + * gnu-source.m4: Remove file -- now it's part of autoconf-2.53c. + * mbstate_t.m4: Likewise. + * fnmatch.m4: Likewise. + +2002-08-05 Jim Meyering + + * jm-winsz1.m4: Also change use of $am_cv_sys_posix_termios + to $ac_cv_sys_posix_termios. Reported by Andreas Schwab. + +2002-08-03 Jim Meyering + + * jm-winsz1.m4: Require AC_SYS_POSIX_TERMIOS, not AM_SYS_POSIX_TERMIOS. + Reported by mkc@mathdogs.com. + +2002-08-01 Jim Meyering + + * prereq.m4 (jm_PREREQ_TEMPNAME): lib/tempname.c may use uintmax_t, + so require jm_AC_TYPE_UINTMAX_T. Patch by Joe Orton. + +2002-07-28 Jim Meyering + + * jm-macros.m4: Don't require jm_FUNC_READDIR. + * readdir.m4 (jm_FUNC_READDIR): Remove file/macro. No longer needed. + +2002-07-27 Jim Meyering + + * prereq.m4 (jm_PREREQ_READUTMP): Don't check just + `struct utmpx.ut_exit' and `struct utmp.ut_exit'. Instead, check + all combinations of utmp/utmpx and ut_termination/e_termination + and ut_exit/e_exit. + +2002-07-23 Jim Meyering + + * c-bs-a.m4 (AC_C_BACKSLASH_A): Remove file, now that autoconf + provides this macro. + +2002-07-20 Jim Meyering + + * intdiv0.m4: New file. From gettex-0.11.3. + + * jm-macros.m4: Require autoconf-2.53b. + Use new macros AC_FUNC_MALLOC and AC_FUNC_REALLOC, + in place of jm_-prefixed ones. Thanks, Akim! + * malloc.m4: Remove file, now that autoconf provides this macro. + * realloc.m4: Likewise. + +2002-07-18 gettextize + + * gettext.m4: Upgrade to gettext-0.11.3. + * iconv.m4: Upgrade to gettext-0.11.3. + * isc-posix.m4: Upgrade to gettext-0.11.3. + * lcmessage.m4: Upgrade to gettext-0.11.3. + * lib-link.m4: Upgrade to gettext-0.11.3. + +2002-07-17 Jim Meyering + + * boottime.m4: New file. Extracted from sh-utils' configure.ac + and extended to work also with *BSD systems. + +2002-07-15 Jim Meyering + + FreeBSD support for uname and uptime. + * jm-macros.m4 (jm_MACROS): Check for the sysctl function. + (jm_CHECK_ALL_HEADERS): Check for sys/sysctl.h. + Suggestion from Bruno Haible. + +2002-06-11 Paul Eggert + + * fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Check for btowc. + +2002-06-22 Jim Meyering + + * c-stack.m4: New file, from diffutils-2.8.2. + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_C_STACK. + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Don't require AC__GNU_SOURCE, + now that configure.ac uses AC_GNU_SOURCE. + (jm_MACROS): Rename: jm_FUNC_FNMATCH to AC_FUNC_FNMATCH_GNU. + * prereq.m4 (jm_PREREQ_EXCLUDE): Likewise, wrt jm_FUNC_FNMATCH. + + Update to latest tools. Suggestions from Paul Eggert. + * stdbool.m4: New file, from diffutils-2.8.2. + * gnu-source.m4: Update from diffutils-2.8.2. + * fnmatch.m4: Likewise. + * prereq.m4: Change each use of AC_CHECK_HEADERS(stdbool.h) + to AC_HEADER_STDBOOL + +2002-06-21 Jim Meyering + + * c-bs-a.m4: Add comment, from diffutils-2.8.2. + * mbrtowc.m4: Likewise. + + * mbstate_t.m4: Update from diffutils-2.8.2. + * mbswidth.m4: Reflect name change: + s/AC_MBSTATE_T/AC_TYPE_MBSTATE_T. + * prereq.m4 (jm_PREREQ_QUOTEARG): Likewise. + + * lib-link.m4: Update from gettext-0.11.2. + * gettext.m4: Likewise. + + * jm-macros.m4 (jm_CHECK_ALL_HEADERS): Check for hurd.h. + From Alfred M. Szmidt. + +2002-05-19 Paul Eggert + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Check for st_author. + +2002-06-07 Jim Meyering + + * prereq.m4 (jm_PREREQ_STAT): Check for sys/param.h and sys/mount.h. + They're needed at least for NetBSD 1.5.2. + ($statxfs_includes): Include those same headers. + ($statxfs_includes): Include sys/vfs.h if available. + ($statxfs_includes): Likewise for sys/statvfs.h. + Check for the following members in both structs statfs and statvfs: + f_basetype, f_type, f_fsid.__val, f_namemax, f_namelen. + +2002-06-01 Jim Meyering + + * d-type.m4 (jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Rename macro: + s/D_TYPE_IN_DIRENT/HAVE_STRUCT_DIRENT_D_TYPE/. + +2002-05-28 Jim Meyering + + * readdir.m4 (jm_FUNC_READDIR): Undefine `mkdir', not `rmdir'. + Reported by Volker Borchert. + +2002-05-27 Jim Meyering + + * gettimeofday.m4 (AC_FUNC_GETTIMEOFDAY_CLOBBER): Also replace + localtime. + + * readdir.m4 (jm_FUNC_READDIR): Undefine `rmdir' so we don't try to + use the replacement function; it wouldn't resolve at link time. + Reported by Volker Borchert. + +2002-04-30 Jim Meyering + + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_STAT. + +2002-04-29 Paul Eggert + + * prereq.m4 (jm_PREREQ_HARD_LOCALE): Check for stdlib.h. + Do not check for alloca.h (no longer used) or stdbool.h (was never + used?). Add AM_C_PROTOTYPES since hard-locale.h uses it. + +2002-04-28 Paul Eggert + + * prereq.m4 (jm_PREREQ_SIG2STR): Remove; all callers changed. + +2002-04-29 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Remove use of AC_FUNC_STRNLEN. + * prereq.m4: Add jm_PREREQ_STRNLEN. + Use AC_FUNC_STRNLEN here instead. + + * jm-macros.m4: Don't AC_REQUIRE([AC_PROG_CC_STDC]). + With autoconf-2.53a, it's part of AC_PROG_CC. + +2002-04-28 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Add AC_REPLACE_FUNCS(sig2str). + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_SIG2STR. + +2002-04-24 Jim Meyering + + * prereq.m4 (jm_PREREQ_HARD_LOCALE): New macro. + (jm_PREREQ): Use it. + + * getloadavg.m4: Check for these headers: locale.h unistd.h + mach/mach.h fcntl.h. + Check for this function: setlocale. + +2002-04-16 Jim Meyering + + * prereq.m4 (jm_PREREQ_READUTMP): Also check for these members: + ut_pid, ut_id, ut_exit. + +2002-04-12 Jim Meyering + + * ls-mntd-fs.m4 (checking for getmntinfo function...): Remove now-bogus + check for f_type in sys/mount.h. Instead, just test for the existence + of the getmntinfo function. Needed for Darwin 5.3. + + * dirfd.m4 (UTILS_FUNC_DIRFD): Also detect when dirfd is a macro. + This is necessary at least on Darwin 5.3. + + * jm-macros.m4: Don't AC_REPLACE(strnlen), now that we use + AC_FUNC_STRNLEN. Otherwise, we'd end up putting two copies of strnlen.o + in the library, and that makes some versions of ranlib object. + +2002-04-09 Jim Meyering + + * malloc.m4: (jm_FUNC_MALLOC): Change the `checking ...' message + to be more precise. Rather than saying we're checking whether the + function `works', say what we're testing. + * realloc.m4 (jm_FUNC_REALLOC): Likewise. + Reported by Bruno Haible. + +2002-02-27 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Do not replace stime; no longer used. + Check for clock_settime. + +2002-02-25 Paul Eggert + + * acl.m4: New file. + * jm-macros.m4 (jm_MACROS): Require AC_FUNC_ACL. + Do not check for acl or sys/acl.h, as AC_FUNC_ACL does that now. + +2002-02-16 gettextize + + * codeset.m4: Upgrade to gettext-0.11. + * gettext.m4: Upgrade to gettext-0.11. + * glibc21.m4: Upgrade to gettext-0.11. + * iconv.m4: Upgrade to gettext-0.11. + * isc-posix.m4: Upgrade to gettext-0.11. + * lcmessage.m4: Upgrade to gettext-0.11. + * lib-ld.m4: New file, from gettext-0.11. + * lib-link.m4: New file, from gettext-0.11. + * lib-prefix.m4: New file, from gettext-0.11. + * progtest.m4: Upgrade to gettext-0.11. + +2002-02-15 Paul Eggert + + * prereq.m4 (jm_PREREQ_POSIXVER): New macro. + (jm_PREREQ): Use it. + +2002-01-26 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require autoconf-2.52g. + * strnlen.m4: Remove file, now that it's part of autoconf. + +2002-01-22 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Require AC_FUNC_FSEEKO. + +2002-01-19 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Use AC_FUNC_STRNLEN. + Remove useless quotes: DF_PROG="df". + * strnlen.m4: New file. + +2001-12-14 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Check for iswspace. + Suggestion from Bruno Haible. + +2001-11-20 Jim Meyering + + * mkstemp.m4 (UTILS_FUNC_MKSTEMP): Update comment to reflect that + SunOS 4.1.4 and Solaris 2.5.1 lose, too. + +2001-11-19 Jim Meyering + + * mkstemp.m4 (UTILS_FUNC_MKSTEMP): Don't bother with a temporary + directory. Use "conftestXXXXXX" as the template. + Suggestion from Paul Eggert. + + * mkstemp.m4 (UTILS_FUNC_MKSTEMP): Close each descriptor immediately, + so the test doesn't mistakenly hit the max-open-files limit. + +2001-11-18 Jim Meyering + + * prereq.m4 (jm_PREREQ_TEMPNAME): Check for declaration of getenv. + +2001-11-17 Jim Meyering + + * mkstemp.m4 (UTILS_FUNC_MKSTEMP): New file and macro. + Prompted by a report from Bob Proulx. + + * jm-macros.m4 (jm_MACROS): Don't test for mkstemp here. + Instead, require UTILS_FUNC_MKSTEMP. + +2001-11-11 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Remove code to set POW_LIBM. + Now, that's done as part of AC_FUNC_STRTOD. + +2001-10-22 Paul Eggert + + * jm-winsz1.m4 (jm_WINSIZE_IN_PTEM): Do not define + WINSIZE_IN_PTEM if defines struct winsize. + +2001-11-10 Jim Meyering + + * prereq.m4 (jm_PREREQ_PHYSMEM): New function. + (jm_PREREQ): Use it. + +2001-11-09 Jim Meyering + + * jm-macros.m4: Require autoconf-2.52f. + (AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD): + Use these AC_-prefixed names, not the AM_-prefixed ones. + + * afs.m4 (jm_AFS): Quote the body. Patch by Akim Demaille. + +2001-11-04 Jim Meyering + + * fpending.m4: Remove unused cruft that saved, set, and restored $DEFS. + +2001-11-03 Jim Meyering + + * jm-glibc-io.m4n (jm_FUNC_GLIBC_UNLOCKED_IO): Quote first arg + of AC_DEFUN. + + * dirfd.m4 (UTILS_FUNC_DIRFD): Rework so dirfd.c doesn't have to + know the name of the variable in the macro definition. + +2001-11-01 Jim Meyering + + * dirfd.m4 (UTILS_FUNC_DIRFD): New macro. + * jm-macros.m4 (jm_MACROS): Require UTILS_FUNC_DIRFD. + +2001-10-20 Paul Eggert + + * error.m4 (jm_PREREQ_ERROR): + Do not invoke AC_CHECK_FUNCS with strerror_r, as + AC_FUNC_STRERROR_R does that. + Check for strerror declaration. + + * strerror_r.m4: Add copyright notice, as nontrivial m4 files + are supposed to have them these days. + (AC_FUNC_STRERROR_R): Always do char* test, so that it gets cached. + Merge changes from latest Autoconf CVS. + Rename ac_cv_func_strerror_r_works to ac_cv_func_strerror_r_char_p, + and rename HAVE_WORKING_STRERROR_R to STRERROR_R_CHAR_P, since + POSIX decided to standardize on the int flavor of strerror_r. + +2001-09-30 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): See if + `struct fsstat' has the `f_fstypename' member. + Use that to define FS_TYPE, which is now used to make + the getfsstat link test tighter. + +2001-09-29 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS) + [one-argument getmntent function]): Include stdio.h before mntent.h. + SunOS 4.1.x needs it for the declaration of `FILE'. + Patch by Volker Borchert. + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS) + Check for these headers: sys/param.h sys/ucred.h sys/mount.h + sys/fs_types.h, and make the link-test for getfsstat guard #include + directives with appropriate #if HAVE_*_H tests so that we can + detect getfsstat on Apple Darwin1.3.7 systems. + Reported by Nelson Beebe. + Fix harmless typo in cache variable name: s/getsstat/getfsstat/. + +2001-09-28 Paul Eggert + + Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which + #defines strtoimax. Also treat the other strto* functions + like strtoimax. + + * xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX): + Check for strtoul and strtoumax, + as those declarations are made even in the signed case. + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): + Likewise, for strtol and strtoimax. + +2001-09-24 Jim Meyering + + * gettext.m4: Use the version from gettext-0.10.40, not CVS. + +2001-09-23 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Add a compile-test + instead of the mere test for existence of mntent.h. The latter + would get a false-positive on AIX 3.4 systems. + In the outer getmntent if-block, don't die if neither of the getmntent + tests succeeds. Instead, just fall through and continue with the + remaining tests. + +2001-09-22 Jim Meyering + + * gettext.m4: New file. From gettext. + * lcmessage.m4: Sync with gettext -- this changes only comments. + * progtest.m4: Likewise + * isc-posix.m4: Decrement serial number to sync with gettext. + * glibc21.m4: Likewise. + + * libintl.m4: Remove. No longer used. + +2001-09-20 Jim Meyering + + * xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX): Check for declaration of + strtoimax. + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check for declaration of + strtoumax. + +2001-09-17 Jim Meyering + + * chown.m4, fstypename.m4, getgroups.m4, gettimeofday.m4, + * jm-mktime.m4, lstat.m4, malloc.m4, memcmp.m4, mkdir-slash.m4, + * nanosleep.m4, putenv.m4, readdir.m4, realloc.m4, rename.m4, + * st_dm_mode.m4, stat.m4, strerror_r.m4, timespec.m4, utimbuf.m4, + * utimes.m4: Use AC_DEFINE rather than AC_DEFINE_UNQUOTED, + whenever the right hand side need not be expanded by the shell. + +2001-09-16 Paul Eggert + + * fnmatch.m4 (jm_FUNC_FNMATCH): Remove test for GNU C + library. It's not correct, as some older glibcs are buggy. + fnmatch wasn't fixed until glibc 2.2. + + Use AC_DEFINE, not AC_DEFINE_UNQUOTED, as there's no + special shell magic here. + +2001-09-16 Jim Meyering + + * mkdir-slash.m4 (UTILS_FUNC_MKDIR_TRAILING_SLASH): New file/macro. + * jm-macros.m4: Require it. + +2001-09-15 Jim Meyering + + * jm-macros.m4: Check for help2man. + +2001-09-11 Jim Meyering + + * host-os.m4 (UTILS_HOST_OS): New file/macro. + The body, by Paul Eggert, was moved here from configure.in. + * jm-macros.m4: Require UTILS_HOST_OS. + +2001-09-04 Paul Eggert + + * prereq.m4 (jm_PREREQ_XREADLINK): New macro. + (jm_PREREQ): Use it. + +2001-09-03 Paul Eggert + + * prereq.m4 (jm_PREREQ_XGETCWD): Check for limits.h and + sys/param.h, as pathmax.h includes them. + +2001-09-03 Paul Eggert + + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD. + (jm_PREREQ_XGETCWD): New macro. + + * getcwd.m4: New file. + +2001-09-01 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Check for canonicalize_file_name. + Used by df. + +2001-08-30 Paul Eggert + + Simplify code, partly by assuming autoconf 2.52 semantics. + + * Makefile.am (EXTRA_DIST): Remove uintmax_t.m4. + + * inttypes.m4 (AC_PREREQ): Bump to 2.52. + (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf in 2.52. + All uses removed. + (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): + Move AC_REQUIRE to next-to-top level, to avoid confusion. + Use 2.52's AC_CHECK_TYPE instead of merely looking for the header. + * prereq.m4 (jm_PREREQ_HUMAN): Don't require jm_AC_HEADER_INTTYPES_H. + * jm-macros.m4 (jm_MACROS): Likewise. + + * uintmax_t.m4: Remove, as it duplicates inttypes.m4. + + * xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX): + Quote first arg of AC_DEFUN. + Require jm_AC_TYPE_UINTMAX_T and jm_AC_TYPE_UNSIGNED_LONG_LONG + since they are needed to parse the include file even if we need + only xstrtoimax. Simplify logic behind the args to AC_REPLACE. + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Likewise, + but with opposite signedness. + +2001-08-30 Paul Eggert + + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_EXCLUDE. + (jm_PREREQ_EXCLUDE): New macro. + +2001-08-26 Jim Meyering + + * jm-macros.m4: Require jm_AC_PREREQ_XSTRTOIMAX. + + * xstrtoimax.m4: New file. + * xstrtoumax.m4: Add comments explaining why we + AC_REPLACE_FUNCS(strtol). + +2001-06-20 Paul Eggert + + * inttypes.m4: Add AC_PREREQ(2.13). + (jm_AC_HEADER_INTTYPES_H): Test for intmax_t, too. + (jm_AC_TYPE_INTMAX_T): New macro. + (jm_AC_TYPE_UINTMAX_T): Moved here from uintmax_t.m4. + + * longlong.m4 (jm_AC_TYPE_LONG_LONG): New macro. + + * longlong.m4: Renamed from ulonglong.m4. + * inttypes.m4: Renamed from inttypes_h.m4. + * uintmax_t.m4: Removed. + +2001-08-12 Jim Meyering + + * afs.m4, assert.m4, bison.m4, check-decl.m4, chown.m4, d-ino.m4, + d-type.m4, dos.m4, error.m4, fnmatch.m4, fpending.m4, fstypename.m4, + fsusage.m4, ftruncate.m4, getgroups.m4, glibc.m4, gnu-source.m4, + group-member.m4, jm-glibc-io.m4, jm-macros.m4, jm-mktime.m4, + jm-winsz1.m4, jm-winsz2.m4, lchown.m4, lib-check.m4, libintl.m4, + link-follow.m4, ls-mntd-fs.m4, lstat.m4, malloc.m4, mbrtowc.m4, + mbstate_t.m4, mbswidth.m4, memcmp.m4, nanosleep.m4, perl.m4, + prereq.m4, putenv.m4, readdir.m4, realloc.m4, regex.m4, rename.m4, + rmdir-errno.m4, search-libs.m4, st_dm_mode.m4, st_mtim.m4, stat.m4, + strftime.m4, timespec.m4, unlink-busy.m4, uptime.m4, utimbuf.m4, + utime.m4, utimes.m4, xstrtoumax.m4: + Quote the first argument in each use of AC_DEFUN. + +2001-08-05 Jim Meyering + + * jm-macros.m4: Require autoconf-2.52. + +2001-08-03 Paul Eggert + + The following changes are from gettext 0.10.39 as maintained by + Bruno Haible, except that getline.m4 continues to use AC_LIBOBJ. + + * codeset.m4: Upgrade to serial AM1. + (AM_LANGINFO_CODESET): Renamed from jm_LANGINFO_CODESET; + all uses changed. Quote first arg of AC_DEFUN. + (am_cv_langinfo_codeset): Renamed from jm_cv_langinfo_codeset. + + * iconv.m4: Upgrade to serial AM2. + (AM_ICONV): Renamed from jm_ICONV; all uses changed. + Add --with-libconv-prefix. + Quote first arg of AC_DEFUN. Add description for ICONV_CONST. + (am_cv_func_iconv): Renamed from jm_cv_func_iconv. + (am_cv_lib_iconv): Renamed from jm_cv_lib_iconv. + (am_cv_proto_iconv): Renamed from jm_cv_proto_iconv. + * jm-macros.m4 (jm_MACROS): Reflect s/jm_/AM_/ renamings. + + * c-bs-a.m4 (AC_C_BACKSLASH_A): Quote first arg of AC_DEFUN. + * getline.m4 (AM_FUNC_GETLINE): Likewise. + * glibc21.m4 (jm_GLIBC21): Likewise. + * inttypes_h.m4 (jm_AC_HEADER_INTTYPES_H): Likewise. + * isc-posix.m4 (AC_ISC_POSIX): Likewise. + * lcmessage.m4 (AM_LC_MESSAGES): Likewise. + * progtest.m4 (AM_PATH_PROG_WITH_TEST): Likewise. + * uintmax_t.m4 (jm_AC_TYPE_UINTMAX_T): Likewise. + * ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG): Likewise. + + * getline.m4 (AM_FUNC_GETLINE): Don't bother checking for + string.h any more. + + * progtest.m4 (AM_PATH_PROG_WITH_TEST): If not found, print "no", + not the default value. + + 2001-06-25 Bruno Haible + * mbswidth.m4 (jm_PREREQ_MBSWIDTH): Don't require AM_C_PROTOTYPES. + Also check for mbsinit. Needed for SCO 3.2v5.0.2. + Also include ; this is where AIX 3.2.5 declares wcwidth. + Also check for iswcntrl, used for wcwidth fallback. + Use AC_TRY_COMPILE to emulate AC_CHECK_DECLS, for portability + to Autoconf 2.13. + +2001-08-03 Jim Meyering + + * mbrtowc.m4 (jm_FUNC_MBRTOWC): Use `#include', not `@%:@include', + as it was in the original. Reported by Paul Eggert. + +2001-07-16 Jim Meyering + + * gettimeofday.m4: New file. + Prompted by a report from Bernhard Baehr. + +2001-07-15 Jim Meyering + + * Makefile.am.in (Makefile.am): Remove most of the unlocked-io.h stuff. + Now it's in ../Makefile.cfg. + +2001-07-04 Jim Meyering + + * Makefile.am.in (glibc-io.struct): New target. Rework the code + that generates jm-glibc-io.m4 so that it doesn't trigger any make + distcheck failure. + +2001-07-02 Jim Meyering + + The following changes were prompted by suggestions from Bruno Haible. + + * jm-glibc-io.m4n: New file, the template from which jm-glibc-io.m4 + is now generated. + * Makefile.am.in (Makefile.am): Include jm-glibc-io.m4n in emitted + definition of EXTRA_DIST. + (Makefile.am): Emit the dependency, `all-local: jm-glibc-io.m4' to + ensure that the generated file is created/updated whenever the list + of $(unlocked_functions) is changed. + (jm-glibc-io.m4): New rule. + (unlocked-io.h): New rule -- currently unused. + +2001-06-24 Jim Meyering + + * regex.m4 (jm_INCLUDED_REGEX): Use a quadrigraph to represent an + unmatched right bracket, rather than kludging it with an extra, + falsely-matching quote in a comment. Patch by Akim Demaille. + +2001-05-27 Jim Meyering + + * prereq.m4 (jm_PREREQ_READUTMP): Check for ut_type in struct utmpx. + Check for ut_type in struct utmp. + +2001-05-22 Jim Meyering + + * strftime.m4 (_jm_STRFTIME_PREREQS): Don't use AC_LIBOBJ(strftime), + now that we use the package-supplied version unconditionally. + (jm_FUNC_STRFTIME): Don't replace strftime, for the same reason. + +2001-05-21 Jim Meyering + + * regex.m4: Change a couple backticks to single quotes to avoid shell + syntax errors. + +2001-05-19 Alexandre Duret-Lutz + + * dos.m4 (jm_AC_DOS): Check for _WIN32, __WIN32__, and __MSDOS__. + +2001-05-11 Paul Eggert + + * strftime.m4 (jm_FUNC_GNU_STRFTIME): + Don't bother to check library strftime, since + we'll be using our own my_strftime function anyway. + Define my_strftime instead of strftime. + +2001-05-15 Jim Meyering + + * regex.m4: Use proper quoting so brackets appear in the test program. + Reported by, and with help from, Bruno Haible. + +2001-05-13 Jim Meyering + + * jm-macros.m4 (major_t, minor_t): Define to unsigned int if undefined. + +2000-11-26 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Do not check for fseeko; no longer used. + +2001-04-21 Jim Meyering + + * rmdir-errno.m4: Write to a new file, so that a restrictive umask + doesn't interfere. + +2001-04-21 Alexandre Duret-Lutz + + * ftruncate.m4: Check for chsize. + Link with ftruncate.o unconditionally if ftruncate is missing. + This was required when cross-compiling to i586-mingw32msvc. + +2001-03-24 Jim Meyering + + * jm-macros.m4: Require autoconf-2.49d. + +2001-03-20 Bruno Haible + + * iconv.m4 (jm_ICONV): Recommend GNU libiconv. + +2001-03-17 Jim Meyering + + * memcmp.m4 (jm_AC_FUNC_MEMCMP): Remove my copy of AC_FUNC_MEMCMP, + now that the version in autoconf is equivalent. + (jm_FUNC_MEMCMP): Adjust to use AC_FUNC_MEMCMP. + + * error.m4 (jm_PREREQ_ERROR): Invoke AC_FUNC_STRERROR_R. + Suggestion from Akim Demaille. + + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_TEMPNAME. + (jm_PREREQ_TEMPNAME): New function. + +2001-02-25 Paul Eggert + + * jm-macros.m4 (jm_MACROS): Use mkstemp replacement if the system + lacks mkstemp. Compile our own tempname.c if we compile our own + mkstemp.c, as mkstemp relies on tempname. + +2001-03-01 Jim Meyering + + * dos.m4 (jm_AC_DOS): Remove extra backslashes, now that + AH_VERBATIM really does output its argument verbatim. + +2001-02-18 Paul Eggert + + * jm-macros.m4 (jm_CHECK_ALL_HEADERS): Check for sys/resource.h. + +2001-02-17 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Don't check for + getmntent via AC_CHECK_FUNCS, since that would get a `no' and disrupt + further attempts by AC_FUNC_GETMNTENT to check with e.g., -lgen on + UnixWare 7.1.1. + + * mbrtowc.m4 (jm_FUNC_MBRTOWC): Adapt to use AC_CACHE_CHECK etc., + rather than AC_CACHE_VAL. + +2001-02-17 Paul Eggert + + * mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC. + * mbswidth.m4 (jm_PREREQ_MBSWIDTH): + Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc). + * prereq.m4 (jm_PREREQ_QUOTEARG): Likewise. + +2001-02-07 Jim Meyering + + * regex.m4 (jm_INCLUDED_REGEX): Add a test for the latest bug. + +2001-02-05 Jim Meyering + + * jm-macros.m4: Require autoconf-2.14d (not yet released), because + it includes the patch required for `large file' support with at least + HP-UX's 10.20 /bin/cc. + +2001-02-03 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Restore prior use of + AS_IF, now that it works once again (mysteriously). + * fsusage.m4 (jm_FILE_SYSTEM_USAGE): Likewise. + +2001-01-30 Jim Meyering + + Don't use filenames that are 8.3-equivalent to "conftest" on DOS. + * chown.m4: Rename conftestchown to conftest.chown. + * rename.m4: s/conftestdir/conftest.d1/ and s/conftestdir2/conftest.d2/. + * utimes.m4: s/conftestdata/conftest.data/ + Inspired by Pavel Roskin's change in autoconf. + +2001-01-27 Jim Meyering + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Open-code what was + a use of AS_IF. + * fsusage.m4 (jm_FILE_SYSTEM_USAGE): Likewise. + +2001-01-26 Jim Meyering + + * prereq.m4 (jm_PREREQ_QUOTEARG): Check for stddef.h, now that + quotearg.c includes it. + +2001-01-15 Bruno Haible + + * iconv.m4 (jm_ICONV): Also check whether the iconv declaration + has const. + +2001-01-20 Jim Meyering + + Be sure that headers are checked before used in code compiled + for the type checks. + * jm-macros.m4 (jm_MACROS): Remove all header checks. + In place of that, invoke jm_CHECK_ALL_TYPES. + (jm_CHECK_ALL_HEADERS): New functions with the above checks. + (jm_CHECK_ALL_TYPES): Require jm_CHECK_ALL_HEADERS. + Alan Iwi reported a build failure on an f300-fujitsu-uxpv4.1_ES; + The check for ssize_t was mistakenly run before the test for unistd.h. + + The configure-time check for stdbool.h was missing. + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_HASH. + (jm_PREREQ_HASH): New function. + +2001-01-17 Jim Meyering + + * fsusage.m4 (jm_FILE_SYSTEM_USAGE): Use AS_IF, not AS_IFELSE, + for autoconf-2.49c. + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Likewise. + +2001-01-14 Jim Meyering + + * rename.m4: Use temporary directories named conftestdir{,2}, not + foo and bar. Create conftestdir/ in the script, not in the C code. + Remove directories in the script, not in the C code. + Remove conftestdir{,2} before trying to create the directory. + Make the entire configure script fail if the mkdir fails. + +2001-01-02 Volker Borchert + + * rename.m4: New file. + * jm-macros.m4 (jm_MACROS): Require vb_FUNC_RENAME. + +2001-01-01 Alexandre Duret-Lutz + + * libintl.m4 (AM_GNU_GETTEXT): Define MKINSTALLDIRS by + expanding the value of $ac_aux_dir, as in AM_MISSING_HAS_RUN, + so `make install' also works in VPATH builds. + +2001-01-01 Jim Meyering + + * prereq.m4 (jm_PREREQ_READUTMP): Include utmp.h (if available), even + on systems with utmpx.h. It's necessary for the declaration of utmp's + ut_user member. Reported by Andreas Jaeger. + + * check-decl.m4 (jm_CHECK_DECLS): Include grp.h and pwd.h if available. + They are required for the declarations of getgrgid and getpwuid resp. + (_jm_DECL_HEADERS): Check for grp.h and pwd.h. + Reported by Andreas Jaeger. + +2000-12-25 Alexandre Duret-Lutz + + * libintl.m4 (AM_WITH_NLS): When using AC_CONFIG_AUX_DIR, + prepend $(top_srcdir) to the value of MKINSTALLDIRS so that it + can be used in subdirectories. + +2000-12-26 Jim Meyering + + * dos.m4 (jm_AC_DOS): Rewrite (though it's still a stub) to work better + with autoheader. + +2000-12-17 Jim Meyering + + * dos.m4 (jm_AC_DOS): New file and macro. + * jm-macros.m4 (jm_MACROS): Require jm_AC_DOS. + +2000-12-06 Paul Eggert + + * off_t-format.m4: Remove this file. + * jm-macros.m4 (jm_MACROS): Remove jm_SYS_OFF_T_PRINTF_FORMAT. + +2000-12-06 Jim Meyering + + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): If we need the replacement + strtoull, we may well need the replacement strtoul, too. + Check for declarations of strtoul and strtoull. + Check for strtol. Mainly as a cue to cause automake to include + strtol.c -- that file is included by each of strtoul.c and strtoull.c. + Check for limits.h -- strtol.c needs it. + +2000-12-02 Jim Meyering + + * off_t-format.m4 (OFF_T_PRINTF_FORMAT_STRING): New file/macro. + * jm-macros.m4 (jm_MACROS): require it. + +2000-11-30 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Check for stdint.h. + +2000-11-30 Jim Meyering + + * getloadavg.m4: s/ifval/m4_ifval/ to accommodate new autoconf. + +2000-11-03 Bruno Haible + + * jm-macros.m4 (jm_MACROS): Add test for wcrtomb. + +2000-11-04 Jim Meyering + + * regex.m4: Use the `m4_' prefix on `syscmd' and `m4_sysval'. + +2000-10-29 Jim Meyering + + * fsusage.m4: s/AC_SHELL_IFELSE/AS_IFELSE/ to match autoconf renaming. + * ls-mntd-fs.m4: Likewise + +2000-10-28 Jim Meyering + + * prereq.m4 (jm_PREREQ): Add jm_PREREQ_MEMCHR. + (jm_PREREQ_MEMCHR): New function. + +2000-10-21 Jim Meyering + + * check-decl.m4 (jm_CHECK_DECLS): Also check for memrchr. + * prereq.m4 (jm_PREREQ_DIRNAME): New macro. + * jm-macros.m4 (AC_REPLACE_FUNCS): Add memrchr. + +2000-09-18 Jim Meyering + + * getloadavg.m4 (AC_FUNC_GETLOADAVG): Restore the initial value of LIBS. + Otherwise, everyone ends up linking with -lelf for some configurations. + Reported by Mike Stone. + +2000-08-26 Jim Meyering + + * jm-macros.m4: Use jm_FUNC_FPENDING. + * fpending.m4: New file. + +2000-08-20 Jim Meyering + + * check-decl.m4: Include utmp.h `#if HAVE_UTMP_H', rather than + `#if !HAVE_UTMPX_H'. The latter would lose on systems with neither + utmp.h nor utmpx.h. Reported by Eli Zaretskii. + +2000-08-11 J. David Anglin + + Improve fileutils installation on systems where running + programs (like install) can't be unlinked. + * unlink-busy.m4 (jm_FUNC_UNLINK_BUSY_TEXT): New file/macro. + * jm-macros.m4: Use jm_FUNC_UNLINK_BUSY_TEXT. + +2000-08-06 Paul Eggert + + * mbstate_t.m4 (AC_MBSTATE_T): Define mbstate_t to be int, + not char, for compatibility with glibc 2.1.3 strftime.c. + +2000-07-23 Paul Eggert + + * mbswidth.m4 (jm_PREREQ_MBSWIDTH): Check for wcwidth declaration. + +2000-07-23 Jim Meyering + + * check-decl.m4 (jm_CHECK_DECLS): Check for declarations of these, too: + getgrgid, getpwuid, getuid. + +2000-07-16 Bruno Haible + + * mbswidth.m4: New file. + * prereq.m4 (jm_PREREQ): Call jm_PREREQ_MBSWIDTH. + +2000-07-14 Jim Meyering + + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Require jm_AC_TYPE_UINTMAX_T. + +2000-07-10 Paul Eggert + + From a suggestion by Bruno Haible. + * mbstate_t.m4 (AC_MBSTATE_T): + Renamed from AC_MBSTATE_T_OBJECT. All uses changed. + Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT + and mbstate_t, to a single-part test that simply defines mbstate_t. + * prereq.m4 (jm_PREREQ_QUOTEARG): s/AC_MBSTATE_T_OBJECT/AC_MBSTATE_T/. + +2000-07-10 Jim Meyering + + * strerror_r.m4: Mirror the correction made in autoconf. + + * gnu-source.m4: Output to confdefs.h directly. + Suggestion from Akim Demaille. + +2000-07-09 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Add a test to see if -lm is required + to link seq. If so, set SEQ_LIBM to -lm. From Bruno Haible. + + * gnu-source.m4 (AC__GNU_SOURCE): New file/macro. + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Require it. + +2000-07-05 Bruno Haible + + * strerror_r.m4 (AC_FUNC_STRERROR_R): Pass a reasonably large buffer + to strerror_r. + Include for use of isalpha. + +2000-07-05 Paul Eggert + and Bruno Haible + + * mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Test for mbstate_t + only if the test for an object-type mbstate_t fails. This + prevents us from mistakenly reporting that mbstate_t is a + system object type after we "#define mbstate_t int" to work + around its lack. + +2000-07-04 Jim Meyering + + * fsusage.m4 (jm_FILE_SYSTEM_USAGE): Use plain old `echo' instead + of the deprecated AC_CHECKING. + +2000-07-03 Jim Meyering + + * check-decl.m4 (AC_CHECK_DECLS): Add strnlen. + +2000-07-03 Paul Eggert + + * mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13. + Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H. + +2000-07-02 Jim Meyering + + * mbstate_t.m4: Also define mbstate_t, if necessary. + + * chown.m4: Replace each use of AC_SUBST(LIBOBJS)/LIBOBJS=... with + AC_LIBOBJ(function_name). + * chown.m4: Likewise. + * fnmatch.m4: Likewise. + * ftruncate.m4: Likewise. + * getgroups.m4: Likewise. + * getline.m4: Likewise. + * group-member.m4: Likewise. + * jm-macros.m4: Likewise. + * lstat.m4: Likewise. + * malloc.m4: Likewise. + * memcmp.m4: Likewise. + * nanosleep.m4: Likewise. + * putenv.m4: Likewise. + * realloc.m4: Likewise. + * regex.m4: Likewise. + * stat.m4: Likewise. + * strftime.m4: Likewise. + +2000-07-01 Jim Meyering + + * ls-mntd-fs.m4: Remove a `FIXME' comment and fix the associated + problem. + +2000-06-17 Bruno Haible + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Rename BeOS specific + macro from MOUNTED_NEXT_DEV to MOUNTED_FS_STAT_DEV. + +2000-07-01 Jim Meyering + + * uptime.m4: Put double quotes around use of $cross_compiling. + +2000-06-28 Jim Meyering + + * mbstate_t.m4: Use stdlib.h, not stdio.h. The latter is not included + by quotearg.c, for which we perform this test. From Bruno Haible. + +2000-06-17 Bruno Haible + + * check-decl.m4 (_jm_DECL_HEADERS): Check for utmp.h as well. + * prereq.m4 (jm_PREREQ_READUTMP): Likewise. If either or + exists, put readutmp.o into LIBOBJS. + +2000-06-25 Jim Meyering + + * mbstate_t.m4: Include stdio.h before wchar.h to work around + Linux header bug when _XOPEN_SOURCE is defined to 500. + +2000-06-24 Jim Meyering + + * strerror_r.m4: Revive this file -- to try out an experimental + version of AC_FUNC_STRERROR_R that may work even on BeOS, a system + for which strerror does return char*, but which lacks a conveniently + accessible declaration of the function. If the compile-test says + strerror_r doesn't work, then resort to a `run'-test that works on + BeOS and segfaults on DEC Unix. + +2000-06-19 Paul Eggert + + * mbstate_t.m4: New file, defining AC_MBSTATE_T_OBJECT. + * prereq.m4 (jm_PREREQ_QUOTEARG): Use it. Add check for iswprint. + +2000-06-23 Jim Meyering + + * afs.m4: Add missing AC_MSG_RESULT. + Reported by Bruno Haible. + + * fsusage.m4: s/AC_MSG_CHECKING/AC_CHECKING/. + Suggestion from Bruno Haible. + +2000-06-21 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add getpass. + +2000-06-18 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Remove mkdir. + + * link-follow.m4 (jm_AC_FUNC_LINK_FOLLOWS_SYMLINK): Change the + `checking whether...' message to be consistent with that of the + lstat test. + +2000-06-16 Bruno Haible + + * glibc21.m4 (jm_GLIBC21): Define GLIBC21 for Makefiles, not for C. + +2000-06-12 Jim Meyering + + * getloadavg.m4 (AM_FUNC_GETLOADAVG): Replace with AC_FUNC_GETLOADAVG + from autoconf, and tweak the latter to accept an optional argument. + * jm-macros.m4: s/AM_FUNC_GETLOADAVG/AC_FUNC_GETLOADAVG/, and supply + the optional argument, `lib'. + +2000-06-08 Jim Meyering + + * largefile.m4: Remove file (now that it's part of autoconf). + +2000-06-04 Paul Eggert + + Rewrite largefile configuration so that we don't need to run + getconf and don't need AC_CANONICAL_HOST. [I'm leaving the use of + AC_CANONICAL_HOST in configure.in -- jmm] + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS, + AC_SYS_LARGEFILE_SPACE_APPEND): Remove. + (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro. + (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from + CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY. + All uses changed. + Instead of inspecting the output of getconf, try to compile the + test program without and with the macro definition. + (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check + for getconf. Instead, check for the needed flags by compiling + test programs. + +2000-06-03 Jim Meyering + + * prereq.m4 (jm_PREREQ_HUMAN): Use []-quoted list in AC_CHECK_DECLS, + now that autoconf requires that. + + * jm-glibc-io.m4: Add a kludge to make autoheader emit the required + #undefs. E.g., #undef HAVE_DECL_FERROR_UNLOCKED. + Use []-quoted list in AC_CHECK_DECLS, now that autoconf requires that. + +2000-05-26 Bruno Haible + + * glibc21.m4: New file. + * jm-macros.m4 (jm_MACROS): Call jm_GLIBC21. + +2000-05-28 Jim Meyering + + * jm-macros.m4 (AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Rename from + jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. + * stat.m4: Likewise. + * lstat.m4: Likewise. + * lstat-slash.m4: Remove file (absorbed into autoconf). + + * jm-macros.m4 (AC_FUNC_STRERROR_R): Rename from jm_FUNC_STRERROR_R. + * strerror_r.m4: Remove file (absorbed into autoconf). + +2000-05-26 Jim Meyering + + * uptime.m4: Use `$cross_compiling', not `$ac_cv_prog_cc_cross'. + +2000-05-24 Jim Meyering + + * prereq.m4: Use []-quoted list in AC_CHECK_MEMBERS, now that + autoconf requires that. + * lib-check.m4: Likewise. + * jm-macros.m4: Likewise. + * strftime.m4: Likewise. + + * check-decl.m4 (jm_CHECK_DECLS): Use []-quoted list in AC_CHECK_DECLS, + now that autoconf requires that. + +2000-05-22 Jim Meyering + + * stat.m4: Require jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. + * lstat.m4: Likewise. + +2000-05-20 Jim Meyering + + * prereq.m4 (jm_PREREQ_HUMAN): New macro. + (jm_PREREQ): Use it. + +2000-05-09 Jim Meyering + + * gettext.m4: Rename this... + * libintl.m4: ...to this. + +2000-05-06 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add atexit. + (AC_REPLACE_FUNCS): Add strnlen. + + * rmdir-errno.m4 (fetish_FUNC_RMDIR_NOTEMPTY): New macro and file. + * jm-macros.m4: Require fetish_FUNC_RMDIR_NOTEMPTY. + + * nanosleep.m4 (jm_FUNC_NANOSLEEP): Save and restore LIBS around + AC_SEARCH_LIBS call for nanosleep. + (LIB_NANOSLEEP): Set and AC_SUBST. + +2000-05-03 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to + be 500, instead of _GNU_SOURCE to be 1, to work around glibc + 2.1.3 bug. This avoids a clash when files like regex.c define + _GNU_SOURCE. + +2000-05-05 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Save and restore LIBS around AC_SEARCH_LIBS + call for clock_gettime. + (LIB_CLOCK_GETTIME): Set and AC_SUBST. + + * search-libs.m4: Update from autoconf. + + su doesn't work on Solaris 2.6. + * lib-check.m4: When checking for struct spwd.sp_pwdp, also include + . Reported by Dragos Harabor. + +2000-05-03 Jim Meyering + + * check-decl.m4 (AC_CHECK_DECLS): Add strndup. + +2000-05-02 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE): Define _GNU_SOURCE if + this is needed to make ftello visible (e.g. glibc 2.1.3). Use + compile-time test, rather than inspecting host and OS, to + decide whether to define _LARGEFILE_SOURCE. + +2000-05-01 Jim Meyering + + * fsusage.m4: Use AC_MSG_CHECKING instead of obsolete AC_CHECKING. + + * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Add BeOS support. + Based on a patch from Bruno Haible. + +2000-04-18 Jim Meyering + + * prereq.m4 (jm_PREREQ_GETPAGESIZE): New macro. + (jm_PREREQ): Use it. + +2000-04-17 Jim Meyering + + Get it right :-) + * jm-macros.m4 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Emit the + actual #define via AH_VERBATIM. Don't need separate AC_DEFINE. + Suggestion from Akim Demaille. + +2000-04-14 Jim Meyering + + * jm-macros.m4 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use the one-arg form + of AC_DEFINE. Otherwise, the #ifndef in AH_VERBATIM gets clobbered. + +2000-04-13 Jim Meyering + + * jm-macros.m4 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use new AH_VERBATIM + to insert required #ifndef into config.h.in. + Suggestion from Akim Demaille. + +2000-04-12 Jim Meyering + + * getloadavg.m4 (AM_FUNC_GETLOADAVG): Use AC_CHECK_HEADERS, not + `AC_CHECK_HEADER' to check for locale.h. Thanks to a report from + Christian Krackowizer. + + More code moved from ../configure.in into (jm_CHECK_ALL_TYPES). + * jm-macros.m4 (_GNU_SOURCE): Define. + (AC_SYS_LARGEFILE): Require. + (AM_C_PROTOTYPES): Require. + +2000-04-05 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Don't use -n32 on + IRIX if the installer said otherwise. + +2000-04-05 Jim Meyering + + Portability tweaks required for ultrix4.3. + * check-decl.m4 [!HAVE_UTMPX_H] (headers): Include . + (jm_CHECK_DECLS): Add getutent to the list of functions. + (_jm_DECL_HEADERS): Add utmpx.h. + From John David Anglin. + + * strftime.m4: Back out the 2000-04-02 change. + Instead of that change, simply undefine putenv in the test program. + +2000-04-03 Jim Meyering + + * gettext.m4: Fix typo in comment. + + * codeset.m4 (AC_CHECK_HEADERS): Add langinfo.h (moved here from + textutils/configure.in). Suggestion from Paul Eggert. + (AC_CHECK_FUNCS): Add nl_langinfo. (also from textutils/configure.in) + +2000-04-02 Paul Eggert + + * strftime.m4 (jm_FUNC_GNU_STRFTIME): Set TZ environment + variable in the shell rather than using putenv, which isn't + portable. This avoids the configure-time inter-test dependency + on the potentially-renamed putenv function. + +2000-03-30 Paul Eggert + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Include + before checking struct stat.st_blksize, so that + HAVE_STRUCT_STAT_ST_BLKSIZE is defined correctly. + +2000-03-29 Paul Eggert + + * strftime.m4 (_jm_STRFTIME_PREREQS): Check for strftime, + since strftime.c uses HAVE_STRFTIME to decide whether to use + the underlying strftime. + +2000-03-10 Jim Meyering + + * lib-check.m4: Look for getspnam in -lgen, too. + From Marco Franzen. + +2000-02-02 Bruno Haible + + * codeset.m4: New file. + * iconv.m4: New file. + * jm-macros.m4 (jm_MACROS): Call jm_LANGINFO_CODESET and jm_ICONV. + +2000-03-04 Jim Meyering + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Require AC_C_VOLATILE, + for lib/localcharset.c. + +2000-03-03 Jim Meyering + + * regex.m4: Make sure re_compile_pattern accepts patterns like `{1'. + +2000-03-02 Jim Meyering + + * timespec.m4: Require AC_HEADER_TIME before the cache check so + the messages come out on separate lines. + + * jm-glibc-io.m4 (jm_FUNC_GLIBC_UNLOCKED_IO): Use AC_CHECK_DECLS, + rather than jm_CHECK_DECLARATIONS. + * decl.m4: Remove now-unused file. + + * check-decl.m4 (AC_CHECK_DECLS): Add getlogin, ttyname, and geteuid. + +2000-02-27 Jim Meyering + + * check-decl.m4: Add getenv to the list. + +2000-02-23 Jim Meyering + + * check-decl.m4: Now that we have the new AC_CHECK_DECLS, use it + in place of my hack. + +2000-02-10 Jim Meyering + + * nanosleep.m4 (jm_FUNC_NANOSLEEP): Rename replacement function from + gnu_nanosleep to rpl_nanosleep. + +2000-02-09 Jim Meyering + + * lib-check.m4 (jm_LIB_CHECK): Fix typo: check for sp_pwdp in + struct spwd, rather than in struct passwd. Reported by Gaël Quéri. + +2000-02-08 Akim Demaille + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Quote square brackets with + `[' and `]' and remove uses of `changequote'. + (AC_SYS_LARGEFILE_MACRO_VALUE): Likewise. + (AC_SYS_LARGEFILE): Likewise. + * gettext.m4 (AM_GNU_GETTEXT): Likewise. + * strftime.m4 (jm_FUNC_GNU_STRFTIME): Remove now-unnecessary use + of changequote. + * regex.m4 (jm_INCLUDED_REGEX): Likewise. + * readdir.m4 (jm_FUNC_READDIR): Likewise + * memcmp.m4 (jm_AC_FUNC_MEMCMP): Likewise, and add `int' for main. + * getloadavg.m4 (AM_FUNC_GETLOADAVG): Likewise. + +2000-02-05 Jim Meyering + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Require most macros. + Remove explicit use of AC_HEADER_TIME. It is required by + jm_CHECK_TYPE_STRUCT_TIMESPEC. Using AC_HEADER_TIME and + `AC_REQUIRE'ing jm_CHECK_TYPE_STRUCT_TIMESPEC provoked a but + in autoconf whereby the expansion of the latter ended up preceding + the expansion of its prerequisite, AC_HEADER_TIME. + Reported by Volker Borchert. + +2000-02-03 Jim Meyering + + * prereq.m4 (jm_PREREQ_READUTMP): Check for utmpxname. + +2000-02-02 Jim Meyering + + * prereq.m4 (jm_PREREQ_ADDEXT): Fix typo that resulted in no + definition of HAVE_PATHCONF: s/AC_CHECK_FUNC/AC_CHECK_FUNCS/. + Reported by Eli Zaretskii. + +2000-01-31 Jim Meyering + + * check-decl.m4 (jm_CHECK_DECLS): Add nanosleep to the list of + functions. Add the time.h and sys/time.h headers along with the + AC_REQUIRE'ment of AC_HEADER_TIME. + +2000-01-30 Jim Meyering + + * lib-check.m4: Clean up some kludgy old shadow password tests. + + * prereq.m4 (utmp_includes): Define. + Check for ut_user and ut_name members in both struct utmpx + and struct utmp. + +2000-01-29 Jim Meyering + + * lib-check.m4: New file containing library-related checks from + fileutils and sh-utils (textutils had none). + +2000-01-28 Jim Meyering + + * perl.m4: Change format of warning message to look more like that + from the missing script. Suggestion from François Pinard. + +2000-01-25 Jim Meyering + + * timespec.m4: Require AC_HEADER_TIME, and include sys/time.h as well + as time.h in the compile check. + * nanosleep.m4: Require AC_HEADER_TIME rather than simply using it. + Fix typo in cross-compiling case: s/yes/no/. + +2000-01-23 Jim Meyering + + * jm-macros.m4: Move df-related tests here from fileutils/configure.in + + * ls-mntd-fs.m4: s/list_mounted_fs/ac_list_mounted_fs/ + (jm_LIST_MOUNTED_FILESYSTEMS): Take two parameters. + + * fsusage.m4: New file. Extracted from fileutils/configure.in. + s/space/ac_fsusage_space/. + (jm_FILE_SYSTEM_USAGE): Take two parameters. + + * ftruncate.m4: New file (derived from part of fileutils/configure.in). + * jm-macros.m4 (jm_FUNC_FTRUNCATE): AC_REQUIRE it. + (jm_CHECK_ALL_TYPES): Require AC_HEADER_MAJOR and AC_HEADER_DIRENT. + + * jm-macros.m4 (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN): + AC_SUBST these here, rather than just in sh-util/configure.in, so + that the now-shared-by-fileutils-and-textutils lib/Makefile.am are + all the same. + (AM_FUNC_OBSTACK): Add (from fileutils/configure.in). + (AC_CHECK_FUNCS): Merge all checks from fileutils, textutils, sh-utils. + (AM_FUNC_STRTOD): Added (from textutils', sh-utils' configure.in). + (AC_SUBST(POW_LIBM)): Likewise. + (AC_SUBST(DF_PROG)): Moved from fileutils/configure.in. + +2000-01-22 Jim Meyering + + * jm-macros.m4: Call AC_PROG_CC_STDC just before AC_C_CONST. + + * prereq.m4 (jm_PREREQ_QUOTEARG): Add wctype.h. + + * jm-macros.m4 (AC_CHECK_HEADERS): Add checks from fileutils' + configure.in + (AC_CHECK_HEADERS): Likewise for sh-utils. + (AC_CHECK_HEADERS): Likewise for textutils. + Merge the three lists of headers. + + * prereq.m4 (jm_PREREQ_ADDEXT): New macro. Parts moved here + from fileutils' configure.in. + + * decl.m4: Remove kludgy `test -z $ac_...AC_CHECK_HEADERS(...)' code. + Moved tests into their own function (_jm_DECL_HEADERS) in check-decl.m4. + + * check-decl.m4: Use #if rather than #ifdef. + Add HAVE_DECL_STRTOUL and HAVE_DECL_STRTOULL. + (jm_CHECK_DECLARATIONS): Add strtoul strtoull. + (_jm_DECL_HEADERS): Define new function. + (jm_CHECK_DECLARATIONS): Require it. + +2000-01-19 Jim Meyering + + * nanosleep.m4 (jm_FUNC_NANOSLEEP): Include , too. + Use AC_HEADER_TIME. Volker Borchert reported that OpenBSD-2.3/sparc + defines `struct timespec' in + + * c-bs-a.m4: Remove uses of changequote altogether. + Thanks to Akim for explaining. + +2000-01-16 Jim Meyering + + * jm-macros.m4: Require jm_FUNC_GROUP_MEMBER, jm_FUNC_PUTENV, + AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME, jm_FUNC_MKTIME, + jm_FUNC_GETGROUPS AC_FUNC_VPRINTF, AC_FUNC_ALLOCA, + AM_FUNC_GETLOADAVG, and jm_SYS_PROC_UPTIME. + +2000-01-16 Jim Meyering + + * c-bs-a.m4: Use `changequote(<<,>>)', rather than `changequote(, )' + because the latter didn't work. + +2000-01-15 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add gethostname and getusershell. + (AC_REPLACE_FUNCS): Add memcpy and memset. + Add these, too: stime strcspn stpcpy strstr strtol strtoul. + Add strpbrk. + Add these: euidaccess memcmp mkdir rmdir rpmatch strndup strverscmp. + +2000-01-12 Jim Meyering + + * prereq.m4 (jm_PREREQ_CANON_HOST): New macro. + (jm_PREREQ): Use it. + (jm_PREREQ_READUTMP): New macro. + (jm_PREREQ): Use it. + +2000-01-11 Paul Eggert + + Quote multibyte characters correctly. + * c-bs-a.m4: New file. + * prereq.m4 (jm_PREREQ_QUOTEARG): New macro. + (jm_PREREQ): Use it. + +2000-01-11 Paul Eggert + + * uintmax_t.m4: Port to autoconf 2.13. + +2000-01-08 Jim Meyering + + * strerror_r.m4 (jm_FUNC_STRERROR_R): New file/macro. + * jm-macros.m4 (jm_FUNC_STRERROR_R): Require it. + +2000-01-04 Jim Meyering + + * d-type.m4 (jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Rename from + jm_STRUCT_DIRENT_D_TYPE. + * d-ino.m4 (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Rename from + jm_STRUCT_DIRENT_D_INO. + * utimbuf.m4 (jm_CHECK_TYPE_STRUCT_UTIMBUF): Rename from + jm_STRUCT_UTIMBUF. + * jm-macros.m4: Reflect s/jm_STRUCT_/jm_CHECK_TYPE_STRUCT_/ renamings. + * utime.m4: Likewise. + + * timespec.m4 (jm_CHECK_TYPE_STRUCT_TIMESPEC): New file, macro. + * jm-macros.m4 (jm_CHECK_TYPE_STRUCT_TIMESPEC): Require it. + +2000-01-03 Paul Eggert + + * nanosleep.m4 (jm_FUNC_NANOSLEEP): Search for nanosleep in -lrt + (for Solaris 7) and in -lposix4 (for Solaris 2.5.1). + +2000-01-02 Jim Meyering + + * search-libs.m4: Escape `$' in $3 of dnl comment. I no longer + remember if this is necessary. + +1999-12-26 Jim Meyering + + * jm-macros.m4: Use it here. + * nanosleep.m4 (jm_FUNC_NANOSLEEP): New file/macro. + +1999-12-23 Jim Meyering + + * jm-macros.m4: Check for clock_gettime (moved from + fileutils/configure.in) + Check for gettimeofday. + +1999-12-20 Jim Meyering + + * strftime.m4: Remove kludge, now that I'm using the fixed + autoconf-2.14a-1999-12-20. + +1999-12-19 Jim Meyering + + * lstat-slash.m4: New file. + * jm-macros.m4: Use the new macro: + jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. + +1999-12-07 Jim Meyering + + * perl.m4: Require that File::Compare be available, too. + Too many systems seem to lack it. + + * strftime.m4: Add checks for most of the cpp macros tested in + GNU's strftime.c. Prompted by a patch from Paul Eggert. + +1999-11-18 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a + problem with the QNX 4.25 shell, which doesn't propagate exit + status of failed commands inside shell assignments. + +1999-11-17 Jim Meyering + + * gettext.m4: Use new AC_CONFIG_LINKS in place of AC_LINK_FILES. + +1999-11-07 Jim Meyering + + * getloadavg.m4: Add `, 1, [FIXME]' to each use of AC_DEFINE. + +1999-11-06 Jim Meyering + + * link-follow.m4 (jm_AC_FUNC_LINK_FOLLOWS_SYMLINK): New file/macro. + * jm-macros.m4 (jm_MACROS): Use it here. + +1999-11-05 Jim Meyering + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Move some tests from configure.in + of textutils, fileutils, and sh-utils into this one (shared between + those packages) file. + Use `AC_CHECK_MEMBERS((struct stat.st_blksize))' instead of deprecated + AC_STRUCT_ST_BLKSIZE. + +1999-11-03 Jim Meyering + + * ssize_t.m4: Remove file. No longer needed since the new version of + AC_CHECK_TYPE checks includes unistd.h. + * jm-macros.m4: Use straight `AC_CHECK_TYPE(ssize_t, int)'. + Suggestion from Akim Demaille. + +1999-10-30 Jim Meyering + + * uintmax_t.m4: Require 2.14a. Remove backslash before backtick in + m4-quoted string. + * ls-mntd-fs.m4: Likewise. + * jm-macros.m4: Likewise. Also, use AC_TYPE_SSIZE_T instead + * jm-winsz1.m4: Likewise. + + * const.m4: Remove file, since the fix made it into the experimental + version of autoconf. + * mktime.m4: Likewise. + + * check-type.m4: Remove file, now that the latest version of + AC_CHECK_TYPE takes a third arg to specify additional #includes. + + * ssize_t.m4: New file, requires experimental version of autoconf. + * jm-macros.m4: Use new AC_TYPE_SSIZE_T instead of my hacked + AC_CHECK_TYPE. + +1999-10-04 Jim Meyering + + * jm-macros.m4: Don't require autoconf-2.14.1. + +1999-09-22 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around GCC + 2.95.1 bug with HP-UX 10.20. + +1999-09-17 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add strdup. + Paul Nevai reported a link failure on a NeXT CUBE with NeXTSTEP 3.3 + due to missing strdup (against sh-utils-2.0). + +1999-08-29 Jim Meyering + + * jm-macros.m4: Require jm_BISON. + * bison.m4: New file. + +1999-08-17 Paul Eggert + + * largefile.m4 (AC_SYS_LARGEFILE): Fix typo: missing comma + in value for _FILE_OFFSET_BITS, which broke ports to HP-UX 10.20. + +1999-08-05 Jim Meyering + + * getline.m4: Rename test file from conftestdata to conftest.data + to avoid conflicts with `conftest' on 8+3 filesystems. + Suggestion from Eli Zaretskii. + +1999-08-04 Jim Meyering + + * jm-macros.m4: Move a 4-line block of code from the configure.in of + fileutils and sh-utils (textutils's getline test was inadequate). + (AM_FUNC_GETLINE): Run this test. + (AC_CHECK_FUNCS): Check for getdelim. + Reported by Bob Proulx. + +1999-08-02 Jim Meyering + + * jm-macros.m4: Add a comment. + +1999-08-01 Jim Meyering + + * mktime.m4 (AC_FUNC_MKTIME): Undefine to avoid syntax errors from m4. + +1999-08-01 Paul Eggert + + * lfs.m4: Remove this file. + * largefile.m4: New file. It contains the old contents of + lfs.m4, except that all names with prefix AC_LFS have been + changed to use the prefix AC_SYS_LARGEFILE instead, to be + compatible with future autoconf versions. Also, some minor m4 + quoting problems have been fixed. + +1999-07-16 Paul Eggert + + * ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG): Make sure + that we can shift, multiply and divide unsigned long long + values; Ultrix cc can't do it. + +1999-07-14 Paul Eggert + + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether + defines strtoumax as a macro (and not as a + function). + +1999-07-05 Paul Eggert + + * gettext.m4 (AM_WITH_NLS): Remove unnecessary lines. + Fix typo: $nls_cv_header_intl was misspelled as $nsl_cv_header_intl. + (AM_GNU_GETTEXT): Fix problem with brackets and m4 quoting, + and simplify the shell code. + +1999-07-03 Paul Eggert + + * mktime.m4: New file, which is a preview of what should appear + in the next public autoconf release. + +1999-07-20 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add memmove. + +1999-07-15 Jim Meyering + + * jm-macros.m4 (AC_CHECK_FUNCS): Check for getpagesize. + +1999-05-22 Jim Meyering + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add memchr. + +1999-05-20 Jim Meyering + + * search-libs.m4 [AC_SEARCH_LIBS]: Quote name in undefine. + Add a colon after each `then' in case $4 is empty. + +1999-05-16 Jim Meyering + + * search-libs.m4: New file to override autoconf's AC_SEARCH_LIBS. + +1999-05-10 Jim Meyering + + * jm-mktime.m4: Reflect renaming: AM_FUNC_MKTIME -> AC_FUNC_MKTIME. + + * jm-macros.m4: Require 2.14.1, since we use newly-renamed + AC_FUNC_MKTIME. + +1999-05-10 Andreas Schwab + + * jm-mktime.m4, putenv.m4: Fix typos in config.h comments. + +1999-05-04 Paul Eggert + + * lfs.m4 (AC_LFS): -n32, -o32, and -n64 should be in CFLAGS, + not CPPFLAGS, so that linking works correctly in IRIX. + +1999-04-30 Paul Eggert + + * jm-macros.m4 (AC_REPLACE_FUNCS): Add dup2. + +1999-04-20 Jim Meyering + + * xstrtoumax.m4: Require jm_AC_TYPE_UNSIGNED_LONG_LONG. + AC_REPLACE xstroull if necessary. From Paul Eggert. + (AC_CHECK_FUNCS): Remove strtoull, strtoumax, strtouq. + +1999-04-20 Paul Eggert + + * uintmax_t.m4 (jm_AC_TYPE_UINTMAX_T): Move unsigned long + long check into new jm_AC_TYPE_UNSIGNED_LONG_LONG macro. + * jm-macros.m4 (jm_CHECK_ALL_TYPES): Require + jm_AC_TYPE_UNSIGNED_LONG_LONG. + * ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG): New file/macro. + + * lfs.m4: Port to AIX and HP-UX. Support cross-compilation. + +1999-04-18 Jim Meyering + + * xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): New file/macro. + * jm-macros.m4: Use it. + +1999-04-06 Jim Meyering + + * strftime.m4: Remove test for %f. + +1999-03-29 Jim Meyering + + * jm-macros.m4 (jm_CHECK_ALL_TYPES): New macro, contains the + superset of the AC_TYPE_* checks in the textutils, fileutils, + and sh-utils, plus AC_TYPE_PID_T. Paul Eggert suggested adding + AC_TYPE_PID_T. + +1999-03-28 Jim Meyering + + * jm-macros.m4: Define GNU_PACKAGE here. + Be sure to AC_SUBST it, once again, so that @GNU_PACKAGE@ is + replaced e.g., in the *.sh files of the sh-utils. + +1999-03-20 Jim Meyering + + * jm-macros.m4: s/jm_WITH_REGEX/jm_INCLUDED_REGEX/. + * regex.m4 (jm_INCLUDED_REGEX): Rename from jm_WITH_REGEX. + Don't depend on AM_GLIBC. Suggestions from Alain Magloire. + +1999-03-19 Jim Meyering + + * jm-winsz1.m4 (jm_WINSIZE_IN_PTEM): New macro. + +1999-03-12 Jim Meyering + + * jm-macros.m4: Use AC_FUNC_SETVBUF_REVERSED. + +1999-03-07 Jim Meyering + + * jm-glibc-io.m4: Use only those *_unlocked macros that are declared. + +1999-02-17 Jim Meyering + + * gettext.m4 (AM_GNU_GETTEXT): Do `changequote' around use of brackets + in macro definition. From Eli Zaretskii and Alain Magloire. + +1999-02-07 Jim Meyering + + * group-member.m4: New file -- extracted from sh-utils' configure.in. + + 1999-02-05 Eli Zaretskii + * gettext.m4: Support DOS-style d:/foo/bar absolute file names. + +1999-02-06 Jim Meyering + + * chown.m4: Use `AC_SUBST(LIBOBJS)' since we set LIBOBJS. + * fnmatch.m4: Likewise. + * getgroups.m4: Likewise. + * lstat.m4: Likewise. + * malloc.m4: Likewise. + * putenv.m4: Likewise. + * realloc.m4: Likewise. + * regex.m4: Likewise. + * stat.m4: Likewise. + * strftime.m4: Likewise. + Suggestion from Alain Magloire. + + * chown.m4: Use `.$ac_objext', not `.o'. + * fnmatch.m4: Likewise. + * getgroups.m4: Likewise. + * getline.m4: Likewise. + * lstat.m4: Likewise. + * malloc.m4: Likewise. + * memcmp.m4: Likewise. + * putenv.m4: Likewise. + * realloc.m4: Likewise. + * regex.m4: Likewise. + * stat.m4: Likewise. + * strftime.m4: Likewise. + Suggestion from Alain Magloire. + + * jm-macros.m4: Actually invoke jm_WITH_REGEX now that it requires + an argument. + + * regex.m4: Add a run-time Test for proper operation of + re_compile_pattern. + +1999-01-31 Jim Meyering + + * getloadavg.m4: Check for locale.h and the function, setlocale. + +1999-01-30 Jim Meyering + + * check-type.m4: Use 3-arg form of AC_DEFINE. + + * jm-mktime.m4: Make this a wrapper around the official AM_FUNC_MKTIME + rather than my private copy, now that the official one is up to date. + * mktime.m4: Remove file. + + * getloadavg.m4: Use 3-arg form of AC_DEFINE. + * uptime.m4: Likewise. + * uintmax_t.m4: Likewise. + +1999-01-28 Jim Meyering + + * jm-macros.m4: Use jm_AFS. + * afs.m4: New file (from fileutils' configure.in). + + * assert.m4: Use the 3-argument forms of AC_DEFINE* macros. + * chown.m4: Likewise. + * d-ino.m4: Likewise. + * d-type.m4: Likewise. + * fnmatch.m4: Likewise. + * getgroups.m4: Likewise. + * gettext.m4: Likewise. + * jm-mktime.m4: Likewise. + * jm-winsz2.m4: Likewise. + * lcmessage.m4: Likewise. + * ls-mntd-fs.m4: Likewise. + * malloc.m4: Likewise. + * memcmp.m4: Likewise. + * putenv.m4: Likewise. + * realloc.m4: Likewise. + * st_mtim.m4: Likewise. + * strftime.m4: Likewise. + +1999-01-16 Jim Meyering + + * jm-macros.m4 (ARGMATCH_DIE): Define. + (ARGMATCH_DIE_DECL): Define. + +1999-01-12 Jim Meyering + + * Makefile.am.in: Rewrite to avoid using fmt. + Reported by Lars Hecking. + +1999-01-10 Jim Meyering + + * fstypename.m4: Use the new 3-arg form of AC_DEFINE instead of my + gross kludge. + * inttypes_h.m4: Likewise. + * lstat.m4: Likewise. + * malloc.m4: Likewise. + * readdir.m4: Likewise. + * realloc.m4: Likewise. + * st_dm_mode.m4: Likewise. + * stat.m4: Likewise. + * utimbuf.m4: Likewise. + * utimes.m4: Likewise. + + * check-decl.m4: Use the new 3-arg form of AC_DEFINE instead of the + AC_CHECK_FUNCS hack. Now, it's still a hack, but at least the + comments in config.h.in are meaningful. + + * jm-macros.m4: Require autoconf-2.13 here. + + * regex.m4: By default, don't use the included regex.c on systems + with glibc 2. Suggestion from Uli Drepper. + +1999-01-02 Jim Meyering + + * jm-macros.m4: Replace strcasecmp and strncasecmp. + +1998-12-18 Jim Meyering + + * Makefile.am.in (Makefile.am): Simplify rule. + Based on a suggestion from Lars Hecking. + +1998-11-16 Jim Meyering + + * lfs.m4: Double-quote the `uname...` expression. + +1998-11-16 Paul Eggert + + * lfs.m4 (AC_LFS): Add support for HP-UX 10.20 and HP-UX 11. + +1998-11-14 Jim Meyering + + * lstat.m4: Correct comment. POSIX does not permit it to succeed. + * stat.m4: Likewise. + +1998-11-03 Jim Meyering + + * stat.m4: Rewrite to set HAVE_STAT_EMPTY_STRING_BUG. + * lstat.m4: Rewrite to set HAVE_LSTAT_EMPTY_STRING_BUG. + +1998-10-18 Jim Meyering + + * check-decl.m4 (jm_CHECK_DECL_LOCALTIME_R): Remove macro. + +1998-10-17 Jim Meyering + + * decl.m4 (jm_CHECK_DECLARATION): Don't hard-code which headers to + include, though we still hard-code the `require'-like AC_CHECK_HEADERS + calls for those previously hard-coded headers. Instead, take a new + parameter. + (jm_CHECK_DECLARATIONS): Reflect interface change. + * check-decl.m4 (jm_CHECK_DECLS): Likewise. + (jm_CHECK_DECL_LOCALTIME_R): New macro. + + * mktime.m4: Test for spring-forward gap before long-running test. + +1998-10-14 Jim Meyering + + * mktime.m4: Use the more portable "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver". From Paul Eggert. + +1998-10-11 Jim Meyering + + * mktime.m4 (jm_AM_FUNC_MKTIME): New file and macro. + This adds a test for a recently added compatibility fix for mktime.c. + * jm-mktime.m4: Require jm_AM_FUNC_MKTIME, not AM_FUNC_MKTIME. + +1998-09-27 Jim Meyering + + * jm-macros.m4 (jm_MACROS): Require jm_FUNC_FNMATCH. + + * fnmatch.m4 (jm_FUNC_FNMATCH): New file/macro. Extracted from + ../configure.in, including a change from Gordon Matzigkeit to allow + cross-compiling for the Hurd. + + * glibc.m4: New file/macro to test for the GNU C Library + versions 1 and 2. From Gordon Matzigkeit. + Indent. + +1998-09-21 Jim Meyering + + * chown.m4: Declare locals: before, after. From Andries Brouwer. + +1998-08-18 Paul Eggert + + Port nanosecond-resolution times to UnixWare 2.1.2 and + pedantic Solaris 2.6. + + * st_mtim.m4 (AC_STRUCT_ST_MTIM_NSEC): Renamed from + AC_STRUCT_ST_MTIM. + * st_mtim.m4 (AC_STRUCT_ST_MTIM_NSEC): + Generate name of ns member, instead of just 1 or undef. + Allow for UnixWare 2.1.2 and Solaris 2.6 if in pedantic mode. + +1998-08-15 Jim Meyering + + * ssize_t.m4 (jm_TYPE_SSIZE_T): Remove file. + * check-type.m4: New file. Replacement for AC_CHECK_TYPE. + * jm-macros.m4: Use the new AC_CHECK_TYPE(ssize_t, int) + instead of jm_TYPE_SSIZE_T. + +1998-08-12 Jim Meyering + + * st_dm_mode.m4: New file. From Johan Danielsson. + +1998-08-02 Jim Meyering + + * st_mtim.m4: Use hack to avoid having to put #undef HAVE_ST_MTIM + in acconfig.h manually. + +1998-07-31 Paul Eggert + + * st_mtim.m4: New file. + +1998-07-28 Jim Meyering + + * utimes.m4: Undef stat. + +1998-07-25 Jim Meyering + + * utime.m4 (jm_FUNC_UTIME): New file and macro. + * utimes.m4 (jm_FUNC_UTIMES_NULL): New file and macro. + +1998-07-09 Manfred Hollstein + + * chown.m4 (jm_FUNC_CHOWN): Add a check to verify that the + uid and gid actually remain unchanged. + +1998-07-07 Jim Meyering + + * jm-glibc-io.m4: Remove fclose_unlocked. + +1998-07-04 Jim Meyering + + * regex.m4: Use syscmd, ifelse, and sysval. Mainly as an exercise + to prove that this macro can be used in packages without regex.c. + +1998-07-02 Andreas Schwab + + * gettext.m4 (AM_WITH_NLS): Remove intl/libintl.h if + is to be used. + +1998-07-03 Jim Meyering + + * gettext.m4: Add -lintl if it's found to be necessary. + + * gettext.m4: New file -- from gettext-0.10.35. + * lcmessage.m4: Likewise. + * progtest.m4: Likewise. + + * regex.m4 (jm_WITH_REGEX): New file and macro. + * jm-macros.m4: Require the new macro. + +1998-06-29 Jim Meyering + + * fstypename.m4: Include sys/param.h. NetBSD 1.3.1 requires this + for the definition of NGROUPS (used in a system header included + by sys/mount.h). + +1998-06-28 Jim Meyering + + * ls-mntd-fs.m4: New file. + * fstypename.m4: New file. + + * jm-macros.m4: Require the new macro. + * jm-glibc-io.m4: New file. + +1998-05-19 Jim Meyering + + * jm-macros.m4: Add jm_FUNC_LCHOWN. + * lchown.m4: New file. + + * Makefile.am.in: New file. + * Makefile.am (Makefile.am): Depend on Makefile.am.in. + +1998-05-14 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add them. + * jm-macros.m4: New file. + * utimbuf.m4: New file. + +1998-05-12 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add isc-posix.m4. + +1998-05-11 Jim Meyering + + * isc-posix.m4: New file. + +1998-05-10 Jim Meyering + + * jm-mktime.m4: Use AM_FUNC_MKTIME, now that it's up to date. + +1998-05-09 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add ssize_t.m4. + (EXTRA_DIST): Remove mktime.m4, now that the new version is included + with automake. + + * ssize_t.m4: New file. + * mktime.m4: Remove file -- the new automake has this now. + +1998-04-26 Jim Meyering + + * assert.m4: New file. + * Makefile.am (EXTRA_DIST): Add assert.m4. + +1998-04-05 Jim Meyering + + * prereq.m4 (jm_PREREQ_REGEX): New macro. + (jm_PREREQ): Use it here. + +1998-03-23 Jim Meyering + + * inttypes_h.m4: Kludges so I don't have to add HAVE_INTTYPES_H + in acconfig.h. + +1998-03-15 Jim Meyering + + * prereq.m4: New file. + * error.m4: New file. + * Makefile.am (EXTRA_DIST): Add error.m4 and prereq.m4. + +1998-02-07 Jim Meyering + + * getline.m4: Don't set am_cv_func_working_getline before the + cache-check for the same variable -- that defeated the purpose of + the test; the test program was never run. This was a problem only + on systems with losing getline functions -- HP-UX 10.20 is one. + Reported by Bjorn Helgaas. + +1998-02-06 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add perl.m4. + +1998-01-10 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add const.m4. + + * const.m4: New file. Use an initializer in this declaration + typedef int charset[2]; const charset x; + Reported by Bob Glickstein. + +1997-12-21 Jim Meyering + + * chown.m4: Fix reversed types on -1 args to chown. + From Kaveh Ghazi. + +1997-12-14 Jim Meyering + + * check-decl.m4: s/DECLARATION_/DECL_/g. + Add lseek and memchr. + + * decl.m4: s/HAVE_DECLARATION_/HAVE_DECL_/g. + T.E.Dickey said that some older preprocessors + have a 20-character limit on names. + +1997-11-30 Jim Meyering + + * inttypes_h.m4: New file. + * uintmax_t.m4: New file. + * Makefile.am (EXTRA_DIST): Add inttypes_h.m4 and uintmax_t.m4. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/ChangeLog new file mode 100644 index 0000000..5f12d1c --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/ChangeLog @@ -0,0 +1,8382 @@ +2002-07-28 Jim Meyering + + * Version 4.1.12. + + * configure.ac: Require automake-1.6b. + + * TODO: Remove entry that mentions rm's HAVE_WORKING_READDIR. + Since remove.c was rewritten, rm is no longer susceptible to that. + +2002-07-26 Jim Meyering + + * src/stat.c: Don't include malloc.h -- it was unnecessary. + +2002-07-22 Jim Meyering + + * Version 4.1.11. + + * src/stat.c (usage): The short form of --dereference is now -L, not -l. + Reported by Kalle Olavi Niemitalo. + + * src/rm.c: Add new option, --presume-input-tty, for testing only. + Not documented. + + This test might remove a file owned by the person running `make check'. + * tests/rm/fail-eperm: Hoist definition of $target_file, and use + that (not $f) in test for owner/dir/symlink. Patch by Michael Stone. + + * tests/rm/fail-eperm: Handle the case in which rm produces no output. + + rm would prompt for a symlink to an unwritable file + * src/remove.c (prompt): When not interactive, don't prompt + for a symlink. Reported by Dave Beckett. Patch by Michael Stone. + * tests/rm/dangling-symlink: Add a test for the above-fixed bug. + +2002-07-20 Jim Meyering + + * src/copy.c (copy_internal): Use file_name_lookup, not getdport. + Patch by Alfred M. Szmidt. + + * Makefile.maint (news-r1, news-r2): Define. Better regexp. + (announcement): Use them here. Also makes the line length < 80. + + * Upgrade to cvs automake -- required to work with 2.53b. + * configure.ac: Require automake-1.6a. + + * Version 4.1.10. + + * Upgrade to gettext-0.11.3. + * Upgrade to autoconf-2.53b. + +2002-07-19 Jim Meyering + + * src/dircolors.hin: Add .wav. + + * tests/rm/fail-eperm: Don't expect `ARGV_0=$0 exec ...' to work. + It doesn't work with /bin/sh of Solaris5.6. + Use an explicit `export ARGV_0' instead. + [comparing actual and expected output]: Don't match the entire line, + but rather just the `rm: cannot remove `$dir/$f':' part. + + * tests/rm/dangling-symlink: Use input-tty rather than + testing for /dev/stdin. + + * tests/Makefile.am (EXTRA_DIST): Add input-tty. + * tests/input-tty: New file. + +2002-07-18 Jim Meyering + + * src/dircolors.hin: Add the following to the list of colorizable + TERM names: dtterm xterm-color Eterm. + New archive suffix: .jar + New image suffixes: .jpeg .pbm .pgm .tiff .mpeg .xcf .xwd + Audio suffixes: .ogg .mp3 + From Michael Stone. + +2002-07-16 Jim Meyering + + * src/stat.c (print_it): Use memcpy and a little pointer arithmetic, + rather than stpncpy. + +2002-07-14 Jim Meyering + + Under some circumstances, rm would fail due to a lack of + permissions, but give a misleading diagnostic like this: + rm: cannot chdir from `.' to `foo': Not a directory + * src/remove.c (remove_dir): Detect the case in which unlinking a + non-directory fails with EPERM, and give an appropriate diagnostic. + Reported by Michael Stone. + +2002-07-13 Jim Meyering + + * tests/rm/fail-eperm: New file/test, for the above. + * tests/rm/Makefile.am (TESTS): Add fail-eperm. + + * src/stat.c (print_it): Use xstrdup, not strdup. + Use strspn to avoid an explicit loop. + Use fputc rather than printf "\n". + + * src/stat.c: Include quote.h. + (print_stat): Use xreadlink, rather than using readlink directly. + Use the quote function rather than hard-coded double quotes. + Use error, not perror. + +2002-07-09 Martin Michlmayr + + * src/df.c (show_dev): Make the `Use%' column align with + its heading, even when -P is used with -h or -H. + +2002-07-10 Jim Meyering + + * man/du.x: Add a description of --exclude=PATTERN. + * src/du.c (usage) [--exclude]: Use PATTERN rather than PAT. + From Martin Michlmayr. + +2002-07-09 Jim Meyering + + I added stat.x, but didn't update the definition of dist_man_MANS. + * man/Makefile.am (dist_man_MANS): Add stat.1. + (stat.1): Add dependency. + Reported by Michael Stone. + + Ensure that the above never happens again. + * man/Makefile.am (check-x-vs-1): New target. + (check-local): Depend on check-x-vs-1. + + * src/mv.c (euidaccess): Remove declaration. It was unused. + From Michael Stone. + (yesno): Remove declaration. It too was unused. + +2002-07-08 Paul Eggert + + NEWS, doc/coreutils.texi: + New ls time style: long-iso, which generates YYYY-MM-DD HH:MM. + Any time style can be preceded by "posix-". + The default time style is now posix-long-iso instead of posix-iso. + + * src/ls.c (enum time_style): Remove posix_iso_time_style. + Add long_iso_time_style. + (time_style_args, time_style_types, decode_switches): Likewise. + (decode_switches): If a time style is prefixed by "posix-", ignore + it if in the POSIX locale. Default style is now posix-long-iso. + (usage): Explain the above. + +2002-07-06 Jim Meyering + + * tests/Makefile.am (envvar-check): Mark as `.PHONY'. + + * src/stat.c: Remove everything associated with --secure option. + +2002-07-04 Jim Meyering + + * src/remove.c (prompt): Fix test for write-protectedness to also + check errno == EACCES. Otherwise, `rm dangling-symlink' would + mistakenly prompt. Reported by Mike Castle. + + * tests/rm/Makefile.am (TESTS): Add dangling-symlink. + * tests/rm/dangling-symlink: New file/test, for the above fix. + +2002-07-03 Jim Meyering + + * src/stat.c (usage): Rename --link/-l to --dereference/-L. + Describe --secure. + Describe --format. + (main): Support -L. Deprecate -l. + +2002-07-02 Jim Meyering + + * src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c (usage): + Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it. + * src/df.c, src/dircolors.c, src/du.c, src/install.c: Likewise. + * src/link.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c: Likewise. + * src/mknod.c, src/mv.c, src/rm.c, src/rmdir.c, src/shred.c: Likewise. + * src/stat.c, src/sync.c, src/touch.c, src/unlink.c: Likewise. + +2002-07-01 Jim Meyering + + * tests/touch/fail-diag: Handle yet another different diagnostic. + Report from Volker Borchert. + +2002-06-29 Jim Meyering + + * src/stat.c (print_statfs): Use `fputc ('*', stdout)' + instead of the combination of strcat and printf. + (print_statfs) [!FLASK_LINUX]: Print `*' for %S and %C, + rather than `S' and `C'. + (print_stat) [!FLASK_LINUX]: Likewise. + + * src/remove.c (AD_mark_current_as_unremovable): Replace dead + code with an assertion. + +2002-06-26 Paul Eggert + + * src/ls-test: Use grep, not egrep. + +2002-06-25 Jim Meyering + + * src/remove.c (prompt): Add a comment to help translators work + around the problem of making the translations of the adjective + `write-protected' and the corresponding run-time-variable noun + (e.g., file, directory, symlink, etc.) consistent. From Paul Eggert. + +2002-06-24 Jim Meyering + + * src/stat.c (usage): Add missing open-quote. + Reported by Michael Piefel. + +2002-06-22 Jim Meyering + + * Version 4.1.9. + + * configure.ac: Invoke AC_GNU_SOURCE very early. + + * tests/rm/rm1: Accommodate the slightly different diagnostic we + get on some systems, due to `unlink (dir)' failing with EACCES + rather than EPERM. E.g. for ReiserFS on Linux-2.4.18. + +2002-06-21 Jim Meyering + + * Makefile.maint (wget-update): Checkout into config/. + Warn when skipping a file. + + * src/stat.c: Include sys/statvfs.h. + [!HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H]: Include sys/param.h + and sys/mount.h, to get decl of struct statfs on NetBSD 1.5.2. + (NAMEMAX_FORMAT, STRUCT_STATVFS): Define. + (HAVE_STRUCT_STATXFS_F_TYPE, SB_F_NAMEMAX): Define. + Remove `static' attribute from decl of program_name. + (human_fstype): Use f_basetype or f_fstypename if available. + (print_human_time): Use nstrftime and an ISO format string, in + place of strftime with `%c'. The latter is too locale-dependent. + (print_statfs): Deal with lots of portability issues: some fields + are available only with statfs, others only with statvfs, and + some are available in both, but with different types. + (do_statfs) [DEFAULT_FORMAT_TERSE]: Factor out. + [DEFAULT_FORMAT_VERBOSE]: Likewise. + + * src/copy.c: Change all `preserving ...' diagnostics to + `failed to preserve ...' to make the failure clearer. + * src/cp.c: Likewise. + +2002-04-03 Alfred M. Szmidt + + * src/copy.c Include hurd.h. + (copy_internal): Preserve the stat.st_author field. + +2002-06-21 Jim Meyering + + * src/ls.c (LOGIN_NAME_MAX): Define if not already defined. + (ID_LENGTH_MAX): Define. + (ST_DM_MODE): New macro. Code moved from... + (print_long_format): ...here. + (print_long_format): Itemize and comment the individual parts + of init_bigbuf. Use the above *_MAX macros. + +2002-06-20 Jim Meyering + + * src/system.h: Change `defined(X)' syntax to `defined X' + in cpp directives. + +2002-06-17 Jim Meyering + + * tests/setgid-check: Interpret a permissions string of + drwxr-xr-x (DOS/Windows) as meaning the cwd is not setgid. + Reported by Rich Dawe. + +2002-05-19 Paul Eggert + + Add support for new ls option --author, for GNU/Hurd. + Derived from a suggestion by Alfred M. Szmidt. + + * doc/coreutils.texi (ls invocation), NEWS: Document this. + * m4/jm-macros.m4 (jm_CHECK_ALL_TYPES): Check for st_author. + * src/ls.c (st_author) [! HAVE_STRUCT_STAT_ST_AUTHOR]: New macro. + (print_author): New var. + (AUTHOR_OPTION): New enum val. + (long_options, decode_switches, print_long_format, usage): + Support --author. + (format_user): New function. + (print_long_format): Use it. Make print buffer a bit bigger. + +2002-06-15 Jim Meyering + + * tests/sample-test (trap): Make sure the temporary hierarchy is + writable before removing it. + + * tests/mv/perm-1: New file, to demonstrate fix of 2002-06-12. + * tests/mv/Makefile.am (TESTS): Add perm-1. + + * src/system.h: For GNU libc 2.2 and newer, ensure that + has been included before this file. + +2002-06-13 Richard Dawe + + Accommodate DOS file name limitations. + * tests/cp/same-file: Change temp. file name: s/\.err/_err/, for DOS. + * tests/mv/force: Similar. + * tests/mv/into-self: Similar. + * tests/touch/no-rights: Similar. + * tests/mv/mv-special-1: Remove leading `.' from temp. names. + +2002-06-15 Jim Meyering + + * src/sys2.h (S_ISNAM): Add to list of S_IS* macros. + Rearrange #if directives for each S_IS macro. + From diffutils-2.8.2. + +2002-06-12 Jim Meyering + + * src/mv.c (do_move): Give one diagnostic, not two, when unable to + unlink a destination file. This bug was introduced in fileutils-3.16l. + +2002-06-07 Jim Meyering + + * tests/mv/part-fail: Also accept the permission-denied diagnostic + issued by some losing systems. Reported by Volker Borchert. + + * src/remove.c (remove_entry): Use DT_IS_DIR only if + HAVE_STRUCT_DIRENT_D_TYPE is defined. + +2002-06-02 Jim Meyering + + `rm' no longer uses explicit recursion, and as such is now able + to remove hierarchies of effectively unlimited depth. Prior to + this change, on typical systems, rm would fail (segfault) to remove + hierarchies of depth greater than about 25,000. + + * src/remove.c: Merge in all changes from no-recursion branch. + See below for details. + * src/remove.h: Likewise. + * src/mv.c (do_move): Adapt to new calling sequence for rm. + * src/rm.c (main): Likewise. + +2002-06-02 Jim Meyering + + * tests/rm/r-2: Adjust, now that we no longer report + `removing all entries of directory ...'. + * tests/rm/r-1: Likewise. + + * src/remove.c (enum Ternary): Define type. + (prompt): Add a parameter. Adjust callers. + (remove_entry): Attempt rmdir here, only if a directory is + `known' to be empty. Significant rework. + (remove_dir): Propagate failure `up' also when rmdir fails. + +2002-06-01 Jim Meyering + + * tests/rm/Makefile.am (TESTS): Add rm5. + * tests/rm/rm5: New test. + +2002-05-30 Jim Meyering + + In interactive mode, prompt only once about an empty directory. + * src/remove.c (enum Prompt_action): Define. + (prompt): Two new parameters. Adjust all callers. + + Performance. + * src/remove.c (remove_entry) [!ROOT_CAN_UNLINK_DIRS]: + Don't call rmdir here. + +2002-05-29 Jim Meyering + + * src/remove.c (AD_pop_and_chdir): Don't use errno (it's not valid) + in diagnostic for changed dev/ino. + (remove_entry): Tweak diagnostic. + +2002-05-27 Jim Meyering + + * src/remove.c (ROOT_CAN_UNLINK_DIRS): Define. + (AD_pop_and_chdir): Propagate status as we traverse back `up' the tree. + (DO_UNLINK, DO_RMDIR): Define. + (remove_entry) [ROOT_CAN_UNLINK_DIRS]: Add code so this works also on + systems where root can use `unlink' to remove directories. + +2002-05-24 Jim Meyering + + * tests/mv/mv-special-1: Adapt for changed format of --verbose output. + +2002-05-22 Jim Meyering + + * src/remove.c: Include file-type.h. + Include file type in prompt when asking whether to remove file. + Based on a patch from Paul Eggert. + + * src/remove.c (prompt): Add comment. + + * src/remove.c (remove_dir): Fix another (known) leak. + + * tests/rm/rm3: Don't depend on order of traversal of dir entries. + It is nondeterministic on some types of filesystems. + + * src/remove.c (hash_freer): New function. + (AD_mark_helper): Use it. + (AD_mark_as_unremovable): xstrdup the filename argument. + (remove_dir): Free directory name. + + * src/remove.c (remove_entry): Fail also when trying to remove a + directory without the --recursive option. + Change a diagnostic, s/unlink/remove/, now that it can apply also + to a directory. + + * src/remove.c (is_empty_dir): New function. + (prompt): New function, factored out of... + (remove_entry): ...here. Call it. + (remove_dir): Call prompt before rmdir. + + * src/remove.c (remove_entry): Add support for prompting (e.g., -i). + + * src/remove.h (UPDATE_STATUS): New macro. + Include save-cwd.h. + (struct File_spec): Remove declaration. + Update prototypes. + + * src/remove.c [AD_ent] (status): New member. This lets us propagate + the status from a subdirectory to its parent via AD_pop_and_chdir. + (AD_push_initial): Set it. + (AD_push): Likewise. + (remove_cwd_entries): Change return type to enum RM_status, and + adjust all callers. + (rm): Use UPDATE_STATUS rather than open-coding it. + + * src/remove.c (remove_entry): New function, factored out of... + (remove_cwd_entries): ...here, and... + (rm_1): ...here. + + * src/remove.c (remove_cwd_entries): Add support for --verbose. + (remove_dir): Likewise. + (rm_1): Likewise. + +2002-05-18 Jim Meyering + + * tests/rm/rm3: New file. + * tests/rm/rm4: New file. + * tests/rm/Makefile.am (TESTS): Add rm3 and rm4. + +2002-05-17 Jim Meyering + + * tests/rm/rm1: New file. + * tests/rm/rm2: New file. + * tests/rm/unread2: New file. + * tests/rm/Makefile.am (TESTS): Add rm1, rm2, and unread2. + + * src/remove.h (enum RM_status) [RM_NONEMPTY_DIR]: New member. + +2002-05-13 Jim Meyering + + * src/remove.c (rm): Free cwd_state, if necessary. + +2002-05-01 Jim Meyering + + * src/remove.c (rm_1): Remove now useless (always true) + user_specified_name parameter. Adjust sole caller. + + * src/remove.c (rm): New function. This interface allows + one to remove multiple arguments at a time. This is important in + that it allows us to hide the remove_init/remove_fini functions and + the cwd_state parameter. + (rm_1): Renamed from rm. + (remove_init, remove_fini): Remove functions. Each body is now + part of `rm'. + * src/remove.h (rm): Update prototype. + +2002-06-01 Jim Meyering + + * src/ls.c: Remove use of D_TYPE_IN_DIRENT, now that that symbol + has been renamed. + +2002-05-30 Jim Meyering + + * src/copy.c (copy_reg): Use a temporary to avoid a warning + from gcc -W about comparison between signed and unsigned. + (copy_internal): Likewise, but use a cast. + +2002-05-22 Jim Meyering + + * src/sys2.h (S_ISREG, S_ISDIR): Define if not already defined. + (S_TYPEISSEM, S_TYPEISSHM, S_TYPEISTMO): Likewise. + + * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR): + Remove definitions. + * src/sys2.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR): + Define here instead. + +2002-04-27 Jim Meyering + + * src/remove.c (cycle_check): New function containing code factored + out of remove_dir. The sole difference is that upon detecting a + cycle, rm now dies unconditionally. Before, in interactive mode, + it would ask the user whether to continue. + (remove_dir): Call cycle_check. + +2002-04-25 Jim Meyering + + Avoid new warnings from gcc. + * src/dd.c: Declare input_file and output_file to be `const'. + (skip): Declare `file' parameter to be `const', too. + + Remove hash table, active_dir_map, used to detect directory cycles. + Instead, detect them lazily with just O(1) memory. + Suggestion from Andi Kleen. + * src/remove.c (is_power_of_two): New function. + (print_nth_dir, make_active_dir_ent): Remove functions. + (hash_active_dir_ent, hash_compare_active_dir_ents): Likewise. + (remove_dir): Check for cycles here, ... + (rm): ... and don't check for cycles here. + + * src/remove.c (rm): Call fspec_get_full_mode here, rather than + fspec_get_filetype_mode. We want to get the dev/ino earlier, and + at the same time as when we get the file type, to avoid the risk + that an attacker would change e.g. a directory to a symlink before + we record its dev/ino. + + * configure.ac (AC_CONFIG_FILES): Remove intl/Makefile. + (AM_GNU_GETTEXT): Add external arg. + + * intl/: Remove directory. + * Makefile.am (SUBDIRS): Remove intl. + (DISTCLEANFILES): Remove definition. + + * src/sys2.h: Remove ENABLE_NLS-related code. + (_, N_) Remove definitions. + Include "gettext.h" instead. + + * src/Makefile.am (INCLUDES): Remove -I../intl. + +2002-04-22 Jim Meyering + + * src/remove.c (rm): Call exit with EXIT_FAILURE, not `1'. + +2002-04-19 Jim Meyering + + * tests/cp/*: Clean up. + + * tests/sample-test: Use a temporary directory named + `basename $0`.tmp/$$. Create with mkdir -p. + + * tests/cp/backup-1: Use better trap, etc. + * tests/mkdir/p-2: Use better trap. + * tests/mkdir/p-1: Likewise. + * tests/mkdir/concurrent-1: Likewise. + + * tests/rm/deep-1: Set $tmp the new way. + + * tests/rm/ir-1: Use `rm', not $RM. Use better trap. + * tests/rm/i-1: Likewise. + * tests/rm/f-1: Likewise. + + * tests/sample-test: Use automatically-derived name for temporary + directory. This is more 8.3-friendly. Based on a suggestion from + Richard Dawe. + + * tests/sample-test: New file. + * tests/Makefile.am (EXTRA_DIST): Add sample-test. + +2002-04-17 Jim Meyering + + * src/touch.c (touch): Don't report errors for nonexistent files + when --no-create is in effect. Based on a patch from TAKAI Kousuke. + * tests/touch/no-create-missing: New file/test for above. + * tests/touch/Makefile.am (TESTS): Add no-create-missing. + +2002-04-16 Jim Meyering + + * src/stat.c: Add copyright comment. + (human_fstype): Rename from print_human_fstype, and rework accordingly. + (print_statfs): Use human_fstype to honor format width on %T. + +2002-04-15 Jim Meyering + + Handle "lld" vs "ld" printf formats the same way Bash does. + * src/stat.c: Include inttypes.h. + (PRIdMAX, PRIuMAX): Define, if not already defined. + (print_statfs): Use those macros, not the literal strings. + (print_stat): Likewise. + Suggestion from Paul Eggert. + + * src/stat.c (print_human_fstype): Add missing `break;' + for `case S_MAGIC_MINIX:'. + +2002-04-14 Jim Meyering + + * src/stat.c (statfs_secure): Define. + (print_stat): Remove another #ifdef. + (do_statfs): Likewise. + (print_statfs): Prefer/use fputs over printf. + (print_stat): Likewise. + + * src/Makefile.am (bin_PROGRAMS): Add stat. + (noinst_HEADERS): Add fs.h. + + * src/stat.c [HAVE_SYS_VFS_H]: Guard incluion of sys/vfs.h. + Constify many parameters. + (print_statfs): Fix typo: Use %u (to match %lu) for namelen, not %d. + (verbose_usage): Remove function. Move contents into usage. + Remove lots of #if directives involving FLASK_LINUX + [!FLASK_LINUX] (is_flask_enabled): Define. + (stat_secure, lstat_secure): Define. + (print_statfs): Remove lots of nested #if directives. + Instead, rely on support fo %llu and %lld printf formats -- + but that is only temporary, since it's not porable enough. + (main): Hoist is_flask_enabled test to be done here, rather + than in each of do_stat and do_statfs for every argument. + +2002-04-13 Jim Meyering + + * src/stat.c: Include system.h, error.h, and many other headers. + [HAVE_SYS_SYSMACROS_H]: Guard inclusion of sys/sysmacros.h. + (PROGRAM_NAME, AUTHORS): Define. + (long_options): Declare/define. + (print_human_access): Rewrite to use mode_string. + (usage): Rewrite. + (main): Use getopt_long. + (print_human_type): Call fputs once rather than calling + printf many times. + (print_human_fstype): Revamp in a similar fashion. Don't use strdup. + Declare most functions to be `static'. + +2002-04-12 Jim Meyering + + * src/Makefile.am (LDADD): List ../lib/libfetish.a both before + and after @LIBINTL@. Thanks to Paul Eggert for the fix and to + Bruno Haible for diagnosing the problem. + + * src/link.c: Include long-options.h. + [long_opts]: Remove. + (usage): Tweak --help output; use *_OPTION_DESCRIPTION macros. + (main): Don't use getopt directly. Use parse_long_options instead. + Tweak a diagnostic. + Use EXIT_FAILURE rather than a literal `1'. + * src/unlink.c: Likewise. + (main): If POSIXLY_CORRECT is set, don't recognize --help or --version, + so the program can operate on a file with one of those names. + +2002-04-11 Jim Meyering + + New programs link and unlink. + + * src/Makefile.am (bin_PROGRAMS): Add link and unlink. + * src/link.c, src/unlink.c: New files, from Debian's fileutils_4.1-10. + Written by Michael Stone. + + * man/link.x: New file. + * man/unlink.x: New file. + * man/Makefile.am: Add link and unlink. + +2002-04-07 Jim Meyering + + * tests/install/basic-1: Tweak comments to reflect reality. + * tests/cp/fail-perm: Add VERBOSE=yes support. + * tests/mv/mv-special-1: Fix typo in VERBOSE=yes handling. + Reported by Richard Dawe. + +2002-03-30 Jim Meyering + + * Version 4.1.8. + + * tests/mv/i-link-no: Use --reply=no rather than -i. + The latter depends on whether stdin is a tty and hence would + fail in some situations where --reply=no doesn't. + + * src/mv.c (do_move): Correct a comment. + + * src/copy.c (copy_internal): Move the block that sets `earlier_file' + down to just before the first use of that variable. Otherwise, it was + possible to make mv (and probably cp, too) malfunction when copying + hard-linked files into a directory containing at least one of the + source file names. Call forget_created everywhere thereafter where + this function returns without creating a destination file that might + subsequently be linked. Reported by Iida Yosiaki. + * src/cp-hash.c (forget_created): New function. + * src/cp-hash.h (forget_created): Prototype. + + * tests/mv/i-link-no: New test for the above. + Based on an example from Iida Yosiaki. + * tests/mv/Makefile.am (TESTS): Add i-link-no. + +2002-03-17 Jim Meyering + + * src/copy.c (copy_internal) [move_mode]: Give a better diagnostic, + by using errno from the failed unlink, when a cross-device `mv' + fails, e.g., because the destination cannot be unlinked. + Prompted by a report from Karl Berry. + * tests/mv/part-fail: New test for the above. + * tests/mv/Makefile.am (TESTS): Add part-fail. + +2002-03-16 Jim Meyering + + * src/Makefile.am (datadir): Don't override $(datadir) + which might be set by --datadir and different from $(prefix)/share. + Patch from Albert Chin-A-Young. + +2002-03-10 Jim Meyering + + * Version 4.1.7. + + * src/ln.c (main): Change wording in diagnostic. + * src/cp.c (do_copy): Likewise. + * src/install.c (strip): Likewise. + Suggestions from Santiago Vila. + + * Use autoconf-2.53. Regenerate dependent files. + + * Makefile.maint (GZIP, BZIP2): Remove definitions. + ($(my_distdir).tar.bz2): Remove rule. Now, it's built by `make dist'. + + * configure.ac (AM_INIT_AUTOMAKE): Specify the required version + of automake (1.6), and options (gnits dist-bzip2), rather than... + * Makefile.am (AUTOMAKE_OPTIONS): ...here. Remove definition. + + * src/copy.c (copy_reg): Don't exit upon finding a replaced file. + Instead, just skip it like the diagnostic says. + Reported by Paul Eggert. + +2002-03-09 Paul Eggert + + * src/copy.c (copy_reg): Use a more concise diagnostic for + reporting replaced files. This avoids a bug in the code, + which mishandled ino_t wider than long. + * src/remove.c (remove_dir): Likewise, twice. + +2002-03-09 Jim Meyering + + * Makefile.am (EXTRA_DIST): Remove config/config.rpath, + now that automake knows about it. + +2002-03-08 Jim Meyering + + Don't allow a malicious user to trick another user's rm process into + removing unintended files. In one scenario, if root is removing a + hierarchy that is writable by the malicious user, that user may trick + root into removing all of `/'. Reported by Wojciech Purczynski. + + * src/remove.c (remove_dir): After chdir `..', call lstat to get the + dev/inode of "." and fail if they aren't the same as the old numbers. + (remove_cwd_entries): New parameter, `cwd_dev_ino'. + (remove_dir): Likewise. + (rm): Likewise. + Adjust all callers. + * src/mv.c (do_move): The first time we resort to copy/remove, + call lstat `.' to get the device/inode numbers now required for rm. + * src/rm.c (main): Call lstat `.' to get the device/inode numbers + now required for rm. + * src/remove.h (struct dev_ino): Declare new type. + (rm): Add a parameter to the prototype. + +2002-03-06 Jim Meyering + + * Use automake-1.6. Regenerate dependent files. + +2002-03-05 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add config/config.rpath. + +2002-03-04 Jim Meyering + + * Makefile.maint (tgz-size): Also handle a suffix of `K', since + the sizes in the output of `du -h' now look like `29K' + +2002-03-03 Jim Meyering + + * Version 4.1.6. + +2002-03-03 Paul Eggert + + Make cp -r equivalent to cp -R. Add a new cp option --copy-contents + for people who want to emulate the traditional (and rarely desirable) + cp -r behavior. + + * src/cp.c (COPY_CONTENTS_OPTION): New enum value. + (long_opts): Add --copy-contents. + (usage): Describe new behavior. Sort options. + (main): Implement new behavior. Remove diagnostics for -a and -r; + no longer needed. + * src/copy.c (copy_internal): Remove -r warning; no longer needed. + + * NEWS: Document this. + +2002-03-02 Jim Meyering + + * src/copy.c (copy_internal): For each symlink copied by cp -r, + issue a warning that `cp -r' is not portable. + + * src/cp.c (main): Revert change of 2001-12-29. With this change, + cp -r once again preserves symlinks. + (usage): Document the original (now-restored) behavior. + * tests/cp/r-vs-symlink: Reflect changed semantics of cp's -r option. + + * src/cp.c (main): Warn when -r is specified before --archive (-a). + * src/cp.c (main): Fail when -r is specified after --archive (-a) + on the command line. + + * src/copy.c (copy_reg): Detect abuse of a race condition + whereby an unprivileged user could gain read access to otherwise- + inaccessible files when root uses cp or mv to copy a hierarchy + belonging to that user. + +2002-02-27 Paul Eggert + + * src/ls.c (decode_switches, usage): Add --time-style=+FORMAT. + * doc/coreutils.texi (Formatting file timestamps): Document it. + +2002-02-25 Paul Eggert + + Add ACL support to 'ls' for HP-UX and Unixware, and try to + establish a framework for adding it for other hosts. + This builds on a suggestion of Andreas Gruenbacher. + + * lib/Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c. + * lib/acl.h, lib/acl.c, m4/acl.m4: New files. + * m4/jm-macros.m4 (jm_MACROS): Require AC_FUNC_ACL. + Do not check for acl or sys/acl.h, as AC_FUNC_ACL does that now. + * src/ls.c: Include "acl.h" rather than . + (USE_ACL): Remove; replaced by HAVE_ACL everywhere. + (gobble_file): Use file_has_acl rather than doing it ourselves. + +2002-02-20 Jim Meyering + + * src/touch.c: Include posixver.h. + (usage): Document only the intersection of the old and new behaviors, + to encourage portability. + (main): Use `posix2_version ()' in place of POSIX2_VERSION. + +2002-02-17 Jim Meyering + + * ABOUT-NLS, intl/*: Update to Gettext 0.11. + * INSTALL: Update to Autoconf 2.52h. + + * src/Makefile.am (datadir): Use `share' in place of @DATADIRNAME@, + per Gettext-0.11. + (LDADD): Use @LIBINTL@ instead of @INTLLIBS@, per Gettext-0.11. + + * configure.ac (AC_CONFIG_AUX_DIR): New macro invocation. + (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11. + + * config: New subdirectory, containing the following files from .: + config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs. + Move the following files here from doc: texinfo.tex, mdate-sh. + +2002-02-16 Jim Meyering + + * tests/ls/infloop: Use `head -n 7', not `head -7'. + * tests/rm/hash: Likewise. + +2002-02-10 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Hungarian (hu). + +2002-02-02 Jim Meyering + + * src/shred.c: (VERBOSE_UPDATE): Update every 5 seconds, not every 10. + (wipename): Quote file names only when necessary. + (main): Copy quoted string into malloc'd storage so it doesn't + get clobbered when using -u and --verbose. + + Minor clean-up. + * src/shred.c: + Use `NULL' rather than `(time_t *) 0'. + (dopass): Use STREQ in place of strcmp. + Add parentheses around use of nested ternary operator. + +2002-01-15 Paul Eggert + + * src/shred.c (VERBOSE_UPDATE): Now counts seconds, not bytes. + + (dopass): If verbose, output a line every VERBOSE_UPDATE seconds, + and suppress duplicate output lines. Output a percentage as well + as a count of bytes. + + Also, fix comment/code typo regarding how many bytes have been + written; this typo was harmless before, but is no longer harmless with + the above change in effect. + +2002-02-02 Jim Meyering + + * src/remove.c (rm): Add a comment. + +2002-01-28 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5d. + * configure.ac (AM_INIT_AUTOMAKE): Use zero-arg form of this macro. + +2002-01-21 Jim Meyering + + * po/POTFILES.in: Add lib/xmemcoll.c + + * src/chown-core.c: Don't include "xalloc.h", as system.h already + does that via sys2.h. + * src/ls.c: Likewise. + * src/shred.c: Likewise. + +2002-01-20 Paul Eggert + + * src/ls.c: Avoid undefined behavior when strcoll fails, + by resorting the directory with strcmp instead. + + Include . + Include "quote.h". + (compare_atime, rev_cmp_atime, compare_ctime, rev_cmp_ctime, + compare_mtime, rev_cmp_mtime, compare_size, rev_comp_size, + compare_name, rev_cmp_name, compare_extension, rev_cmp_extension, + compare_version, rev_compare_version): Move before use, so that + we can remove the forward declaration. Reimplement in terms of + the new functions described below, using xstrcoll instead of strcoll. + (failed_strcoll): New var. + (xstrcoll): New function. + (V): New type. + (cmp_ctime, compstr_ctime, rev_str_ctime): New functions. + (cmp_mtime, compstr_mtime, rev_str_mtime): Likewise. + (cmp_atime, compstr_atime, rev_str_atime): Likewise. + (cmp_size, compstr_size, rev_str_size): Likewise. + (cmp_version): Likewise. + (cmp_name, compstr_name, rev_str_name): Likewise. + (cmp_extension, compstr_extension, rev_str_extension): Likewise. + (sort_files): Use prototype for internal function var. + If the strcoll-based comparison fails, fall back on a strcmp-based one. + +2002-01-19 Jim Meyering + + Ensure that the two version numbers in configure.ac remain in sync. + * Makefile.maint (local-check): Depend on ac-check. + (ac_p_pkg, AC_INIT_PKG): Define. + (ac_p_ver, AC_INIT_VER): Define. + (ac-check): New rule. + +2002-01-19 Jim Meyering + + * configure.ac: Remove code that set LIBOBJS in support of ansi2knr. + The latest version of autoconf objected to it, and besides, I don't + care too much about K&R support these days. + +2002-01-14 Paul Eggert + + * src/touch.c (main): Issue a warning for obsolete usage, unless + POSIXLY_CORRECT. + +2002-01-14 Paul Eggert + + Add support for POSIX 1003.1-2001, which requires removal for + support of the obsolete `touch [-acm] MMDDhhmm[YY] FILE...' syntax. + + * NEWS: Document this. + * src/touch.c (usage, main): Implement this. + +2002-01-12 Jim Meyering + + Avoid giving a misleading diagnostic in some unusual cases. + Instead, give one that makes sense. + + * src/copy.c (copy_reg): Don't treat errno==ENOENT as a special case. + (same_file_ok): Detect a case that would have lead to the errno==ENOENT + condition above (and a misleading diagnostic), and return 0 so we give + a diagnostic about the source and destination being the same file. + (copy_internal): Use an explicit test for errno==EXDEV to detect + that rename has failed because source and destination are on + different devices. This reverts part of a change from 1997-12-13, + and is to avoid letting a race condition evoke a bogus diagnostic. + Note that while POSIX has encouraged the errno==EXDEV test for + years, it was inadequate back in 1997. I'm hoping that many + more systems have conforming support these days. + Reported by Michael Gaughen + + * src/shred.c (usage): Also mention Ext3. + Suggestion from Göran Uddeborg. + +2002-01-06 Bruno Haible + + * src/ls.c (long_time_format): Extend translator comments. + +2002-01-05 Jim Meyering + + * Version 4.1.5. + +2001-12-29 Jim Meyering + + * src/cp.c (main): With -r, always dereference symlinks. + Reported by Christian Harkort. Patch by Chris J. Bednar. + + * tests/cp/r-vs-symlink: New file to test for the above fix. + * tests/cp/Makefile.am (TESTS): Add r-vs-symlink. + +2001-12-21 Jim Meyering + + * src/shred.c [!HAVE_CONFIG_H]: Remove cpp block that duplicated + code in lib/ in order to facilitate compiling this program without + config.h. + +2001-12-19 Paul Eggert + + * src/shred.c: Add FSF copyright notice. + +2001-12-18 Paul Eggert + + Use notation compatible with SI and with IEC 60027-2. + For example, --block-size=1MB now means --block-size=1000000, + whereas --block-size=1MiB now means --block-size=1048576. + A trailing `B' now means decimal, not binary; this is a silent change. + -H or --si now outputs the trailing 'B', for consistency with this. + Programs now output trailing 'K' (not 'k') to mean 1024. + New df, du short option -B is short for --block-size. + You can omit an integer `1' before a block size suffix, + e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'. + + * NEWS, doc/coreutils.texi: Document this. Remove documentation + for obsolescent constructs MD, --kilobytes, -m or --megabytes. + + * src/dd.c (usage, parse_integer): Prefer K to k for 1024. + * src/shred.c (usage, main): Likewise. + + * src/shred.c (xstrtoumax): If there is no number but there + is a valid suffix, assume 1. "MB" now means decimal, "MiB" binary. + Accept 'K' as well as 'k'. + + * src/dd.c (usage): MD -> MB for decimal. + + * src/df.c (BLOCK_SIZE_OPTION): Remove; no longer needed now that + we have 'B'. + (long_options, usage, main): Add -B. + (usage): Deprecate --kilobytes, -m, --megabytes. + Document size suffixes. + * src/du.c: Likewise. + * src/ls.c (usage): Deprecate --kilobytes. Document size suffixes. + + * src/df.c (print_header, show_dev): Enlarge column widths for + trailing "B". + +2001-12-17 Jim Meyering + + * Makefile.maint (real_dir): Remove unused variable. + (url_dir_list): Don't set define it here, but... + * Makefile.cfg (url_dir_list): ...define it here instead. + (hosts, a_host, b_host): Remove now-unused variables. + (alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables. + +2001-12-15 Jim Meyering + + * Version 4.1.4. + + * tests/touch/fail-diag: Also accept SunOS4's `Not owner' diagnostic. + Reported by Volker Borchert. + + * tests/help-version: Fail also if ./$i --version fails. + Run each --help and --version test with a few different settings + of LC_MESSAGES. Prompted by a report from Nelson Beebe. + +2001-12-11 Jim Meyering + + Include the word `fail' in some diagnostics to make it clearer + that they indicate a failure. + * src/chgrp.c (main): s/getting attributes/failed to get attributes/. + * src/chmod.c (change_file_mode, main): Likewise. + * src/chown-core.c (change_file_owner): Likewise. + * src/chown.c (main): Likewise. + * src/cp.c (re_protect): Likewise. + * src/touch.c (touch, main):Likewise. + Suggestion from Karl Berry. + +2001-12-10 Jim Meyering + + * src/dd.c (buggy_lseek_support): Remove function. + (skip_via_lseek) [__linux__]: New function. + (skip): Use skip_via_lseek, not buggy_lseek_support. + Based on an outline from Paul Eggert. + +2001-12-09 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Estonian (et). + +2001-12-08 Jim Meyering + + * Makefile.cfg (wget_files): Remove ansi2knr.c, since it's + no longer available at that location. + +2001-12-04 Jim Meyering + + * tests/chgrp/basic: Don't use diff's -u option. It's not portable. + Besides, with GNU diff one can use the DIFF_OPTIONS envvar. + * tests/ls/no-arg: Likewise. + * tests/ls/recursive: Likewise. + * tests/ls/rt-1: Likewise. + +2001-12-02 Jim Meyering + + * Version 4.1.3. + + * src/sys2.h (HELP_OPTION_DESCRIPTION): New macro. + (VERSION_OPTION_DESCRIPTION): New macro. + * src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c, + * src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c, + * src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/rm.c, + * src/rmdir.c, src/shred.c, src/stat.c, src/sync.c, src/touch.c (usage): + Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION + instead of hard-coding --help and --version descriptions. + + * POTFILES.in: Add src/sys2.h. + + * src/touch.c (touch): Extend the change of 2001-09-15 to work on + systems for which errno is set to EPERM in that case. Thus, e.g., + `touch /' by non-root gives a better diagnostic on systems like SunOS4. + Reported by Volker Borchert. + + Don't emulate dd's skip=N for *all* character devices; lseek works + just fine on non-tape character devices like /dev/mem and /dev/kmem. + * src/dd.c (buggy_lseek_support) [__linux__]: Emulate `skip=N' + behavior using reads, not lseek for Linux tape devices (major == 9). + Kernel lseek support for tapes is broken, up to and including + linux-2.4.16. Reported by Herbert Xu. + +2001-11-27 Jim Meyering + + * tests/ls/rt-1: Compare all lines of output. + Update code to use `trap' and more up to date infrastructure. + + The change of 2001-11-01 introduced a bug whereby some recursive + listings didn't have a blank line between per-directory groups of files. + * src/ls.c (print_dir): Print a newline before each directory name + except the first one, rather than after each except the last, since + now (after the changes of 2001-11-01) detecting whether a `pending*' + is the last would involve more work. Reported by Andreas Schwab. + * tests/ls/recursive: New file. Test for the above. + * tests/ls/Makefile.am (TESTS): Add recursive. + + This change has no net effect. + * src/ls.c (main): Remove always-true conjunct and add a comment. + +2001-11-26 Jim Meyering + + * src/shred.c: Don't include "gtod.h" + (main): Don't `call' GETTIMEOFDAY_INIT. + * src/ls.c: Likewise. + +2001-11-24 Jim Meyering + + * Makefile.maint: Include signatures for the xdelta file, too. + + * Makefile.maint (emit-upload-commands): Rename from + emit-rsync-commands. + Output only the package name and the prev and current version numbers. + + * Version 4.1.2. + + * src/sync.c (usage): Make --help and --version strings + start in column 7. + + * Makefile.cfg (move_if_change): Remove definition. + ($(srcdir)/m4/jm-glibc-io.m4): Use mv, not move-if-change. + +2001-11-23 Jim Meyering + + * cp.c, df.c, du.c, install.c, ln.c, ls.c, mkdir.c (usage): + * mkfifo.c, mknod.c, mv.c, shred.c, touch.c (usage): + Note that ``Mandatory arguments to long options are mandatory + for short options too.'' + + * src/shred.c (usage): Use `output', not `print' in description of + the --version option, so this message is consistent with all the rest. + + * chgrp.c, chmod.c, chown.c, cp.c, dd.c, df.c, dircolors.c (usage): + * du.c, install.c, ln.c, ls.c, rm.c, rmdir.c, shred.c, touch.c (usage): + Split --help output into smaller pieces. + Use fputs, not printf. + + * src/cp-hash.c: Use opaque type, Hash_table, not `struct hash_table'. + * src/du.c: Likewise. + * src/remove.c: Likewise. + +2001-11-22 Jim Meyering + + Don't fail for commands like this: cp a a d/ + This change in behavior was introduced in 4.1.1, as part of the + 2001-09-28 change. cp and mv still fail for commands like this: + rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c + + * src/copy.c (triple_hash_no_name): New function. + (src_info_init): New function. + (copy_internal): Warn and return early for the second and subsequent + occurrences of the same source file named on the command line. + * src/copy.h (struct cp_options) [src_info]: New member. + * src/install.c (cp_option_init): Initialize new member. + * src/mv.c (cp_option_init): Likewise. + * src/cp.c (cp_option_init): Likewise. + (do_copy): Call src_info_init. + + * tests/mv/dup-source: New test for the above. + * tests/mv/Makefile.am (TESTS): Add dup-source. + + * src/copy.c (seen_file): Change type of `stats' parameter to pointer. + (copy_internal): Update caller. + + * src/copy.c (struct F_triple): Rename from dest_info. + (seen_file): Rename from seen_dest. Rename parameters accordingly. + (record_file): Rename from record_dest. Rename parameters accordingly. + (triple_hash): Rename from dest_info_hash. + (triple_compare): Rename from dest_info_compare. + (triple_free): Rename from dest_info_free. + + * src/mknod.c (main): Add a literal format string to suppress + a warning from gcc's -Wformat-security. + + copy.c shouldn't maintain static state. + + * src/copy.c (dest_info): Remove declaration of file-scoped global. + (dest_info_init): Require a parameter. + Update all callers. + (seen_dest): Require a hash table parameter. Update callers. + (record_dest): Likewise. + * src/copy.h: Include hash.h. + (struct cp_options) [dest_info]: New member. + * src/install.c (cp_option_init): Initialize new member. + * src/mv.c (cp_option_init): Likewise. + * src/cp.c (cp_option_init): Likewise. + (do_copy): Remove const attribute from declaration of parameter, x. + +2001-11-17 Jim Meyering + + * tests/chmod/equals: New test for the just-fixed bug in + lib/modechange.c. + * tests/chmod/Makefile.am (TESTS): Add equals. + + * configure.ac: Replace use of the one-arg form of AC_INIT + with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR. + +2001-11-12 Jim Meyering + + * tests/rm/r-3: Clean up. + +2001-11-09 Jim Meyering + + * configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no + arguments. + +2001-11-06 Jim Meyering + + * src/dircolors.hin: Remove duplicate entry for .png. + Reported by Frédéric L. W. Meunier. + +2001-11-03 Jim Meyering + + * Version 4.1.1. + + * src/ls.c (DEV_INO_PUSH): Avoid unnecessary copies. + (dev_ino_pop): Likewise. + +2001-11-02 Jim Meyering + + * src/ls.c: Rename global: s/trace_dirs/recursive/. + (extract_dirs_from_files): Rename parameter: + s/recursive/ignore_dot_and_dot_dot/. + + * src/ls.c: (dev_ino_pop): Cast 2nd arg of obstack_blank to `int' + before negating to avoid warning from gcc on systems with 64-bit size_t. + + * src/ls.c: Use XMALLOC and XREALLOC in a several places. It's cleaner. + +2001-11-01 Jim Meyering + + * src/ls.c: Include dirfd.h. + (print_dir): If dirfd fails, resort to using stat. + + * tests/ls/infloop: Redirect cmp's stderr to /dev/null. + + * src/ls.c (struct pending) [st_ino, st_dev]: Remove members. + (queue_directory): Remove just-added 3rd parameter + and associated code, and update callers. + (print_dir): Get dev/inode pair via `fstat (dirfd (reading), ...', + and call visit_dir to detect cycles here. + Push the dev/inode pair onto the new stack. + (dev_ino_obstack): New global. + (DEV_INO_PUSH): New macro. + (dev_ino_pop): New function. + (ASSERT_MATCHING_DEV_INO): New macro. + (visit_dir): Take two parameters (dev,ino), not one `pending'. + (main): Initialized the dev_ino_obstack. + Don't call visit_dir here. + Get the dev/ino pair from the new stack, not from the pending entry. + + Make ls -R detect directory cycles. + Add loop detection without incurring an additional stat call per + directory processed. To detect loops efficiently (i.e., time: +O(1) + per directory processed by ls -R, total additional space: + O(max-tree-depth)), record the dev/ino of each `active' directory + in a hash table. To know when a directory is no longer active, + insert a marker (name == NULL) entry for it in the pending queue. + When a marker comes to the front of the queue, that directory is no + longer active, and must be removed from the hash table. To remove it, + we need to know its dev/ino again. Since by the time a directory + has become inactive its files[] info is long gone and it's DIR* + is closed, I must either save the dev/ino someplace (pending seemed + logical) or recompute them via stat. + + The following change will convert to using a stack of dev/ino pairs + instead, pushing an entry when doing the opendir (use fstat on + dirfd (reading)), and popping (when encountering a marker) to get + the dev/ino pair to be removed from the hash table. + + * src/ls.c: Include hash.h, same.h, and xalloc.h. + (INITIAL_TABLE_SIZE, LOOP_DETECT): Define. + (active_dir_set): New global. + (struct dev_ino): Declare. + (dev_ino_hash, dev_ino_compare, dev_ino_free): New functions. + (visit_dir, free_pending_ent): New functions. + (main): Initialize the active_dir_set hash table, if necessary. + Don't confuse a marker entry with a real one. + Detect loops. + Manage the set of active directories. + Free the hash table. + (queue_directory): Add a new parameter. + Ensure that we set the new dev/ino members for each enqueued directory. + Update all callers. + (print_dir): Don't confuse a marker entry with a real one. + (extract_dirs_from_files): Insert a marker entry before inserting + the entries for subdirectories. + + Don't try to print a NULL pointer. + * src/ls.c (main): Don't use ARGMATCH_TO_ARGUMENT. + This reverts part of the 1998-12-31 change. + * tests/ls/dired: New test, for the above. + * tests/ls/Makefile.am (TESTS): Add dired. + +2001-10-24 Jim Meyering + + * src/cp.c (main): Free hash table storage. + * src/cp-hash.c (forget_all): Use hash_free, not hash_clear. + +2001-10-22 Paul Eggert + + * src/sys2.h (alloca): Define to __builtin_alloca if __GNUC__, + to avoid a warning if -Wall. + +2001-10-21 Paul Eggert + + * src/dd.c: Remove as many instances of 'unsigned' as + possible, as some of them were not conforming to ANSI C, and + they made the code hard to read. Avoiding 'unsigned' cuts + down on the number of casts. + + (newline_character, space_character, save_char): + Now char, not unsigned char. + (obuf): Now char *, not unsigned char *. + (ascii_to_ebcdic, ascii_to_ibm, ebcdic_to_ascii): + Now char[], not unsigned char[]. + (translate_charset, translate_buffer, swab_buffer, skip, copy_simple, + copy_with_block, copy_with_unblock): + Arg now points to char, not unsigned char. + All callers changed. + (translate_charset, parse_conversion, apply_translations): + Use int index, not unsigned int. + (bit_count): Arg is now int, not unsigned int. + Callers not changed, as they already assumed this. + (translate_buffer): Cast char to unsigned char before using + it as a subscript. + (swab_buffer): Returns char *, not unsigned char *. + (dd_copy): Use char, not unsigned char, for buffers. + Use size_t for possibly-large index, not unsigned int. + +2001-10-21 Jim Meyering + + * src/shred.c (isaac_seed_machdep): Handle SIGSEGV, too. Ick. + + * tests/mv/Makefile.am (TESTS): Remove i-3. It's not portable. + + * src/copy.c: Include xreadlink.h. + (copy_internal): Don't use PATH_MAX. + Rewrite the symlink-copying code to use xreadlink. + +2001-10-20 Jim Meyering + + * src/touch.c (touch): Extend last change to work on systems + for which errno is set to EINVAL. + + * src/ls.c: Declare some local variables to be `const', where + appropriate. + (usage): Improve the description of --dereference (-L). + + * src/rm.c (usage): Clarify description of --directory (-d). + Based on a patch from Michael Stone. + + * man/chmod.x: Describe sticky files and directories. + From Michael Stone. + + * tests/mv/partition-perm: Don't use a umask that removes owner + read/write. Use a stricter test for permissions. + + * tests/cp/link-preserve: Don't use a umask that removes owner + read/write. That would induce spurious failures in a probably- + outdated version of purify. + +2001-10-18 Jim Meyering + + * src/mv.c (movefile): Now that remember_copied xstrdup's the file + name, free `new_dest'. + + Plug a leak. + * src/cp-hash.c (remember_copied): Use src_to_dest_free to free + the entry we couldn't insert. + + Don't use free'd memory. + * src/copy.c (dest_info_free): New function. + (dest_info_init): Make the hash table code use it. + (record_dest): Store each DEST in malloc'd memory. Hence the above. + Use dest_info_free to free the `ent' we couldn't insert. + +2001-10-14 Jim Meyering + + Now, -P is the same as --no-dereference, per POSIX. + Use --parents to get the old meaning. + + * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: Remove member. + (long_opts): Associate --no-dereference with `-P'. + (usage): Update description of -P. + (main): Remove local, used_P_option, and code to warn + that the meaning of -P would be changing. + +2001-10-13 Jim Meyering + + * src/copy.c (copy_internal): Tighten up and add comments + describing the test for when to record (via remember_copied) + a triple. + Relax the test that guards the hard-linked-dir check and + the hard-link-preserving code. + + Remove the link-preserving semantics from cp_options.dereference. + Clean up the code that preserves links for `cp -d' and `mv'. + Introduce new options: + --preserve[={mode,ownership,timestamps,links,all}] + --no-preserve={mode,ownership,timestamps,links,all} + -p and --preserve remain unchanged and are equivalent to + `--preserve=mode,ownership,timestamps' + + * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: New member. + (enum) [NO_PRESERVE_ATTRIBUTES_OPTION]: New member. + (enum) [PRESERVE_ATTRIBUTES_OPTION]: New member. + (long_opts): Separate -d and --no-dereference options. + Add `no-preserve'. + Separate -p and --preserve options. + The long-named --preserve now accepts optional arguments; -p doesn't. + (usage): Describe additions and changes. + (cp_option_init): Initialize new member, preserve_links, to 0. + (decode_preserve_arg): New function. + (main) [case 'a']: Set preserve_links to 1. + [case 'd']: Set preserve_links to 1. + Add `case' for long-named --no-dereference. + Handle long-named --no-preserve and --preserve. + + * src/copy.h (enum Dereference_symlink): Add comments. + (struct cp_options) [preserve_links]: New member. + * src/install.c (cp_option_init): Initialize new member to 0. + * src/mv.c (cp_option_init): Initialize new member to 1. + + * tests/cp/link-preserve: Add tests for some of the above. + +2001-10-13 Jim Meyering + + * src/copy.h (struct cp_options) [failed_unlink_is_fatal]: Remove + unused member. + * src/mv.c (cp_option_init): Don't set it. + * src/cp.c (cp_option_init): Likewise. + * src/install.c (cp_option_init): Likewise. + + * src/copy.h (struct cp_options): Rename members: + s/preserve_owner_and_group/preserve_ownership/, and + s/preserve_chmod_bits/preserve_mode/. + * src/copy.c, src/cp.c, src/install.c, src/mv.c: Update all uses. + + * man/chown.x: Fix typo: s/Sh/SH/ before OPTIONS. + Reported by Eric S. Raymond. + +2001-10-12 Jim Meyering + + * tests/ls/Makefile.am (TESTS): Add infloop. + (XFAIL_TESTS): Mark it as a test that we expect to fail (temporarily). + * tests/ls/infloop: New file. + +2001-10-11 Jim Meyering + + * src/mknod.c (main): Tell what's wrong with `mknod c zero 1 5' rather + than saying just `Try `./mknod --help' for more information.'. + Suggestion from Karl Berry. + +2001-10-07 Jim Meyering + + * TODO: Remove items relating to cp-hash.c, now that they're done. + + Allow cp -d (and mv when it resorts to copying) to preserve + hard links that span command line arguments. + + * src/cp.c (do_copy): Don't clear the hash table after processing + each command line argument. + * tests/cp/link-preserve: New test for the above. + * tests/cp/Makefile.am (TESTS): Add link-preserve. + + * src/cp-hash.c (remember_copied): Make a local copy of the file name. + (src_to_dest_free): New function (to free the above). + (hash_init): Register src_to_dest_free. + * src/copy.c (copy_dir): Now that remember_copied copies the + file name, free the temporary `dst_path' allocated here. + +2001-10-06 Jim Meyering + + Convert du.c to use the functions in lib/hash.c, not private, + slightly-modified copies of those that used to be in cp-hash.c. + + * src/du.c (struct entry) [coll_link]: Remove member. + (struct htab): Remove. + (hash_reset, hash_init, hash_insert2, hash_insert): Remove functions. + + * src/du.c: Include hash.h and same.h. + (htab): Change type of global to `struct hash'; + (entry_hash, entry_compare, hash_ins): New functions. + (count_entry): Use hash_ins instead of hash_insert. + +2001-10-06 Jim Meyering + + Rewrite cp-hash.c to use the functions in lib/hash.c. + + * src/cp-hash.c (hash_init): Die if hash_initialize fails. + + * src/cp-hash.c: Rewrite to use the functions in lib/hash.c. + * src/cp-hash.h: Update prototype for hash_init. + * src/mv.c (do_move): Reflect that hash_init now takes no arguments. + * src/install.c (main): Likewise. + * src/cp.c (main): Likewise. + +2001-10-06 Jim Meyering + + * src/copy.c (record_dest): Avoid a small leak. + +2001-10-06 Jim Meyering + + This decreases the memory footprint a little, when copying + hierarchies containing many files. + + * src/copy.c (copy_internal): Call remember_copied only if + the source file has 1 < st_nlink, or if it's a directory. + Now that EARLIER_FILE is set conditionally, initialize it to NULL. + + * tests/mv/childproof: Redirect stderr on one test. + +2001-10-05 Jim Meyering + + * src/copy.c: Include hash-pjw.h and remove definition of hash_pjw. + * src/remove.c: Likewise. + +2001-10-01 Jim Meyering + + * src/remove.c (hash_pjw): Remove function. + * src/copy.c: Likewise. + +2001-09-29 Jim Meyering + + * src/copy.c (copy_internal): Call record_dest for all types of + files (for which this makes sense), not just regular ones. + + * mkinstalldirs: Update from master. + + * Makefile.maint (wget-update): Add mkinstalldirs. + +2001-09-28 Jim Meyering + + This mv command should fail (likewise for cp), rather than + silently clobbering one of the source files. + rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c + Reported by Dan Jacobson. + + * src/cp.c (do_copy): Call dest_info_init if necessary. + * src/install.c (main): Likewise. + * src/mv.c (main): Likewise. + * src/copy.h (dest_info_init): Declare. + * src/copy.c: Include "hash.h" and "same.h". + (struct Dest_info): Define. + (dest_info): Declare global. + (DEST_INFO_INITIAL_CAPACITY): Define. + (hash_pjw): New function. + (dest_info_hash): Likewise. + (dest_info_compare): Likewise. + (dest_info_init): Likewise. + (seen_dest): Likewise. + (record_dest): Likewise. + (copy_internal): If the destination exists, fail if it's in the set + of files that have already been created as part of this mv or cp. + (copy_internal) [move_mode]: Record the destination dev/ino/filename. + (copy_internal) [!move_mode, regular file]: Likewise. + + Accept new option: --reply={yes,no,query} + * src/cp.c: (enum) [REPLY_OPTION]: Define. + (usage): Describe new option. + Split long usage string into smaller pieces. + (main): Handle new option. + + * missing: Update from master. + * config.guess: Likewise. + * config.sub: Likewise. + + * configure.ac: Tell automake to use the file name `config.hin' + rather than the two-`.' config.h.in. + +2001-09-26 Jim Meyering + + * man/Makefile.am (common_dep): s/configure.in/configure.ac/. + + * configure.ac: Renamed from configure.in. + + * INSTALL, mkinstalldirs: Update to autoconf 2.50 version. + +2001-09-23 Jim Meyering + + * tests/mv/childproof: New test, for the above fix. + Based on a report from Dan Jacobson. + * tests/mv/Makefile.am (TESTS): Add childproof. + + * Makefile.am (SUBDIRS): When using newer gettext (in which + intl/libintl.h is created by rules intl/Makefile) + `intl' must precede `lib'. + +2001-09-22 Jim Meyering + + Mostly clean-up (modulo the better diagnostic). + * src/copy.c (copy_internal): Rename parameter, move_mode, to + command_line_arg, and adjust caller. Now, move_mode is a local + that is derived from command_line_arg. + Factor some involved code to produce something slightly more readable. + Use x->move_mode, not move_mode in determining which diagnostic + to give (`backing up %s would destroy source; %s not moved'). + +2001-09-16 Paul Eggert + + * src/ls.c (usage): Fix typo in -g usage. + -H now means --dereference-command-line. + +2001-09-16 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5. + + * man/Makefile.am (*.1): Depend on *source* files, not binaries. + (.x.1): Add code to work around ginstall vs. install exception. + + * man/Makefile.am (dist_man_MANS): Use dist_man_MANS, not man_MANS. + +2001-09-15 Jim Meyering + + Convert to a more conventional (e.g., like autoconf) Makefile.am. + * man/Makefile.am: Remove hacks. + * man/GNUmakefile: Remove file. + * man/Makefile.summ: Remove file. + * man/Makefile.maint: Remove file. + * man/ginstall.x: Remove. Renamed to ... + * man/install.x: ... this. New file. + Michael Stone reported that man pages weren't built in non-srcdir build. + + * src/touch.c (EISDIR): Define to 0, if not already defined. + (touch): Give a better diagnostic for e.g., `touch /' by non-root. + Based on a patch from Michael Stone. + Reported by Jeff Sheinberg as Debian bug #101677. + * tests/touch/fail-diag: New test, for the above fix. + * tests/touch/Makefile.am (TESTS): Add fail-diag. + + * src/copy.c (copy_internal) [move_mode]: Support the new + --reply=... option. + (UNWRITABLE): Define (factored out of copy_internal). + (copy_internal): Use UNWRITABLE. + + Accept new option: --reply={yes,no,query} + * src/mv.c: Include argmatch.h. + (enum) [REPLY_OPTION]: Define. + (usage): Describe new option. + Split long usage string into smaller pieces. + (main): Handle new option. + + * src/cp.c (main): Reflect renaming: s/I_ON/I_ASK_USER/. + + * src/copy.h (enum Interactive): Remove members, I_OFF and I_ON. + Instead, add I_ALWAYS_YES, I_ALWAYS_NO, and I_ASK_USER. + + * tests/mv/i-2: Clean up: use priv-check rather than open-coding it. + +2001-05-11 Paul Eggert + + * src/chmod.c, src/chown.c, src/mkdir.c, src/rm.c, src/rmdir.c (main): + Don't strip trailing slashes; POSIX doesn't allow it here. + Don't include "dirname.h" when no longer needed. + +2001-09-08 Jim Meyering + + * src/copy.c (copy_internal): Add braces around now-multi-stmt + if-block. This fixes a bug introduced by my 2001-08-06 change. + * tests/mv/i-4: New test, for the above. + * tests/mv/Makefile.am (TESTS): Add i-4. + +2001-09-04 Paul Eggert + + * src/ls.c (get_link_name): Update use of xreadlink. + +2001-09-02 Jim Meyering + + * tests/priv-check: Change usage not to use $1. + That's not portable to e.g., Solaris2.6's /bin/sh. + Communicate via an envvar instead. + * tests/mv/i-3: Don't pass an argument to a sourced script. + * tests/cp/special-bits: Likewise. + * tests/chown/basic: Likewise. + + * Makefile.maint (alpha): Depend on local-check so that they run + a little earlier. + +2001-09-01 Jim Meyering + + * src/df.c (show_point): Use canonicalize_file_name, if possible. + [HAVE_RESOLVEPATH], [!HAVE_RESOLVEPATH]: Use malloc, not alloca, + so that these two paths also produce `resolved' in malloc'd storage. + Free that memory when done with it. + + * src/ls.c: Include "xreadlink.h". + (get_link_name): Don't use PATH_MAX. + Rewrite to use xreadlink. + +2001-08-30 Paul Eggert + + * src/chgrp.c: Do not include savedir.h; not used. + * src/chown.c: Likewise. + + * src/chmod.c (change_dir_mode): Remove statp arg; no longer needed. + * src/chown-core.c (change_dir_owner): Likewise. + * src/du.c (count_entry): Remove st_size argument. + * src/copy.c (copy_dir): Likewise. + +2001-08-30 Paul Eggert + + * src/copy.c: Include full-write.h. + * src/dd.c: Likewise. + + * src/copy.c (full_write): Remove decl; not needed. + * src/dd.c: Likewise. + * src/install.c: Likewise. + * src/mv.c: Likewise. + + * src/copy.c (copy_reg): + Don't assume read and write size fits in int. + * src/dd.c (open_fd): Likewise. + +2001-08-30 Paul Eggert + + * src/remove.c (bool): Remove; moved to... + * src/system.h: ...here. + + * src/du.c (count_entry, main): Reflect changes to the + exclude functions. + +2001-08-13 Jim Meyering + + * src/cp.c, src/dd.c, src/ln.c, src/ls.c, src/mv.c (AUTHORS): Mark + string for translation, since it contains the English word `and'. + + * Makefile.maint (author_mark_check): New rule. + (local-check): Depend on it. + + Change the rules governing when mv prompts before removing an + existing destination file so it is consistent with POSIX: + Now, in the absence of --force (-f), if stdin is a tty and an + existing destination is not writable mv will prompt before + overwriting the destination file. + Reported by Vin Shelton. + + * src/copy.c (overwrite_prompt): New function. + (copy_internal): Separate the mv-specific and non-move_mode code + that determines whether to prompt the user. + [move_mode]: Don't make mv fail (i.e. don't return 1) just because + the user declined to remove one or more of the files. + * src/copy.h (enum Interactive): New type. + (struct cp_options) [interactive]: Change type to Interactive. + (struct cp_options) [stdin_tty]: New member. + * src/cp.c (cp_option_init): Adjust initialization of `interactive', + and initialize new member, stdin_tty. + * src/mv.c (cp_option_init): Likewise. + * src/install.c (cp_option_init): Likewise. + * src/cp.c (main): Adjust initialization(s) of `interactive', + * src/mv.c (main): Likewise. + * tests/mv/i-1: Change expected exit status to reflect the above. + +2001-08-12 Jim Meyering + + * tests/mk-script ($program_name): Define. + (main): Use $program_name, rather than long-inaccurate `build-script'. + (main): Iterate over the sorted keys (rather than `while...each...'), + so this script produces the same output regardless of which version + of perl (e.g., perl5.6) is used. + + Work around non-compliant gettimeofday on Mac OS X 10.0.4, + (aka Darwin 1.3.7) that caused the date of the first file listed + in long output to be the current time rather than the file's mtime. + The real work is in m4/gettimeofday.m4 and the wrapper function, + lib/gettimeofday.c. + * src/ls.c: Include gtod.h. + (main): `Call' GETTIMEOFDAY_INIT. + (print_long_format): Add a comment about gettimeofday. + Report and diagnosis from Bernhard Baehr. + + * src/shred.c: Include gtod.h. + (main): `Call' GETTIMEOFDAY_INIT, just in case the code ever changes + to make it necessary. + +2001-08-10 Paul Eggert + + * src/ls.c (print_long_format): Simplify previous patch for + listing negative sizes, by adding OFF_T_MAX - OFF_T_MIN + 1 + instead of doing a fancy conditional shift. This is simpler + and it avoids GCC's bogus compile-time warning about shift + counts. (As a bonus, it is portable to hosts that do not use + twos-complement arithmetic. :-) + +2001-08-10 Jim Meyering + + * ls.c (print_long_format): Multiply the shift width by zero + to avoid a warning from gcc on hosts with an unsigned type for the + st_size member. + +2001-08-06 Paul Eggert + + * src/ls.c (print_long_format): If a file size is negative, assume + the typical case where it has wrapped around from a positive value. + +2001-08-07 Jim Meyering + + * Makefile.maint (m4-check): New rule. + (local-check): Depend on it. + +2001-08-06 Jim Meyering + + Fix the bug whereby `mv -uf source dest' would delete source, + even though it's older than dest. + + * src/mv.c (usage): Correct the description of --update. + * src/copy.c (copy_internal): Set *rename_succeeded, so that + the caller (mv) doesn't remove the source file. + Reported by Phelippe Neveu. + + * tests/mv/update: New test for the above. + * tests/mv/Makefile.am (TESTS): Add update. + +2001-08-05 Jim Meyering + + * tests/root-only: Generalize. Rename to ... + * tests/priv-check: ...this. New file. Renamed from the above. + * tests/Makefile.am (EXTRA_DIST): Reflect renaming. + * tests/mv/i-3: Reflect name and usage changes. + * tests/chown/basic: Likewise. + * tests/cp/special-bits: Likewise. + * tests/sample-test: Likewise. + +2001-08-04 Jim Meyering + + * tests/root-only: Remove *all* write access, not just that + of the owner. + + * tests/mv/i-3: New test for the above fix. + * tests/mv/Makefile.am (TESTS): Add i-3. + +2001-08-03 Paul Eggert + + * ls.c (quote_name): Pass 0 to mbsnwidth, since the default + got changed and we want the default now. + +2001-08-03 Paul Eggert + + * ls.c (quote_name): Pass 0 to mbsnwidth, since the default + got changed and we want the default now. + +2001-07-15 Jim Meyering + + * src/Makefile.am (INCLUDES): Add -I../lib so sys2.h can include + the new, generated file, unlocked-io.h. + + * src/sys2.h: Include "unlocked-io.h", rather than hard-coding the + HAVE_*_UNLOCKED macros. + + * Makefile.cfg ($(srcdir)/m4/jm-glibc-io.m4): New rule. + +2001-07-14 Jim Meyering + + * Makefile.maint (tgz-size): Also work for sizes in the kilobyte range. + + * Makefile.maint: More changes from autoconf. + + Changes from autoconf. + * Makefile.maint (GZIP_ENV): Add --best. + (AMTAR): Define. + (writable-files): Factor out ../release/ constant, and work (by + creating it) even if such a directory doesn't exist. + +2001-07-08 Jim Meyering + + * src/copy.c (get_dest_mode): Clear set-user-ID and set-group-ID bits + when copying (i.e., not in move mode) and not preserving permissions. + Reported by kytek@cybercomm.net. + FIXME: add a test for this!!! + +2001-07-02 Jim Meyering + + * src/ln.c (do_link): Test the boolean symbolic_link, not the function, + symlink. Patch by Frederik Eaton. + +2001-06-17 Jim Meyering + + * Makefile.maint: Factor out definitions specific to fileutils, + sh-utils, and textutils, so that other packages can use the framework. + Patch by Akim Demaille. + * Makefile.cfg: New file with package-specific definitions. + * GNUmakefile: Include Makefile.cfg. + * Makefile.am (EXTRA_DIST): Add Makefile.cfg. + +2001-06-16 Jim Meyering + + * src/ls.c (main): Recheck global print_with_color after calling + parse_ls_color, since that function may have reset it. + Based on a patch from Richard Dawe. + +2001-06-16 Jim Meyering + + * config.sub: Update from master repository. + * config.guess: Likewise. + +2001-06-09 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Turkish (tr). + +2001-05-25 Jim Meyering + + * src/ls.c (print_long_format): Don't truncate user names + or group names that are longer than 8 characters. + + Add definitions that let me factor the wget rule while still letting + me accommodate the fact that these files reside in several different + directories and come from different places. + * Makefile.maint (wget-files): Define. + (get-targets, *-local_dir, *-url_prefix): Likewise. + (target, url, local_file): Convenience variables. + ($(get-targets)): The factored rule. + +2001-05-24 Jim Meyering + + * src/ansi2knr.c: Update from master source. + + * Makefile.maint (wget-update): Have wget write to a temporary file, + and replace the original only if wget succeeds. + Also get ansi2nkr.c. + (move-if-change): Define. + (wget-update): Use it in place of mv. + + * src/ls.c: Use `#if D_TYPE_IN_DIRENT && defined DTTOIF' to + determine whether to enable the DT_INIT definition, not the less + portable `#if defined _DIRENT_HAVE_D_TYPE || defined DTTOIF'. + Reported by Eli Zaretskii. + + * src/mkfifo.c (main): Remove quotes around %s. + The argument is already quoted via the quote function. + * src/mknod.c (main): Likewise. + Reported by Göran Uddeborg. + +2001-05-21 Jim Meyering + + * Makefile.maint (wget-update): depcomp and missing are now in + automake's lib/ subdirectory. + +2001-05-11 Paul Eggert + + Add new --time-style option. + Change --full-time to be equivalent to --time-style=full-iso. + + * NEWS, doc/omni-utils.texi: Describe this change. + + * src/ls.c: Include "hard-locale.h". + (nstrftime): New decl. + (enum time_style): New enum. + (time_style_args, time_style_types): New constants. + (full_time): Remove. + (long_time_format): Initialize to POSIX defaults. + (TIME_STYLE_OPTION): New constant. + (long_options, decode_switches, usage): Add --time-style support. + (long_time_expected_width): Use nstrftime, not strftime. + (print_long_format): Likewise. + Increase initial size to match new full-iso time style. + + * tests/ls/time-1: Unset QUOTING_STYLE and TIME_STYLE. Set TZ. + Adjust to change in full-time format. + Fix typo in failure messages (-a and -m were interchanged). + +2001-05-20 Jim Meyering + + * doc/Makefile.am (EXTRA_DIST): Add constants.texi and doclicense.texi. + (info_TEXINFOS): s/fileutils/omni-utils/. + (check-texinfo): New rule. + (check): Depend on check-texinfo. + + * doc/omni-utils.texi (uniq invocation): Document the new optional + arguments to the --all-repeated option. + Make all references to POSIX use @sc{posix}. + +2001-05-19 Jim Meyering + + * doc/fileutils.texi: Remove. + + * doc/omni-utils.texi: Change a few uses of `timezone' to `time zone'. + Reported by Stephen Eglen. + +2001-05-16 Jim Meyering + + * Makefile.maint (my-distcheck): Remove work-around kludge and + associated comment, now that automake has ben fixed. + +2001-05-12 Paul Eggert + + Clean up some of the places where the code assumed that random + types like 'mode_t' fit into 'int', which POSIX doesn't guarantee. + + * src/ls.c (struct fileinfo.linkmode): Now st_mode. + (print_color_indicator, print_name_with_quoting, print_type_indicator, + length_of_file_name_and_frills): + Use mode_t, not unsigned int, to store modes. + (dired_dump_obstack): Do not assume size fits in 'int'. + (get_link_name): readlink returns ssize_t, not int. + (make_link_path): Store buffer size as size_t, not int. + (print_long_format): Use unsigned long, not unsigned, to print + nlink_t, uid_t, gid_t, major_t, minor_t. + +2001-05-13 Paul Eggert + + * src/mknod.c (main): Check for NODEV device only if NODEV is defined. + * src/system.h (NODEV): Remove, undoing previous change. + +2001-05-13 Jim Meyering + + * src/remove.c (dir_name, dir_len): Define to different names + to avoid shadowing warnings due to new declarations from dirname.h. + + * tests/Fetish.pm (run_tests): Fail if any test name is longer + than 12 bytes. + * tests/ls-2/tests: Shorten test names so the length of a + resulting file name doesn't exceed 14. + +2001-05-12 Paul Eggert + + * src/system.h (NODEV): New macro, if not already defined. + + * src/mknod.c (main): Check for overflow when converting out + of uintmax_t. Do not assume that major_t and minor_t are no + wider than int. Check for makedev failures. Convert device + numbers via uintmax_t, not unsigned long, just in case. + Coalesce duplicate code in the block and character device + cases. + +2001-05-11 Paul Eggert + + Add new --dereference-command-line option. + -H now means this instead of meaning --si, as POSIX requires. + + * NEWS, doc/omni-utils.texi: Document this. + + * src/ls.c (enum Dereference_symlink): New type. + (dereference): New var, replacing trace_links, which was removed. + (long_options, main, decode_switches, gobble_file, usage): + Implement the changes. + + * tests/ls-2/tests: + Rename slink-dir test to slink-dir-dF. Add new tests + slink-dir-F, slink-dir-dFH, slink-dir-dFL. + +2001-05-11 Paul Eggert + + dirname code cleanup. base_name now behaves more compatibly + with POSIX basename when given file names that have trailing + slashes, and similarly for dir_name. Add new primitives + base_len and dir_len. Put the directory-name-related decls + into dirname.h. + + * src/chmod.c (strip_trailing_slashes): Remove; now in dirname.h. + * src/chown.c (strip_trailing_slashes): Likewise. + * src/cp.c (strip_trailing_slashes): Likewise. + * src/df.c (strip_trailing_slashes): Likewise. + * src/ln.c (strip_trailing_slashes): Likewise. + * src/mkdir.c (strip_trailing_slashes): Likewise. + * src/rm.c (strip_trailing_slashes): Likewise. + * src/rmdir.c (strip_trailing_slashes): Likewise. + + * src/dircolors.c, src/ls.c, src/remove.c: + Include "dirname.h", to get base_name. + + * src/cp.c (make_path_private): Use dir_len instead of + dir_name, and avoid an extra mealloc call. + + * src/df.c (find_mount_point): No need to strip trailing + slashes before invoking new dir_name. + + * src/mv.c: Include "dirname.h". + (strip_trailing_slashes_2): Remove; now done by + strip_trailing_slashes. All callers changed. + + * src/sys2.h (base_name): Remove decl; now in dirname.h. + + * src/copy.c (copy_internal): Remove the code that tested for NULL + dir_name return value. That can't happen. + +2001-05-12 Jim Meyering + + * src/ls.c (usage): Wording changes related to -o, -n, and -g. + * doc/omni-utils.texi: Likewise. + From Paul Eggert. + +2001-05-11 Paul Eggert + + * src/chmod.c (mode_changed, change_file_mode): + There's no need to invoke both lstat and stat here, so call just + one of the two functions. + +2001-05-11 Jim Meyering + + * doc/omni-utils.texi: New file. The union of fileutils.texi, + sh-utils.texi, and textutils.texi. Merged by Brian Youmans. + + * src/shred.c (usage): Warn about backups and mirrors. + * doc/omni-utils.texi (shred invocation): Likewise. + From Nelson Beebe. + +2001-05-09 Jim Meyering + + * src/ls.c (main): Don't set `format_needs_stat' for --recursive (-R), + because that would make `ls -RF dir' stat unnecessarily all of the + files in dir/ on some systems. + Similarly, don't set `format_needs_stat' for --dereference (-L), + because that would make `ls -RLF dir' stat unnecessarily all non-symlink + files in dir/ on some systems. + Instead, ... + (gobble_file): ... also stat a file if `trace_dirs' (-R) is set and its + type is unknown. + ... also stat a file if `trace_links' (-L) is set and the file is a + symlink or its type is unknown. + (print_dir): Also recognize DT_REG and DT_LNK. + +2001-05-07 Jim Meyering + + * src/chown.c (main): Fix thinko that made --from=... fail: + s/argv[optind]/optarg/. Reported by Andrew Pham. + + * tests/chown: New directory. + * tests/chown/basic: New (root-only) test for the above. + * tests/cp/special-bits: Factor out the root-only test into this ... + * tests/root-only: ... new file. + * tests/Makefile.am (EXTRA_DIST): Add root-only. + (SUBDIRS): Add chown. + * tests/chown/Makefile.am: New file. + * configure.in (AC_OUTPUT): Add tests/chown/Makefile. + +2001-05-05 Jim Meyering + + * src/ls.c (decode_switches): Complain if the envvar, QUOTING_STYLE, + is set to an invalid value. + Move some declarations of locals into scopes where they're used. + +2001-05-02 Jim Meyering + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + +2001-05-01 Jim Meyering + + * Makefile.maint (tgz-size, xd-size): Compute sizes. + (announcement): Include sizes of .tar.gz and .xdelta files + in the announcement. + + * src/ls.c (print_owner): New global variable. + (usage): Update the descriptions of -g. + (decode_switches): Honor the -g option (omit owner information), + now that POSIX specifies it. + (print_long_format): Don't print owner name if -g was specified. + Move declaration of `user_name' into the scope where it's used. + (print_group): Rename global from `inhibit_group'. Update all + uses accordingly. + * doc/fileutils.texi (What information is listed): Describe -g. + * TODO: Remove item for ls -g. + + * src/ls.c (decode_switches): Make -n work just like -l, except + with numeric IDs, per POSIX. Before, to have any effect, -n had + to be used with -l. Reported by Dale Scheetz. + (usage): Update the description of -n. + Separate the descriptions of -n and --numeric-uid-gid. + Split string in --help output that had exceeded my limit of + 2048 bytes. + +2001-04-29 Jim Meyering + + * Version 4.1. + + * configure: Regenerate using a further-patched copy of autoconf-2.49e + to work around a bug in its test for ranlib. This is the change to + autoconf's acgeneral.m4 that was made on 2001-04-24. + + * README: Don't mention mvdir. It is no longer provided. + Don't mention HP/UX vs. du blocksize problem. It's long gone. + Remove note about how cp, mv, and ln couldn't make backups + of files with names of maximum length. Now they can do that. + Thank the people who have provided access to their systems + for portability testing. + Warn about and describe autoconf/automake version requirements. + Use a better URL for the GNU Coding Standards. + + * man/rm.x: Refer to shred. + Remove the example showing how to remove `-foo', since that is now + in the --help output (and hence automatically included). + * src/rm.c (usage): Mention shred. + + * src/shred.c (usage): Include in --help output the warning about + some of the filesystem types on which shred is not effective. + +2001-04-25 Jim Meyering + + * Makefile.maint (my-distcheck): Add a comment. + +2001-04-23 Jim Meyering + + * Version 4.0.45. + +2001-04-22 Jim Meyering + + * src/ls.c (decode_switches): Ensure that -1 has no effect when it + follows -l, per POSIX. Reported by Ulrich Drepper. + + * src/dd.c (usage): Mention that sync makes dd pad with spaces (rather + than NULs) when used with block or unblock. + (dd_copy): When using sync with either block or unblock, + pad with spaces. Reported by Dale Scheetz. + * tests/dd/skip-seek (block-sync-1): New test, for this. Based on + a report from Dale Scheetz. + * doc/fileutils.texi (dd invocation): Document it here, too. + + * configure: Regenerate using a patched copy of autoconf-2.49e to + work around a bug in its test for a working memcmp function. + This is the change to autoconf's acfunctions.m4 that was made + on 2001-04-22. + + * tests/ls/no-arg: New file. + * tests/ls/Makefile.am (TESTS): Add no-arg. + * src/ls.c (main): Fix off-by-one error introduced with last change. + +2001-04-21 Jim Meyering + + * Version 4.0.44. + + * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49e. + + * doc/fileutils.texi (touch invocation): Discuss ctime. + Based on suggestions and contributions from Aharon Robbins + and Dan Jacobson. + + * src/ls.c (main): When given two or more arguments but the only one + that exists is a directory, don't treat it as if it were the only + argument. Before, `mkdir d; ls no-dir d 2>/dev/null' would act like + `ls d' and produce no output. Now, it prints `d:'. + Report and patch from Stéphane Chazelas. + * tests/ls-2/tests: New tests, for the above fix. + +2001-04-08 Jim Meyering + + * depcomp: New version, from automake. + +2000-10-31 Bruno Haible + + * ls.c: Don't inspect MB_LEN_MAX. Paul Eggert says it's + not always defined correctly. + +2001-04-03 John David Anglin + + * tests/chgrp/basic: Ensure that initial group id's are properly set + for `d' and `d/f3'. + +2001-04-02 Jim Meyering + + * tests/mv/setup: Skip nonexistent directories so we don't get + diagnostics from df about e.g., `/usr/tmp not found'. + +2001-03-24 Jim Meyering + + * configure.in: Don't require autoconf version here -- it's done in m4/. + +2001-03-23 Jim Meyering + + * Version 4.0.43. + + * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49d. + + * Makefile.maint (check-copyright): New target and rule. + (alpha): Depend on it. + + * missing: Handle shell built-ins (only `:' and `cd' for now) to work + around brain damage in Ultrix's /bin/sh. + +2001-03-18 Jim Meyering + + * Version 4.0.42. + + * tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL + to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a + suggestion from Eli Zaretskii. + +2001-03-17 Paul Eggert + + * doc/fileutils.texi: Warn that touch DATE FILE will be withdrawn. + +2001-03-17 Jim Meyering + + * tests/install/basic-1: Add the standard $VERBOSE-handling hook. + This test currently fails for mips-dec-ultrix4.4. + + * tests/install/create-leading: Use ../envvar-check rather than + open-coding the same tests. + + * tests/envvar-check: Set/use $as_unset, for those shells + (like Ultrix4's /bin/sh) that don't accept `unset'. + + * missing (--run): Use `eval' to run `"$@"'. Otherwise, Ultrix4.4's + /bin/sh fails and outputs garbage. + + * src/touch.c (usage): Tweak the obsolescent usage line so that + help2man recognizes it as such. Reported by Dan Jacobson. + +2001-03-16 Jim Meyering + + * Makefile.maint (wget-update): Also get `missing'. + Use for-loops. + + * missing: Update from automake. + +2001-03-11 Jim Meyering + + * tests/rm/isatty: Disable this test, for now. + It would block when run in the background. + +2001-03-09 Jim Meyering + + * config.guess: Update from master repository. + + * Makefile.maint (my_distdir): Define new variable, and use this + in place of most old uses of $(distdir). + + * src/Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES). + Reported by Akim Demaille. + + * tests/help-version: Ensure that /dev/full is a character device + (using test -c) as well as being writable, before trying to write to it. + Otherwise, the test could mistakenly append a newline to an existing, + regular, writable, /dev/full file. + Suggested by Ulrich Drepper. + +2001-03-06 Jim Meyering + + * src/dd.c (S_TYPEISSHM): Rename parameter to reflect its type. + (main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM. + Patch by Alain Magloire. + +2001-03-04 Jim Meyering + + * src/dd.c (output_char): Reformat so each statement is on a + separate line. + +2001-02-21 Jim Meyering + + * src/mkdir.c (main): Remove assignment-in-if-expression. + In fact, remove t_errno altogether. Reported by Nelson Beebe. + + * tests/ls-2/tests: Add two tests of existing behavior -- both will + have to be changed (soon after release), once ls is fixed. + +2001-02-20 Paul Eggert + + * src/ls.c (FULL_TIME_OPTION): Renamed from FULL_TIME, for + consistency with the other enum values. + +2001-02-20 Paul Eggert + + * NEWS, doc/fileutils.texi: ls -H is now obsolescent. + * src/ls.c (SI_OPTION): New enum value. + (long_options): Use it instead of 'H' for --si. + (decode_switches): Warn that -H will change soon. + (usage): Likewise. + +2001-02-18 Jim Meyering + + * tests/rm/Makefile.am (TESTS): Add isatty. + * tests/rm/isatty: New test, for the bug fixed below. + + * Version 4.0.41. + + * depcomp: New version, from automake. + + `chmod 0 file; rm file' would no longer prompt before removal. + * src/remove.c (remove_file): Revert last change. + Reported by Vin Shelton. + +2001-02-17 Jim Meyering + + * Version 4.0.40. + + * src/chown.c (main): `quote' the offending argument. + +2001-02-17 Paul Eggert + + Stop trying to support hosts that have nonstandard declarations for + mbrtowc and/or mbstate_t. It's not worth the portability hassle. + + * m4/mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC. + * m4/mbswidth.m4 (jm_PREREQ_MBSWIDTH): + Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc). + * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Likewise. + * lib/mbswidth.c, lib/quotearg.c, src/ls.c (mbrtowc, mbsinit): + Remove workaround macros for hosts that have mbrtowc but not + mbstate_t, as we now insist on proper declarations for both + before using mbrtowc. + Reported by Matt Schalit. + +2001-02-17 Jim Meyering + + * config.sub: Update from master repository. + * config.guess: Likewise. + +2001-02-16 Paul Eggert + + * doc/getdate.texi: Mention that only English is supported. + Show how to use "date" so that the output is acceptable to getdate. + Mention Z as an abbreviation for UTC. + +2001-02-11 Jim Meyering + + * Makefile.maint (emit-rsync-commands): Define. + (alpha): Use it here. + +2001-02-10 Jim Meyering + + * Makefile.maint (alpha): Fix previous, incomplete change. + + * Version 4.0.39. + + * depcomp: New version, from automake. + +2001-02-04 Jim Meyering + + * README: Remove note about now-ancient Sequents. + +2001-02-03 Jim Meyering + + * src/ln.c (main): Change type of index variable to `unsigned int' + to avoid a warning. + + * config.guess: Update from master repository. + + * Makefile.maint (a_host): Use fencepost. + (real_dir): Use the same name for both. + (alpha): Print commands for both hosts. + + * src/mv.c (long_options): Use `strip-trailing-slashes', + per the documetation, not `strip-trailing-slash'. + * src/cp.c (long_opts): Likewise. + Reported by Oskar Liljeblad. + + * doc/fileutils.texi (mv invocation): Add a warning about how a trailing + slash makes a difference. Prompted by a report from Oskar Liljeblad + via Michael Stone (Debian bug#83991). + +2001-01-31 Jim Meyering + + * config.sub: Update from master repository. + * config.guess: Likewise. + +2001-01-28 Jim Meyering + + * Version 4.0.38. + + * configure, aclocal.m4, etc.: Regenerate using autoconf-2.49c. + + * src/ls.c (gobble_file): Add a FIXME comment. + + * TODO: Add a few items. + + * src/ls.c (enum) [FULL_TIME]: Define. + (long_options): Use it. + (decode_switches): Make --full-time imply -l. + Prompted by a report from Karl Eichwalder. + +2001-01-22 Jim Meyering + + * src/remove.c (remove_file): Correct an expression to avoid making + an unnecessary call to euidaccess for each file. + +2001-01-21 Jim Meyering + + * Version 4.0.37. + +2001-01-20 Jim Meyering + + * configure.in: Remove jm_CHECK_ALL_TYPES. + Now it's invoked by jm_MACROS. + +2001-01-17 Jim Meyering + + * src/sys2.h (case_GETOPT_VERSION_CHAR): Use PACKAGE, not GNU_PACKAGE. + * src/sync.c (main): Likewise. + * src/shred.c (PACKAGE): Likewise. + * src/dd.c (main): Likewise. + +2001-01-14 Jim Meyering + + * Version 4.0.36. + + * src/shred.c (UINT_MAX_32_BITS): Define. + Use UINT_MAX_32_BITS in the cpp conditions that determine + the `word32' typedef. Using a literal `0xffffffff' failed with + HPUX10.20's /bin/cc. + + * config.sub: Update from master repository. + * config.guess: Likewise. + +2001-01-02 Volker Borchert + + Work around a broken rename system call, e.g. on SunOS 4.1.1_U1, + that fails when the source path has a trailing slash. + * src/copy.h [RENAME_TRAILING_SLASH_BUG]: Use the rename wrapper. + * tests/mv/trailing-slash: Test whether the workaround works. + * tests/m4/Makefile.am (TESTS): Add trailing-slash. + +2001-01-03 Alexandre Duret-Lutz + + * po/Makefile.in.in (update-po): Merge po-files in temporary files + in the build directory, and update the source directory only when + the merged catalog differs from the original. This fixes the known + `make distcheck' failure due to `make update-po' being called + on up-to-date but read-only files. + +2001-01-13 Jim Meyering + + * src/copy.c (same_file_ok): When moving a symlink onto itself, + don't remove the symlink. Reported by David Luyer as Debian bug#82089, + via Michael Stone. + * tests/mv/into-self-4: New test for the above. + * tests/mv/Makefile.am (TESTS): Add into-self-4. + + * tests/chmod/setgid: If `chmod g+s d' fails, then try to chgrp + to a group of which we're a member, then try the chmod again. + +2001-01-11 Jim Meyering + + * depcomp: New version, from automake. + +2001-01-10 Jim Meyering + + * src/copy.c (copy_internal): Add a comment. + Set *copy_into_self in the new code that detects that. + Make diagnostic more consistent: s/won't/will not/. + [move_mode, copy_into_self]: Give a diagnstic here, now that + we have the top_level_* globals. Remove the corresponding diagnostic + from mv.c. + Add a FIXME comment. + * src/mv.c (do_move): Remove diagnostic, now that copy.c issues it. + Set `fail' to nonzero in the primary `if (copy_into_self)' block + rather than in its own tiny one below. + + * src/copy.c (copy_internal): Don't allow cp (or mv, when working + across a partition boundary) to overwrite a non-directory with a + directory. Reported by Michael J. Croghan. + * tests/cp/dir-vs-file: New test for the above. + * tests/cp/Makefile.am (TESTS): Add dir-vs-file. + +2001-01-09 Jim Meyering + + Give a better diagnostic for `cp -R a a'. + * src/copy.c (top_level_src_path, top_level_dst_path): New globals. + (copy_internal): Use them. + (copy): Set them. + * src/cp-hash.c [struct entry] (node): Describe how it's used, + now that we've overloaded it, in order to detect and diagnose + the copying-directory-into-self problem. + (new_file): Remove global. + (htab): Declare global to be static. + (remember_created): Insert file name instead of dummy pointer, so + that copy.c can use the just-created directory name to detect + the copying-directory-into-self problem. + * tests/cp/into-self: New test for the above. + * tests/cp/Makefile.am (TESTS): Add into-self. + +2001-01-07 Jim Meyering + + * src/cp.c (usage): Split a string that was longer than 2048 bytes. + + * doc/perm.texi: s/can not/cannot/ + +2001-01-07 Karl Eichwalder + + * src/chown.c (usage): Split long message string. + +2001-01-07 Karl Eichwalder + + * src/ls.c (usage): Untabify. + + * src/chgrp.c (parse_group): Normalize spelling. + +2001-01-03 Paul Eggert + + * NEWS: Document the planned --full-time change. + * doc/fileutils.texi: Likewise. + * NEWS: Document that time stamps depend on LC_TIME, not LC_MESSAGES. + +2001-01-03 Paul Eggert + + Use the more precise algorithm of GNU "make" to decide whether + a file is in the future, by looking at high-resolution time + stamps if available. + + * src/ls.c: + (TIMESPEC_NS): New macro. + (current_time): Initialize to the minimum value. + (current_time_ns): New var. + (main): Do not bother to initialize current_time; + it's no longer needed. + (get_current_time): New function. + (print_long_format): Use it when a file appears to be in the future. + Get the nanoseconds of the file's time stamp, if available, + and use that to decide whether the file appears to be in the future. + + * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): New macros. + +2001-01-02 Paul Eggert + + * src/ls.c (long_time_expected_width, print_long_format): Fix + bug: the initial byte passed to strftime wasn't initialized to + a nonzero value after the buffer was reallocated. + +2001-01-02 Paul Eggert + + Make ls -l compatible with POSIX, which requires that the + behavior of time formats must depend only on LC_TIME, not on + LC_MESSAGES. + + * po/Makefile.in.in (install-data-yes): If the package is + fileutils, install LC_TIME as an alias for LC_MESSAGES. + * src/sys2.h (dcgettext): New macro. + * src/ls.c (decode_switches): Use dcgettext with LC_TIME, + not plain gettext, to get the translations of time formats. + +2001-01-02 Paul Eggert + + * src/ls.c (long_time_expected_width): New function. + (print_long_format): Use it, so that we don't assume a + particular width for time stamps in an internationalized + environment. + +2001-01-01 Paul Eggert + + * doc/fileutils.texi, NEWS: + ls -l now reports the year for files even slightly in the future, as + POSIX requires. This helps warn users about clock skew problems. + + * src/ls.c (print_long_format): + Report the year for files even slightly in the future. + Avoid overflow problems near Y2038 on 32-bit hosts. + To calculate "six months", take half the average Gregorian + year, not 180 days. + +2001-01-01 Jim Meyering + + * tests/chmod/Makefile.am (TESTS): Add setgid. + * tests/chmod/setgid: Test for chmod's existing behavior. + Based on a report from Paul Eggert. + +2000-12-29 Paul Eggert + + Clean up the terminology a tad: some directories were called "sticky" + when they were really setgid. + * tests/Makefile.am (EXTRA_DIST): sticky-check -> setgid-check + * tests/chmod/c-option, tests/cp/cp-parents, tests/mkdir/parents, + tests/mkdir/perm: Likewise. + * tests/setgid-check: File renamed from tests/sticky-check. + All uses of "sticky" changed to "setgid". + +2000-12-31 Jim Meyering + + * tests/cp/Makefile.am (TESTS): Add deref-slink. + * tests/cp/deref-slink: New file. Test for the bug fixed by my + 2000-12-28 change to copy.c. + +2000-12-30 Paul Eggert + + * src/ls.c: Improve performance by invoking gettext twice at the start, + instead of once for each file. + (long_time_format): New var. + (decode_switches): Initialize it, if format == long_format. + (print_long_format): Use it. + +2000-12-30 Paul Eggert + + * src/ls.c (print_long_format): Don't dump core if strftime + returns the empty string. + +2000-12-30 Paul Eggert + + * src/ls.c (gobble_file): If not using long format, don't + invoke acl; it's not needed. + +2000-12-30 Jim Meyering + + Avoid an unnecessary `stat' when using --dereference. + * src/copy.c (same_file_ok): Use stat only if lstat reported that + the file was a symbolic link. + +2000-12-29 Paul Eggert + + * doc/perm.texi: append-only directories -> restricted deletion flag, + which is the term that POSIX d5 uses for this notion. + +2000-12-28 Paul Eggert + + * tests/group-names: Try /usr/xpg4/bin/id (Solaris 7) if plain + 'id' doesn't work. + +2000-12-28 Jim Meyering + + * tests/cp/cp-parents: Run sticky-check from just-created directory. + +2000-12-28 Jim Meyering + + * src/copy.c (same_file_ok): Fix two typos from my 2000-09-03 change: + s/tmp_dst_sb/tmp_src_sb/. + +2000-12-27 Paul Eggert + + * tests/sticky-check: Turn off the working directory's sticky + bit, so that we don't have to worry about it later. + + * src/copy.c (same_file_ok): Use a single auto var for + tmp_dst_sb, instead of two static vars. Likewise for + tmp_src_sb. + +2000-12-26 Jim Meyering + + * Version 4.0.35. + + * Regenerate build/config framework to use automake-1.4b and + the latest CVS version autoconf. + + * tests/mkdir/perm: Disable the test if the working directory has + the sticky bit set. + * tests/cp/cp-parents: Likewise. + Reported by Nelson Beebe. + +2000-12-25 Jim Meyering + + Clean-up to avoid warnings from Irix's c89. + + * src/remove.c (hash_compare_active_dir_ents): Return explicit `true' + or `false', rather than relying on implicit int-to-enum cast. + * src/copy.c (same_file_ok): Remove declaration and set of unused + variables: src_sb_no_link, dst_sb_no_link. + * src/ls.c (extract_dirs_from_files): Remove unused variable. + Reported by Nelson Beebe. + + * src/ls.c (gobble_file): Move decl of local, val, into the scope + where it's used. + +2000-12-24 Jim Meyering + + For both ln and install, when using `--backup=simple --suffix=S', + the suffix `S' wasn't used. + + * src/ln.c (main): Actually use the local variable, + `backup_suffix_string'. + * src/install.c (main): Likewise. + Nelson Beebe reported the unused variables. + * tests/ln/misc: Add a test for this (for all of cp, mv, ln, install). + + * man/help2man: Update to version 1.24. + +2000-12-22 Jim Meyering + + * Version 4.0.34. + + * src/shred.c (isaac_seed_machdep) [_ARCH_PPC]: Disable the code + that would use the PPC mfspr `asm' code. Suggestion from Michael Stone. + +2000-12-19 Jim Meyering + + * doc/fileutils.texi: Use `ref_file' in place of `file' to make + descriptions of the various --reference=... options clearer. + +2000-12-17 Jim Meyering + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + +2000-12-16 Jim Meyering + + * src/chown-core.c (uint_to_string): New function. + (uid_to_name): Use it. + (gid_to_name): Use it. + Rename locals, user/group, to uid/gid. + + * src/chown-core.h (enum Change_status): Start with 1. + + * src/chown.c (main): Rename locals, user/group, to uid/gid. + * src/chgrp.c (main): Rename local, group, to gid. + + * tests/group-names: New file. + * tests/Makefile.am (EXTRA_DIST): Add group-names. + * tests/chgrp/basic: Use group-names. + * tests/chgrp/deref: Likewise. + * tests/chgrp/recurse: Likewise. + + * tests/chgrp/basic: Don't assume that creating a file gives it + group $g1. + + * tests/chgrp/Makefile.am (TESTS): Add recurse. + +2000-12-15 Jim Meyering + + * src/chown-core.h [enum Dereference_symlink] (dereference): Rename + from change_symlinks. + * src/chown-core.c: Declare lstat. + Rename change_symlinks member to `dereference' and use the DEREF_* + enum values. + (describe_change): Merge the chgrp and chown switch statements. + Use xmalloc to form the `user:group' string. + (change_file_owner): Record (and later, use) is_symlink and is_directory + from the lstat stats, in order to control whether we operate on symlinks + and whether (with -R) we traverse symlinks to directories. + When dereferencing, use open/fchown (rather than chown) on symlinks. + * src/chown.c (main): Reflect renaming: s/dereference/change_symlinks/. + * src/chgrp.c (main): Likewise. + + * src/chown-core.c (describe_change): Use `:' (not `.') to separate the + username and group in messages evoked by the --verbose and --changes + options. + +2000-12-09 Jim Meyering + + * src/Makefile.am (noinst_HEADERS): Add chown-core.h. + (chown_SOURCES): Define. + (chgrp_SOURCES): Define. + + * src/chgrp.c: Include "chown-core.h". + [enum Change_status, enum Verbosity]: Remove declarations. + Remove decls of globals that are now part of struct Chown_option. + Remove decl of xstat. + (describe_change): Remove function. + (change_file_group): Likewise. + (change_dir_group): Likewise. + (parse_group): Don't set global, groupname, here... + (main): ... instead, initialize `chopt.group_name' here. + Initialize chopt and update uses of the now-members. + Set group_name also when it's obtained via a --reference=FILE option. + Call change_file_owner (with -1 for uids), not change_file_group. + + * src/chown.c: Don't include pwd.h or grp.h -- no longer needed. + Include "chown-core.h". + [enum Change_status, enum Verbosity]: Remove declarations. + Remove decls of globals that are now part of struct Chown_option. + (describe_change): Remove function. + (change_file_owner): Likewise. + (change_dir_owner): Likewise. + (main): Initialize chopt and update uses of the now-members. + Set user_name and group_name also when they're obtained via a + --reference=FILE option. + Pass `chopt' to change_file_owner. + + * src/chown-core.c: Include , , and "xalloc.h". + [!_POSIX_VERSION]: Declare getgrnam and getgrgid. + (gid_to_name): New function. + (uid_to_name): Likewise. + (chopt_free): Likewise. + + Factor out code that's common to chgrp.c and chown.c. + * src/chown-core.h: New file. + * src/chown-core.c (chopt_init): New function. + (describe_change): Extracted/combined from chgrp.c and chown.c. + (change_dir_owner): Likewise. + (change_file_owner): Likewise. + * po/POTFILES.in: Add src/chown-core.c. + + * configure.in (AC_OUTPUT): Add tests/chgrp/Makefile. + * tests/Makefile.am (SUBDIRS): Add chgrp. + * tests/chgrp: New directory. + * tests/chgrp/basic: New test. + * tests/chgrp/deref: Likewise. + * tests/chgrp/Makefile.am: New file. + + * src/chown.c (change_file_owner): Restore special file permission + bits, since calling chown resets them on some systems. + Reported by Matt Perry. + +2000-12-08 Andreas Schwab + + * tests/mv/mv-special-1: Don't make the success of the test depend + on the order in which directory entries are processed. + +2000-12-03 Jim Meyering + + * src/ls.c (gobble_file) [USE_ACL]: Set have_acl member unconditionally + to avoid uninitialized memory reference via FILE_HAS_ACL. + + * Makefile.maint (alpha): Use rsync rather than scp, so the destination + file is created only after the successful completion of the copy. + +2000-12-02 Jim Meyering + + * tests/ls/Makefile.am (TESTS): Add follow-slink. + * tests/ls/follow-slink: New file. + +2000-12-01 Paul Eggert + + * src/ls.c (gobble_file): Do not fall back on lstat if stat + fails; POSIX.2 does not allow this. Invoke acl only on + non-symlinks, and only if lstat or stat succeeds. + +2000-12-02 Jim Meyering + + * configure: Regenerate using the very latest version (in CVS) of + autoconf. + + * tests/dd/skip-seek: Remove test #2, now that support for the + `B' suffix is gone. + * tests/dd/Makefile.am (TESTS): Add skip-seek2 + * tests/dd/skip-seek2: New file. + +2000-12-01 Paul Eggert + + * src/dd.c (skip, dd_copy): Use ssize_t to store result of + safe_read, to avoid overflow e.g. on 64-bit Solaris sparc. + (dd_copy): Remove unnecessary cast. + +2000-12-01 Paul Eggert + + * doc/fileutils.texi: Remove B suffix. Document how to have + the desired effect without it. + + * src/dd.c: Undo most of the changes since 2000-11-24, since we've + documented a standard way to do it. + (skip_bytes, seek_bytes): Remove. + (usage): Remove B suffix. + (scanargs, skip, dd_copy, main): Remove support for B suffix. + +2000-11-28 Jim Meyering + + * src/mkdir.c (main): Remove any trailing slash unconditionally. + Reported by Volker Borchert. + * tests/mkdir/t-slash: Add a test for this. + +2000-11-27 Jim Meyering + + * Version 4.0.33. + + * tests/touch/no-rights: Use touch with `-d tomorrow' to avoid a + race condition. + + * tests/Fetish.pm (_compare_files): New function. + (_process_file_spec): Likewise. + (_at_replace): Likewise. + (run_tests): Support new keywords, AUX and CMP and associated + syntax and semantics. + + * config.sub: Likewise. + * config.guess: Likewise. + +2000-11-26 Jim Meyering + + * src/dd.c (skip): Perform the `records < blocksize' test + at the top of the loop, not at the bottom. + +2000-11-26 Paul Eggert + + * src/dd.c (skip): New arg COUNT_BYTES. Read with BLOCKSIZE + bytes, but consider RECORDS to be a byte count if COUNT_BYTES + is nonzero. + +2000-11-25 Paul Eggert + + * doc/fileutils.texi: Document seek=nB and skip=nB. + + * src/dd.c (skip_bytes, seek_bytes): Now booleans, not counts. + (seek_records): Renamed from seek_record, for consistency with + skip_records and max_records. All uses changed. + + (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB + and skip=nB. + (enum Unit, Unit): Remove. + (skip, dd_copy, main): Undo most recent change. + (dd_copy, main): Pass blocksize of 1 as appropriate when + skip_bytes or seek_bytes is nonzero. + (main): Rework ftruncate failure diagnostic to always use byte count. + +2000-11-25 Jim Meyering + + * src/dd.c: Add new options, bskip and bseek. + Based on a patch from Chris Sylvain. + * tests/dd/skip-seek: New tests. + * tests/dd/Makefile.am (TESTS): Add skip-seek. + +2000-11-24 Paul Eggert + + * src/dd.c (S_TYPEISSHM): New macro. + (main): Report failed fstat. + Complain only when ftruncate fails on a regular file, + a directory, or a shared memory object. + +2000-11-24 Jim Meyering + + * src/dd.c: Declare a pointer parameters to be `const' as appropriate. + + * src/dd.c (main): Use ftruncate only on regular files. + Based on a patch from Michael Stone. + Reported by andras@kolumbus.fi at http://bugs.debian.org/77174. + +2000-11-23 Jim Meyering + + * src/df.c (show_point): Before accepting an entry as a match, make + sure that the mount directory exists and has the required device number. + Before, e.g., `df /floppy' would mistakenly report on the root + partition if /floppy were not listed in /etc/mtab but / was. + Patch from Eirik Fuller (http://bugs.debian.org/76923). + + * src/chmod.c (mode_changed): New function. + (change_file_mode): Use it to determine accurately when -c should + make chmod announce there's been a change. + Based on a patch from Michael Stone. + Reported by Kai Henningsen as Debian bug #77349. + + * tests/chmod/c-option: New test for the above fix. + * tests/chmod/Makefile.am (TESTS): Add c-option + + * tests/sticky-check: New file. Factored out of tests/mkdir/parents. + * tests/Makefile.am (EXTRA_DIST): Add sticky-check. + * tests/mkdir/parents: Source sticky-check instead of open-coding it. + +2000-11-19 Jim Meyering + + * tests/chmod/equal-x: Update to use its own directory, and better trap. + +2000-11-18 Paul Eggert + + * src/ls.c (BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION, + INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION, + SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum + values, to ensure that option values can't collide with chars. + (long_options, decode_switches): Use them. + +2000-11-18 Paul Eggert + + * src/sys2.h (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum + constants rather than macros. Use values that cannot conflict + with C characters or with -1, CHAR_MAX + 1, etc. + +2000-11-18 Jim Meyering + + * src/du.c (count_entry): Don't omit the size of a directory entry + merely because we couldn't `chdir' into it. That would give subtly + different results in some cases. Reported by Mattias Wadenstein + via Michael Stone. + + * src/ls.c: Revert change of 2000-11-11. It inadvertently change + the output format of `ls -l --full-time'. + + * src/mkdir.c (main): When failing to create a directory, give only + one diagnostic, not two. Reported by Volker Borchert. + + * src/mkdir.c (main): With --parents, remove any trailing slashes + from the argument to the final mkdir call. Required for NetBSD. + Reported by Volker Borchert. + * tests/mkdir/t-slash: New test for this. + * tests/mkdir/Makefile.am (TESTS): Add t-slash. + + * tests/mv/mv-special-1: Create and `cd' into temporary directory + before anything else. Reported by Volker Borchert. + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + +2000-11-17 Jim Meyering + + * Makefile.am (.NOTPARALLEL): Remove target. + * GNUmakefile (.NOTPARALLEL): ... put it here instead, since this + file is common to these packages: fileutils, sh-utils, textutils. + + * Makefile.am (.NOTPARALLEL): New target. Prevent unwanted parallelism. + Suggestion from Ulrich Drepper. + * po/Makefile.in.in (Makefile): Likewise. + + * Makefile.maint (sha1): Define. + (announcement): Include SHA1 digest of .tar.gz file. + +2000-11-14 Jim Meyering + + * tests/mkdir/perm: Add an `echo' so that the input to the sed command + is NL-terminated. Otherwise, Solaris' /bin/sed generates no output. + Reported by Vin Shelton. + +2000-11-13 Paul Eggert + + * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should + be tested with #ifdef, not with #if. + +2000-11-12 Jim Meyering + + * src/ls.c (print_long_format): Remove obsolete comment. + From Paul Eggert. + + * doc/texinfo.tex: Update from master repository. + +2000-11-11 Paul Eggert + + * src/ls.c (): Include if HAVE_LANGINFO_H. + (DATE_FMT_LANGINFO): New macro, taken from sh-utils/src/date.c. + (print_long_format): Use it to determine "date" format. + Do not wrap "%b %e %Y" and "%b %e %H:%M" in _(), as it results in + incorrect behavior when LC_ALL is unset, LC_TIME is "C", and + LC_MESSAGES or LANG is set to something disagreeing with the POSIX + locale. + +2000-11-11 Jim Meyering + + * Version 4.0.32. + + * Makefile.maint (GZIP_ENV): Define to --no-name, so the timestamp + is not included in the .tar.gz file. + + * tests/mkdir/perm (tests): Use `empty' (instead of just blanks) to + indicate no `-m' option. Using just blanks wasn't portable to + Solaris2.5.1's /bin/sh. + + * tests/mkdir/perm: Don't put a newline in IFS; that's not portable to + NetBSD's /bin/sh. Instead, filter newlines and leading/trailing blanks + out of `tests' before the `set -'. + + * Makefile.maint (announcement): Limit depth of ChangeLog `find' to 2. + + * src/ls.c (print_long_format): Wrap the `--full-time' date format + string in _(...), so it too may be internationalized. + Suggestion from Jungshik Shin. + +2000-11-10 Jim Meyering + + * src/touch.c (main): Interpret a lone numeric argument of 8 or 10 + digits as a file name, rather than as a date/time in the obsolescent + `MMDDhhmm[YY]' format. Reported by Wenjun Zheng. + * tests/touch/obsolescent: New test for this. + * tests/touch/Makefile.am (TESTS): Add obsolescent. + +2000-11-06 Jim Meyering + + * tests/cp/cp-parents: Move mkdir tests into ../mkdir. + + * doc/fileutils.texi: Use Free Documentation Licence. + Change GNU to @sc{gnu} in many places. + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + * man/help2man: Update from latest version: 1.23. + + * src/mkdir.c: Do not set the permissions of the final directory + component if it was not just created. + Based on a patch from Volker Borchert. + + * tests/rwx-to-mode: New file. + * tests/Makefile.am (EXTRA_DIST): Add rwx-to-mode. + * tests/mkdir/parents: New test for the above mkdir.c fix. + * tests/mkdir/Makefile.am (TESTS): Add parents. + (TESTS_ENVIRONMENT): Define srcdir=$(srcdir). + +2000-11-02 Won-kyu Park + + * src/df.c (print_header): Mark strings for translation. + +2000-11-05 Jim Meyering + + * Version 4.0.31. + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + + * src/mkdir.c (main): Use make_dir instead of using mkdir directly. + Diagnose as failure when mkdir tries to create (without the + --parent (-p) option) a directory that already exists. + * tests/cp/cp-parents: Add a test for the above fix. + + * tests/mv/mv-special-1: Clean up this test. + +2000-11-01 Jim Meyering + + * Version 4.0.30. + + * src/chmod.c (main): Better diagnostics. + +2000-10-31 Jim Meyering + + * tests/lang-default: Add all the internationalization-related + variable names autoconf uses. Set and export them in a loop. + + `mkdir -p' would create parent directories with permissions + that did not account for the umask. [introduced with the + 2000-09-30 change that became part of fileutils-4.0.28] + * src/mkdir.c: Include dirname.h. + Compute the parent directory `mode' unconditionally, effectively + as `$(umask -S),u+wx'. + Use make_path to create only the parent directories, thus using + the same code, both with and without -p, to create the final + component in each file name. Reported by Bob Proulx. + + Add tests for the above fix. + * tests/cp/cp-parents: Add some permission tests. + * tests/mkdir/perm: Fix the test so it actually does something. + Run each test also with mkdir's `-p' option and check permissions + on the parent directories. + +2000-10-23 Paul Eggert + + * doc/getdate.texi: Use @sc where appropriate. Document the + ranges of supported times more precisely. Correct menu + spacing. Document old Latin 12m/12pm tradition. Remove list + of alphabetic time zone names, as it wasn't correct and people + shouldn't be relying on it anyway. Relative items also + account for non-DST adjustments. Fix some misspellings. + +2000-10-30 Jim Meyering + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + +2000-10-29 Jim Meyering + + * Version 4.0.29. + + * src/cp.c (do_copy): When constructing dst_path for use with the + --parents option, first remove any trailing slashes from the command + line argument. Otherwise, tests/cp/cp-parent would fail on NetBSD. + + * tests/cp/cp-parents: Add a test. + + * src/ls.c (DT_INIT): Define. + [enum filetype]: Remove the #ifdef, and use DT_INIT on the + initializers instead. `unknown' was undefined for some systems. + Reported by John David Anglin. + + * tests/lang-default (LC_COLLATE): Set it to the empty string and + export it. Otherwise, tests/cp/cp-mv-backup would fail e.g., when + LC_COLLATE was set to en. Reported by Vin Shelton. + +2000-10-28 Jim Meyering + + * src/ls.c (main): In call to gobble_file with `"."', use `directory' + as the type, not `unknown'. + [enum filetype] (arg_directory): Rather than `100', use + a number that should never conflict with another DT_* value. + From Ulrich Drepper. + + * Version 4.0.28. + + Make `ls' a lot more efficient on systems (e.g., linux-2.4.*) + that store file type information in directory entries. + + * src/ls.c [enum filetype] (unknown): + Add members (as yet unused): + (HAVE_STRUCT_DIRENT_D_TYPE): Define. + (format_needs_type): New global. + (main): Set it. + (print_dir): Set `type' from directory entry, if possible. + (gobble_file): Add a parameter, TYPE. + Stat the file only if its type is unknown and we need the type. + Patch from Ulrich Drepper. + + Shred can now determine the size of a block devices (e.g. /dev/fd0) + by writing until a write operation fails. + + * src/shred.c: Include assert.h. + (fillrand): Add a parameter, size_max. + Adjust caller. + Add an assertion. + (dopass): Break out of the `for (;;)' loop if size < offset. + That can happen now that dopass is called with SIZE == -1. + (do_wipefd): Accept a length of zero only for a regular file. + If lseek fails or returns 0 for a non-regular file, let dopass + determine the length. + Inspired by a patch from Alan Iwi. + + * tests/Makefile.am (EXTRA_DIST): Add lang-default. + + * tests/rm/hash: Factor out the expensive-test-checking code, ... + * tests/expensive: ... into this new file. + * tests/cp/perm: Disable this test by default; it's expensive. + Mark this as an expensive test. + * tests/Makefile.am (EXTRA_DIST): Add expensive. + + * doc/fileutils.texi (shred invocation): Give two examples. + +2000-10-26 Jim Meyering + + * doc/getdate.texi (Authors of getdate): Add Paul Eggert. + +2000-10-23 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add .prev-version. + +2000-10-22 Jim Meyering + + * src/cp.c (make_path_private): Add a FIXME comment. + + * tests/lang-default: New file. Set LANG, LC_ALL, and LANGUAGE to '' + (rather than to `C') and export them into the environment. + Suggestion from Bruno Haible. + + * tests/cp/backup-is-src: Source lang-default rather than open-coding + the setting/exporting of LANG, LC_ALL, and LANGUAGE. + * tests/cp/cp-mv-backup: Likewise. + * tests/cp/same-file: Likewise. + * tests/cp/slink-2-slink: Likewise. + * tests/cp/symlink-slash: Likewise. + * tests/ln/sf-1: Likewise. + * tests/ls/symlink-slash: Likewise. + * tests/ls/time-1: Likewise. + * tests/mv/backup-is-src: Likewise. + * tests/mv/diag: Likewise. + * tests/mv/force: Likewise. + * tests/mv/hard-link-1: Likewise. + * tests/mv/i-2: Likewise. + * tests/mv/into-self: Likewise. + * tests/mv/into-self-2: Likewise. + * tests/mv/into-self-3: Likewise. + * tests/mv/mv-special-1: Likewise. + * tests/mv/part-symlink: Likewise. + * tests/mv/partition-perm: Likewise. + * tests/rm/r-1: Likewise. + * tests/rm/r-2: Likewise. + +2000-10-21 Jim Meyering + + * tests/cp/cp-parents: New test. + * tests/cp/Makefile.am (TESTS): Add cp-parents; + +2000-10-19 Jim Meyering + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + * depcomp: Likewise. + +2000-10-18 Jim Meyering + + * tests/mv/part-symlink: Make sure the programs use C-locale formats + and translations. Bruno Haible reported that this test would fail + when using other locales, because ls printed a translation of `total'. + +2000-10-16 Jim Meyering + + * src/ls.c (print_long_format): Wrap date format strings in _(...) + so they may be internationalized. Suggestion from Christian Rose. + +2000-10-13 Jim Meyering + + * src/mv.c (rm_option_init): Remove FIXME-maybe comment. + +2000-09-30 Jim Meyering + + * tests/du/two-args: Update to use newer template. + + * src/install.c: Remove big, option-describing comment block. + (main): Rename local `symbolic_mode' to `specified_mode'. + + * src/mkdir.c (main): Don't set the umask to 0 and hand-apply + the previously-set umask unconditionally. Do that only when a + MODE has been specified. Otherwise, call mkdir with the full + creation mask (0777 or 0666) and let the kernel apply the umask. + The difference shows up only on file systems with ACL support + when the containing directory has a default ACL. + Patch by Andreas Gruenbacher. + (main): Rename local `symbolic_mode' to `specified_mode'. + * src/mknod.c (main): Likewise (but `call mknod', not mkdir). + Also, when MODE is specified, call chmod to ensure that the + permission bits are set as specified even when the containing + directory has a default ACL. + Patch by Andreas Gruenbacher. + * src/mkfifo.c (main): Likewise (but `call mkfifo', not mkdir). + Patch by Andreas Gruenbacher. + + * tests/mkdir/perm: New test. + * tests/mkdir/Makefile.am (TESTS): Add perm. + +2000-08-17 Andreas Gruenbacher + + * src/chmod.c (change_file_mode): Perform the chmod even if the + file mode permission bits are the same as those that should be set. + Omitting the chmod call would be alright with minimal 1003.1e DS17 + ACLs, but eventually there may be other permissions in addition to + rwx. E.g., add and delete for directories, and something analogous + to NT's take ownership permission. + +2000-09-25 Jim Meyering + + * tests/cp/same-file: Don't use `diff -u'. It's not portable. + Reported by Christian Krackowizer. + * tests/cp/same-file: Run `diff -c' only if cmp finds a difference. + * tests/mv/part-symlink: Likewise. And clean up. + + `shred --exact file1 file2' wouldn't touch `file1' + * src/shred.c (long_opts): --exact doesn't take an argument. + Reported by Alan Iwi. + * tests/shred/exact: New test for this. + * tests/shred/Makefile.am (TESTS): Add exact. + + * Makefile.maint (PREV_VERSION): Get the value from a file, rather + than trying to derive it from the current version number. + This is much more robust. + (alpha): Record just-released version number in `.prev-version', + and commit (post-tag). + + * Version 4.0.27. + +2000-09-24 Paul Eggert + + * doc/fileutils.texi: Update to more closely match changes in 4.0z. + * src/cp.c (usage): Match revised documentation better. + +2000-09-24 Jim Meyering + + * src/cp.c (main): Tweak a relatively new diagnostic. + +2000-09-23 Jim Meyering + + * tests/ls/time-1: Output more information when a test fails. + +2000-09-22 Jim Meyering + + * src/install.c (cp_option_init): Once again make it so install always + unlinks an existing destination before trying to open it for writing. + Otherwise, installing onto a running shared library would make the + running program malfunction. + Reported by Dan Pascu via Michael Stone. + + * src/mv.c (do_move): Moving a directory specified with a trailing + slash from one partition to another, and giving it a different + name at the destination would cause mv to get a failed assertion. + Reported by Michael Stone. + (strip_trailing_slashes_2): Move function definition to precede + new first use. + * tests/mv/part-rename: New test for the above fix. + * tests/mv/Makefile.am (TESTS): Add part-rename. + + * src/copy.c (copy_internal): Don't try to unlink directories when + using --remove-dest with -R. + * tests/cp/dir-rm-dest: New test for the above fix. + * tests/cp/Makefile.am (TESTS): Add dir-rm-dest. + +2000-09-19 Jim Meyering + + * doc/fileutils.texi (cp invocation): Describe how --force works. + Update description of -P (soon to change meaning to conform w/POSIX). + Describe --remove-destination. + + * src/cp.c (main): When used with --force, each of the --link and + --symbolic-link options now implies --remove-destination. + Reported by Miles Bader via Mike Stone. + * tests/cp/link: New file. Test for the above fix. + * tests/cp/same-file: Adjust for this change in behavior. + +2000-09-15 Volker Borchert + + * tests/Makefile.am (check-root, root-hint): New targets. + (check-recursive): Depend on root-hint. + * Makefile.am (check-root): New target. + +2000-09-16 Jim Meyering + + * doc/perm.texi (Changing Special Permissions): Remove this statement: + ``a' in the USERS part of a symbolic mode does not cause the special + permissions to be affected'... It doesn't reflect what the code does + and isn't required by POSIX. Reported by aldomel@ix.netcom.com via + Mike Stone. + +2000-09-15 Jim Meyering + + * config.sub: Update from master repository. + +2000-09-10 Jim Meyering + + * tests/cp/cp-mv-backup (LC_ALL): Set to `C' and export to ensure + that `ls' sorts the same way for everyone. Reported by Vin Shelton. + + * Makefile.maint (b_host): Use freefriends.org, not tug.org. + +2000-09-09 Jim Meyering + + * Makefile.maint (announcement): Use a stricter regexp for the + previous version. + + * Version 4.0z. + + * tests/cp/special-bits: New file. + * tests/cp/Makefile.am (TESTS): Add special-bits. + (TESTS_ENVIRONMENT): Propagate $MAKE into environment, for special-bits. + + * src/copy.c (SAME_OWNER, SAME_GROUP, SAME_OWNER_AND_GROUP): Define. + (copy_internal): Avoid calling chown if we know it's not necessary. + + * src/copy.c (copy_internal): Call chmod also if we've made the + preceding chown call and we're supposed to preserve some special + permission bit(s) that would have been reset by chown. + Reported by Greg Louis. + +2000-09-08 Jim Meyering + + * src/mkdir.c (S_IRWXUGO): Remove definition. + * src/sys2.h (S_IRWXUGO): Define here, instead. + +2000-09-07 Jim Meyering + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + +2000-09-05 Jim Meyering + + * tests/mv/part-symlink: Redirect stdout to stderr before trying to + remove the temp directory. Otherwise, the `rm -rf' would get an + error because the output file wouldn't be closed and the directory + wouldn't be `empty'. + * tests/cp/same-file: Likewise. + + * tests/cp/same-file: Remove the `cp -dl sl1 sl2' case, + since it's no longer portable (hard link to a symlink). + Likewise for the `cp -bdl symlink foo' case. + + * config.guess: Update from master repository. + +2000-09-04 Jim Meyering + + * src/cp.c: Move declaractions of lstat, stat, and rpl_lstat + as well as the definition of lstat from here... + * src/copy.h: ...to here. + * src/copy.c: Remove declaration of lstat, now that it's in copy.h. + + * tests/mv/force: mv's --force (-f) option is no longer needed for + this test, now that all it does is cancel --interactive (-i). + + * tests/cp/same-file: Add new tests using cp's --rem option. + Reflect the fact that cp's -f option no longer causes cp to remove the + destination file before trying to open it. + Reflect the fact that `cp -bdl' now makes a backup when copying a + symlink onto the file it points to (FIXME: look into this, and why + cp -bl does *not* do so). + + * src/ln.c (do_link): Tweak diagnostics. + +2000-09-03 Jim Meyering + + * src/install.c (cp_option_init): Initialize new members. + + * src/cp.c (enum): Add UNLINK_DEST_BEFORE_OPENING. + [long_options]: Add an entry for --remove-destination. + (usage): Describe --remove-destination. + (do_copy): Use unlink_dest_after_failed_open member, not `force.' + (cp_option_init): Initialize new members. + (main): Handle UNLINK_DEST_BEFORE_OPENING (aka --remove-destination). + + * src/mv.c: Remove obsolete comment block. + (cp_option_init): Initialize new members. + (usage): Reflect the fact that --force (-f) relates only to whether + mv prompts. + (main): Remove uses of old `force' option member. + + * src/install.c (cp_option_init): Reflect + + `force' no longer means unlink-dest-before-opening + * src/copy.h (struct cp_options) [force]: Remove member. + [unlink_dest_before_opening]: Add member. `cp -f' and `mv -f' used to + do this. Now, you must use `cp --remove-destination' to get this + behavior. Now, `cp -f' and `mv -f' work as required by POSIX. + [unlink_dest_after_failed_open]: Add member. + Paul Eggert reported that `cp -f' removes an existing destination + file unconditionally, and that is contrary to POSIX. + + * src/copy.c (same_file_ok): New function, extracted from copy_internal, + and rewritten. + (copy_internal): Unlink destination file when unlink_dest_before_opening + option is set, and when the source is neither a regular file nor a + directory. + + * tests/mv/Makefile.am (TESTS): Add part-symlink. + + * src/ls.c: Use strcoll (not strcmp) when comparing file names. + Suggestion from Ulrich Drepper. + +2000-08-27 Jim Meyering + + * src/copy.c (copy_reg): New parameters: X and NEW_DST. + Remove the SPARSE_MODE parameter. Update caller. + Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when copying + a regular source file and the destination file exists; upon failure, + unlink that existing file, then open again, but with O_WRONLY|O_CREAT. + (copy_internal): `force' is not related to interactive; remove + the conjunct. + Remove the entire `else if (x->force)' block; justifying + removal of the non-directory part is easy: POSIX requires we try + to open an existing regular file, so we can't unlink it beforehand. + The part that changes the mode on a directory to allow overwriting + isn't necessary. + + * src/copy.c (copy_reg): Rename two goto labels. + (copy_internal): Set `new_dst' when the move_mode rename fails, + since we then unlink the destination file. + + * src/cp.c (usage): --force is independent of --interactive. + +2000-08-24 Jim Meyering + + Put back the kludge. It's necessary after all. + * src/dd.c (buggy_lseek_support): New function. + (skip): Use it. + Frank Adler reported that although _llseek returns 0, lseek + erroneously returns an offset suggesting the operation succeeded + even though it fails. + + * install-sh: Double quote as needed, to protect against arguments + containing spaces or shell metacharacters. Reported by Bruno Haible. + +2000-08-23 Jim Meyering + + * tests/dd/not-rewound: New test, for the SEEK_CUR vs. SEEK_SET part + of the last change. Based on Paul's example. + * tests/dd/Makefile.am (TESTS): Add not-rewound. + +2000-08-22 Paul Eggert + + * src/dd.c (skip): + Assume lseek failed if it returned zero, since a zero return is + impossible and some buggy drivers return zero. + + Use SEEK_CUR rather than SEEK_SET; this fixes a bug when the + file descriptor is not currently rewound. + +2000-08-23 Jim Meyering + + * src/dd.c: Back out my last change. Paul's (above) is better. + +2000-08-22 Jim Meyering + + Don't even try to use lseek on character devices. + * src/dd.c (buggy_lseek_support): New function. + (skip): Use it. + Reported by Martin Gallant via Michael Stone. + +2000-08-21 Jim Meyering + + * tests/cp/same-file: Clean up traps. Create files in a subdir. + + * install-sh (oIFS): Remove unmatched double quote, left over from + my 2000-08-12 change. From J. David Anglin. + + * Makefile.maint (wget-update): Get the latest version of depcomp. + + * depcomp: Update from automake. + +2000-08-20 Jim Meyering + + * Version 4.0y. + + Add support for cp's new POSIX-mandated -H and -L options. + * src/copy.h (enum Dereference_symlink): Define. + (struct cp_options) [dereference]: Change type to Dereference_symlink. + * src/copy.c: Declare lstat. + (copy_dir): Set `xstat' member to lstat so that with `-H' we don't + follow symlinks found via recursive traversal. + Update uses of `dereference' to compare against new enum member names. + * src/cp.c (long_opts): Add --dereference, -L. + (usage): Describe -L and -H. + (cp_option_init): Initialize to DEREF_UNDEFINED, not `1'. + (main): Add `H' and `-L' to getopt spec string. + [case 'a']: Initialize `dereference' to DEREF_NEVER, not 0. + [case 'd']: Likewise. + [case 'H']: New case. + [case 'L']: New case. + [case 'R']: Don't set dereference to `0' here. + If it's not yet defined, set x.dereference to DEREF_NEVER + if -R was specified, else set it to DEREF_ALWAYS. + Set x.xstat accordingly for -H. + * doc/fileutils.texi (cp invocation): Describe -H and -L. + * src/mv.c (cp_option_init): Initialize to DEREF_NEVER, not `0'. + * src/install.c (cp_option_init): Initialize to DEREF_ALWAYS, not `1'. + + * tests/cp/Makefile.am (TESTS): Add cp-HL. + * tests/cp/cp-HL: New test. + + * src/du.c (print_totals): Rename global from opt_combined_arguments. + +2000-08-17 Paul Eggert + + * src/copy.c (DO_CHOWN): Do not make a special case for non-root. + POSIX.2 requires that cp -p and mv attempt to set the uid of the + destination file, even if you're not root. This affects behavior + only on hosts that let you give files away via chmod. + * NEWS: Describe the above change. + +2000-08-15 Jim Meyering + + * src/du.c (count_entry): Remember the current directory also for `.' + and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu. + * tests/du/two-args: Add tests for this. + +2000-08-14 Jim Meyering + + * src/copy.c (copy_reg): Move declaration of local, `n_read', into + the scope where it's used. + (copy_internal): In calling copy_reg, pass not the raw `src_mode', + but the possibly-umask-relative mode, `get_dest_mode (x, src_mode)'. + +2000-08-13 Jim Meyering + + * src/copy.c (get_dest_mode): Rename from new_nondir_mode. + Honor the umask for `cp', but not for `mv' or `cp -p'. + (copy_reg): New 4th parameter, dst_mode. Pass it as 3rd arg. to open. + (copy_internal): Change type of locals `src_mode' and `src_type' from + int to mode_t. + Remove unnecessary local, `fix_mode'. + Combine two if-stmts into one. + Pass `src_mode' as 4th arg to copy_reg. + If we've just created a new regular file, return early, skipping the + chmod step. copy_reg now sets permissions of such files upon creation. + Use get_dest_mode, so there's just one chmod call here. + + * tests/cp/Makefile.am (TESTS): Add perm. + * tests/cp/perm: New tests, to help ensure the above didn't + change anything. + +2000-08-12 Jim Meyering + + * tests/mv/into-self-2: Remove test for the VERSION_CONTROL and/or + SIMPLE_BACKUP_SUFFIX envvars. Source ../envvar-check instead. + * tests/mv/i-2: Likewise. + * tests/mv/to-symlink: Likewise. + * tests/cp/slink-2-slink: Likewise. + * tests/mv/partition-perm: Likewise. + * tests/cp/cp-mv-backup: Likewise. + + * tests/Makefile.am (EXTRA_DIST): Add envvar-check. + * tests/envvar-check: New file. + + * install-sh: Remove trailing blanks. + Output diagnostics to stderr, not stdout. + Remove many useless curly braces and double quotes. + +2000-08-11 J. David Anglin + + * install-sh: Improve error handling. + Do the job even when the target file is `busy' on systems + that don't allow such files to be unlinked. + +2000-08-12 Jim Meyering + + * README: Remove note about how installation can fail and the + work-around, now that it's all automated. + +2000-08-07 Paul Eggert + + * src/cp.c (usage, main): For cp -P messages, mention the new + behavior as well as the old. + +2000-08-07 Paul Eggert + + Standardize on "memory exhausted" instead of "Memory exhausted" + or "virtual memory exhausted". + Invoke xalloc_die instead of printing our own message. + * src/chmod.c (main): Likewise. + * src/copy.c (copy_dir, copy_internal): Likewise. + * src/cp.c (do_copy): Likewise. + * src/dircolors.c (xstrndup): Likewise. + * src/install.c (main): Likewise. + * src/ln.c (do_link): Likewise. + * src/mkdir.c (main): Likewise. + * src/mkfifo.c (main): Likewise. + * src/mknod.c (main): Likewise. + * src/mv.c (movefile): Likewise. + * src/remove.c (remove_cwd_entries, rm): Likewise. + * src/shred.c (quotearg_colon, xmalloc): + "virtual memory exhausted" -> "memory exhausted" + +2000-08-07 Jim Meyering + + * src/cp.c (enum) [PARENTS_OPTION]: New member. + (long_opts): Update "parents" and deprecated "path" entries to use + `PARENTS_OPTION', not `P'. + (usage): Update --help output. + (main): Warn that the meaning of `-P' will soon change. + +2000-08-06 Jim Meyering + + * doc/fileutils.texi (cp invocation) [-r]: Remove inaccurate mention of + `non-symbolic links'. + +2000-08-05 Jim Meyering + + * config.guess: Update from master repository. + * config.sub: Likewise. + + * Regenerate build/config framework to use the latest CVS versions + of automake and autoconf. + +2000-07-31 Jim Meyering + + * src/shred.c [!HAVE_CONFIG_H]: Use `virtual memory exhausted', not + `Memory exhausted'. + +2000-07-30 Jim Meyering + + * src/sys2.h (ISPRINT): Undef before defining to avoid warning. + + * src/copy.c (copy_internal): Quote the file names that are displayed + with --verbose and --backup. + * src/remove.c (remove_file): Quote the file names that are displayed + with --verbose. + (remove_dir): Likewise. + * tests/mv/mv-special-1: Add quote marks to match new behavior. + * tests/rm/r-1: Likewise. + * tests/rm/r-2: Likewise. + + * src/df.c: Convert "`%s'" in format strings to "%s", and wrap each + corresponding argument in a `quote (...)' call. + * src/dircolors.c: Likewise. + * src/du.c: Likewise. + * src/mkdir.c: Likewise. + * src/mkfifo.c: Likewise. + * src/mknod.c: Likewise. + * src/shred.c: Likewise. + * src/rmdir.c: Likewise. + * src/cp-hash.c: Likewise. + + * src/chgrp.c: Convert "`%s'" in format strings to "%s", and wrap each + corresponding argument in a `quote (...)' call. + Add more precise diagnostics. + * src/chmod.c: Likewise. + * src/chown.c: Likewise. + + * src/remove.c (remove_cwd_entries): Quote one more file name. + + * src/help-version: Remove file. Move it to ... + * tests/help-version: ...here + * tests/Makefile.am (TESTS): Set to help-version. + (TESTS_ENVIRONMENT): Define. + (EXTRA_DIST): Add $(TESTS). + * src/Makefile.am (EXTRA_DIST): Remove help-version. + (TESTS): Remove definition. + (TESTS_ENVIRONMENT): Remove definition. + +2000-07-24 Bruno Haible + + * src/ls.c: Include , , , . + (quote_name): Use mbrtowc to step through the filename string while + replacing nonprintables with question marks. Return the screen width, + not the strlen length. Do no output if the out stream is NULL. + (length_of_file_name_and_frills): Use the quote_name return value. + +2000-07-25 Jim Meyering + + * src/chgrp.c (change_file_group): Save errno from a possibly failed + chown, and use that later. Otherwise, errno itself could be clobbered + before used. + * src/chmod.c (change_file_mode): Likewise. + * src/chown.c (change_file_owner): Likewise. + + * src/mv.c (main): Remove unnecessary "%s" argument. + + * src/ln.c: Convert "`%s'" in format strings to "%s", and wrap each + corresponding argument in a `quote (...)' call. + Add more precise diagnostics. + * src/mv.c: Likewise. + * src/cp.c: Likewise. + * src/touch.c: Likewise. + +2000-07-23 Jim Meyering + + * Version 4.0x. + + * src/dd.c (main): Give a better diagnostic for e.g., + `dd if=/dev/fd0 seek=100000000000'. + Convert "`%s'" in format strings to "%s", and wrap each + corresponding argument in a `quote (...)' call. + Add many, more precise diagnostics. + + * src/remove.c (ASSIGN_STRDUPA): Remove macro definition. + * src/sys2.h (ASSIGN_STRDUPA): New macro (moved here from remove.c). + + Fix cp so that `cp -r DIR1/ DIR2' works once again. + * src/cp.c (ASSIGN_BASENAME_STRDUPA): New macro. + (do_copy): Use it here (so we always strip trailing slashes before + calling base_name). Reported by Branden Robinson via Michael Stone. + + Test for the above fix. + * tests/cp/Makefile.am (TESTS): Add dir-slash. + * tests/cp/dir-slash: New file. + +2000-07-17 Jim Meyering + + * Makefile.maint (WGET): Define. + (ftp-gnu): Define. + (wget-update): New rule, based on the one in autoconf. + + * src/shred.c (usage): Give a little more info. + Remove a FIXME comment. + + Avoid warnings. + * src/ls.c (struct bin_str): Declare `string' member to be `const'. + (put_indicator): Declare local `p' to be `const'. + +2000-07-15 Jim Meyering + + Begin converting "`%s'" in format strings to "%s", and wrap each + corresponding argument in a `quote (...)' call -- if there's only one. + If there are two or more, then use `quote_n (0, ...), + quote_n (1, ...), ...'. + + Here's the justification, from Paul Eggert (thanks, Paul): + + [Consider] the following, taken from fileutils/copy.c: + + error (0, errno, _("cannot create directory `%s'"), dst_path); + + Now, suppose dst_path is "/'\nrm: removing all files under `/" + (expressed in C string syntax). This will cause the user to see + the following delightfully ambiguous display: + + cp: cannot create directory `/' + rm: removing all files under `/' + + It would be better to rewrite the above line to be something + like this: + + error (0, errno, _("cannot create directory %s"), quote (dst_path)); + + using the definition of "quote" [in lib/quote.c]. That way, + the user will see the following unambiguous display instead: + + cp: cannot create directory `/\'\nrm: removing all files under `/' + + One might object that any user who asks to copy a file with + a weird name like that deserves to get confused. But this + is not a good objection, as the source of the string may not + be under the user's control, or even visible to the user. + + * src/copy.c: Adapt format strings and args as above. Include quote.h. + I have deliberately not changed the output of --verbose. + FIXME: maybe I should. + * src/cp.c: Likewise. + * src/remove.c: Likewise. + * src/install.c: Likewise. and improve a couple diagnostics. + +2000-07-13 Paul Eggert + + * NEWS: Describe --quoting-style=clocale. + + * doc/fileutils.texi: New clocale quoting style. + Undo the previous change to the locale quoting style. + +2000-07-09 Jim Meyering + + * config.guess: Update from FSF. + * config.sub: Likewise. + +2000-07-05 Paul Eggert + + * doc/fileutils.texi: Don't use ` and ' for quoting. + +2000-07-01 Jim Meyering + + * Version 4.0w. + + * tests/touch/dangling-symlink: Warn about the problem rather + than failing, on some very recent (at least 2.3.99) versions of + the Linux kernel. Suggestion from Ulrich Drepper. + * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Define host_triplet + for use in the dangling-symlink test. + +2000-06-28 Jim Meyering + + * tests/mv/i-2: Don't copy `out' into /tmp. + +2000-06-26 Paul Eggert + + Now that savedir.c has been cleaned up... + * src/chgrp.c (change_dir_group): Don't set errno before + invoking savedir, and assume that errno is nonzero if savedir fails. + * src/chmod.c (change_dir_mode): Likewise. + * src/chown.c (change_dir_owner): Likewise. + * src/copy.c (copy_dir): Likewise. + * src/du.c (count_entry): Likewise. + +2000-06-26 Paul Eggert + + * src/df.c (show_dev): Round disk usage percentage up, not to + nearest value. Use integer arithmetic if it's easy. Fix bug + when converting twos-complement negative values to floating point. + +2000-06-25 Jim Meyering + + * src/copy.c (copy_internal): Don't return immediately after a failed + copy_dir call -- otherwise, the failure to read a single file in a + source directory would cause the containing destination directory + not to have the owner and/or permissions set properly. + Reported by Piotr and Maciej Kwapulinski. + * tests/cp/fail-perm: Test for it. + * tests/cp/Makefile.am (TESTS): Add fail-perm. + + * Version 4.0v. + +2000-06-18 Jim Meyering + + * README-alpha: Update. + +2000-06-17 Jim Meyering + + * tests/install/basic-1: Don't fail (just exit 77) if strip doesn't + work. Suggestion from Ulrich Drepper. + Add canonical trap/mkdir/cd, plus exit portability cruft. + +2000-06-16 Jim Meyering + + * src/copy.c (copy_reg): Give a slightly better diagnostic upon + open failure. + +2000-06-15 Paul Eggert + + * NEWS, doc/fileutils.texi: df, du, and ls now round disk + usage up and disk free space down. + + * src/df.c (df_readable): New arg for rounding style. + Round negative numbers correctly. + (show_dev): Round disk usage up and disk free space down. + + * src/ls.c (print_dir, gobble_file, print_long_format, + print_file_name_and_frills): Round disk usage up. + * src/du.c (print_size): Likewise. + +2000-06-14 Andreas Schwab + + * tests/rm/r-1 (framework_failure): Initialize this instead of + test_failure. + +2000-06-12 Jim Meyering + + * Version 4.0u. + + * tests/rm/r-1: Clean up. + Be careful to remove temp directory upon interrupt. + + * src/mv.c (main): Give the correct diagnostic when using the + --target-dir=DIR option, but no arguments. + Patch from Michael Stone. Reported by Herbert Xu. + * tests/mv/diag: New test for this. + * tests/mv/Makefile.am (TESTS): Add diag. + +2000-06-08 Brian Youmans <3diff@gnu.org> + + * doc/perm.texi (Multiple Changes): Fix typo. + * doc/fileutils.texi: A few typos and minor formatting fixes. + * doc/getdate.texi: Likewise. + +2000-06-06 Jim Meyering + + * Makefile.maint (alpha_subdir): Factor out `gnu/fetish'. + +2000-06-04 Jim Meyering + + * Version 4.0t. + + * src/df.c (show_point) [HAVE_REALPATH && !HAVE_RESOLVEPATH]: + Cast undeclared `realpath' to char* to avoid warning. + +2000-06-03 Jim Meyering + + * src/install.c (usage): Document that -v is a synonym for --verbose. + * src/mkdir.c: Allow -v as synonym for --verbose, to be consistent + with other fileutils. + * src/rmdir.c: Likewise. + Suggestion from François Pinard. + +2000-06-02 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Danish (da). + +2000-05-29 Jim Meyering + + Allow `cp -d -u' to copy one symlink onto another that's identical. + * src/copy.c (copy_internal): Change the || to ^ in the big sameness + test, so copying one symlink onto another, identical one doesn't fail + here. + If the symlink call fails, don't report the failure if the destination + already exists and is a symlink pointing to the proper name. + Reported by Andrew Burgess. + * tests/cp/slink-2-slink: New test. + * tests/cp/Makefile.am (TESTS): Add slink-2-slink. + * tests/cp/same-file: Adapt to fit new semantics of `cp -d'. + +2000-05-25 Jim Meyering + + * src/dd.c (close_stdout_wrapper): Don't dereference NULL pointer. + From Bob Proulx. + +2000-05-23 Jim Meyering + + * tests/shred/remove: Add traps to clean up. + Correct broken running-as-root test. + + * tests/mv/i-2: Exit 77 when run as root. Reported by Andreas Schwab. + +2000-05-20 Jim Meyering + + * Version 4.0s. + + * tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change. + + * tests/rm/r-2: Clean up. + * tests/ls/time-1 (LC_ALL): Set it unconditionally. + +2000-05-19 Jim Meyering + + Save device number as well as inode number for each directory, + and use both in comparisons. This makes the directory cycle + test more robust, and closes the small remaining hole whereby + an attacker could subvert a running `rm -r' command. + + * src/remove.c (struct active_dir_ent) [st_dev]: New member. + [st_ino]: Rename from `inum'. + (make_active_dir_ent) [device]: New parameter. + (hash_compare_active_dir_ents): Compare using SAME_INODE macro. + (fspec_init_common): New function, factored out. + (fspec_init_file): Initialize have_device member. + (fspec_get_full_mode): Remove parameter. Update caller. + Set have_device and st_dev members. + * src/remove.h (struct File_spec) [have_device, st_dev]: New members + +2000-05-18 Jim Meyering + + * src/remove.c (rm): Combine adjacent fputc and fprintf. + + * tests/rm/Makefile.am (TESTS): Add hash. + * tests/rm/hash: New test for the fix in lib/hash.c. + +2000-05-17 Jim Meyering + + * src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert + a running `rm -r'. Reported by Morten Welinder. + +2000-05-15 Jim Meyering + + * src/ln.c (do_link): Use complete strings in diagnostics so they + are easier to translate. Reported by Michel Robitaille. + (main): Drop support for the case in which S_ISLNK wasn't defined. + It was broken in any case. + + * tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the + current locale is not C (POSIX). From Matthew Clarke. + +2000-05-13 Jim Meyering + + * src/help-version: New test. + * src/Makefile.am (TESTS): Define. + (TESTS_ENVIRONMENT): Likewise. + (EXTRA_DIST): Add help-version. + + * src/chgrp.c: Arrange to call close_stdout only upon exit. + * src/chmod.c: Likewise. + * src/chown.c: Likewise. + * src/cp.c: Likewise. + * src/df.c: Likewise. + * src/dircolors.c: Likewise. + * src/du.c: Likewise. + * src/install.c: Likewise. + * src/ln.c: Likewise. + * src/ls.c: Likewise. + * src/mkdir.c: Likewise. + * src/mkfifo.c: Likewise. + * src/mknod.c: Likewise. + * src/mv.c: Likewise. + * src/rm.c: Likewise. + * src/rmdir.c: Likewise. + * src/shred.c: Likewise. + * src/sync.c: Likewise. + * src/touch.c: Likewise. + + * src/dd.c: Include closeout.h. + (usage): Don't call close_stdout here. + (close_stdout_wrapper): New, kludgey, function and file-scoped global. + (main): Register it with atexit. + +2000-05-12 Jim Meyering + + Unlike for mv, -i doesn't cancel the effect of -f + and -f doesn't cancel the effect of -i. + * src/cp.c (main) ['f']: Don't reset `x.interactive'. + ['i']: Don't reset `x.force'. + * src/copy.c (copy_internal): Fix force and interactive tests. + Patch from Michael Stone, reported by Jeff Sheinberg. + +2000-05-09 Jim Meyering + + * src/shred.c: Include sys/types.h in shred.c before including + sys/stat.h or system.h. From John David Anglin. + +2000-05-08 Jim Meyering + + * tests/shred/remove: Don't use touch in root test. Instead, append to + the test file, since now touch operates even on files which deny owner + write access. + +2000-05-06 Jim Meyering + + * src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@. + + * src/rmdir.c (EEXIST): Remove now-unused definition. + (ENOTEMPTY): Likewise. + (errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY, + which is determined by the autoconf test in m4/rmdir-errno.m4. + +2000-05-03 Bruno Haible + + Don't fail when running `make check' with non-`C' locale. + * tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext) + and LC_ALL (for systems which look at LC_MESSAGES). + * tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has + LC_CTYPE or LC_ALL set. Define it and LANGUAGE before the first use + of sort. + +2000-05-03 Jim Meyering + + With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro. + * src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup. + * src/dircolors.c: Remove declaration of strndup. + Reported by Bruno Haible. + +2000-05-02 Jim Meyering + + * src/rm.c (usage): Add the answer to `How do I remove a file named -f?' + +2000-05-01 Jim Meyering + + * src/install.c (change_attributes): Don't even attempt the chmod + if the chown fails. Before, when a non-root user ran `install -m 4755 + -o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to + the ID of the installing user. Reported by Marc Olzheim. + +2000-04-30 Jim Meyering + + * src/touch.c (O_NOCTTY): Define if not defined already. + (touch): Add O_NOCTTY to the flags passed to open. + +2000-04-29 Jim Meyering + + * Version 4.0r. + + * src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat. + +2000-04-27 Jim Meyering + + Clean up. + * tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR. + * tests/mkdir/p-1: Use mkdir, not $MKDIR. + * tests/mkdir/p-2: Likewise. + + * configure.in (AC_OUTPUT): Add tests/du/Makefile. + * tests/Makefile.am (SUBDIRS): Add du. + * tests/du: New directory. + * tests/du/two-args: New test. + + * tests/mkdir/special-1: New test. + * tests/mkdir/Makefile.am (TESTS): Add special-1. + +2000-04-25 Paul Eggert + + * src/du.c (pop_dir): Remove through_symlink arg; use null cwd + for that purpose instead. + (count_entry): Also save the directory if we're saving more + than one level. + Fix file descriptor and memory leak when chdir fails. + +2000-04-26 Jim Meyering + + * src/mkdir.c: Rename global: s/path_mode/create_parents/. + (main): No longer perform explicit chmod when creating + parent directories, since make_path now does the chmod. + +2000-04-17 Jim Meyering + + * src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP. + (enum) [FROM_OPTION]: New member. + (long_options): New getopt spec. + (change_file_owner): Add old_user, old_group parameters. Use them. + (change_dir_owner): Likewise. + (usage): Describe. + (main): New case. + From Andries Brouwer. + * doc/fileutils.texi (invoking chown): Document it. + +2000-04-16 Jim Meyering + + * src/cp.c: New option: --strip-trailing-slashes. + (enum) [STRIP_TRAILING_SLASHES_OPTION]: New member. + (remove_trailing_slashes): New global. + (long_opts): New getopt spec. + (usage): Describe. + (do_copy): Strip trailing slashes on SOURCE names only if the new + option has been specified. + (main): New case. + + * tests/cp/symlink-slash: New test for the change in behavior. + * tests/cp/Makefile.am (TESTS): Add symlink-slash. + + * doc/fileutils.texi (Trailing slashes): Factor out discussion on + trailing slashes into its own node. + Cross reference from cp and mv. + +2000-04-14 Jim Meyering + + * src/touch.c (touch): Add O_NOCTTY to the list of open-time flags. + +2000-04-13 Jim Meyering + + Move some code into m4/. + * configure.in (_GNU_SOURCE): Don't define here. + (AC_SYS_LARGEFILE): Don't use here. + (AM_C_PROTOTYPES): Don't use here. + * acconfig.h: Remove now-unused file. + +2000-04-08 Jim Meyering + + * doc/fileutils.texi (cp invocation): Mention that there is an + application for cp's --sparse=never option. From Martin Hippe. + (cp invocation): Describe how --backup and --force + can be useful together. + +2000-03-10 Alan Iwi + + * src/ls.c: Add support for "ln=target" in the LS_COLORS variable, + to colorize links as for the file/directory pointed to. + * src/dircolors.hin: Add a few words of documentation of the above. + +2000-04-08 Jim Meyering + + * src/cp.c (usage): Document that while the --backup option takes an + optional argument, the -b option accepts none. + (main): Use `backup type' in call to xget_version, not the + now-deprecated `--version-control'. + * src/install.c: Likewise. + * src/ln.c: Likewise. + * src/mv.c: Likewise. + +2000-03-12 Jim Meyering + + Merge from textutils. + * src/system.h (O_BINARY, O_TEXT): Define if necessary. + (SET_BINARY, SET_BINARY2): Define. + (DEV_BSIZE): Define to BBSIZE if appropriate. + +2000-03-10 Jim Meyering + + * tests/mv/mv-special-1: Make the message more like that in the + similar touch and shred tests. + * tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo + bug and `exit 77' if the fifo cannot be created. + Report and suggestion from Volker Borchert. + +2000-03-03 Jim Meyering + + * po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a + space optimization anyway) to populate $(distdir). Otherwise, the dist + rules that change permissions would end up affecting the master sources. + +2000-03-01 Paul Eggert + + * src/df.c (show_point): Ignore shortcuts based on path + prefixes that are loop file system mount points, since they + yield undesirable output. + +2000-02-29 Jim Meyering + + * src/ls.c (decode_switches): Remove `e' from getopt_long's list of + option characters. Reported by John Summerfield. + +2000-02-28 Jim Meyering + + * tests/install/basic-1: Use ginstall, not install. + +2000-02-27 Jim Meyering + + * Version 4.0q. + + * src/sys2.h: Guard declaration of strtoull also with + `&& HAVE_UNSIGNED_LONG_LONG'. + + * src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...' + now that autoconf always defines the HAVE_DECL_ symbols. + + * src/install.c (install_file_to_path): Always use install_file_in_file. + Based on a patch from Adam Klein via Michael Stone. + + * tests/install/Makefile.am (TESTS): Add create-leading. + * tests/install/create-leading: New file. + + * tests/install/basic-1: Clean up. + * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft. + +2000-02-26 Jim Meyering + + Tranform the generated src/Makefile.in file so it falls back on + using /bin/rm when necessary. The old rule didn't always work. + This is necessary only on certain losing systems, and because this + package builds an `rm' executable and some people put `.' too + early in their PATH. + * Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment. + (EXTRA_DIST): Add .kludge-stamp. + (.kludge-stamp): New rule. + * src/Makefile.am (AUTOMAKE): Remove definition. + (Makefile.in): Remove dependency on automake-wrap script. + (EXTRA_DIST): Remove automake-wrap. + * src/automake-wrap: Remove file. + + * tests/rm/r-2: Don't make the success of the test depend on the + order in which directory entries are processed. + Reported by Andreas Schwab. + +2000-02-12 Jim Meyering + + * po/POTFILES.in: Add lib/userspec.c. + + * doc/fileutils.texi (chown invocation): Deprecate use of `.'. + + * src/chown.c (usage): Mention only `:', and not `.' as the separator, + since POSIX allows only the former. + Prompted by a report from Manas Garg. + +2000-02-11 Jim Meyering + + * src/df.c (main): Count the stat'able arguments. + Print the header line only if there is at least one valid argument. + Reported by Andy Longton + +2000-02-10 Jim Meyering + + Make du work when invoked from an unreadable directory. + + * src/du.c (pop_dir): New function. + (count_entry): Factor out common code (pop_dir), and call the new + function instead. + Move declaration of global, `stat_buf' into this function. + (du_files): Don't stat `.' or call save_cwd, since count_entry + never returns with a changed working directory. + +2000-02-09 Jim Meyering + + * tests/mv/mv-special-1: Use $null and $dir in place of literals + in `here' script. + Exit 77 if we can't set up the framework (Volker Borchert reported + that this test would fail because mknod failed when run on SunOS4.1.4 + using NFS-mounted disk from an OpenBSD system). + +2000-02-05 Jim Meyering + + * src/copy.c (copy_internal): Don't allow mv to move a directory onto + a non-directory. Reported by Brian Kimball via Michael Stone. + +2000-02-03 Jim Meyering + + * tests/mv/Makefile.am (TESTS): Add dir-file. + (TESTS_ENVIRONMENT): Remove vestiges of old tests. + * tests/mv/dir-file: New file. + +2000-02-02 Jim Meyering + + * tests/touch/Makefile.am (TESTS): Add fifo. + * tests/touch/fifo: New file. + +2000-02-01 Jim Meyering + + * src/touch.c (O_NDELAY): Define to 0 if not defined. + (O_NONBLOCK): Define to O_NDELAY if not defined. + (touch): Open with O_NONBLOCK, so one can touch a fifo without hanging. + Reported by Eric G. Miller via Michael Stone. + + * man/*.x: Change ." to .\". + Reported by Andreas Schwab and Brendan O'Dea. + +2000-01-31 Jim Meyering + + * man/Makefile.maint (ginstall_filter): Define. + ($(man_MANS)): Use it here so that the install.1 man page refers + to `install', not `ginstall'. Reported by Andreas Schwab. + +2000-01-30 Jim Meyering + + * Version 4.0p. + + * configure.in: Move library-related tests into m4/lib-check.m4. + + * src/system.h (ST_NBLOCKS): Use st_size only for regular files and + for directories. From H. J. Lu. + + * src/dd.c (main): Exit with nonzero status if ftruncate fails. + +2000-01-24 Jim Meyering + + * src/ln.c (usage): Describe behavior when LINK_NAME is omitted. + From Michael Stone. + + * src/mv.c (main): Don't expect array index `n_files - 1' to evaluate + to `-1' for unsigned int n_files == 0. Doing so lead to a segfault on + alpha. From Michael Stone. + +2000-01-23 Jim Meyering + + * configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.) + Remove nearly all function checks (moved to m4/.) + (AC_SUBST(DF_PROG)): Move this to m4/. + (ftruncate test): Move into new file: m4/ftruncate.m4. + (AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/. + Remove df-related tests. i.e., move jm_LIST_MOUNTED_FILESYSTEMS, + jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/. + +2000-01-22 Jim Meyering + + * configure.in: Move addext.c prerequisites from this file into m4/. + (AC_CHECK_HEADERS): Move these checks into m4/. + +2000-01-17 Paul Eggert + + * src/dd.c (interrupt_handler): Likewise. + (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION, + to decide whether to call sigaction; this fixes an old typo. + +2000-01-16 Jim Meyering + + * lib/Makefile.am: Sync with sh-utils/lib/Makefile.am. + + * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME, + jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and + AC_FUNC_ALLOCA. They're now in m4/. + + Sync with the version from emacs-20.5. + * lib/alloca.c + (): Include if HAVE_STRING_H. + (): Include if HAVE_STDLIB_H. + (alloca): Abort if malloc fails. + Reported by Paul Eggert. + +2000-01-15 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy + memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol + strtoul strverscmp. Now they're in m4/. + +2000-01-12 Jim Meyering + + * tests/shred/remove: Make the warning that this shred test may not + be run as root more prominent. Suggestion from Volker Borchert. + +2000-01-11 Paul Eggert + + Quote multibyte characters correctly. + + * lib/quotearg.c (ISGRAPH): Remove. + (ISPRINT): New macro. + (): Include if HAVE_MBRTOWC && HAVE_WCHAR_H. + (isprint, mbrtowc, mbsinit, mbstate_t): New macros, + defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H). + (quotearg_buffer_restyled): New function, with most of the old + quotearg_buffer's contents. + Major rewrite to support multibyte characters. + (quotearg_buffer): Now just calls quotearg_buffer_restyled. + + * m4/c-bs-a.m4: New file. + * m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro. + (jm_PREREQ): Use it. + +2000-01-11 Paul Eggert + + * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned + long, to parse numeric modes. Check for any unknown bits, not + just unknown bits left of the leftmost known bit. + +2000-01-11 Paul Eggert + + * lib/getdate.y: Update copyright notice. + +2000-01-11 Paul Eggert + + * COPYING: Sync with latest FSF version (fixing a minor Y2k problem). + +2000-01-11 Paul Eggert + + * lib/exclude.c, lib/exclude.h: Sync to the slightly more + general version of GNU tar. + + * src/du.c (count_entry): + Adjust to new calling convention for excluded_filename. + (main): Likewise, for add_exclude_file. + +2000-01-11 Jim Meyering + + * lib/memcpy.c (memcpy): Protoize. + + Prepare to sync lib/ directories of fileutils, sh-utils, and textutils. + * lib/Makefile.am: s/fu/fetish/ + * src/Makefile.am: s/libfu/libfetish/ + + * lib/hash.c (hash_initialize): Fix typo in comment. + From François Pinard. + +2000-01-10 Jim Meyering + + * Version 4.0o. + + * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h. + +2000-01-09 Jim Meyering + + * Version 4.0n. + + * src/ln.c (do_link): Produce the same sort of one-line output for + `--backup --verbose' as cp, mv, install. Before this, the backup + file name wasn't printed at all. + + This affects cp, install, and mv. + * src/copy.c (copy_internal): When making backup files in verbose + mode, print the backup file name on the same line as the rest of the + information, e.g., `a -> b (backup: b.~13~)' rather than on a separate + line by itself. Suggestion from Karl Berry. + +2000-01-08 Jim Meyering + + * lib/error.c (error): Use __strerror_r's return value only if + HAVE_WORKING_STRERROR_R. + (error_at_line): Likewise. + + * Makefile.maint (null_AM_MAKEFLAGS): Define. + (my-distcheck): Use it to avoid distributing out of date files + whose derivation would require a maintainer tool. + +2000-01-07 Jim Meyering + + * lib/euidaccess.c: Sync with the GNU C library. + + * tests/dir/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix + to exported PATH value (though not strictly necessary, here). + * tests/dd/Makefile.am: Likewise. + * tests/dircolors/Makefile.am: Likewise. + * tests/rm/Makefile.am: Likewise. + * tests/rmdir/Makefile.am: Likewise. + * tests/shred/Makefile.am: Likewise. + * tests/touch/Makefile.am: Likewise. + * tests/shred/Makefile.am: Likewise. + +2000-01-06 Jim Meyering + + * man/help2man: Import version 1.020. + + * lib/strftime.c: Sync with the GNU C Library. + +2000-01-06 Paul Eggert + + * tar/lib/getdate.y: Sync tm_diff with the GNU C Library. + (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed. + (tm_diff): Renamed from difftm. All uses changed. + Replace body with that taken from GNU C Library 2.1.3pre1. + (get_date): Prefer tm_gmtoff to tm_diff if available. + +2000-01-04 Paul Eggert + + * savedir.c (savedir): Don't store past the end of an array if + name_size is zero and the directory is empty. + + * Makefile.maint (PREV_VERSION): Tweak so it handles e.g., 2.0a -> 2.0. + (alpha): Create xdelta diffs. + +2000-01-02 Jim Meyering + + * Version 4.0m. + + * src/mv.c: New option: --strip-trailing-slashes. + + 1999-11-18 Paul Eggert + + * lib/strftime.c (my_strftime): Some old compilers object to + '\a', so don't bother optimizing for it. + +2000-01-01 Paul Eggert + + Fix bug: `df PATH' sometimes misbehaves when there is an + inaccessible mount point unrelated to PATH. + * configure.in (AC_CHECK_FUNCS): Add realpath, resolvepath. + * src/df.c (#pragma alloca): Add if _AIX is defined. + (path-concat.h): Include. + (show_point): If HAVE_REALPATH or HAVE_RESOLVEPATH is defined, + find the real absolute path for PATH, and use that to find the + mount point. + + (show_point): Prefer non-dummy entries in shortcuts, too. + Disable bogus mount dirs instead of restatting them each time. + +1999-12-30 Jim Meyering + 1999-12-17 Kalle Olavi Niemitalo + + * src/rmdir.c (remove_parents, main): Don't pass errno to error + when printing "removing directory" message. Failure of rmdir is + handled elsewhere. + +1999-12-23 Jim Meyering + + * configure.in: Remove clock_gettime tests. + Now they're in m4/jm-macros.m4. + + * src/ln.c (usage): Correct typos. + List new --target-directory=... usage. + Reported by Göran Uddeborg + + * src/mv.c (usage): List new --target-directory=... usage. + +1999-12-22 Jim Meyering + + * lib/getdate.y (get_date): Fix typo in time_t overflow test. + From Michael Stone. + +1999-12-21 Andreas Schwab + + * tests/shred/remove: Use $file, not $tmp/file. Exit 77 if run as + root. + +1999-12-20 Paul Eggert + + * src/df.c (ceil_percent): Remove. + (show_dev): Avoid overflow problems when calculating percent. + Do not display negative percents. + +1999-12-19 Jim Meyering + + * Version 4.0l. + + * doc/fileutils.texi: Clarify and combine descriptions of -c and of + --time=ctime. + Likewise for -u/--time=atime. + + * src/ls.c [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Use lstat wrapper. + [Notice the new configure-time test in m4/lstat-slash.m4. ] + (main): Back out change from 1999-02-19 that made ls remove + trailing slashes from command line arguments to accommodate early + versions of Linux. Now, `ls symlink-to-dir/' acts like + `ls symlink-to-dir/.' thus following the symbolic link, as POSIX says + it should. Suggestion from Bruno Haible and Andreas Schwab. + + * lib/xstat.in (slash_aware_lstat): New function. + (rpl_@xstat@): Use it. + * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in. + (lstat.c): Likewise. + + Make sure ls does the right thing with symlinks and trailing slashes. + * tests/ls/Makefile.am (TESTS): Add symlink-slash. + * tests/ls/symlink-slash: New test, for above-fixed bug. + +1999-12-18 Jim Meyering + + * src/shred.c (wipename): When repeatedly renaming a file, making the + name shorter and shorter, skip to the next shorter length length if a + rename fails (e.g. due to permission denied). Otherwise, this loop + would iterate for so long that shred would appear to be stuck in an + infinite loop for any but the shortest file names. + Reported by Joe Orton. + + * configure.in (AC_OUTPUT): Add tests/shred/Makefile. + * tests/Makefile.am (SUBDIRS): Add shred. + * tests/shred: New directory + * tests/shred/remove: New file. Tests for the above-fixed bug. + +1999-12-13 Jim Meyering + + * lib/makepath.c (make_path): Consistently use `error' to output + the verbose, `created directory ...' messages. + Reported by Bernhard Rosenkraenzer. + +1999-12-12 Jim Meyering + + Move 120+ lines of stat.h-related macros from system.h (not shared) + to sys2.h, which is shared between fileutils, sh-utils, textutils. + * src/system.h: Move them from here... + * src/sys2.h: ... to here. + + * src/system.h (S_IRUSR, S_IRGRP, S_IWGRP, S_IROTH, S_IWOTH): Define + if not defined. This was necessary on a NeXT Turbostation running + Mach 3.3. Reported by Nelson H. F. Beebe. + + * src/ls.c (decode_switches): If -c or -u is specified and not -l + (or any other option that implies -l), and no sort-type was specified, + then sort by the ctime (-c) or atime (-u). Part of this change reverts + the 1998-01-10 delta. + (usage): Update to reflect this change. + Reported by Paul Slootman via Michael Stone. + +1999-12-09 Jim Meyering + + * src/df.c (BLOCK_SIZE_OPTION, SYNC_OPTION, NO_SYNC_OPTION): Define + these and use them instead of `CHAR_MAX + n'. + * src/du.c (BLOCK_SIZE_OPTION, EXCLUDE_OPTION, MAX_DEPTH_OPTION): + Likewise. + * src/touch.c (TIME_OPTION): Likewise. + * src/rmdir.c (IGNORE_FAIL_ON_NON_EMPTY_OPTION): Likewise. + + * tests/ls/time-1: Test more of the framework (touch's -a and -m + options) before running the actual ls test. + +1999-12-07 Jim Meyering + + * tests/cp/cp-mv-backup: Use 1>&2 rather than `1<&-'. + Suggestion from Volker Borchert. + +1999-12-05 Jim Meyering + + * Makefile.maint: Remove ftp.enst.fr. + +1999-12-04 Jim Meyering + + * Version 4.0k. + + * tests/mv/into-self-2: Adapt to reflect this change in behavior. + Make sure the VERSION_CONTROL envvar is not set. + Run diff if comparison fails. + + * src/copy.c (copy_internal): In move mode, if the rename attempt + fails, then unlink any existing destination file. This makes a + cross-device `mv' more consistent with the intra-device behavior. + This change is required by POSIX to make a cross-device move act with + semantics similar to those of the rename syscall. For example now + `mv' can move a file onto a symlink to itself when that symlink + is on a separate partition. With fileutils-4.0j, it would fail with + a diagnostic saying they were the same file. + Reported by Bruno Haible. + + * tests/mv/to-symlink: New file. Adds test for the above. + * tests/mv/Makefile.am (TESTS): Add to-symlink. + + * tests/cp/cp-mv-backup (trap): Be careful to close $actual before + removing the containing directory. Otherwise, on some systems rmdir + fails to remove the containing directory. + + * tests/ls/time-1: List --full-time dates upon failure. + +1999-12-02 Andreas Schwab + + * src/ls.c (check_symlink_color): New variable. + (main): Set it if we need to check for dangling symlinks when + displaying colors. + (gobble_file): Check check_symlink_color instead of print_with_color. + +1999-11-30 Paul Eggert + + * src/ls.c (usage): Shorten help for --show-control-chars. + +1999-11-30 Jim Meyering + + Give the right diagnostic when failing to create a file in an + unwritable directory. + * src/touch.c (touch): Record errno upon failed errno and use that + saved value if a subsequent fstat, stat or utime call fails. + Reported by Wichert Akkerman via Michael Stone. + +1999-11-27 Jim Meyering + + Clean up test scripts. + * tests/mv/setup: Don't set/use DF or MKDIR. Use df and mkdir instead. + * tests/mv/mv-special-1: Likewise for these: LS MV MKDIR MKNOD RM TOUCH + * tests/mv/backup-is-src: Likewise for RM and MV. + * tests/mv/hard-link-1: Likewise. + * tests/mv/into-self: Likewise. + * tests/mv/into-self-3: Likewise. + + Add test for 1999-05-23 change to src/copy.c (copy_internal). + * tests/mv/partition-perm: New file. + * tests/mv/Makefile.am (TESTS): Add partition-perm. + + * Version 4.0j. + +1999-11-22 Paul Eggert + + * src/df.c (df_readable): Now returns char const *, not char *. + New arg NEGATIVE. + (ceil_percent): Now returns double, not int. + Be more careful about adding 1 to a wild value. + (show_dev): Don't filter out wild sizes from the underlying operating + system; instead, show them to the user as faithfully as possible. + +1999-11-23 Jim Meyering + + * doc/getdate.texi (Calendar date item): Correction regarding 0..68/ + 69-99 split for 1900 vs 2000. From Peter Moulder. + +1999-11-22 Jim Meyering + + * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c. + +1999-11-20 Jim Meyering + + * src/rmdir.c (errno_rmdir_non_empty): New function to encapsulate + errno comparison. + (remove_parents): Use it. + (main): Use it. + + * tests/cp/cp-mv-backup: Run `diff -c' if the test fails. + + * tests/ls/time-1: Use `ls' and `touch', not $LS and $TOUCH. + * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Specify PATH, etc. + + * src/chgrp.c: Declare lstat; needed on e.g. SunOS4. + Reported by Tom Tromey. + +1999-11-19 Jim Meyering + + * lib/strstr.c (strstr): Include config.h. + Add a `;' between shloop label and `}'. + From Akim Demaille. + +1999-11-17 Jim Meyering + + * src/mkdir.c (S_IRWXUGO): Define if necessary. + (main): Use chmod to set the permissions if bits other than those + of S_IRWXUGO were requested. Reported by Sami Farin. + +1999-11-14 Paul Eggert + + * touch.c (touch): Simplify code a tad, using fd == -1 instead + of separate valid_fd variable. + +1999-11-13 Jim Meyering + + * src/touch.c (touch): Don't fail just because we couldn't open + an existing file. This makes it so that touching a read-only + file now works. Also clean up and simplify. + Based on a patch from Chip Salzenberg. + * tests/touch/no-rights: New test for this. + * tests/touch/Makefile.am (TESTS): Add no-rights. + +1999-11-12 Jim Meyering + + * src/remove.c (print_nth_dir): Write one fewer byte so we don't print + a trailing slash. + (rm): Fix bugs in (and test, this time) the very rarely used code + to warn about directory cycles. + Reported by michael@roka.net. + +1999-11-11 Jim Meyering + + * src/copy.c (copy_internal): Treat src and dest as the `same' in + `mv src symlink-to-src' when src and dest are on different partitions. + Otherwise, that `mv' command would silently remove `src'. + Reported by Michael Stone. + * tests/mv/into-self-2: Add a test for this fix. + + * lib/makepath.c (make_path): Fix long-latent bug: s/&&/||/ (others + just like that also dated back to 1992 were fixed in 1998-01-02). + Richard Braakman reported that using `install -d -g foo 1/2` + only sets the group on the intermediate directory, not the final + component. From Michael Stone. + +1999-11-07 Paul Eggert + + * human.c (default_block_size): New function. + (humblock): Use it if no block size is specified. + (human_block_size): If the specified block size is zero, report an + error if report_errors is nonzero; otherwise use the default. + +1999-11-07 Jim Meyering + + * src/dircolors.hin: Add several more TERM types. + Add .bz2 suffix. + Add .png for real this time. + Change the image types colors to be visible in a black-on-white xterm. + From Michael Stone. + + * src/chgrp.c (xstat): New global. + (main): Define it. + (change_file_group): Use it. Before this change, when running chgrp + on a symlink without --dereference (-h) and when the requested group + is the same as the group for the *symlink*, chgrp would do nothing. + Now it changes the group of the file referenced through the symlink. + Reported by Martin Mitchell. + + * src/chmod.c: Use REFERENCE_FILE_OPTION instead of bare `CHAR_MAX + 1'. + * src/chown.c: Define and use REFERENCE_FILE_OPTION and + DEREFERENCE_OPTION in place of bare `CHAR_MAX + N'. + * src/chgrp.c: Likewise. + + * tests/ln/misc: Add hard-link-to-symlink test. + Move framework_failure test to the end. + Fix a typo: s/||/&&/. + + * src/ln.c (do_link): Warn that making a hard link to a symbolic link + is not portable. + + * tests/ln/misc: Use --b=simple, not the now-deprecated `-V simple'. + * tests/ln/backup-1: Likewise. + + * configure.in (AC_OUTPUT): Add tests/rmdir/Makefile. + * tests/Makefile.am (SUBDIRS): Add rmdir. + * tests/rmdir: New directory + * tests/rmdir/ignore: New file. + + * src/rmdir.c (remove_parents): Use the correct test (just as in + main) in handling --ignore-fail-on-non-empty. From Michael Stone. + (usage): Improve description of --parents. Based on suggestion from + Torsten Landschoff. + +1999-11-06 Jim Meyering + + Allow hard links to symlinks on systems that support it. + * src/ln.c (STAT_LIKE_LINK): Define. + (do_link): Use STAT_LIKE_LINK, rather than bare `stat', and perform + the extra lstat only on systems where LINK_FOLLOWS_SYMLINKS. + + * src/ls.c (long_options): Correct typo (s/'F'/'p'/) so that `-p' is + accepted as the short form of --file-type, per the documentation. + From James Sneeringer. + + * src/ln.c (do_link): Fix typo (in which the function name `symlink' + was tested instead of the variable `symbolic_link') that could make + ln perform an unneeded `stat' call. + +1999-11-05 Jim Meyering + + * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated + HAVE_ST_BLOCKS. + * src/copy.c: Likewise. + * lib/fileblocks.c: Likewise. + + * configure.in: Move some type/header/member tests into + m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of + fileutils, textutils, and sh-utils. + +1999-11-02 Jim Meyering + + * man/help2man: Import version 1.018. + * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option. + * man/*.x: Include one-line summary in [NAME] section. + * man/Makefile.summ: Remove the one-line summaries. + Suggestion for clean-up from Akim Demaille. + + * configure.in (ALL_LINGUAS): Add Galician (gl). + +1999-11-01 Jim Meyering + + * src/cp.c (usage): Warn about mixing use of `-r' with FIFOs and + other special files like /dev/zero. + + * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES). + +1999-10-31 Jim Meyering + + * Makefile.maint (my-distcheck): Remove $(DEPDIR) to work around + automake bug. + + * doc/fileutils.texi: Document new --backup[=METHOD] option for + cp, mv, ln, and install. + + * src/ln.c: Convert --backup to take an optional argument. + Deprecate --version-control (-V) in comments. + (usage): Remove mention of --version-control. + (main): Make -V warn then fall through into --backup case. + [--backup case]: Handle optional arg. + * src/install.c: Likewise. + +1999-10-24 Jim Meyering + + * src/cp.c (do_copy): Constify `dest', and cast-away the new + const in assignment to new_dest. + +1999-10-23 Jim Meyering + + * tests/touch/Makefile.am (TESTS): Add dangling-symlink. + * tests/touch/dangling-symlink: New file. + +1999-10-23 Paul Eggert + + * src/touch.c (full_write): Remove unused decl. + (open_maybe_create): Remove. + (touch): Don't record whether the file was created; this isn't + possible to do reliably and portably without race conditions. + If the file was created and if amtime_now is nonzero, this + change means we'll have to do another utime system call, but + that's no more harmful than the previous version of this code. + Reported by Gabor Z. Papp. + +1999-10-21 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Japanese (pa). + +1999-10-17 Jim Meyering + + * tests/mv/backup-is-src: Remove use of mv's now-deprecated + -V option. Use --b=simple instead of -b -V simple. + + * src/mv.c: Convert --backup to take an optional argument. + Deprecate --version-control (-V) in comments. + (usage): Remove mention of --version-control. + (main): Make -V warn then fall through into --backup case. + [--backup case]: Handle optional arg. + + Accept new option: --target-directory=DIR + * src/cp.c (TARGET_DIRECTORY_OPTION): Define. + (SPARSE_OPTION): Define. + (usage): Describe it. + (do_copy): Change meanings/names of first two parameters: use `n_files' + in place of `argc - optind', and `file' instead of `argv + optind'. + Add parameter, target_directory. + (main): Pass new arg, target_directory. + +1999-10-16 Jim Meyering + + * tests/cp/backup-is-src: Remove use of cp's now-deprecated -V option. + Use --b=simple instead of -b -V simple. + * tests/cp/backup-1: Replace use of cp's now-deprecated + --version-control option with use of --backup=simple. + + * src/cp.c: Convert --backup to take an optional argument. + Deprecate --version-control (-V) in comments. + (usage): Remove mention of --version-control. + (main): Make -V warn then fall through into --backup case. + [--backup case]: Handle optional arg. + + * tests/cp/Makefile.am (TESTS): Add cp-mv-backup. + * tests/cp/cp-mv-backup: New file. + +1999-10-11 Jim Meyering + + * lib/getopt.c: Merge changes from latest glibc. + * lib/getopt.h: Likewise. + * lib/getopt1.c: Likewise. + +1999-10-09 Jim Meyering + + Accept new option: --target-directory=DIR + * src/ln.c (TARGET_DIRECTORY_OPTION): Define. + (usage): Describe it. + (main): Implement it. + Make code clearer: use new variable `n_files' in place of + `argc - optind'. Use `file' instead of `argv + optind'. + +1999-10-04 Jim Meyering + + * depcomp: New file, for automake's new dependency support. + * missing: New version, from automake's user-dep-gen-branch. + + * lib/xalloc.h (__attribute__): Apply 1999-10-03 change here, too. + * src/sys2.h (__attribute__): Likewise. + Wrap with #ifndef __attribute__. + +1999-10-03 Paul Eggert + + * getdate.y (__attribute__): Define to empty if GCC claims to + be before 2.8; this is needed for OPENStep 4.2 cc. Also, + define to empty if strict ANSI. + +1999-10-03 Jim Meyering + + Accept new option: --target-directory=DIR + * src/mv.c (TARGET_DIRECTORY_OPTION): Define. + (usage): Describe it. + (main): Implement it. + Remove unused variable, stdin_tty. + Make code clearer: use new variable `n_files' in place of + `argc - optind'. Use `file' instead of `argv + optind'. + +1999-09-28 Jim Meyering + + * src/system.h: Do s/#ifdef HAVE_/#if HAVE_/ -- solely for aesthetics. + Do the same for other config.h macros like CLOSEDIR_VOID and MAJOR_*. + * src/sys2.h: Likewise. + + * lib/xalloc.h (__attribute__): Protect against redefinition. + From Akim Demaille. + +1999-09-26 Jim Meyering + + * lib/xmalloc.c (xalloc_die): Rename from xalloc_fail and + update callers. + Use explicit exit to help avoid warnings. + From Akim Demaille. + + * lib/path-concat.c (DIRECTORY_SEPARATOR): Define. + (ISSLASH): Define. + (path_concat): Allow parameter DIR to be NULL. + (xpath_concat): New function. + From Akim Demaille. + + * lib/xalloc.h (__attribute__): Define. + (ATTRIBUTE_NORETURN): Define. + (xalloc_die): Declare. + (NEW): Define as yet unused macro. + (XFREE): Likewise + (CCLONE): Likewise. + (CLONE): Likewise. + From Akim Demaille. + + * lib/basename.c (base_name): Add prototype. From Akim Demaille. + +1999-09-19 Jim Meyering + + * lib/lchown.c [STAT_MACROS_BROKEN] (S_ISLNK): Undefine. + (S_ISLNK): Define if necessary. + This is necessary on a NEC SX-4 with SUPER-UX 9.1. + Based on a patch from Holger Berger. + + * src/dd.c (siginfo_handler): Mark parameter with ATTRIBUTE_UNUSED. + Change many counter and index variables to be of unsigned type. + (dd_copy): Add new unsigned variable, n_bytes_read, in place of + many uses of `nread'. + + * src/sys2.h (__attribute__): Define. + (ATTRIBUTE_NORETURN): Remove #else clause. + (ATTRIBUTE_UNUSED): Define. + +1999-09-17 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Remove strdup, now that this + is done in m4/jm-macros.m4. + +1999-09-09 Jim Meyering + + * src/touch.c (usage): Remove misleading sentence in --help output. + From Karl Heuer. + + * src/Makefile.am (EXTRAdir): Remove unused variable. + +1999-09-03 Paul Eggert + + * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3. + Use EINVAL instead. + +1999-09-01 Jim Meyering + + * src/cp.c: Remove declaration of xstrdup. + * src/df.c: Likewise. + * src/ls.c: Likewise. + +1999-09-01 Akim Demaille + + * lib/xmalloc.c (xalloc_fail_func): Use `PARAMS'. + * lib/xalloc.h (xalloc_fail_func): Likewise. + (xstrdup): Add protoype. + + * lib/version-etc.c (version_etc_copyright): Default copyright string. + (version_etc): Use it. + * lib/version-etc.h: Declare it. + +1999-08-29 Jim Meyering + + * configure.in (AC_YACC): Remove use, now that we require bison. + + * src/dircolors.hin: Add .rpm, .png, and .fli. + From Andres Soolo. + +1999-08-28 Paul Eggert + + * getdate.y: Add copyright notice. + + (number): Handle `Nov 11 1996' example; see Risks Digest 20.55 + http://catless.ncl.ac.uk/Risks/20.55.html#subj18 + (1999-08-27) + + (): Include only if testing. + (ISUPPER): Remove. + (ISLOWER, PC): New macros. + (): Include if HAVE_STRING_H, not USG. + (bcopy): Remove. + (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume + bison. + (EPOCH_YEAR): Renamed from EPOCH. + (table): Renamed from TABLE. + (meridian): Now an anonymous enum. + (struct parser_control): New type. + (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros. + (yyInput, ..., yyRelYear): Migrated into struct parser_control. + (%pure_parser): Added, so that the parser is pure. + (%union): Removed; the type is now just plain int. + All %type directives removed. + (tLOCAL_ZONE): New %token. + (month_day_table): Renamed from MonthDayTable. + (gmtime, localtime, mktime, time): Declare only if not defined. + (meridian_table): New table. + (dst_table): New table. + (units_table): renamed from UnitsTable. + (relative_time_table): Renamed from OtherTable. + (time_zone_table): Renamed from TimezoneTable. Modernized data. + (military_table): Renamed from MilitaryTable. + (to_hour): Renamed from ToHour. + (to_year): Renamed from ToYear. + (lookup_zone): New function. + (LookupWord): Renamed from lookup_word. + Use lookup_zone for time zones. + (yylex): Now reentrant. All callers changed. + (get_date): Add support for local time zone abbreviations. + Make it reentrant. + +1999-08-22 Jim Meyering + + * src/sys2.h (IF_LINT): Define new macro. + * src/df.c (main): Rename locals i and j. + Use IF_LINT macro instead of #ifdef lint... + + * src/dd.c (parse_integer): Add `const' to char* parameter and + add a separate `suffix' variable. + +1999-08-20 Jim Meyering + + * src/chown.c (usage): Tweak --help output to make it more consistent + with that of chgrp. + * src/chgrp.c (usage): Tweak --help output to make it more consistent + with that of chown. + +1999-08-17 Jim Meyering + + * configure.in: Remove check for rename and the code that would + enable building of the `mvdir' program. + * src/Makefile.am (libexec_PROGRAMS): Remove reference to @MVDIR@. + (EXTRA_PROGRAMS): Remove obsolete mvdir. + * lib/rename.c: Remove obsolete file. (it had a bug, too) + * src/mvdir.c: Remove obsolete file. + * po/POTFILES.in: Remove mvdir.c + + * doc/fileutils.texi (chown, chgrp invocation): Make these sections + consistent with each other. + +1999-08-16 Jim Meyering + + * src/chown.c (groupname): Declare to be `const'. + (change_dir_owner): Declare statp parameter to be `const'. + (usage): Make the output be more consistent with that from chgrp. + + This change is nearly identical to the chown.c change of 1998-05-24 + * src/chgrp.c: Accept new option, --dereference. + --no-dereference is now the default. Include lchown.h. + (enum Change_status) [CH_NOT_APPLIED]: New member. + (change_symlinks): Enable this by default, now. + (describe_change): Handle new case. + (change_file_group): Add new parameter: cmdline_arg. Update callers. + Reorganize to reflect changed semantics. + (LCHOWN): Remove definitions. + From Bruno Haible. + +1999-08-10 Jim Meyering + + * po/POTFILES.in: Add lib/quotearg.c. + +1999-08-09 Paul Eggert + + * NEWS, doc/fileutils.texi, src/ls.c (usage): + Add ls --quoting-style=locale. + + * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): + Change from escape_quoting_style to locale_quoting_style. + (argmatch_invalid): Use new quotearg_style primitive for simplicity. + Also, use ARGMATCH_QUOTING_STYLE to quote, instead of quoting ourselves. + + * lib/quotearg.h (locale_quoting_style): New enum value. + (quotearg_n_style, quotearg_style): New decls. + + * lib/quotearg.c: Include if ENABLE_NLS. + (_): New macro. + (quoting_style_args, quoting_style_v, quotearg_buffer): Add support + for locale_quoting_style, using _("`") and _("'") for open and close + quote symbols. + Do not quote spaces in escape_quoting_style. + (quotearg_n_style, quotearg_style): New functions. + +1999-08-08 Jim Meyering + + * src/touch.c (usage): Clarify description of --time=WORD. + From Karl Berry. + + * lib/savedir.c (savedir): Change type of name_size parameter to off_t. + * lib/savedir.h (savedir): Update prototype. + * src/chmod.c (change_dir_mode): Remove cast of savedir arg. + * src/chown.c (change_dir_owner): Likewise. + * src/chgrp.c (change_dir_group): Likewise. + * src/copy.c (copy_dir): Likewise. + * src/du.c (count_entry): Likewise. + Suggestion from Bob Proulx. + +1999-08-07 Jim Meyering + + * po/POTFILES.in: Add lots of lib/*.c files. + Remove src/cp-hash.c, since it doesn't use _(). + +1999-08-04 Jim Meyering + + * configure.in: Remove getline-testing code. Now it's in m4/. + +1999-08-01 Paul Eggert + + * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS. + +1999-07-30 Jim Meyering + + * src/ls.c (usage): Explain about default wrt --hide-control-chars and + --show-control-chars. Reported by Germano Leichsenring. + +1999-07-28 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR). + +1999-07-24 Jim Meyering + + * src/dd.c (PTR_ALIGN, ROUND_UP_OFFSET): New macros. + (dd_copy): Use those to page-align both the input and output buffers. + +1999-06-01 Volker Borchert + + * tests/Makefile.am: Make envvar-check depend on check-recursive rather + than on `check' so that its tests are performed before any real tests. + +1999-07-15 Jim Meyering + + * src/dd.c: Include getpagesize.h. + (dd_copy): Page-align the input buffer. + Based on a patch from Scott Lurndal. + + * getpagesize.h: New file. + * lib/Makefile.am (noinst_HEADERS): Add getpagesize.h. + + * lib/fsusage.c (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]: + Work around SunOS botch also when block size is different from 1k. + From Jürgen Fluk. + +1999-07-10 Jim Meyering + + * man/help2man: Import version 1.012. + +1999-07-04 Jim Meyering + + * lib/xstrtol.c [!defined strtoumax]: Declare strtoumax. + +1999-07-04 Paul Eggert + + * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol + expands to a macro, which occurs in HP-UX 10.20 with strtoumax. + (strtol, strtoul): New decls (for pre-ANSI hosts), to replace + the above decl. + +1999-06-27 Paul Eggert + + Fix some incompatibilities between `df -P' and POSIX.2. + + * lib/human.h (enum human_inexact_style): New enum. + (human_readable_inexact): New decl. + + * lib/human.c (human_readable): New function. + (human_readable_inexact): Renamed from human_readable, with new arg + INEXACT_STYLE. Add support for ceiling and floor. + + * src/df.c (print_header): Conform to POSIX if posix_format). + (df_readable): Take ceiling if posix_format. + (ceil_percent): New function. + (show_dev): Take ceiling of percent if posix_format. + Align with POSIX-conforming header if posix_format. + + * doc/fileutils.texi: Document these changes. + +1999-05-27 Volker Borchert + + * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix. + +1999-05-23 Jim Meyering + + * src/copy.c (copy_internal): Don't apply the umask in move_mode. + Otherwise, `mv' would not preserve the permissions when copying + between partitions. Reported by David Godfrey + + * Version 4.0i. + + * tests/cp/same-file: Correct erroneous expected output from + the `cp -f foo foo' tests. + * po/POTFILES.in: Add same.c. + * lib/same.h: New file. + * lib/same.c: New file (function extracted from ln.c). + * lib/Makefile.am (libfu_a_SOURCES): Add same.c. + (noinst_HEADERS): Add same.h. + * src/copy.c: Include same.h. + * src/ln.c (same_name): Remove function. + : Include this instead. + : No longer include this. + * tests/mv/force: Be sure we still allow `mv -f FILE LINK-TO-FILE'. + + * src/copy.c (copy_internal): Make it so `cp/mv -f FILE FILE' does not + remove FILE. Suggestion from Chris Yeo. + * tests/mv/force: New test, for the above fix. + * tests/mv/Makefile.am (TESTS): Add force. + (TESTS_ENVIRONMENT): Change PATH to be absolute. + + * tests/mv/force (mv): New test. + +1999-05-17 Paul Eggert + + * lib/getdate.y (get_date): Let mktime deduce tm_isdst if we + have an absolute timestamp, or if the relative timestamp + mentions days, months, or years. Reported by Volker Borchert. + + * lib/human.c (human_readable): Allow from_block_size to be zero. + +1999-05-14 Jim Meyering + + * tests/Makefile.am (envvar-check): Renamed from check-local. + (check): Depend on envvar-check so the envvar check is performed + before all other tests. Reported by Volker Borchert. + * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects, + so CDPATH is mentioned in the message. Reported by Volker Borchert. + + * src/df.c (main): When asking for info on an explicit file name, + just warn rather than failing if the table of mounted filesystems + cannot be read. Based on a patch from Mark Kettenis. + + * lib/version-etc.c (version_etc): Put version info and author names + on the first two lines respectively rather than putting the three + lines of copyright info between them. + + * src/touch.c (open_maybe_create): Handle Solaris' failure mode when + FILE is a directory. Reported by Vin Shelton. + + * lib/human.c: Include or for strlen prototype. + * lib/getline.h [__GLIBC__ >= 2]: #if-out prototypes. + * src/remove.c (pop_dir): Cast length to `int' to avoid a warning on + 64-bit systems. From Ulrich Drepper. + +1999-05-12 Jim Meyering + + * src/shred.c (main): Put `u' for -u in getopt_long's string argument. + Remove the `R'. + +1999-05-07 Jim Meyering + + * Version 4.0h. + + * tests/touch/dir-1: New test. + * tests/touch/Makefile.am (TESTS_ENVIRONMENT): Remove individual + upper-case program names. Add a definition of PATH. + (TESTS): Add dir-1. + + * src/mkdir.c (main): Use better wording in diagnostic: `cannot + create directory' rather than `cannot make directory'. The former + also matches the one in makepath.c. + + * src/dd.c (apply_translations): Use TOUPPER and TOLOWER, + not toupper and tolower. + +1999-05-05 Jim Meyering + + * lib/makepath.c (make_dir): When reporting a mkdir failure and the + target cannot be `stat'ed, use the errno from the failed mkdir call, + not the one from the stat call. Before this change, running + `mkdir -p /no-dir/no-dir' as an unprivileged user would wrongly + elicit `No such file or directory' instead of `Permission denied'. + + * lib/strtol.c (TYPE_SIGNED, TYPE_MAXIMUM, TYPE_MINIMUM): Define. + (ULONG_LONG_MAX, LONG_LONG_MAX, LONG_LONG_MIN): Define if not defined. + Based on a patch from Kaveh Ghazi. + + * src/ls.c (USE_ACL): Define this only #if + (HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT). + Use `USE_ACL' in place of `HAVE_ACL' everywhere else. From Kaveh Ghazi. + +1999-05-04 Jim Meyering + + * lib/makepath.c: Include makepath.h libintl.h, not after it. + Otherwise, we'd get the wrong definition of PARAMS from libintl.h. + (The method of defining PARAMS in libintl.h doesn't check PROTOTYPES, + which is necessary on Irix4 since cc doesn't define __STDC__.) + From Kaveh Ghazi. + +1999-04-30 Jim Meyering + + * Makefile.maint: Define several tag-related make variables. + (cvs-dist): Use the make variables instead of shell ones. + (announcement): Automatically generate diffs for all ChangeLog files, + not just the top level one. + +1999-04-30 Paul Eggert + + * lib/dup2.c: New file. + +1999-04-30 Jim Meyering + + * src/touch.c (touch): Only do the fstat if we need to. + Resort to calling stat for directories, but only when necessary. + (usage): Mention --no-create. + + * src/copy.c (copy_internal): Move the one-file-system test so that + it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block. + Prior to this change, `cp --one-file-system' would traverse a file- + system boundary if the destination directory existed. From Ton Hospel. + +1999-04-27 Paul Eggert + + * src/dd.c: Always use STDIN_FILENO for input and STDOUT_FILENO + for output, to avoid confusion with closed input and output fds. + (input_fd, output_fd): Remove; all uses changed to STDIN_FILENO + and STDOUT_FILENO. + (open_fd): New function. + (main): Use it, instead of open, to ensure that file descriptors + don't get confused. + +1999-04-26 Paul Eggert + + * src/ls.c (decode_switches): Use STDIN_FILENO, STDOUT_FILENO instead + of 0, 1. + + * src/dd.c (skip): Don't fstat the input file; the result is + no longer used. + +1999-04-26 Jim Meyering + + * tests/mv/into-self-2: Update to reflect this change by reversing + the order of arguments so the symlink is the source, not the + destination (otherwise, the mv command would now succeed). + + * src/copy.c (copy_internal): Don't make `mv foo symlink-to-foo' fail. + That is, even though source and destination are `the same,' don't fail + if the destination is a symlink. From Peter Samuelson. + +1999-04-26 Paul Eggert + + * src/dd.c (main): If you can't open an output file (with + seek=...) read-write, then open it for write and report an + error if we can't seek. + + * lib/filemode.c (setst, ftypelet, mode_string): + * lib/mkdir.c (mkdir): + * lib/makepath.c (make_path): + * lib/modechange.c (make_node_op_equals, mode_compile, + mode_create_from_ref, mode_adjust): + * lib/modechange.h (mode_adjust): + * src/chmod.c (describe_change, change_file_mode): + * src/copy.c (copy_reg, copy_internal): + * src/copy.h (struct cp_options.umask_kill): + * src/cp.c (do_copy, cp_option_init, main): + * src/dd.c (main): + * src/install.c (mode, cp_option_init, DIR_MODE): + * src/mkdir.c (main): + * src/mkfifo.c (main): + * src/mknod.c (main): + * src/mv.c (cp_option_init): + * src/touch.c (open_maybe_create): + Use proper mode_t types and macros. + Don't assume the traditional Unix values for mode bits. + + * lib/filemode.c (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, + S_IXOTH): Define if not defined. + (rwx): Remove. + * lib/mkdir.c (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined. + * lib/makepath.c (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRWXU): + Define if not defined. + * src/system.h (S_ISUID, S_ISGID, S_ISVTX, S_IRWXU, S_IRWXG, S_IRWXO): + Define if not defined. + (CHMOD_MODE_BITS): New macro. + * src/install.c (isodigit): Remove unused macro. + + * src/mkfifo.c, src/mknod.c (usage): + Use symbolic mode as default, not octal. + + * lib/utime.c (utime_null): + Don't pass 0666 to open; it's not needed and isn't + guaranteed to be portable. + + * lib/filemode.h: , : Include for mode_t. + (mode_string): Now takes mode_t. + + * lib/modechange.h: Include , for mode_t. + (struct mode_change): Members affected and value are now mode_t instead + of unsigned short. + + * doc/fileutils.texi, doc/perm.texi: + Don't assume traditional Unix mode numbering. + + * lib/modechange.c: modechange.h now includes sys/types.h. + Include xstrtol.h. + (isodigit, oatoi): Remove. + (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, + S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRWXU, S_IRWXG, + S_IRWXO): Define if not defined. + (CHMOD_MODE_BITS): New macro. + (mode_compile): Convert from octal with xstrtoul, not our own routine. + +1999-04-24 Jim Meyering + + * Version 4.0g. + +1999-04-22 Jim Meyering + + * src/shred.c (word32): Don't use `#error'; it runs afoul of + SunOS 4.1.4 cc. From Paul Eggert. + + * lib/strtoull.c: Guard strong_alias and weak_alias with #ifdef _LIBC. + +1999-04-20 Paul Eggert + + Replace our temporary hack implementation of strtoumax with + something very close to the real code in glibc. + + * lib/xstrtoumax.c: Remove the temporary strtoumax replacement; + we now have a true replacement in strtoumax.c. + (__strtol): Always define to strtoumax. + (): No need to include. + (PARAMS): Remove. + (my_strtoumax): Move this to strtoumax.c, + rename it to strtoumax, and simplify. + + * lib/strtoull.c, lib/strtoumax.c: New files. + + * lib/strtol.c: Update to glibc 2.1.1 version. + +1999-04-20 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): s/posix-warn/env-warn/. + (check-local): Also test and warn if CDPATH is set. + +1999-04-20 Paul Eggert + + * configure.in (AC_CANONICAL_HOST): Add; needed for new AC_LFS's + cross-compilation. + * config.guess: New file (from autoconf). + * config.sub: New file (from autoconf). + + * src/shred.c : Include first, since it can do + things like #define const, and this must be done before + including any system headers. + + * lib/xstrtoumax.c (my_strtoumax): Fix typo in computing + whether overflow occurred. Improve overflow-detection to use + only one conditional branch total, rather than 2N+1 + conditional branches for an N-digit number. + +1999-04-18 Jim Meyering + + * configure.in (AC_CHECK_FUNCS): Remove strtoull, strtoumax, and + strtouq, now that they're checked in m4/xstrtoumax.m4. + +1999-04-18 Paul Eggert + + * doc/fileutils.texi, src/shred.c (main, longopts): + Use -u instead of -R for --remove, so that we can preserve + future compatibility with rm. + +1999-04-18 Jim Meyering + + * src/shred.c [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536. + (do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize + member directly. + +1999-04-18 Paul Eggert + + Fix shred to do the right thing with off_t longer than long. + Merge large-integer parsing code with similar code in dd.c, + and put the resulting in lib/xstrtoumax.c so that other programs + can use it. Instead of adding a new lib/xstrtoumax.h I thought + it cleaner to put all the xstroto* declarations into a single + header, which for now is lib/xstrtol.h for lack of a better place. + (Mayby lib/xstdlib.h would be better? :-) + + I thought of several other problems with shredding regular files; + shredding devices is much more reliable. So I changed the defaults + to be more suitable for shredding devices; this should help encourage + users to do the right thing. + + pfstatus isn't portable to environments with varying width + fonts, or with internationalized environments where the byte + count of the message is not the same as its print width. + Rather than deal with this, I just simplified it to not do + tricks with carriage-returns and spaces. (I'm also worried + that vprintf may not return the right value on some hosts; I + vaguelly recall this being a problem.) As a result, -v and - + no longer conflict. + + When removing a special file, try to truncate it first, but don't + worry if this reports an error. + + Try to find the size of a non-regular file by seeking to its end. + + Various porting fixes, mostly because of a port to SunOS 4.1.4 cc. + + Some other minor bug fixes. + + * lib/xstrtoul.h: Remove this file. + * lib/xstrtoumax.c: New file. + + * configure.in (AC_CHECK_FUNCS): Add strtoull, strtoumax, strtouq. + + * lib/xstrtoul.c (STRING_TO_UNSIGNED): Remove. + (__strtol, __strtol_t, __xstrtol): New macros. + + * lib/xstrtol.c (__strtol, __strtol_t, __xstrtol): + New macros to specify the + underlying function, its returned type, and our function. Default to + values suitable for xstrtol. + + Include , since we use its macros. + + (ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed. + (ISSPACE): New macro. + + (bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int + -> __strtol_t. + + (__xstrtol): Depend on whether __strtol_t is an unsigned type, not on + whether STRING_TO_UNSIGNED is defined. Skip isspace chars, not + isblank chars, to match strtol. When returning + LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into + *val. + + * lib/xstrtol.h (__xstrtol, __strtol, __unsigned): Remove macro decls. + : Include if HAVE_INTTYPES_H. + (_DECLARE_XSTRTOL): New macro. + (xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that + we need only one include file, not three. + (_STRTOL_ERROR): Do not undef, as this is no longer needed. + Reword overflow message so that it's independent of type. + + * lib/Makefile.am (libfu_a_SOURCES): Add xstrtoumax.c. + (noinst_HEADERS): Remove xstrtoul.h. + + * lib/xmalloc.c (xalloc_fail): + Pass xalloc_msg_memory_exhausted through gettext. + + * lib/getdate.y: + : Include if HAVE_STDLIB_H, since bison 1.27 invokes "free". + (LookupWord, yylex): Don't pass negative char to ctype macros. + + * doc/fileutils.texi: + Explain why shredding devices is more reliable, and why the + default options are more suitable for devices. + + Remove withdrawn options -b or --no-contents, -c or --freed-contents, + -C or --all-contents, -k or --no-links, -l or --ordinary-links, -L or + --all-links. + + Add -R or --remove, -s or --size. + + -v can no longer be doubled. + + `file system' --> `filesystem' uniformly. + + * src/chgrp.c: Include xstrtol.h, not obsolete file xstrtoul.h. + + * src/shred.c: Include xstrtol.h, not obsolete file xstrtoul.h. + "human.h", "xalloc.h": Include. + (attribute): Remove; no longer needed. + (xstrdup): New decl. + (STDOUT_FILENO): New macro. + (O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H. + + The following changes have effect only if !HAVE_CONFIG_H. + : New include. + (RETSIGTYPE): Remove bogus semicolon at end. + (STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE): + New macros. + (xstrtoumax): Renamed from xstrtoul, with corresponding type changes. + Handle suffixes like the real routine does. + (error): Remove bogus assignment of errno to errnum. + (xmalloc, xstrdup): New functions. + + (O_NOCTTY): Define even if !HAVE_CONFIG_H. + (S_ISFIFO, S_ISSOCK): New macros, if not already defined. + (OUTPUT_BLOCK_SIZE): New macro. + (struct Options.verbose): Now a boolean, since we no longer have two + levels of verbosity. + (long_opts, usage, main): Remove -D or --device option. Invert -p or + --preserve option, and rename it to -R or --remove. + (usage): Describe G suffix. + (usage): "-" no longer conflicts with -v. + (UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it. + (ind): Portability fixes: return word32, not unsigned; multiply by + sizeof (word32) instead of shifting left by 2. + (isaac_refill, isaac_mix): Comment out size of array parameter, as + ansi2knr mishandles this. + (status_visible, status_pos, pfstatus, flushstatus): Remove, since + pfstatus isn't portable to users with varying width fonts, or + internationalized messages, and vfprintf is problematic. All callers + of pfstatus changed to use error instead; this removes incompatibility + of -v with -. All calls to flushstatus removed. + (dopass, do_wipefd): Do not translate non-English msgs with gettext. + + (dopass): Cast lseek constant arguments to (off_t) for benefit + of pre-ANSI compilers; fix one lseek call whose args were interchanged. + Remove unnecessary casts to (off_t). Do not check for EIO + when determining file size; this was just my earlier wild guess. + Use human_readable to print off_t, instead of casting to unsigned long + (which doesn't work in Solaris 2.6, where off_t is longer than long). + Output human-readable sizes, instead of always using "K". + Check for offset overflow (it happened to me in SunOS 4.1.4). + (do_wipefd): Do not insist on regular files, but do check for special + files that cannot possibly be shredded. + Use xmalloc instead of malloc + check. + Do not inspect st_size for non-regular files. + Try to find the size of a non-regular file by seeking to its end. + Do not assume that a regular file of size-0 has unknown size. + Check for regular files with negative sizes, + and for overflow after rounding to next block. + Always try to truncate, even for special files, but do not report an + error if truncation fails on a special file. + + (dopass, wipefile): Do not return 1 for special files; the caller + doesn't care any more. + + (wipefd): Remove unnecessary (and nonportable) check for + whether the file descriptor is read-only. Remove + no-longer-needed check for `-v -'. + + (incname): Return 1 for carry bit, like the documentation says. + + (wipename, wipefile): Accept new argument, specifying the + quoted file name. All callers changed. + + (wipename): Use xstrdup instead of strdup+error check. + + (wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for + errors in NNN more carefully. Restore errno after the check. + Check for errors when closing the file descriptor. + Use more consistent wording when unable to remove a file. + + (main): Do not remove files by default. + Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't + exist if !HAVE_CONFIG_H. + In diagnostics, quote invalid operands to -n and -s options. + Allow T, P, E, Z, and Y suffixes in -s operand. + flags.verbose is now a boolean, not a counter. + Use STDOUT_FILENO instead of 1, for clarity. + + * lib/human.c: + Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the + xstrto... functions. + + * src/dd.c: Include xstrtol.h. + (parse_integer): Migrate most of the work into the new xstrtoumax fn. + + * lib/xstrtoumax.c: New file. + +1999-04-18 Jim Meyering + + * src/dd.c (main): Open the output file with *read* access + only if we might need to read to satisfy a `seek=' request. + From Matthias Urlichs. + +1999-04-10 Jim Meyering + + * Makefile.maint (alpha): Add trailing slash for ncftp. + + * Version 4.0f. + + * configure.in (AC_OUTPUT): Add tests/dd/Makefile. + * tests/Makefile.am (SUBDIRS): Add dd. + * tests/dd: New directory + * tests/dd/misc: New file. + + `ls --color' would segfault + * src/ls.c: Include assert.h. + (color_indicator[]): Add an entry for the type, `door.' + (main): Assert that the lengths of the color_indicator and + indicator_name arrays are appropriately related. + Reported by John Gotts. + + * src/dd.c (scanargs): Fix bug introduced with last change: now that + the loop is gone, manually decrement argc and increment argv. + Reported by Andreas Jaeger and jvogel@linkny.com. + +1999-04-07 Jim Meyering + + * lib/getdate.y (difftm): Protoize. + +1999-04-06 Jim Meyering + + * lib/strftime.c: Update from master source in libc. + +1999-04-04 Jim Meyering + + * tests/ln/misc: Comment out the test added on 1999-01-31. + + * Makefile.maint (url_dir_list): Define properly. + (real_dir_list): Likewise. + + * src/shred.c: Don't include string.h. + [!HAVE_CONFIG_H]: Include string.h here. + [!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'. + (sigill_handler): Change return type and type of local `oldhandler' to + RETSIGTYPE. + (isaac_seed_machdep): Change and type of local `oldhandler' to + RETSIGTYPE. + From Colin Plumb. + + * Version 4.0e + + * tests/cp/same-file: Change the sed command used to extract the + filename from ls -l output, to accommodate the change in format. + + * src/ls.c (print_long_format): Add a space between %s and %3u. This + assures that even when modebuf has the trailing `+' and there are more + than 99 hard links to a file, the permissions string and the link count + will be separated. + +1999-04-03 Jim Meyering + + * src/shred.c (dopass): add curly braces to avoid warning about + ambiguous `else'. + (wipefd): Add parentheses suggested by gcc. + (do_wipefd): Remove declaration of unused local. + +1999-04-02 Colin Plumb + + * shred.c [!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs + to allow standalone compilation. + + (wipefile): Added support for emulating /dev/fd/# files even if + the OS doesn't support them. From Paul Eggert. + + (main, usage): Changed --device short option to -D. + + (wipefd, do_wipefd): Renamed function to do_wipefd and added + separate wipefd that performs sanity checks on externally-opened file + descriptors, such as not append-only. From Paul Eggert. + + (do_wipefd, isaac_seedfd): Do not read file for any reason. + if the file is low-entropy, it's a security hole. + (wipefile) Changed to open O_WRONLY and chmod to write-only when + forcing. + (isaac_seedfd) Function deleted as unnecessary. + From Paul Eggert. + + (dopass): Dynamically fall back to fsync() if fdatasync() fails, + since POSIX, in their infinitesimal wisdom, encourage implementations + that return constant -1, making compile-time testing useless. + From Paul Eggert. + + (dopass): Changed to support a size of -1 to mean "unknown". + This entailed changing to a counting-up offset rather than couting-down + cursize for the central state variable. Also changed size argument to + be call-by-reference so that it can be passed back once known. + (sizer) Function deleted as unnecessary. + (wipefd): Changed to match. From Paul Eggert + + (dopass): Try to skip over bad blocks in destination files. + Also added ftruncate() for more complete destruction of metadata. + + (main, usage): Changed "-" to stand for standard output. + (wipefd): Added error message to detect conflict with -v. + + (dopass): Added periodic fsync() calls to keep the pass progress + display in sync with reality. Hopefully they're sufficiently far spaced + that throughput isn't affected. It might be a good thing to do even in + non-verbose mode, to avoid filling up the kernel caches with dirty data. + Also added ftruncate() for more complete destruction of metadata. + + (quotearg_colon): New function to print + pathological filenames properly. + [!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function + that does most of the work. + (wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument. + (wipename, wipefile, main) Changed diagnostics to use quotearg_colon. + Error messages are also in a more uniform format. + From Paul Eggert. + + (struct Options, main, do_wipefd): Added -s/--size=N flag. + (xstrtoul): Added support for valid_suffixes to help this. + (usage) Documented it. + + (error): Changed some arguments from N_() to _(), since error() + does not translate its argument. I think this is a bug. + + (struct Options do_wipefd, wipefd, wipefile, main): moved passes + argument into the Options structure as n_iterations, which is now a + size_t. From Paul Eggert. + + (isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions + to manage seeding of RNG with arbitrary-sized data. + (isaac_init): commented out as dead code. + (isaac_seed): changed to use new functions to prevent any possibility of + a buffer overflow. + + (isaac_seed): Added support for Solaris' gethrtime() + configure.in: Corresponding feature test. From Paul Eggert. + + (wipename): Change remove() to unlink() for speed & portability. + Use lstat() instead of access() to see if a filename is taken. This + works even on dangling symlinks and avoids the suid problems of + access(2). From Paul Eggert. + + (isaac_seed_machdep): New function for reading cycle counters + +1999-04-02 Paul Eggert + + * configure.in (AC_CHECK_FUNCS): Add gethrtime. + + * src/shred.c (isaac_seed): Don't overrun the s->mm buffer. + Use gethrtime if available. Don't assume that clock_gettime succeeds. + Put most random sources first. + +1999-04-02 Paul Eggert + + shred: Add new options -bcCklL and fix some porting problems. + Remove options -dp. Do not read output files. + + * src/shred.c (long_opts, usage, main, wipefile): Adjust to + new options. + ("human.h", "quotearg.h"): New includes. + (struct Options): New members contents, links, n_iterations. + Remove allow_devices, remove_file. Change n_iterations to size_t. + All uses changed. + (output_block_size): New var. + (usage): Declare __noreturn__ attribute. + (fdatasync): Define to -1 if not present, since we need to invoke both + fdatasync and fsync if both are present. All invokers of fdatasync + now try fdatasync, then fsync. + (MIXIN): New macro. + (isaac_seed): Use it to mix in values. Add uid, gid to mix. + Don't use gettimeofday, as it has too many porting problems. + (isaac_seedfd): Remove, since we no longer read the output files. + (sizefd): Remove; we now determine size by writing sequentially. + (dopass, wipename, wipefile, main): Clean up error messages. + (dopass): Keep track of offset relative to start of file, not + end, since we may not know how large the file is. If size is + negative, write until we fall off the end of the file. + (wipefd): Do not read output file. + Return 0 if successful, -1 if not; do not make a special case for + non-regular files, since our callers have that info now. + (wipename): Now static. Return errno if error. + (main): "-" now stands for standard output. + Do not shred append-only standard output. + (wipefile): Do not grant read permission to file when wiping it. + Use symbolic permission (S_IWUSR), not octal. + + * src/system.h (S_IWUSR): Define if not already defined. + + * configure.in (AC_SEARCH_LIBS): Prefer rt to posix4, for Solaris 7. + (AC_CHECK_FUNCS): Remove gettimeofday. + + * doc/fileutils.texi: Document recent changes. + +1999-04-01 Jim Meyering + + * configure.in (AC_CHECK_FUNCS): Add acl. + (AC_CHECK_HEADERS): Add sys/acl.h. + * src/ls.c [HAVE_SYS_ACL_H]: Include sys/acl.h. + (struct fileinfo): New member `have_acl'. + (gobble_file): Initialize it. + (print_long_format): Use it. + Mostly from Alen Muzinic. + + * src/touch.c (open_maybe_create): New function. + (touch): Rewrite not to use `creat' and to eliminate a race + condition that could make touch truncate a nonempty file. + Report and suggestions from Andrew Tridgell. + +1999-03-31 Jim Meyering + + * src/du.c: Remove prototypes and tsort function definitions. + + * src/chown.c (main): Move the declaration of `e' into the scope + where it's used and make it `const'. + + * src/install.c (main): Qualify a char* with the `const' keyword. + (install_file_in_dir): Likewise. + * src/ln.c (main): Likewise. + * src/mkdir.c (main): Likewise. + * src/mkfifo.c (main): Likewise. + * src/mknod.c (main): Likewise. + * src/mv.c (main): Likewise. + * src/touch.c (touch): Likewise. + +1999-03-30 Jim Meyering + + * src/*.c: Don't include closeout.h or version-etc.h explicitly. + Now, they're included via sys2.h. + +1999-03-29 Jim Meyering + + * configure.in (GNU_PACKAGE): Remove related code -- now it's in + the catch-all for shared autoconf code, m4/jm-macros.m4. + (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use + this instead. + +1999-03-29 Paul Eggert + + Minor lint removal in code that forks and execs. + + * lib/mkdir.c (mkdir): Use pid_t instead of int; check status + against zero. This is to improve portability. + * lib/rename.c (rename): Likewise. + * lib/rmdir.c (rmdir): Likewise. + + * lib/rename.c (rename): + (rename): Do not print any error messages, so that the messages + are internationalized properly. + + * src/install.c (strip): Use standard "cannot fork" message. + Check for strip nonzero exit status. + +1999-03-28 Jim Meyering + + `chmod =OP' did not properly apply the umask + * lib/modechange.c (make_node_op_equals): New function. + (mode_append_entry): Likewise. + (mode_compile): When none of [ugoa] is specified in an `=OP' change + mode request, insert a `=0' entry into the linked list so that all + bits are cleared first. Use the new functions. + Reported by Andrew Dalke. + + New test for the above. + * configure.in (AC_OUTPUT): Add tests/chmod/Makefile. + * tests/Makefile.am (SUBDIRS): Add chmod. + * tests/chmod: New directory + * tests/chmod/equal-x: New file. + +1999-03-27 Jim Meyering + + * lib/modechange.c (mode_compile): Upon allocation failure, free + everything starting with the head, not the tail. + + * src/install.c (strip): Use pid_t, not int. From John Bley. + +1999-03-26 Jim Meyering + + * src/dd.c (PROGRAM_NAME, AUTHORS): Define + (long_options): Remove unused struct. + (scanargs): Remove useless loop. + (main): Use PROGRAM_NAME and AUTHORS in call to parse_long_options. + * src/mvdir.c: Likewise. + * src/sync.c (PROGRAM_NAME, AUTHORS): Define and use. + +1999-03-25 Jim Meyering + + * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c. + (noinst_HEADERS): Add version-etc.h. + + * lib/long-options.c (parse_long_options): Remove version-, copyright-, + and author-printing code. Do it via version_etc. + + * lib/version-etc.c: New file. + * lib/version-etc.h: Prototype for same. + + * src/sys2.h (GETOPT_HELP_CHAR): Define. + (GETOPT_VERSION_CHAR): Define. + (GETOPT_HELP_OPTION_DECL): Define. + (GETOPT_VERSION_OPTION_DECL): Define. + (case_GETOPT_HELP_CHAR): Define. + (case_GETOPT_VERSION_CHAR): Define. + + * src/chgrp.c: No longer include long-options.h. + Include version-etc.h instead. + (PROGRAM_NAME, AUTHORS): Define. + [long_options]: Add entries for --help and --version. + Remove parse_long_options call. + (main) [getopt switch]: Add a case for each of --help and --version. + * src/chgrp.c: Likewise. + * src/chmod.c: Likewise. + * src/cp.c: Likewise. + * src/df.c: Likewise. + * src/dircolors.c: Likewise. + * src/du.c: Likewise. + * src/install.c: Likewise. + * src/ln.c: Likewise. + * src/ls.c: Likewise. + * src/mkdir.c: Likewise. + * src/mkfifo.c: Likewise. + * src/mknod.c: Likewise. + * src/mv.c: Likewise. + * src/rm.c: Likewise. + * src/rmdir.c: Likewise. + * src/shred.c: Likewise. + * src/touch.c: Likewise. + +1999-03-24 Jim Meyering + + * man/help2man: Import version 1.010. + +1999-03-22 Jim Meyering + + * src/chmod.c (usage): Add one-liner. Suggestion from Karl Berry. + +1999-03-19 Jim Meyering + + * src/automake-wrap: Rewrite the automake-generated rule for + clean-binPROGRAMS so that it removes rm even with a losing PATH on a + losing system (PATH with `.' before /bin on a system where you can't + unlink a running executable). Reported by William Bader. + + * configure.in: Use jm_WINSIZE_IN_PTEM. + * src/ls.c [WINSIZE_IN_PTEM]: Include sys/stream.h and sys/ptem.h. + Required by SCO ODT 2.0 systems. Reported by William Bader. + +1999-03-18 Jim Meyering + + * src/remove.c (remove_cwd_entries): Reflect changes in hash_insert. + (remove_init): Call hash_initialize with one more argument. + +1999-03-15 Jim Meyering + + Revamp to allow fine-tuning to control when and by how + much the table grows and shrinks. + * lib/hash.c (next_prime): Don't assert. + (hash_reset_tuning): New function. + (check_tuning): New function. + (hash_initialize): Accept and use new tuning parameter. + (hash_rehash): Rewrite, updating for tuning. + (hash_insert): Honor tuning semantics. + (hash_delete): Likewise. + From François Pinard. + + * lib/hash.h (struct hash_tuning): Define. + (struct hash_table) [tuning]: Add member. + (hash_initialize): Add `tuning' parameter. + + * lib/hash.c (hash_insert): Remove last parameter and change semantics. + * lib/hash.h (hash_insert): Update prototype. + + * lib/hash.c (hash_insert): Don't increment n_entries unconditionally -- + otherwise, we'd do so even when the insertion failed. + From François Pinard. + +1999-03-07 Jim Meyering + + * lib/xmalloc.c (xalloc_fail): Use "%s" format so the message doesn't + have to be scanned for % signs. Suggestion from François Pinard. + + * Makefile.maint: Add two more URLs and the loops to use them. + + * lib/long-options.c (parse_long_options): Include `Copyright...' line + in --version output. + Add the `...NO warranty...' message. + +1999-03-03 Jim Meyering + + * lib/long-options.c (_): Define it. + (parse_long_options): Accept new parameter, authors, and print it. + + * lib/long-options.h: Update prototype. + + * src/chgrp.c: Include long-options.h + [long_options]: Remove the "help" and "version" entries. + (main): Use parse_long_options, including author name(s). + Remove the show_version and show_help blocks. + * src/chmod.c: Likewise. + * src/chown.c: Likewise. + * src/cp.c: Likewise. + * src/dd.c: Likewise. + * src/df.c: Likewise. + * src/dircolors.c: Likewise. + * src/du.c: Likewise. + * src/install.c: Likewise. + * src/ln.c: Likewise. + * src/ls.c: Likewise. + * src/mkdir.c: Likewise. + * src/mkfifo.c: Likewise. + * src/mknod.c: Likewise. + * src/mv.c: Likewise. + * src/mvdir.c: Likewise. + * src/rm.c: Likewise. + * src/rmdir.c: Likewise. + * src/shred.c: Likewise. + * src/sync.c: Likewise. + * src/touch.c: Likewise. + +1999-02-18 Paul Eggert + + * getdate.y: : Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H. + The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days. + +1999-02-17 Jim Meyering + + * src/shred.c (wipename): Fix string thinko. Now, shredding files + in subdirectories works (dir/file). From Janos Farkas. + +1999-02-13 Jim Meyering + + * src/dircolors.c (dc_parse_stream): Don't try to dereference + NULL if there's an error in our built-in list. + Suggestion from François Pinard. + +1999-02-13 Andreas Schwab + + * src/install.c (main): Set x.backup_type only if backups are requested. + (cp_option_init): Initialize backup_type. + (backup_type): Remove unused variable. + + * doc/fileutils.texi: Fix use of @item vs @itemx. + +1999-02-08 Jim Meyering + + * src/dircolors.c (slack_codes): Add "DOOR". + (ls_codes): Add corresponding "do". + Reported by John Gotts. + + * configure.in (ALL_LINGUAS): Add Italian (it). + +1999-02-07 Jim Meyering + + * Version 4.0d (aka 4.1-b4). + + * Makefile.maint (my-distcheck): Don't depend on dist, now that this + is hooked up to the distcheck rule. + * Makefile.am (distcheck-hook): New target and rule -- link to shared + rule, my-distcheck, in Makefile.maint. + + * doc/fileutils.texi (shred invocation): New section. From Colin Plumb. + + * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file, + group-member.m4, and just use this new macro. + Use `.$ac_objext', not the literal `.o'. + +1999-02-02 Jim Meyering + + * src/ls.c (S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR): + Define to zero if not already defined. + (HAVE_SYMLINKS): Define. + (gobble_file): Remove #ifdef. + (get_link_name, make_link_path): Guard these with #if HAVE_SYMLINKS + rather than #ifdef S_ISLNK. + (print_type_indicator): Remove #ifdefs and reorganize. + (print_color_indicator): Remove #ifdefs. + (length_of_file_name_and_frills): Likewise. + +1999-02-01 Rainer Orth + + * src/dircolors.hin: Handle DOOR. + + * src/ls.c (print_type_indicator): Print doors as '>'. + (length_of_file_name_and_frills): Account for this. + (indicator_no): Define C_DOOR. + (indicator_name): Add corresponding name. + + * lib/filemode.c (ftypelet): Handle doors. + + * lib/filemode.c, src/system.h (S_ISDOOR): Define if missing. + +1999-02-01 Jim Meyering + + * lib/strcasecmp.c (STRXCASECMP_FUNCTION): Don't increment within macro + argument list. From Akim Demaille. + +1999-01-31 Jim Meyering + + * doc/fileutils.texi: Wrap the @top node in @ifnottex instead of + @ifinfo so `makeinfo --html ...' works. From Karl Berry. + + * tests/ln/misc: Add test for this. + * src/ln.c (do_link): Allow creation of a hard link to a dangling + symlink. Reported by Alexey Solovyov. + + * src/copy.c (copy_internal): Describe any backup-related renaming + operations when in verbose mode. + (copy_internal): Likewise. + Based on changes from Marty Leisner. + + * lib/lchown.c: Declare chown. + +1999-01-30 Jim Meyering + + * acconfig.h: Remove uintmax and STAT* #undefs. + * configure.in: Require autoconf 2.13. + Remove test for AFS. + Use 3-argument form of AC_DEFINE*. + +1999-01-28 Jim Meyering + + * po/POTFILES.in: Add src/shred.c. + + * src/system.h: Use TIME_WITH_SYS_TIME-based #if test rather than + TM_IN_SYS_TIME based one (for shred). + + * acconfig.h: Remove lots of `#undef's, now that we use the + 3-argument forms of AC_DEFINE* macros. + +1999-01-25 Jim Meyering + + * configure.in (fdatasync): Use AC_CHECK_FUNCS instead of + AC_REPLACE_FUNCS. + (AC_CHECK_FUNCS): Add clock_gettime. + + * src/shred.c (isaac_seed): Guard clock_gettime with test of + HAVE_CLOCK_GETTIME, not CLOCK_REALTIME. + (wipename): Rename local dirfd to dir_fd to avoid shadowing the + function declared in Linux's dirent.h. + +1999-01-25 Akim Demaille + + * lib/argmatch.h (ARRAY_CARDINALITY): Define. + (ARGMATCH_ASSERT): New macro. + + * lib/argmatch.c (program_name): Remove dcl. + Include error.h. + (argmatch_invalid): Use error rather than fprintf. + +1999-01-24 Jim Meyering + + * src/ansi2knr.c: Exit nonzero upon failed write to stdout. + New version from L. Peter Deutsch. + + * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n' + (and hence that of the local `n1', too) to `int' at Paul's request. + + * lib/closeout.c: Add comments. + + * src/shred.c (fdatasync): Remove function. instead, ... + (fdatasync) [! HAVE_FDATASYNC]: Define to fsync. + From Colin Plumb. + +1999-01-23 Jim Meyering + + * src/Makefile.am (bin_PROGRAMS): Add shred. + * src/shred.c: New file. + Portability tweaks. + Internationalize. + (wipename): Print the `FILE: deleted' and `FILE: deleting' messages + only when in verbose mode. + (fdatasync) [! HAVE_FDATASYNC]: New function. + + * man/Makefile.am (man_MANS): Add shred.1. + * man/Makefile.summ (shred-summary): Define. + * man/shred.x: New file. + + * src/shred.c: New file. From Colin Plumb. + Include config.h, getopt.h, system.h and error.h. + Use #else/#if, not #elif. + +1998-11-05 Paul Eggert + + * lib/mktime.c (__mktime_internal): Adopt the traditional (and + problematic) notion of what to do when tm_isdst doesn't match. + +1999-01-17 Jim Meyering + + * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set PATH here, rather + than setting RM and CP. + * tests/cp/*: Now that PATH is set properly, use rm and cp rather + than $RM and $CP. + + * tests/ln/Makefile.am (TESTS): Add backup-1. + (TESTS_ENVIRONMENT): Set PATH here, rather than setting LN. + * tests/ln/*: Now that PATH is set properly, use ln rather than $LN. + * tests/ln/backup-1: New test for this. + * src/ln.c (do_link): Try to remove DEST even after renaming it. + This fixes a bug reported by Jamie Lokier. + + * src/ln.c (same_name): Use SAME_INODE rather than open coding it. + +1999-01-16 Jim Meyering + + * lib/argmatch.c (ARGMATCH_DIE_DECL): Use it. + + * acconfig.h: Remove @BOTTOM@ section. + Instead, add the define and decl via m4/jm-macros.m4. + + * src/ls.c: Don't declare base_name. + Use function-style XARGMATCH once again. + * src/touch.c: Likewise. + * acconfig.h: Add a @BOTTOM@ section. + (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1). + Declare usage. + From Akim Demaille. + + * src/cp.c: Remove declarations of base_name and get_version. + (main): Don't call getenv ("VERSION_CONTROL"); xget_version does it. + Use xget_version and function-style XARGMATCH. + * src/mv.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/install.c (main): Likewise. + * lib/quotearg.c (quotearg_n_options): Declare n1 to be of type + unsigned int, not just int. + * lib/backupfile.h (get_version): Adjust prototype. + (xget_version): Add prototype. + (base_name): Remove prototype. + * lib/backupfile.c [!HAVE_DECL_GETENV]: Declare getenv. + (backup_args): Reorder enum members. + (backup_types): Likewise. + (get_version): Take an additional parameter, `context'. + (xget_version): Like get_version, but if the `version' argument is NULL, + use the value of the envvar VERSION_CONTROL. + (base_name): Declare. + Mostly from Akim Demaille. + + * lib/addext.c (base_name): Declare. + * src/sys2.h: Add prototype for base_name. + + * lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/ + * lib/argmatch.h: Likewise. + + * lib/argmatch.h (XARGMATCH): Define to return a value once again. + (XARGCASEMATCH): Likewise. + + * lib/argmatch.c (EXIT_FAILURE): Define. + (ARGMATCH_DIE): Provide default. + (__xargmatch_internal): New function. + s/rogram_name/program_name. + From Akim Demaille. + +1999-01-14 Akim Demaille + + * src/touch.c (usage): Don't make it static so that it can be + called from libfu.a by xargmatch. + * src/chgrp.c (usage): Likewise + * src/chmod.c (usage): Likewise + * src/chown.c (usage): Likewise + * src/cp.c (usage): Likewise + * src/dd.c (usage): Likewise + * src/df.c (usage): Likewise + * src/dircolors.c (usage): Likewise + * src/du.c (usage): Likewise + * src/install.c (usage): Likewise + * src/ln.c (usage): Likewise + * src/ls.c (usage): Likewise + * src/mkdir.c (usage): Likewise + * src/mkfifo.c (usage): Likewise + * src/mknod.c (usage): Likewise + * src/mv.c (usage): Likewise + * src/mvdir.c (usage): Likewise + * src/rm.c (usage): Likewise + * src/rmdir.c (usage): Likewise + * src/sync.c (usage): Likewise + +1999-01-12 Akim Demaille + + * lib/backupfile.c (get_version): added the parameters KIND. + (xget_version): like get_version, but if argument is NULL, honor + the envvar VERSION_CONTROL. + * src/cp.c: Remove declarations of base_name and get_version. + (main): Use xget_version. + * src/mv.c (main): Likewise. + * src/ln.c (main): Likewise. + * src/install.c (main): Likewise. + +1999-01-12 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Greek (el). + * po/el.po: New file. + + * install-sh: New version from autoconf. + * missing: New version from automake. + * src/ansi2knr.c: Likewise. + * lib/getopt.c: New version from glibc. + * lib/getopt.h: Likewise. + * lib/getopt1.c: Likewise. + * lib/regex.c: Likewise. + * lib/regex.h: Likewise. + * lib/ylwrap: Remove unused file. + +1999-01-10 Jim Meyering + + * Version 4.0c (aka 4.1-b3). + + * Upgrade to autoconf-2.13 and automake-1.3b. + + * src/copy.c (copy_internal): Handle two more values of errno from + failed rename of a directory into a subdirectory of itself. + Thanks to Volker Borchert for testing many types and combinations + of systems. + + * lib/argmatch.c (ARGMATCH_QUOTING_STYLE): Change from c_quoting_style + to escape_quoting_style. + (argmatch_invalid): Now that the quoted quantity is no longer double + quoted, remove the code that removed leading and trailing double quotes. + + * src/ls.c (decode_switches): Now that escape_quoting_style no longer + escapes the SPACE character, arrange for SPACEs to be quoted here. + * lib/quotearg.c (quotearg_buffer): Change escape_quoting_style so that + it no longer escapes ` '. + Suggestion from Paul Eggert. + +1999-01-05 Jim Meyering + + * configure.in (space): Add `for' in message of statvfs check. + From Ulrich Drepper. + +1999-01-04 Jim Meyering + + * Version 4.1-b2. + +1999-01-02 Jim Meyering + + * lib/argmatch.c (argmatch_invalid): Remove double quotes from the + offending quoted argument before using it in explanatory diagnostic. + Use a single fprintf stmt. + + * lib/argmatch.h (XARGMATCH): Don't return a value; instead, + modify a parameter. Add a `Die_stmt' parameter. + Add parentheses. + * lib/argmatch.c (__xargmatch_internal): Remove now-unused function. + (argmatch_to_argument): Add `const' attribute to first parameter. + + * configure.in (AC_REPLACE_FUNCS): Remove strcasecmp (now it's + done in m4/jm-macros.m4). + + * lib/backupfile.c (get_version): Adapt to use new interface to + XARGMATCH. + * src/cp.c: Likewise. + * src/ls.c: Likewise. + * src/touch.c: Likewise. + +1999-01-01 Jim Meyering + + * lib/makepath.c (make_dir): New function, factored out of make_path. + (make_path): Use make_dir rather than open-coding it twice. + This effectively reverses the order of the latter pair of stat/mkdir + calls and fixes a race condition bug whereby one of two concurrent + `mkdir -p' processes could fail with EEXIST. + Include locale.h and libintl.h, and define `_()'. + Mark translatable strings. + + * lib/xmalloc.c: Add comments. + (xcalloc, xmalloc, xrealloc): Remove prototypes. + (xcalloc): Remove `#ifdef NOT_USED' that used to hide this function. + * lib/xalloc.h: Add comments. + (PARAMS, XMALLOC, XCALLOC, XREALLOC): Define. + (xcalloc, xmalloc, xrealloc): Add prototypes here. + Based on changes from Akim Demaille. + + * lib/quotearg.c (quotearg_buffer): Cast -1 to size_t before comparing. + (quotearg_n): Change type of 1st parameter from int to unsigned int. + (quotearg_n_options): Likewise. + * lib/quotearg.h (quoting_style_vals): New public array. + From Akim Demaille. + (quotearg_n_options): Declare `options' parameter to be `const'. + + * lib/human.c (humblock): Use ARGMATCH in place of argmatch. + + * lib/backupfile.c (get_version): Use XARGMATCH in place of + argmatch & co. + +1998-12-31 Jim Meyering + + * src/ls.c (indicator_style_types): New variable. + (format_types): Rename from `formats'. + (color_args): Remove unnecessary `no' string. + (color_types): Remove corresponding `color_never' entry. + (main): Use ARGMATCH_TO_ARGUMENT. + (decode_switches): Use ARGMATCH instead of argmatch code + in each of several cases. + From Akim Demaille. + + * src/cp.c (main): Use XARGMATCH in place of argmatch & co. + * src/touch.c (main): Likewise. + * lib/backupfile.c (get_version): Likewise. + From Akim Demaille. + + * lib/strncasecmp.c: New file. + * lib/strcasecmp.c: Add #ifdefs so it can be used for strncasecmp, too. + * lib/argmatch.c (strncasecmp): Move to a separate file. + Add curly braces around some one-stmt-but-multiline blocks. + + * lib/argmatch.c: Improvements from Akim Demaille. + * lib/argmatch.h: Likewise. + + * lib/addext.c (addext): Protoize. + Indent cpp directives to match nesting. + + Fix warnings from gcc -W -Wall + * lib/posixtm.c (posix_time_parse): Change type of index `i' from + int to unsigned int. + * lib/getdate.y (__attribute__): Define. + (ATTRIBUTE_UNUSED): Define. + (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED. + (MonthDayTable): Add initializers for last entry. + (UnitsTable): Likewise. + (OtherTable): Likewise. + (MilitaryTable): Likewise. + +1998-12-22 Jim Meyering + + * Version 4.1-b1. + + * configure.in (ALL_LINGUAS): Add chinese (zh). + +1998-12-19 Jim Meyering + + * tests/ln/misc: Use absolute path for final rm. + + * Makefile.maint (my-distcheck): Run make with + CFLAGS='-Wformat -Werror'. + +1998-12-18 Jim Meyering + + * src/copy.c (copy_internal): Remove errnoeous `%s: ' prefix + from format string. From Michiel Bacchiani. + + * src/chgrp.c (MAXGID): Define. + Use gid_t (not int) as the type for `group' variables. + (parse_group): Use MAXGID, not INT_MAX. + + * src/install.c (UID_T_MAX, GID_T_MAX): Remove definitions. + * src/sys2.h (UID_T_MAX, GID_T_MAX): Define them here instead. + +1998-12-13 Jim Meyering + + * lib/Makefile.am (EXTRA_DIST): Add xstat.in. + +1998-12-12 Jim Meyering + + 1998-10-15 Akim Demaille + * src/ls.c: Group DIRED's code together. + (full_time, inhibit_group, col_ext_type): Declare static. + (dired_dump_obstack): Apply sizeof to variable, instead of its type. + (parse_ls_color): Rename ext2 as e2. Move into the block where it + is used. + + 1998-10-15 Akim Demaille + * src/ls.c: In order to distinguish col(umn|or): + (init_column_info): Renamed from init_col_info. + (struct column_info): Renamed from struct col_info. + (struct color_ext_type): Renamed from struct col_ext_type. + +1998-12-11 Jim Meyering + + * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in. + (stat.c): Likewise. + * lib/stat.c: Remove file. + * lib/lstat.c: Remove file. + * lib/xstat.in (xstat@): New file. + + * lib/quotearg.c (quotearg_buffer): Use `7' as the mask, not `3'. + From Bruno Haible. + * tests/ls-2/tests: Add a test for this. + + * man/help2man: import version 1.006. + +1998-12-07 Jim Meyering + + * src/copy.c: Use dir_name, not dirname. Include dirname.h. + * src/cp.c: Likewise. + * src/df.c: Likewise. + * src/install.c: Likewise. + * src/ln.c: Likewise. + * src/mvdir.c: Likewise. + + * lib/dirname.c (dir_name): Rename from dirname. + Make argument `const'. Include "dirname.h" + * lib/dirname.h: New file. + * lib/Makefile.am (noinst_HEADERS): Add dirname.h. + +1998-12-06 Jim Meyering + + * lib/rpmatch.c (rpmatch) [!ENABLE_NLS]: Hard-code tests to use + `^[yY]' and `^[nN]' (avoiding regex). From Karl Heuer. + + * lib/*.c: Ansideclify. + + Fix `ls -R .' formatting bug that broke mktexlsr. + * src/ls.c: Include path-concat.h. + (basename_is_dot_or_dotdot): New function, derived from + is_not_dot_or_dotdot. + (is_not_dot_or_dotdot): Remove function. + (extract_dirs_from_files): Use `!basename_is_dot_or_dotdot' + instead of is_not_dot_or_dotdot and use path_concat instead of attach. + + * tests/ls-2/tests: New file (renamed from quoting), + with new test for the `ls -R .' fix. + * tests/ls-2/quoting: Remove file. + * tests/ls-2/Makefile.am (TESTS): s/quoting/tests/. + +1998-11-29 Jim Meyering + + * src/remove.c (DOT_OR_DOTDOT): Move definition from this file... + * src/sys2.h (DOT_OR_DOTDOT): ...to this one. + + * src/dd.c (dd_copy): Rename function from `copy'. + + * src/cp.c (do_copy): Rename local: s/unused/copy_into_self/. + + Per Kristian Hove reported that a certain move-directory-into-self + wasn't properly diagnosed. + + * tests/mv/into-self-3: New file. + * tests/mv/Makefile.am (TESTS): Add into-self-3. + * src/copy.c (copy_internal): Remove earlier (but less effective) + test for move/copy-into-self. + Instead, deduce the move-into-self condition from errno==EINVAL + after a failed rename. + * src/mv.c (do_move): Don't arrange to remove DEST in the + copied-into-self case. + +1998-11-15 Jim Meyering + + Bob McCracken reported that mv couldn't handle certain combinations + of hard linked source files. + + * tests/mv/hard-link-1: New file. + * tests/mv/Makefile.am (TESTS): Add hard-link-1. + * src/mv.c (movefile): Don't free new_dest. + + * lib/error.c (error): Don't use strerror_r's return value. + From Johan Danielsson. + +1998-11-14 Jim Meyering + + * Version 4.0. + + * Makefile.maint (cvs-dist): Search for `$tag:' rather than just $tag + to avoid matching a prefix of another tag. + +1998-11-10 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Greek (el). + * po/el.po: New file. + +1998-11-07 Jim Meyering + + * Version 4.0-b7. + + Accommodate the Hurd (defining lstat to rpl_lstat via config.h didn't + work on Hurd systems because of an inline definition of lstat in a + system header file). This also makes it so that you may run `ls '' ' + on systems that let l?stat operate on the empty string. + + * src/remove.c [HAVE_LSTAT_EMPTY_STRING_BUG]: Define lstat to rpl_lstat + and declare the latter. + * lib/stat.c [stat]: Remove #undef. + (rpl_stat): Protoize. + * lib/lstat.c [lstat]: Remove #undef. + (rpl_lstat): Protoize. Use ENOENT, not EINVAL, to be consistent + with lib/stat.c. + * acconfig.h: Remove #undef's for lstat and stat. + +1998-10-31 Jim Meyering + + * tests/rm/Makefile.am (TESTS): Add new test `empty-name', + but comment it out. + * tests/rm/empty-name: New file. + + * acconfig.h (stat): New #undef. + This omission was uncovered when Mark Kettenis reported that + `rm -r ''' got a failed assertion on the Hurd. This change + doesn't fix *that* problem -- see above. + +1998-10-25 Jim Meyering + + * Version 4.0-b6. + + * README: Man pages will now be supported to the extent that + people send patches. + + * tests/rm/unreadable: Two new tests. + * tests/rm/Makefile.am (TESTS): Add new test `unreadable'. But comment + it out since we're so close to release and since the test compares the + text of diagnostics that are likely to vary between systems. + (TEST_ENVIRONMENT): Add required framework. + + * src/remove.c (remove_cwd_entries): Don't apply CLOSEDIR to a NULL + pointer. (provoke with `mkdir -m 0100 x; rm -rf x') + Upon CLOSEDIR failure, set `status' to RM_ERROR, not RM_OK. + (remove_dir): Return `status', rather than always RM_OK. + +1998-10-18 Jim Meyering + + * Version 4.0-b5. + + * lib/mktime.c: Update from libc with this additional change from Paul. + * lib/strftime.c: Likewise. + + 1998-10-17 Paul Eggert + + Don't invoke localtime_r or gmtime_r unless it's the GNU C + library's localtime_r and gmtime_r; there are too many buggy + implementations of localtime_r and gmtime_r out there, and + it's not worth keeping track of all the different bugs. + + * mktime.c (__EXTENSIONS__, HAVE_LOCALTIME_R): Remove. + (my_mktime_localtime_r): Renamed from localtime_r; all uses changed. + Base it on localtime unless _LIBC. + + * strftime.c (__EXTENSIONS__): Remove. + (my_strftime_gmtime_r): Renamed from gmtime_r; all uses changed. + (my_strftime_localtime_r): Renamed from localtime_r; all uses changed. + Base them on localtime/gmtime if not _LIBC. + +1998-10-17 Jim Meyering + + * Version 4.0-b4. + + * lib/mktime.c: Declare localtime_r if necessary. + * lib/strftime.c: Likewise. + + * tests/Fetish.pm (run_tests): Run $prog with --version only + if $verbose. + +1998-10-11 Jim Meyering + + * Version 4.0-b3. + +1998-10-08 Paul Eggert + + * mktime.c (__mktime_internal): When the requested time falls + in a spring-forward gap of size DT, return a time that is DT + away from the requested time, preferring a time whose tm_isdst + differs from the requested value. Bump the max number of + probes from 4 to 6 to account for the extra probes needed to + discover a spring-forward gap in the worst case. + +1998-10-08 Paul Eggert + + * mktime.c (my_mktime_localtime_r): Renamed from localtime_r. + Define also if HAVE_LOCALTIME_R && defined (localtime_r), with + a body that merely expands localtime_r; this works around a + bug in Digital Unix 4.0A and 4.0D. + +1998-10-05 Jim Meyering + + * po/Makefile.in.in (uninstall): Remove (historical?) command that + removed po-Makefile.in.in. From Akim Demaille. + + * src/install.c (long_options): Add entry for --suffix=SUFFIX option. + From aldomel. + +1998-10-04 Jim Meyering + + * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define PERL. + From Kaveh Ghazi. + +1998-10-03 Jim Meyering + + * Version 4.0-b2. + + * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Add PATH. + + * man/Makefile.maint ($(man_MANS)): Don't depend on actual executables. + Instead, depend on corresponding source file and on configure.in. + Based on suggestion and code from Akim Demaille. + Factor out irregular men into Makefile.summ. + + * man/Makefile.am (EXTRA_DIST): Add Makefile.summ. + + * man/Makefile.summ: New file. + * man/Makefile.maint: Include it. + + * tests/Fetish.pm: Make `DEBUG' be a little more verbose. + + * tests/mv/Makefile.am (TESTS): Add i-1. + * tests/mv/i-1: New test. + +1998-10-02 Jim Meyering + + * tests/ls-2/Makefile.am (EXTRA_DIST): Remove run-test. + * tests/ls-2/run-test: Remove file. + * tests/ls-2/quoting: Include /bin/sh driver framework. + + * tests/dircolors/simple: Remove file. + * tests/dircolors/run-test: Embed it here instead. + * tests/dircolors/simple: Rename from run-test. + +1998-10-01 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Remove README. + From Akim Demaille. + +1998-09-28 Jim Meyering + + * Version 4.0-pre1. + + * Use automake-1.3b. See notes in README. + + * src/copy.c (copy_internal): Do honor `n' reply in move-mode. + Otherwise, `touch a b; echo n|mv -i a b' would remove b. + From Bernd Leibing. + +1998-09-27 Jim Meyering + + * Version 3.16z. + + * Makefile.maint (alpha): New target. + (my-distcheck): Tweak. + + * lib/backupfile.h: Protect against multiple inclusion. + From Akim Demaille. + + * configure.in: Remove use of AC_FUNC_FNMATCH and associated code. + Now, it is invoked through jm_MACROS. + + * lib/strftime.c (my_strftime): Update from FSF. + +1998-09-26 Jim Meyering + + * src/copy.c (copy_internal): Don't preserve hard-linked directories + to avoid damaging the destination filesystem when copying from a + Netapp snapshot directory. With code from Kjetil Torgrim Hollstein + and Paul Eggert. + +1998-09-24 Jim Meyering + + * man/Makefile.maint ($(man_MANS)): Correct typo: s/-tmp/-t/. + From Akim Demaille. + +1998-09-21 Jim Meyering + + * man/Makefile.maint ($(man_MANS)): Remove `echo'. + +1998-09-20 Jim Meyering + + * Version 3.16y. + + * src/install.c (install_file_to_path) [-D]: Create any leading + directories with permissions of 0755. + +1998-09-19 Jim Meyering + + * src/install.c (install_file_to_path): Copy the file after creating + any leading directories. + (main) [case 'v']: Set `x.verbose' to 1, not 0. + Reported by Marty Leisner. + + * man/Makefile.am (transform): Define. + (man_MANS): Include ginstall.1, not install.1, to match the name + of the executable in ../src. + * man/ginstall.x: New file. + * man/install.x: Remove file. + * man/Makefile.maint (ginstall-summary): Renamed from install-summary. + + * man/Makefile.am (EXTRA_DIST): Add Makefile.maint and GNUmakefile. + Reported by Akim Demaille. + + * lib/modechange.c: Fix post-protoization typo. + + * lib/posixtm.h (PARAMS): Define and use. + From Kaveh Ghazi. + +1998-09-12 Jim Meyering + + * Version 3.16x. + + * src/remove.c (remove_cwd_entries): Declare to be static. + + Automatically generate man pages from combination of --help + output and the contents of new, man/*.x files. + * man/Makefile.am (HELP2MAN): Define. + (man_aux): Define. + (EXTRA_DIST): Add $(HELP2MAN) and $(man_aux). + (MAINTAINERCLEANFILES): Add $(man_MANS). + * man/*.x: New files. + * man/GNUmakefile: New file. + * man/Makefile.maint: New file. + * man/help2man: New file. + +1998-09-09 Jim Meyering + + * lib/modechange.c: Protoize. + +1998-09-07 Jim Meyering + + * Version 3.16w. + + * src/df.c (show_dev) [!posix_format]: When using --print-type, + let the device path and the file system type share a single (wider) + field if their combined lengths allow it. From Andries Brouwer. + + * tests/touch/empty-file: Upon failure, suggest how to rerun the test + with longer delay, in case NFS clock skew was the cause of the failure. + Reported by Kaveh Ghazi. + + * tests/ls-2/quoting: Add tests. + * tests/Fetish.pm (run_tests): Add simple PRE/POST hooks. + (_create_file): Don't include $$ in temp file name. + (run_tests): Use shorter suffixes for temp file names. + +1998-09-06 Jim Meyering + + * src/touch.c: Include posixtm.h. + (usage): Correct the description of the format of the + date string argument to -t option. + (main): Update to use rewritten posixtime function. + Reported by Andries Brouwer. + + * lib/Makefile.am (libfu_a_SOURCES): Change posixtm.y to posixtm.c. + (noinst_HEADERS): Add posixtm.h. + + * lib/posixtm.h: New file. + * lib/posixtm.c: New file. Rewritten based on posixtm.y. + * lib/posixtm.y: Remove file. + +1998-09-05 Andreas Schwab + + * src/ls.c (print_dir_name): Put back. + (print_dir): Also print directory name header if print_dir_name is + true. + +1998-08-29 Jim Meyering + + * Version 3.16v. + + * src/du.c (long_options): Use corresponding short-option character + in place of `1', and `NULL' in place of pointer in initialization. + * src/cp.c (long_opts): Likewise. + * src/ln.c (long_options): Likewise. + * src/mkdir.c (longopts): Likewise. + * src/rmdir.c (longopts): Likewise. + * src/chown.c: Replace 12 and 13 with CHAR_MAX + 1 and CHAR_MAX + 2 + respectively. + * src/chmod.c (long_options): Replace 12 with CHAR_MAX + 1. + * src/chgrp.c (long_options): Replace 12 with CHAR_MAX + 1. + + * tests/Fetish.pm: New file -- moved from ls-2/. + * configure.in (AC_OUTPUT): Add tests/dircolors/Makefile. + * tests/Makefile.am (SUBDIRS): Add dircolors. + (EXTRA_DIST): Add Fetish.pm. + * tests/dircolors: New directory + + * src/ls.c (print_dir_name): Remove global variable. + (print_dir): When trace_dirs is set, always print the directory + name header. + +1998-08-26 Jim Meyering + + * src/dircolors.c (dc_parse_stream): Don't segfault when a line + contains only one token. Reported by Olav Morkrid. + +1998-08-24 Paul Eggert + + * src/system.h (CHAR_MIN, CHAR_MAX): + Renamed from SCHAR_MIN, SCHAR_MAX, since these + macros apply to char, not signed char. + + * src/df.c, src/du.c, src/touch.c (long_options, main): + Don't assume ASCII. + +1998-08-18 Paul Eggert + + Port nanosecond-resolution times to UnixWare 2.1.2 and + pedantic Solaris 2.6. + + * configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM. + * acconfig.h (ST_MTIM_NSEC): New #undef. + * src/system.h (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP): + Use new ST_MTIM_NSEC macro. + +1998-08-16 Jim Meyering + + * lib/filemode.h (PARAMS): Define and use. + From Kaveh Ghazi. + +1998-08-15 Jim Meyering + + * Version 3.16u. + + * Makefile.maint (announcement): New target. + + * tests/mv/into-self: Update to reflect changed behavior of mv. + * src/mv.c (do_move): Fail upon attempt to move a directory into itself. + With prodding from François Pinard :-) + + * tests/ls-2/Fetish.pm: New file + * tests/ls-2/run-test: New file + + * src/copy.c (copy_internal) [one-file-system]: Do copy mount point + directories (but none of their entries). This makes `cp --archive + --one-file-system' use the same policy `tar --one-file-system' does. + From Marty Leisner. + + * src/ls.c (qmark_funny_chars): Add comment from Paul eggert. + +1998-08-14 Jim Meyering + + * tests/mv/setup: Work around another bug in Ultrix4.3a's /bin/sh. + Reported by Christian von Roques. + + * configure.in (AC_OUTPUT): Add tests/ls-2/Makefile. + * tests/Makefile.am (SUBDIRS): Add ls-2. + * tests/ls-2: New directory + +1998-08-14 Christian von Roques + + * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNT]: Don't + infloop on getmnt(2) returning 0. + + * tests/cp/backup-is-src: Avoid bug in Ultrix4.3a /bin/sh, + not initializing output redirection of : command. + * tests/mv/backup-is-src: Likewise. + * tests/rm/i-1: Likewise. + +1998-08-12 Jim Meyering + + * po/Makefile.in.in: Provide automake-style DESTDIR support. + From Johan Danielsson. + (DISTFILES): Remove ChangeLog. + po/ChangeLog: Remove empty file. + + * configure.in (AC_STRUCT_ST_DM_MODE): Use it. + + * src/ls.c: Include filemode.h. + * src/chmod.c: Likewise. + + * lib/filemode.c (ftypelet): Add comments for Cray DMF support. + From Johan Danielsson. + Protoize. Tsort function definitions and remove prototypes of + static functions. + (mode_string): Remove prototype. + * lib/filemode.h (mode_string): New file. + * lib/Makefile.am (noinst_HEADERS): Add filemode.h. + +1998-08-09 Jim Meyering + + * Version 3.16t. + +1998-07-31 Paul Eggert + + Add support for filesystems whose timestamps have better resolution + than 1 second (e.g. Solaris 2.6, recent Linux kernels). + + * configure.in (AC_STRUCT_ST_MTIM): Add. + + * src/copy.c (copy_internal): Compare time stamps with + subsecond resolution if available. + + * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime, + rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time + stamps with subsecond resolution if available. + + * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, + CTIME_CMP, MTIME_CMP): New macros. + +1998-08-01 Jim Meyering + + * configure.in (ALL_LINGUAS): Add slovak (sk) and norwegian (no). + +1998-07-28 Paul Eggert + + * lib/mountlist.c (read_filesystem_list): Remove all_fs + argument, but put the necessary information into the result so + that the caller can ignore filesystems that he's not + interested in. + + * lib/mountlist.h (struct mount_entry): + New members me_dummy, me_remote. + (read_filesystem_list): Remove all_fs argument. + (REMOTE_FS_TYPE): Remove. + (ME_DUMMY, ME_REMOTE): New macros. + + * lib/xstrtol.c: Remove duplicate include of . + + * src/df.c (show_all_fs): + Revert to boolean value; the old negative value is + now in show_local_fs. + (show_local_fs): New variable. + (show_dev): New args me_dummy and me_class. Use show_local_fs + and boolean show_all_fs in combination with these new args + to decide whether to show a device. + (show_disk): Pass flags to show_dev. + (show_point): Use a non-dummy mount entry if possible. + (show_all_entries): Pass flags to show_dev. + (main): --local sets show_local_fs now. Ask for file system types if + show_local_fs is nonzero, since ME_REMOTE might need them. + +1998-07-27 Jim Meyering + + * tests/install/Makefile.am (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM. + + * tests/install/basic-1: Add a test for this. + * src/install.c: Make copy create each destination file initially + with mode 0600 so strip will work, then apply specified mode. + Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed. + +1998-07-25 Jim Meyering + + * src/mv.c (chown): Remove unused definition. + Reported by Kaveh Ghazi. + + * src/rmdir.c (main): rmdir fails with EEXIST on some systems. + Handle that, so --ignore-fail-on-non-empty works. + (EEXIST): Define to zero if not defined. + (ENOTEMPTY): Likewise. + + * tests/cp/same-file: Remove `diff' I'd put in for debugging. + Exit with the status from cmp. + + * Version 3.16s. + + * tests/cp/same-file: Skip three more unportable tests. + These failed on SunOS4.1.4. + + * src/copy.c (SAME_INODE): Remove definition. + * src/sys2.h (SAME_INODE): Define it here instead. + + * src/remove.c (same_file): New function. + (remove_dir): Use it to give a better diagnostic when rmdir fails + because it can't remove the current directory. + + * src/df.c (long_options): Changes table entries not to use this form: + {"all", no_argument, &show_all_fs, 1}, + but rather this form: + {"all", no_argument, NULL, 'a'}, + Using the latter, all the option handling in one place: the getopt loop. + + * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTINFO]: + Use fsp_to_string. + (fsp_to_string): Don't xmalloc return value (yet). + (xatoi): Ansideclify. + (fstype_to_string): Ansideclify. + * lib/mountlist.h: Define and use PARAMS macro. + + * lib/utime.c: New file. + * src/touch.c (utime_now): Moved into m4/utimes.m4. + (touch) [!HAVE_UTIME_NULL]: Remove #ifdef and the use of utime_now + in the if-block. + + * configure.in (jm_FUNC_UTIME): Use this, not AC_FUNC_UTIME. + +1998-07-22 Paul Eggert + + * lib/human.c (human_readable): amt -> damt, to fix typo when + computing which power to use after overflow occurs during + multiplication. + + * lib/xstrtol.c: Include if NDEBUG is not defined; + needed on SunOS 4. + +1998-07-21 Paul Eggert + + Add df -l or --local option. + * doc/fileutils.texi: Document it. + * lib/mountlist.h (REMOTE_FS_TYPE): New macro. + * lib/mountlist.c (read_filesystem_list): + If all_fs is negative, omit non-local filesytems. + + * src/df.c (show_dev): Omit local devices if show_all_fs is negative. + (show_all_fs): If negative, omit non-local filesystems. + All uses of (all_fs != 0) changed to (all_fs > 0). + (long_options, usage, main): Add -l or --local option. + (main): When asking for df of an explicit file name, get all + the mount points, so that we're more likely to find it when + we look it up. + +1998-07-18 Jim Meyering + + * src/copy.c (copy_internal): Add another exclusion from the + sameness test: when --force has been specified, the destination + is unlinked before any copy. + (copy_internal): Add yet another: when both src and dest are symlinks. + + * tests/touch: New subdir. + * tests/Makefile.am (SUBDIRS): Add touch. + * configure.in (AC_OUTPUT): Add tests/touch/Makefile. + + * tests/mv/into-self-2: New test. + * tests/mv/Makefile.am (TESTS): Add into-self-2. + +1998-07-06 Andreas Schwab + + * lib/mountlist.c (read_filesystem_list): Fix more memory leaks on + failure. + +1998-07-16 Jim Meyering + + Work around failure of chown calls on m68k-motorola-sysv systems. + * src/chown.c: Include lchown.h. + * lib/Makefile.am (noinst_HEADERS): Add lchown.h. + * lib/lchown.h: New file, just to define ENOSYS on systems that lack it. + * lib/lchown.c: Include lchown.h. + Reported by and with suggestions from Manfred Hollstein. + +1998-07-12 Paul Eggert + + * src/df.c (print_header): Print "1k-blocks", not "1.0k-blocks". + +1998-07-07 Jim Meyering + + * src/sys2.h [HAVE_FCLOSE_UNLOCKED]: Remove unnecessary block. + Suggestion from Ulrich Drepper. + +1998-07-04 Jim Meyering + + * lib/safe-read.c (safe_read): Change type of pointer parameter to + `void' to avoid Irix4 cc errors. Reported by Kaveh Ghazi. + * lib/safe-read.h: Update prototype. + + * src/dircolors.c (parse_line): Add casts to avoid errors from + Irix4's `cc' C compiler. From Kaveh Ghazi. + + * lib/xstrtol.c: Include stdio.h. Required on some systems when + using assert. From Kaveh Ghazi. + + * tests/mv/backup-is-src: Use cmp, not diff. + Reported by Kaveh Ghazi. + +1998-07-03 Jim Meyering + + * Version 3.16r. + + * src/remove.c (remove_dir): Use fprintf (not error) to avoid + newline in prompt. + +1998-06-30 Paul Eggert + + * lib/mountlist.c (read_filesystem_list): + Don't leak memory on failure. + Don't create a dummy struct mount_entry entry; + use the address-of-the-tail-address method instead. + Preserve errno if possible on failure, setting it to 0 if inapplicable. + Close file descriptor leak if the F_SETLKW failed. + Report an error if SVR4 lock file cannot be opened for some reason + other than a nonexistent lock file. + +1998-07-03 Jim Meyering + + * configure.in (AM_WITH_REGEX): Remove. Now the replacement + macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS. + * acconfig.h (WITH_REGEX): Remove undef. + * lib/Makefile.am (noinst_HEADERS): Add regex.h. + * lib/rpmatch.c: Remove #ifdef around inclusion. + * lib/rx.c: Remove file. + * lib/rx.h: Remove file. + + * src/df.c (df_readable): Rename local so as not to shadow global. + + * src/copy.c (SAME_INODE): New macro. + Use it to replace open-coded equivalents. + (copy_internal): Rename variable and reverse sense of tests + to make the code a little clearer. + +1998-07-02 Andreas Schwab + + * src/copy.c (copy_internal): Try harder identifying a relative + symbolic link in the current directory. + + * src/copy.c (copy_internal): Don't skip test for same file if + creating a hardlink from symlink over a non-symlink while making + backups. + * tests/cp/same-file: Skip tests that depend on link(2) not + following symlinks. + +1998-07-02 Andreas Schwab + + * src/copy.c (copy_internal): Don't call chown on a symlink. + +1998-07-01 Jim Meyering + + * lib/xstrtol.c: Don't define NDEBUG here, now that it's done via + configure's --disable-assert option. + +1998-06-29 Paul Eggert + + * lib/mountlist.c (read_filesystem_list): + Plug file descriptor leak on failure. + Report failure if lock file can't be opened for some reason + other than nonexistence. + +1998-06-29 Jim Meyering + + * Version 3.16q. + + * lib/mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT2]: + Always close stream and file descriptor before returning. + + * src/df.c (main): Move the test of the result of the + read_filesystem_list call up out of if-block -- code in the + else-block depends on it too. + +1998-06-29 Paul Eggert + + * lib/mountlist.c (read_filesystem_list): If SVR4, lock + /etc/.mnttab.lock if available, to avoid race conditions + (e.g. with the automounter on Solaris 2.6). + + Include , , . + +1998-06-29 Jim Meyering + + * lib/mountlist.c (fstype_to_string): Guard with + #if ! HAVE_F_FSTYPENAME_IN_STATFS. + +1998-06-28 Paul Eggert + + Add support for new --block-size option and + BLOCK_SIZE. DF_BLOCK_SIZE, etc. variables to `df', `du', and `ls'. + Adjust df output slightly to accommodate larger filesystems. + + * lib/human.c, lib/human.h (human_readable): Coalesce last two args + into one, for convenience. All callers changed. + (human_block_size): New function. + * lib/human.c: Include only if HAVE_CONFIG_H. + Include if HAVE_STDLIB_H; + declare getenv unless HAVE_DECL_GETENV. + (_): New macro. + Include , , . + (DEFAULT_BLOCK_SIZE): New macro. + (block_size_args, block_size_types): New constants. + (humblock): New function. + * lib/xstrtol.h (__ZLONG_MAX): Remove. + * lib/xstrtol.c (bkm_scale): Don't assume that you can convert + unsigned long to double without losing information. + (bkm_scale_by_power): New function. + + * lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer): + Add support for SI-like suffixes like "GB" and "TD". + * src/dd.c (usage): Describe it. + + * src/df.c, src/du.c, src/ls.c (human_readable_base, output_units): + Remove; replace with new variable output_block_size. All uses changed. + (long_options, usage, main): Add --block-size. + (main, decode_switches): Use new human_block_size function to + initialize output block size consistently with other programs. + + * src/df.c (print_header, show_dev): Shrink some columns and expand + others, to squeeze in support for today's larger filesystems. + (print_header): Print output block size using power-of-1024 SI format. + (df_readable): Coalesce last two args into one, for convenience. + All callers changed. + (main): Remove check for portable output format and larger + or human-readable block sizes. + + * NEWS, doc/fileutils.texi: Describe above changes. + +1998-06-28 Jim Meyering + + * src/ls.c (usage): Make --kilobytes description consistent with + that in du and df. From Göran Uddeborg. + + * lib/mountlist.c (fsp_to_string): Clean out some crufty #ifdefs + now that we're using the jm_FSTYPENAME autoconf macro. + James Tanis reported the old version didn't compile on BSDI3. + + * configure.in: Move big block of list_mounted_fs checks into + new jm_LIST_MOUNTED_FILESYSTEMS macro. + Use new jm_FSTYPENAME macro. + + * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers. + * src/ls.c: Add DIRED_ prefix to the macros: PUTCHAR, FPUTS, and + FPUTS_LITERAL + +1998-06-27 Jim Meyering + + * src/copy.c (copy_reg): Detect identical source and dest here. + (copy_internal): Make the test symmetric. + + * tests/cp/same-file: New file. + * tests/cp/Makefile.am (TESTS): Add it. + +1998-06-26 Jim Meyering + + * src/remove.c (remove_file): Remove `non-directory' part of + `removing non-directory FILE' verbose message. + +1998-06-23 Jim Meyering + + * src/df.c (show_dev): Increase field width for blocks, used, + and available columns from 7 to 8. + +1998-06-21 Jim Meyering + + * aclocal.m4: Regenerate with fixed gettext.m4 installed. + See README-alpha for details. + +1998-06-02 Andreas Schwab + + * src/automake-wrap: Quote `&' in sed replacement text. + +1998-05-31 Jim Meyering + + * Version 3.16p. + + * src/install.c (main): Fix argv-handling bug in my 1998-05-09 change. + Reported by Don Parsons. + +1998-05-30 Jim Meyering + + * tests/ls/time-1: Clean up ctime test. Note that it fails also + on Solaris5.5.1 tmpfs file systems. + + Solve the `rm -f rm' problem more cleanly. + * src/.rm-warning: Remove file. + * src/automake-wrap: New file. + * src/Makefile.am (AUTOMAKE): Define to use automake-wrap. + (Makefile.in): Depend on automake-wrap. + (EXTRA_DIST): Add automake-wrap. + (DISTCLEANFILES): Remove definition. + (rm_DEPENDENCIES): Likewise. + (.rm-warn-stamp): Remove rule. + +1998-05-27 Jim Meyering + + * tests/ls/Makefile.am (TESTS): s/cr-1/rt-1/ + * tests/ls/rt-1: New file, renamed from cr-1. + +1998-05-26 Andreas Schwab + + * src/Makefile.am (.rm-warn-stamp): Cope with $(srcdir) != ".". + + * tests/ls/cr-1: Don't use the ctime for testing, it is impossible + to set it reliably. + +1998-05-25 Jim Meyering + + * configure.in (_GNU_SOURCE): AC_DEFINE it here. + * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section. + [!_GNU_SOURCE]: Add #undef instead. + +1998-05-24 Jim Meyering + + * Version 3.16o. + + * src/ansi2knr.c: Use new version from automake-1.3. + + * src/chown.c: Accept new option, --dereference. + --no-dereference is now the default. + (enum Change_status) [CH_NOT_APPLIED]: New member. + (change_symlinks): Enable this by default, now. + (describe_change): Handle new case. + (change_file_owner): Add new parameter: cmdline_arg. Update callers. + Reorganize to reflect changed semantics. + (LCHOWN): Remove definitions. + + * lib/lchown.c: New file. + +1998-05-21 Jim Meyering + + * configure.in (ALL_LINGUAS): Add russian (ru). + +1998-05-16 Jim Meyering + + * src/remove.c (hash_compare_strings): Return true or false, not 1/0. + (remove_cwd_entries): Use RM_OK, not equivalent literal `1'. + + * lib/hash.c (is_prime): Ansideclify. + (next_prime): Ansideclify. Add an assertion. + + * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS=' + lines from the m4/*.m4 macros, so the hack of including some + custom-replaced C source file names here is no longer needed. + + * configure.in (jm_MACROS): New wrapper macro. + Remove uses of most jm_* macros. + + * acconfig.h (HAVE_STRUCT_UTIMBUF): Remove #undef. Now it's handled + as part of utimbuf.m4. + (memcmp): Add #undef. + +1998-05-12 Jim Meyering + + * configure.in: Use my replacement AC_ISC_POSIX rather than + open-coding it. + + * src/copy.c (copy_internal): Plug a small leak. + +1998-05-10 Jim Meyering + + * src/mv.c (do_move): Remove lots of code that was duplicated in + copy.c (copy), now that copy() has better support for mv. This fixes + a bug with cross-filesystem `mv -i' whereby you could get two prompts + for the same destination file and eventually remove the destination + file even though one of the responses was negative. + Reported by Dirk Lattermann. + + * src/copy.h: Better support for mv: + [struct cp_options] (move_mode): New member. + * src/copy.c (copy_internal): Use new move_mode member. + Add parameter. + (copy): Add parameter. + + * tests/cp/Makefile.am (TESTS): Add backup-is-src. + * tests/mv/Makefile.am (TESTS): Likewise. + + * lib/userspec.c: Don't declare strdup if it's defined as a macro. + Reported by Lorne Baker. + + * src/Makefile.am (ginstall_SOURCES): Add copy.c and cp-hash.c. + + * src/mv.c (cp_option_init): Initialize new members. + * src/cp.c (cp_option_init): Likewise. + (main): Set new preserve_* options. + +1998-05-09 Jim Meyering + + * src/copy.h: Support for install: + [struct cp_options] (failed_unlink_is_fatal): New member. + (preserve_owner_and_group): New member. + (preserve_chmod_bits): New member. + (preserve_timestamps): New member. + (preserve): Remove member. + (set_mode): New member. + (mode): New member. + * src/copy.c (new_nondir_mode): New function. Use where appropriate. + Use more-specific preserve_* members in place of removed `preserve'. + (copy_internal): Honor failed_unlink_is_fatal. + + * src/install.c (main): Rewrite argv-handling to be clearer. + (copy_file): Rewrite to use copy.c (copy). + (change_attributes): Get rid of now-(with chown wrapper)-unnecessary + `no_need_to_chown' parameter. Fix caller. + (install_file_in_file): Remove now-unnecessary `to_created' parameter. + (cp_option_init): New function. + Update several functions to take new parameter specifying copy options. + + * tests/install: New subdir, with one basic test. + * tests/Makefile.am (SUBDIRS): Add install. + * configure.in (AC_OUTPUT): Add tests/install/Makefile. + + * src/dd.c: Include safe-read.h. + Don't declare safe_read. + * src/touch.c: Likewise. + + * configure.in (jm_TYPE_SSIZE_T): Use it. + * acconfig.h (ssize_t): Add undef. + +1998-05-03 Jim Meyering + + * po/: Update from gettext-0.10.35. + * intl/: Likewise. + * configure.in: Remove use of AC_LINK_FILES. + (AC_OUTPUT): Remove po/Makefile-generating sed command. + +1998-04-28 Jim Meyering + + * src/dircolors.c (parse_line): Use ISSPACE, not isspace. + Use unsigned char * pointers, not potentially signed ones, to avoid + sign extension. + +1998-04-26 Jim Meyering + + * configure.in: Use jm_ASSERT. + * acconfig.h: Add NDEBUG. + + * src/mv.c: Don't define NDEBUG. + * src/cp.c: Likewise. + +1998-04-14 Jim Meyering + + * src/.rm-warning: New file. + * src/Makefile.am (EXTRA_DIST): Add .rm-warning + (DISTCLEANFILES): Add .rm-warn-stamp. + (rm_DEPENDENCIES): Depend on .rm-warn-stamp. + (.rm-warn-stamp): New rule. + (rm_prep): Comment out rule. + + * src/df.c (main): Use STREQ in string equality tests, not strcmp. + * src/dircolors.c (dc_parse_stream): Likewise. + (dc_parse_file): Likewise. + * src/du.c (main): Likewise. + * src/ls.c (decode_switches): Likewise. + * src/remove.c (hash_compare_strings): Likewise. + * src/touch.c (main): Likewise. + +1998-04-13 Jim Meyering + + * lib/Makefile.am (noinst_HEADERS): Add safe-read.h. + +1998-04-11 Jim Meyering + + * lib/hash.c: Add curly braces around statements in + if/else/while/do/etc. that span more than a line -- even around + multiline simple statements or single-line simple statements + preceded by a comment line. + +1998-04-09 Jim Meyering + + * configure.in: Don't use AC_PATH_PROG to check for perl, now that + we use jm_PERL. + +1998-04-06 Jim Meyering + + * src/cp-hash.c (cph_hash_insert): Rename from now-conflicting + hash_insert. Also declare to be static. + * src/cp-hash.h (hash_insert): Remove declaration. + + * lib/hash.c: Lots of minor spec and name changes, and new comments. + (hash_rehash): Rewrite to be easier on the allocator. + From François Pinard. + * lib/hash.h: More comments. + * src/remove.c: Change names/usage of hash-related functions to work + with the above. + +1998-04-05 Jim Meyering + + * lib/regex.c (WIDE_CHAR_SUPPORT): Define. + This now depends on HAVE_BTOWC so systems that lack btowc (like + solaris-2.5.1) don't lose. + +1998-04-04 Jim Meyering + + * GNUmakefile: Add conditionals so that running `make' in an + unconfigured source directory will get a reasonable diagnostic. + + * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal + know about the m4/ subdirectory. + * Makefile.maint (aclocal-files): Remove now-unnecessary (with + automake-1.2h and the above change) aclocal-related rules and includes. + +1998-04-01 Jim Meyering + + * tests/ls/cr-1: New file. + * tests/ls/Makefile.am (TESTS): Add cr-1. + +1998-03-31 Jim Meyering + + * src/system.h (TYPE_MAXIMUM): Cast result to `(t)' so this macro + works with `unsigned char'. + From Greg Wooledge. + (SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define. + + * lib/xstrtol.c: Merge with the version from textutils. + + * lib/memcmp.c (rpl_memcmp): Rename from memcmp. + +1998-03-30 Andreas Schwab + + * src/ls.c (compare_ctime, rev_cmp_ctime, compare_mtime, + rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size, + rev_cmp_size): Use file name as secondary sort key to get + consistent sorting. + +1998-03-28 Jim Meyering + + * src/copy.c: Add copyright. + * src/remove.c: Add copyright. + [_AIX]: Add #pragma alloca. + +1998-03-27 Jim Meyering + + * Makefile.maint ($(ACLOCAL_M4)): Replace old rule with this + dependency and the := assignment of ACLOCAL to make the default + rule use the `-I m4' option. + + * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h. + +1998-03-23 Jim Meyering + + * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4 + automatically handles it. + +1998-03-21 Jim Meyering + + * lib/quotearg.h: Update from patch-2.5.3. + * lib/quotearg.c: Likewise. + * src/ls.c (decode_switches): Pass a null pointer instead of address + of quotearg_quoting_options. + +1998-03-19 Paul Eggert + + * lib/fsusage.h (struct fs_usage): New member + fsu_bavail_top_bit_set. + * lib/fsusage.c: Include . + (CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros. + (get_fs_usage): If top bit of system variable corresponding to + fsu_bavail is set, then set fsu_bavail_top_bit_set, and + sign-extend the value when storing it into fsu_bavail. + * src/df.c (show_dev): If fsu_bavail_top_bit_set is nonzero, + assume the original value corresponding to fsu_bavail was negative. + Reported by Arne Juul. + +1998-03-18 Jim Meyering + + * src/Makefile.am (rm-prep): Add dependency and rule to save users + with `.' too early in their PATH from the `rm: cannot unlink `rm': + Text file busy' error. Suggestion from Philippe De Muyter. + +1998-03-15 Jim Meyering + + * Version 3.16n. + + * lib/chown.c: Use #if, not #ifdef with HAVE_ macros. + * lib/closeout.c: Likewise. + * lib/dirname.c: Likewise. + * lib/euidaccess.c: Likewise. + * lib/fileblocks.c: Likewise. + * lib/filemode.c: Likewise. + * lib/ftruncate.c: Likewise. + * lib/group-member.c: Likewise. + * lib/isdir.c: Likewise. + * lib/long-options.c: Likewise. + * lib/mountlist.c: Likewise. + * lib/path-concat.c: Likewise. + * lib/save-cwd.c: Likewise. + * lib/savedir.c: Likewise. + * lib/strcasecmp.c: Likewise. + * lib/strdup.c: Likewise. + * lib/userspec.c: Likewise. + * lib/yesno.c:: Likewise. + + * src/chgrp.c: Use #if, not #ifdef with HAVE_ macros. + Use #if !, not #ifndef with HAVE_ macros. + * src/chown.c: Likewise. + * src/copy.c: Likewise. + * src/dd.c: Likewise. + * src/dircolors.c: Likewise. + * src/install.c: Likewise. + * src/ls.c: Likewise. + * src/mv.c: Likewise. + * src/touch.c: Likewise. + + * configure.in: Use jm_PREREQ. + +1998-03-14 Jim Meyering + + Revert most `getdate.h -> get-date.h' changes of 1998-02-20. + With automake-1.2f, that hack is no longer needed. + + * src/remove.c: Use `virtual memory exhausted' message, not + `Memory exhausted' to be consistent with the majority of other + such messages. + Say `removing all...', not `removing any...'. + * src/rmdir.c (remove_parents): Be consistent with documentation of + --verbose option and with remove.c in saying `removing...' before + the operation is attempted. + (main): Likewise. + Suggestions from Santiago Vila. + + * src/copy.c (copy_dir): Add new parameter, copy_into_self, and set it. + (copy_internal): Likewise. + (copy): Likewise. + Update all callers. + * src/copy.h (copy): Update prototype. + * src/cp.c (do_copy): Add unused arg in calls to copy. + * src/mv.c (do_move): Add ©_into_self arg in call to copy. + Don't remove source directory when copy_into_self is nonzero. + Reported by Arne Henrik Juul. + + * tests/mv/into-self: Test for the above. + * tests/mv/Makefile.am (TESTS): Add into-self. + +1998-02-28 Eli Zaretskii + + * userspec.c (parse_user_spec) [__DJGPP__]: Make function know + about any arbitrary user and group by pretending to be the user + and to belong to the group specified in `spec_arg' argument. + + * idcache.c (getuidbyname) [__DJGPP__]: Make function know about + any arbitrary user name. + (getgidbyname) [__DJGPP__]: Make function know about any arbitrary + group name. + +1998-02-24 Jim Meyering + + * lib/xstrtol.c (TYPE_SIGNED): Define. + (TYPE_MAXIMUM): Define. + (ULONG_MAX): Use TYPE_MAXIMUM. + (LONG_MAX): Use TYPE_MAXIMUM. + + * lib/fnmatch.c: Update from libit. + * lib/idcache.c: Update from libit. + +1998-02-23 Paul Eggert + + * lib/quotearg.h, lib/quotearg.c: New files. + * lib/Makefile.am (libfu_a_SOURCES): Add quotearg.c. + (noinst_HEADERS): Add quotearg.h. + + * src/ls.c: Include new file quotearg.h. + (enum indicator_style): Rename all to classify, and not_programs + to file_type, to match option spellings. All users changed. + (indicator_style_args): New constant. + (quote_funny_chars, quote_as_string, quote_shell): Remove; + (filename_quoting_options, dirname_quoting_options): Use these + variables instead. + (long_options): Add --indicator-style, --quoting-style, + --show-control-chars. Remove --quote-shell. + (dired_dump_obstack): Remove style parameter and don't output style. + (main): Go back to previous method of outputting //DIRED// + and //SUBDIRED// lines, without style. But add a new + //DIRED-OPTIONS// line that does output style. + (decode_switches, usage): Add --indicator-style, --quoting-style, + --show-control-chars. Remove --quote-shell. + (decode_switches): Default from QUOTING_STYLE environment variable. + Set new quoting vars. + (quote_name): Renamed from quote_filename. + Take new arg specifying quoting options. + Always print; do not have a special case for null FILE * argument. + All callers changed. + Move the guts of this function to new file quotearg.c. + (length_of_file_name_and_frills): Use quotearg_buffer instead + of (old) quote_filename to find length of file name. + + (decode_switches, parse_ls_color, print_dir, gobble_file, + get_link_name): Quote output in diagnostics. + + * NEWS, doc/fileutils.texi: Describe above changes. + * doc/fileutils.texi: Mention that control characters are output + as question marks if output is a terminal. + +1998-02-22 Jim Meyering + + * Version 3.16m. + + * ChangeLog-1997: New file. + * Makefile.am (EXTRA_DIST): Add ChangeLog-1997. + +1998-02-21 Jim Meyering + + * configure.in (AC_OUTPUT): Add tests/mv/Makefile. + * tests/Makefile.am (SUBDIRS): Add mv. + * tests/mv: New directory + * tests/mv/mv-special-1: New test. + +1998-02-20 Jim Meyering + + * src/touch.c: Include get-date.h. + Remove get_date decl. + + * lib/getdate.h: Removed. Could cause confusion with an + automake-generated `.y.h' rule. + * lib/get-date.h: Renamed from getdate.h. + * lib/getdate.y: s/getdate.h/get-date.h/ + * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/ + +1998-02-19 Jim Meyering + + 1997-10-17 Eli Zaretskii + * lib/fileblocks.c [__DJGPP__]: Add missing typedef for daddr_t. + +1998-02-13 Jim Meyering + + * src/mv.c (cp_option_init): Set copy_as_regular to 0, not 1. + Otherwise, mv tries to open special files. + Reported by Kjetil Torgrim Homme. + +1998-02-08 Jim Meyering + + * Makefile.maint (cvs-dist): Update po/ to clear modified status + of *.po files before running cvs tag -c. + + * src/ln.c (usage): Reword to use `TARGET' and `LINK_NAME' in + description. + +1998-02-07 Jim Meyering + + * GNUmakefile: New file. + * Makefile.am (EXTRA_DIST): Add GNUmakefile. + Don't include Makefile.maint from here. It's included from GNUmakefile. + + * configure.in: Don't use AM_MAINTAINER_MODE. + (jm_PERL): Use this. + + * src/Makefile.am (EXTRA_DIST): Remove dcgen.pl. Add dcgen. + (CLEANFILES): Remove dcgen. + (dircolors.h): Use $(PERL). + (.pl): Remove rule. + +1998-02-01 Jim Meyering + + * POTFILES.in: Add remove.c. Reported by Santiago Vila. + +1998-01-28 Jim Meyering + + * src/df.c (print_header): Tweak format to align heading over + last column of `df -i' output. From Andreas Schwab. + +1998-01-27 Andreas Schwab + + * Makefile.am: Include Makefile.maint from $(srcdir). + +1998-01-25 Jim Meyering + + * Version 3.16l. + + * Makefile.maint: New file. + * Makefile.am: Move rules common to textutils, fileutils, sh-utils + into Makefile.maint. + Include Makefile.maint. + (EXTRA_DIST): Add Makefile.maint. + + * src/cp.c (re_protect): Don't fail for non-root when chown fails + due not only to lack of permission (EPERM), but also to lack of + support (EINVAL). Reported by Bengt Martensson. + * src/copy.c (DO_CHOWN): Likewise. + +1998-01-24 Jim Meyering + + * tests/ls/time-1 (test_failure): Rename does not update ctime; + link does -- so use ln, not mv. + Note that the SunOS4.1.4 failure of the ctime test is expected. + + * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around + bug in Cray C 5.0.3.0 when T == time_t. + + * tests/rm/r-1: Adjust expected output for changed format of + `rm --verbose'. + * tests/rm/r-2: Likewise. + +1998-01-23 Jim Meyering + + * lib/mktime.c (__mktime_internal): Work around bug in Irix4.0.5's + C compiler. From Kaveh Ghazi. + (TYPE_MINIMUM): Define. + (TYPE_MAXIMUM): Define. + (TIME_T_MIN): Use TYPE_MINIMUM. + (TIME_T_MAX): Use TYPE_MAXIMUM. + +1998-01-22 Jim Meyering + + * src/dd.c: Reorder functions to obviate forward dcls. + (quit): Declare to be inline to stifle compile warning. + + * src/cp.c (do_copy): Add unreachable `return 0' to stifle warning. + + * tests/rm/sunos-1: Don't use -f. Do adjust $RM if it's a + relative path. + + * tests/ls/time-1: Use GNU touch to work around problems with NFS + caching and/or clock skew. Reported by Kaveh Ghazi. + + * tests/ls/Makefile.am (TESTS_ENVIRONMENT): Add TOUCH. + + * src/Makefile.am (noinst_HEADERS): Add remove.h. + (mv_SOURCES): Define. + (rm_SOURCES): Define. + +1998-01-21 Jim Meyering + + * src/install.c: Declare new global, backup_type. + (main): Initialize backup_type unconditionally. + (copy_file): Call find_backup_file_name with new argument, backup_type. + * src/ln.c: Declare new global, backup_type. + (main): Initialize backup_type unconditionally. + (do_link): Call find_backup_file_name with new argument, backup_type. + + * src/copy.c (copy_internal): Use x->backup_type, not the global. + (valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE. + + * src/copy.h (VALID_SPARSE_MODE): Define. + [struct cp_options] (backup_type): New member. + + * src/cp.c [NDEBUG]: Comment out definition. + (do_copy): Use x->backup_type, not the global. + + * src/remove.c: New file. Contains guts of old rm.c. + (remove_init): New function. + (remove_fini): New function. + (rm): Take third argument, specifying options. + * src/remove.h: New file. Associated dcls. + * src/rm.c: Remove and minimally librarify guts for use in mv.c. + (main): Pass options (`&x') to rm. + Call remove_init and remove_fini instead of open-coding them. + + * src/mv.c (rm_option_init): New function. + (cp_option_init): New function. + (copy_reg): Remove now-unused function. + (do_move): Set up for and use `copy.c (copy)' in place of copy_reg. + Set up for and use `remove.c (rm)' in place of unlink. + +1998-01-20 Jim Meyering + + * lib/backupfile.c: Use ANSI function definitions. + Remove global declaration of backup_type. + (simple_backup_suffix): Default to `~', not `.orig'. + Use PARAMS, not __BACKUPFILE_P. + (find_backup_file_name): Add parameter, backup_type. + * lib/backupfile.h: Remove extern declaration of backup_type. + Use PARAMS, not __BACKUPFILE_P. + (VALID_BACKUP_TYPE): Define. + (find_backup_file_name): Adjust prototype. + +1998-01-13 Andreas Schwab + + * src/df.c (print_header): Fix inode format header to line it up + with the rest of the output. + +1998-01-13 Jim Meyering + + * lib/stat.c: Set errno to ENOENT, not EINVAL. This is consistent + with most other implementations. + +1998-01-12 Jim Meyering + + * lib/fileblocks.c: Include sys/param.h only #if HAVE_SYS_PARAM_H. + Move function-spanning `#if ...BSIZE' directive to follow inclusion + of sys/param.h since BSIZE is sometimes defined in sys/param.h. + Reported by Philippe De Muyter. + +1998-01-10 Jim Meyering + + * Version 3.16k. + + * src/install.c (install_file_to_path): New function. + FIXME: update fileutils.texi. + (main): Handle new option, -D. + Based on a patch from Marty Leisner. + (usage): Describe -D. + + * src/ls.c (decode_switches) [-u]: Fix bug whereby -u worked only + with -l or -t. Now, -u (like -c) implies --sort=time. + (usage): Correct descriptions of --sort, --time, and -t. + Suggestions from Andreas Schwab. + + Add test for the above fix. + * configure.in (AC_OUTPUT): Add tests/ls/Makefile. + * tests/Makefile.am (SUBDIRS): Add ls. + * tests/ls: New directory. + * tests/ls/Makefile.am: New file. + * tests/ls/time-1: New file. + + * lib/makepath.c (make_path): Reformat 3 if-stmts to test + `if (newly_created_dir)' only once. Suggestion from Andreas Schwab. + +1998-01-06 Jim Meyering + + * lib/getdate.y: Move inclusion of getdate.h and dependent extern + declarations down so getdate.h's prototype follows the sometimes- + enabled definition of `const' to nothing. Otherwise, the prototype + wouldn't match the definition because of the defined-away `const'. + From Kaveh Ghazi. + (get_date): ANSI-fy definition. + Add %expect directive. + +1998-01-05 Andreas Schwab + + * lib/makepath.c (make_path): Put only newly created directories + on the LEADING_DIRS list. + +1998-01-05 Paul Eggert + + * lib/fsusage.c (PROPAGATE_ALL_ONES): New macro. + (get_fs_usage): If a value consists entirely of 1 bits, + propagate this info to the output by setting it to (uintmax_t) -1. + * src/df.c (df_readable): New function. + (show_dev): If a value consists entirely of 1 bits, or is derived + from some other value that consists entirely of 1 bits, report "-". + Check inode and block counts more carefully for plausibility, + to avoid arithmetic overflow when computing percentages. + +1998-01-04 Jim Meyering + + * Version 3.16j. + + * lib/Makefile.in: Regenerated with patched automake-1.2d. + See README-alpha. + + * src/chgrp.c: Use a single enumerated type, Verbosity, instead of + the two booleans, verbose and changes_only. This fixes a bug whereby + --change had the same effect as --verbose. + * src/chmod.c: Likewise. + * src/chown.c: Likewise. + Reported by Paul Eggert. + +1998-01-04 Paul Eggert + + Check for write errors more carefully. + + * lib/Makefile.am (libfu_a_SOURCES): Add closeout.c. + (noinst_HEADERS): Add closeout.h. + * lib/closeout.c, lib/closeout.h: New files. + * lib/long-options.c (parse_long_options), + src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c, + src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c, + src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, + src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c + (main, usage): Check for write error to stdout before exiting. + Include "closeout.h". + +1998-01-03 Jim Meyering + + * src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1' + just like `fsu.fsu_blocks == 0' as an indicator that usage information + is invalid. This happens with Solaris-5.5.1 CD-ROM mount points. + + * lib/save-cwd.h: Guard PARAMS-enabling definition with + `defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid + problems with Irix4's cc. From Kaveh Ghazi. + * lib/getdate.h: Likewise, but just to be consistent. + + * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so + those files will be built via the ANSI2KNR-filtering rules if necessary. + Reported by Kaveh Ghazi. + +1998-01-02 Jim Meyering + + * Version 3.16i. + + Fix problem with `install -d'. Reported by Marty Leisner. + + * src/install.c (get_ids): When otherwise unspecified, + set uid and gid to -1. + * lib/makepath.c (make_path): Try to change ownership only if we've + just created the directory. Fix latent bug (s/&&/||/ in two places -- + also, note that it could not be exercised via install or mkdir) + whereby chown would not be invoked when only one of owner/group is + not -1. + +1998-01-01 Jim Meyering + + * src/rm.c (remove_cwd_entries): Initialize the entry-name obstack + only once and never free it. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/NEWS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/NEWS new file mode 100644 index 0000000..b89ca31 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/fileutils/NEWS @@ -0,0 +1,748 @@ +[4.1.11] +* `rm symlink-to-unwritable' doesn't prompt [introduced in 4.1.10] +[4.1.10] +* rm once again gives a reasonable diagnostic when failing to remove a file + owned by someone else in a sticky directory [introduced in 4.1.9] +* df now rounds all quantities up, as per POSIX. +* New ls time style: long-iso, which generates YYYY-MM-DD HH:MM. +* Any time style can be preceded by "posix-"; this causes "ls" to + use traditional timestamp format when in the POSIX locale. +* The default time style is now posix-long-iso instead of posix-iso. + Set TIME_STYLE="posix-iso" to revert to the behavior of 4.1.1 thru 4.1.9. +* `rm dangling-symlink' doesn't prompt [introduced in 4.1.9] +* stat: remove support for --secure/-s option and related %S and %C format specs +* stat: rename --link/-l to --dereference/-L. + The old options will continue to work for a while. +[4.1.9] +* rm can now remove very deep hierarchies, in spite of any limit on stack size +* new programs: link, unlink, and stat +* New ls option: --author (for the Hurd). +* `touch -c no-such-file' no longer fails, per POSIX +[4.1.8] +* mv no longer mistakenly creates links to preexisting destination files + that aren't moved +[4.1.7] +* rm: close a hole that would allow a running rm process to be subverted +[4.1.6] +* New cp option: --copy-contents. +* cp -r is now equivalent to cp -R. Use cp -R -L --copy-contents to get the + traditional (and rarely desirable) cp -r behavior. +* ls now accepts --time-style=+FORMAT, where +FORMAT works like date's format +* The obsolete usage `touch [-acm] MMDDhhmm[YY] FILE...' is no longer + supported on systems conforming to POSIX 1003.1-2001. Use touch -t instead. +* cp and inter-partition mv no longer give a misleading diagnostic in some + unusual cases +[4.1.5] +* cp -r no longer preserves symlinks +* The block size notation is now compatible with SI and with IEC 60027-2. + For example, --block-size=1MB now means --block-size=1000000, + whereas --block-size=1MiB now means --block-size=1048576. + A missing `B' (e.g. `1M') has the same meaning as before. + A trailing `B' now means decimal, not binary; this is a silent change. + The nonstandard `D' suffix (e.g. `1MD') is now obsolescent. +* -H or --si now outputs the trailing 'B', for consistency with the above. +* Programs now output trailing 'K' (not 'k') to mean 1024, as per IEC 60027-2. +* New df, du short option -B is short for --block-size. +* You can omit an integer `1' before a block size suffix, + e.g. `df -BG' is equivalent to `df -B 1G' and to `df --block-size=1G'. +* The following options are now obsolescent, as their names are + incompatible with IEC 60027-2: + df, du: -m or --megabytes (use -BM or --block-size=1M) + df, du, ls: --kilobytes (use --block-size=1K) +[4.1.4] +* df --local no longer lists smbfs file systems whose name starts with // +* dd now detects the Linux/tape/lseek bug at run time and warns about it. +[4.1.3] +* ls -R once again outputs a blank line between per-directory groups of files. + This was broken by the cycle-detection change in 4.1.1. +* dd once again uses `lseek' on character devices like /dev/mem and /dev/kmem. + On systems with the linux kernel (at least up to 2.4.16), dd must still + resort to emulating `skip=N' behavior using reads on tape devices, because + lseek has no effect, yet appears to succeed. This may be a kernel bug. +[4.1.2] +* cp no longer fails when two or more source files are the same; + now it just gives a warning and doesn't copy the file the second time. + E.g., cp a a d/ produces this: + cp: warning: source file `a' specified more than once +* chmod would set the wrong bit when given symbolic mode strings like + these: g=o, o=g, o=u. E.g., `chmod a=,o=w,ug=o f' would give a mode + of --w-r---w- rather than --w--w--w-. +[4.1.1] +* mv (likewise for cp), now fails rather than silently clobbering one of + the source files in the following example: + rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c +* ls -R detects directory cycles, per POSIX. It warns and doesn't infloop. +* cp's -P option now means the same as --no-dereference, per POSIX. + Use --parents to get the old meaning. +* When copying with the -H and -L options, cp can preserve logical + links between source files with --preserve=links +* cp accepts new options: + --preserve[={mode,ownership,timestamps,links,all}] + --no-preserve={mode,ownership,timestamps,links,all} +* cp's -p and --preserve options remain unchanged and are equivalent + to `--preserve=mode,ownership,timestamps' +* mv and cp accept a new option: --reply={yes,no,query}; provides a consistent + mechanism to control whether one is prompted about certain existing + destination files. Note that cp's and mv's -f options don't have the + same meaning: cp's -f option no longer merely turns off `-i'. +* remove portability limitations (e.g., PATH_MAX on the Hurd, fixes for + 64-bit systems) +* mv now prompts before overwriting an existing, unwritable destination file + when stdin is a tty, unless --force (-f) is specified, as per POSIX. +* mv: fix the bug whereby `mv -uf source dest' would delete source, + even though it's older than dest. +* chown's --from=CURRENT_OWNER:CURRENT_GROUP option now works +* cp now ensures that the set-user-ID and set-group-ID bits are cleared for + the destination file when when copying and not preserving permissions. +* `ln -f --backup k k' gives a clearer diagnostic +* ls no longer truncates user names or group names that are longer + than 8 characters. +* ls's new --dereference-command-line option causes it to dereference + symbolic links on the command-line only. It is the default unless + one of the -d, -F, or -l options are given. +* ls -H now means the same as ls --dereference-command-line, as per POSIX. +* ls -g now acts like ls -l, except it does not display owner, as per POSIX. +* ls -n now implies -l, as per POSIX. +* ls can now display dates and times in one of four time styles: + + - The `full-iso' time style gives full ISO-style time stamps like + `2001-05-14 23:45:56.477817180 -0700'. + - The 'iso' time style gives ISO-style time stamps like '2001-05-14 ' + and '05-14 23:45'. + - The 'locale' time style gives locale-dependent time stamps like + 'touko 14 2001' and 'touko 14 23:45' (in a Finnish locale). + - The 'posix-iso' time style gives traditional POSIX-locale + time stamps like 'May 14 2001' and 'May 14 23:45' unless the user + specifies a non-POSIX locale, in which case it uses ISO-style dates. + This is the default. + + You can specify a time style with an option like --time-style='iso' + or with an environment variable like TIME_STYLE='iso'. GNU Emacs 21 + and later can parse ISO dates, but older Emacs versions cannot, so + if you are using an older version of Emacs outside the default POSIX + locale, you may need to set TIME_STYLE="locale". + +* --full-time is now an alias for "-l --time-style=full-iso". + +Changes in release 4.1: +[4.0.45] +* dd conv=sync,block now pads only with spaces +* ls's -1 option no longer cancels the effect of a preceding -l +* regenerate configure using a patched version of autoconf-2.49e to work + around a bug in its test for a working memcmp function +* ls: fix off-by-one error introduced with the previous change +[4.0.44] +* ls: When given two or more arguments but the only one that exists is a + directory, don't treat it as if it were the only argument. Before, + `mkdir d; ls no-dir d 2>/dev/null' would act like `ls d' and produce + no output. Now, it prints `d:'. +* touch -d 'last friday' would use a time stamp that was one hour off + (e.g., 23:00 on *thursday* rather than 00:00 of the preceding friday) + when run such that the current time and the target date/time fall on + opposite sides of a daylight savings time transition. + This problem arises only with relative date strings like `last monday'. + It is not a problem with strings that include absolute dates. +[4.0.43] +* regenerate configure-related files using autoconf-2.49d +[4.0.42] +* Using ls's short-named `-H' option evokes the warning that the + meaning of `-H' will soon change. Use `--si' instead. +[4.0.41] +* fix bug in rm introduced in 4.0.38: `chmod 0 f; rm f' would no longer prompt + before removal. +[4.0.40] +* portability fixes, mainly for UnixWare 7.1.1 +[4.0.39] +* cp and mv accept --strip-trailing-slashes, not just --strip-trailing-slash +[4.0.38] +* ls --full-time now implies -l; before, without -l it was a no-op +[4.0.37] +* portability fixes for SunOS4.1.1, Fujitsu (f300-fujitsu-uxpv4.1_ES), + and Unicos (alphaev5-cray-unicosmk2.0.5.X) +[4.0.36] +* `mv dir/ new-name' no longer fails on SunOS4.1.1U +* attempting to use mv to move a symlink onto itself no longer removes + the symlink +* `cp -R directory file' no longer removes `file'. now it fails and gives + a diagnostic +* The manual now warns that ls's --full-time format string is planned + to change in a future release. +* ls -l's time stamp format now depends on LC_TIME, not LC_MESSAGES, + as POSIX requires. +* ls -l now reports the year for files even slightly in the future, as + POSIX requires. This helps warn users about clock skew problems. +* `cp -d file symlink-to-some-other-file' no longer fails +* performance improvements for ls +[4.0.35] +* ln --backup=simple --suffix=SUFFIX once again uses SUFFIX +* install: Likewise. +[4.0.34] +* fix a bug (introduced in 4.0z) that made `chown 123:456 file' act like + `chown 123:123 file'. Other uses with a numeric group ID would cause + chown to fail when it shouldn't have. +* the chown and chgrp programs preserve set-uid and set-gid bits, even on + systems for which the chown function call resets those bits. +* `ls -L dangling-symlink' now fails (per POSIX) rather than printing the + link name +* dd no longer honors the just-added `B' suffix on skip= and seek= arguments. +* `mkdir no-such-dir/' no longer fails on NetBSD systems +[4.0.33] +* dd now accepts skip=nB and seek=nB, to advance past some number of bytes, n, + that need not be a multiple of the block size. +* dd (without conv=notrunc) now complains only when ftruncate fails on a + regular file, a directory, or a shared memory object -- not when it fails + to truncate other types of files, like /dev/fd0. +* chmod --changes (-c) once again issues diagnostics only for the files + with changed permissions +* mkdir now gives one diagnostic (rather than two) for certain failures +* mkdir portability fix for NetBSD +[4.0.32] +* touch now interprets a lone numeric argument of 8 or 10 digits as a file name, + rather than as a date/time in the obsolescent `MMDDhhmm[YY]' format. +* mkdir no longer sets the permissions of the final directory component + if it already exists (this bug, too, was introduced recently) +* ls's --full-time format string is now locale dependent +[4.0.31] +* mkdir: fix a bug introduced in 4.0.30 whereby `mkdir existing-dir' would + succeed. Now it fails, as it should (and used to). +[4.0.30] +* mkdir: fix a bug introduced in 4.0.28 whereby parent directories created + via `mkdir -p' would have permissions that did not account for the umask +[4.0.29] +* ls.c wouldn't compile on some systems: fix it +* `cp -R --parents dir1/ dir2' failed on NetBSD, due to a portability problem +[4.0.28] +* ls is much more efficient on systems (e.g., linux-2.4.*) that store file + type information in directory entries. +* shred now automatically determines the size of each block device argument +* ls's date/time format strings are now locale dependent +* mkdir, mknod, mkfifo, and chmod work better in conjunction with ACLs +* `cp --parents dir1/ dir2' no longer gets a failed assertion +* shred now determines the size of block devices like /dev/fd0 +* `shred --exact file1 file2' now erases `file1', too +[4.0.27] +* install once again unlinks an existing destination before trying to open it +* mv no longer gets a failed assertion when moving a directory (specified with + a trailing slash) from one partition to another, and giving it a different + name at the destination. +* `cp --link -f src existing-dest' no longer fails (bug introduced in 4.0z) +* cp's new --remove-destination option now works with -R +[4.0z] +* `cp -p' once again preserves `special' permission bits (this bug was + introduced in 4.0y) +* mv's --force (-f) option now controls solely whether mv prompts (per POSIX) +* `cp -f' now first attempts to open an existing destination file, and only + if that fails does it resort to unlinking the file and retrying the open. + Before, it would unlink the file before trying to open it. +* cp accepts a new option, --remove-destination, that provides the old behavior +* cp's -f option no longer cancels the effect of --interactive (-i) (per POSIX) +* when ls sorts directory entries, it now honors the current locale settings +* dd's `skip=BLOCKS' operator once again works on systems with a buggy lseek + function (Linux, at least on SCSI tape devices) +* fix a typo in install-sh +[4.0y] +* cp now accepts the POSIX-mandated -H and -L options. +* cp -p and mv now try to preserve uid even if you're not root, as per POSIX.2. + This affects behavior only on hosts that let you give files away via chmod. +* du would fail when given `.' or `..' followed by other command line arguments +* Using cp's short-named `-P' option evokes the warning that the + meaning of `-P' will soon change. Use `--parents' instead. +* chgrp, chmod, and chown: when used with the --verbose option, might give an + invalid diagnostic (due to clobbered errno) when failing. +[4.0x] +* Fix cp so that `cp -r DIR1/ DIR2' works properly once again. +* New ls option --quoting-style=clocale acts like --quoting-style=locale, + except that it quotes "like this" by default instead of `like this'. +[4.0w] +* When `cp -pR' fails to copy a file, it now preserves permissions, owner, + and group of the containing directory. +[4.0v] +* df, du, and ls now round disk usage up and disk free space down +* df, du, ls: --block-size=N now works for values of N that are e.g., + not a multiple of the file's block size +[4.0u] +* give proper diagnostic for mv usage error +* fix compile problem with lib/strnlen.c +[4.0t] +* `cp -d -u' no longer fails with certain existing destination symlinks +* rmdir and mkdir accept -v as synonym for --verbose +[4.0s] +* rm no longer segfaults on certain very deep hierarchies +* IMPORTANT SECURITY FIX: a running `rm -r' may no longer be subverted to + remove unintended directories +* cp can now remove unwritable files in interactive mode; contrary to how mv + works, cp's --interactive (-i) option does *not* cancel the effect of a + preceding --force (-f) option. +* all programs fail when printing --help or --version output to a full device +* install no longer performs chmod if chown fails (see ChangeLog for example) +[4.0r] +* `du dir/subdir1 dir/subdir2' no longer fails +* chown accepts new option: --from=CURRENT_OWNER:CURRENT_GROUP +* cp accepts new option: --strip-trailing-slashes +* install --directory (-d) may now be used to set special bits + e.g., `install -m a=rwx,o+t -d DIR' now honors the `o+t' part +* cp, mv, ln, install: document that while the --backup option takes an + optional argument, the -b option accepts none +* `ls -e' fails with a more useful diagnostic +* df produces better output for loop file system mount points +[4.0q] +* install -D bug is fixed +* chown now works properly when the specified login name contains a period + This is at the expense of always looking up the entire USER.GROUP string + as a login name first, and only then (upon failure) interpreting the `.' + as a separator and looking up `USER'. To avoid the extra getpwnam call, + always use the POSIX-mandated `:' character as the separator. +* `du some-other-dir' no longer fails if it can't open the current directory +* `mv DIR EXISTING-FILE' no longer removes EXISTING-FILE. Now it gets an error + as POSIX says it must. +* touch no longer hangs on fifos +[4.0p] +* various tools: quote multibyte characters correctly in diagnostics +* mv: portability fix for alpha +* dd: portability fix +* unified lib/: now that directory and most of the configuration framework + is common between fileutils, textutils, and sh-utils +[4.0o] +* Include lib/nanosleep.h. +[4.0n] +* cp, install, ln, and mv: when making backup files in verbose mode, these + commands now print the backup file name on the same line as the rest of the + information, e.g., `a -> b (backup: b.~13~)' rather than on a separate line + as all but ln used to do. ln didn't output the backup file name at all. +[4.0m] +* mv accepts new option: --strip-trailing-slashes (soon, many other + programs will, too) +* df no longer hangs when there is an inaccessible mount point unrelated to PATH +* rmdir --verbose no longer prints extra, bogus diagnosic upon failure +* fix df bug that made it print bogus values in the `Use%' column. +* touch -d once again parses dates with `hh:mm ZONE' time zone info. +[4.0l] +* ls -l honors a trailing slash on a symlink argument, per POSIX. +* shred no longer appears to infloop when asked to remove files in + unwritable directories +* `ls -ul' and `ls -uc' sort by name once again, as they should +[4.0k] +* mv may now be used to move a file onto a symlink to itself when that + symlink is on a separate partition. With fileutils-4.0j, it would + fail with a diagnostic saying they were the same file. +* touch would fail with the misleading diagnostic `no such file' when asked + to create a file in an unwritable directory. Now it says something like + `permission denied' or `read-only file system'. +[4.0j] +* mkdir may now be used to set special bits e.g., `mkdir -m o+t dir' works +* touch can now change the time(s) of a file you own even if you don't have + read or write access to it +* rm no longer dumps core after warning about directory cycles +* mv now refuses to move a file onto a symlink to itself when that symlink + is on a separate partition. Before, it would remove the file and leave + only the symlink. +* `install -d -g foo 1/2' now sets the `group' of the final component as well + as that of the leading one. +* df, du, and ls no longer divide by zero when an invalid block size is + specified through an environment variable +* under certain conditions, chgrp would fail to affect files referenced + through symlinks. Now it does. +* ln now makes hard links to symlinks on systems that support it. +* touch: no longer infloop on dangling symlinks +* cp, install, ln, mv: deprecate the --version-control option. Use --backup's + new optional argument instead. The old option still works, but now evokes a + warning. +* cp, install, ln, mv: the --backup option now accepts an optional argument +* cp, install, ln, mv: accept new option: --target-directory=DIR +* chgrp: accept new option, --dereference. --no-dereference is now the default. +* New ls option --quoting-style=locale acts like --quoting-style=c, except + with locale-specific quoting symbols (` and ' by default) instead of ". +* `df DIR' is less likely to hang due to bad NFS mounts +* As per POSIX.2, `df -P' now uses ceiling rather than rounding, and its + header now says `1024-blocks ... Capacity' instead of `1k-blocks ... Use%'. +[4.0i] +* `cp -f FILE FILE' and `mv -f FILE FILE' no longer remove FILE +* touch works once again (DST-wise) when certain `--date DATE-TIME' + values are specified. +* shred's -u option (short form of --remove) is now accepted +[4.0h] +* cp --one-file-system (-x) no longer crosses filesystem boundaries. +* touch can once again operate on directories +[4.0g] +* New large-file support for AIX and HP-UX, and for cross-compiles. +* shred's default options are now suitable for devices, not files, since + shred is more reliable on devices. shred now does not remove by default; + the old -p or --preserve option was inverted and renamed to -u or --remove. +* shred -u now attempts to truncate devices before removing them. +* shred -v no longer outputs carriage-returns; shred -vv has no extra effect; + shred -v now outputs to stderr. +* shred now tries to find the size of a non-regular file by seeking to its end. +* dd now opens the output file for *read* access only if `seek=' is used. +[4.0f] +* `ls --color' no longer segfaults +* dd works once again +[4.0e] +* shred --devices option renamed to -D so that -d, -i and -r can be + compatible with rm. +* shred -s/--size=N option added to specify the size of the object to be + shredded. +* `shred -' now shreds stdout rather than stdin. This is incompatible with -v. +* shred now does not need to read from its output file, so opens it O_WRONLY +* `ls -l' uses `+' to designate each file that has a custom ACL +* eliminate race condition that could make touch truncate a nonempty file +* No longer use *_unlocked I/O macros on systems (like solaris5.5.1) where + they're not declared, so selected executables (e.g., rm) that are linked + with shared libraries will once again run on solaris5.6 systems. +[4.0d (aka 4.1-b3)] +* ls recognizes solaris 2 `doors' +* new program: shred +* ln: Allow creation of a hard link to a dangling symlink +* cp, mv, install: --verbose now prints a message for each backup-related + renaming +* portability fixes for copy.c's code to detect move-directory-into-self +* upgrade to automake-1.3b +* upgrade to autoconf-2.13, and... +* remove some of the kludges in m4/*.m4 that permitted +[4.1-b2] +* concurrent `mkdir -p' processes no longer fail when creating the + same hierarchy +* argmatch.c has been fixed so that the unambiguous usage `ls --color=n' + no longer evokes an error. +* now, specifying an improper argument for an option that accepts enumerated + values evokes diagnostics like this: + $ src/touch --time=x file + src/touch: invalid argument `x' for `--time' + Valid arguments are: + - `atime', `access', `use' + - `mtime', `modify' + Try `src/touch --help' for more information. +[4.1-b1] +* ls --quoting-style=c prints correct octal escapes for certain nonprinting + characters in file names. +* fix `ls -R .' formatting bug that broke mktexlsr +* moving a directory into itself is properly diagnosed in more cases +* moving a directory containing hard-linked files now works + +Changes in release 4.0: +[4.0-b7] +* rm -rf '' no longer gets a failed assertion on the Hurd +[4.0-b6] +* rm simply fails as it should (rather than segfaulting) for + `mkdir -m 0100 x; rm -rf x' +[4.0-b5] +* still *more* mktime.c portability tweaks +[4.0-b4] +* mktime.c portability tweak for headers with GNU libc 5.4.44. +[4.0-b3] +* mktime.c works around problems with Digital Unix 4.0A and 4.0D. +* mktime.c handles dates in the spring-forward gap the same way other + implementations do +* install accepts long option --suffix=SUFFIX +[4.0-b2] +* man/Makefile.maint framework tweaks +* add test for `mv -i' bug +[4.0-pre1] +* fix serious bug whereby `touch a b; echo n|mv -i a b' would remove b. +[3.16z] +* portability tweaks +* avoid `root `cp -a' from Netapp snapshot' corruption +[3.16y] +* `install -D' now works +* distribute maintainer Makefiles in man/ +[3.16x] +* man pages are now automatically generated from a combination of --help + output and the contents of new (though mostly empty), man/*.x files. +[3.16w] +* touch now interprets `-t TIME-DATE' as POSIX specifies +* `ls EMPTY-DIR EMPTY-DIR' once again outputs the directory names +[3.16v] +* portability fixes +* `ls -R EMPTY-DIR' now outputs the name of the directory +[3.16u] +* mv now fails (as it should) upon attempt to move a directory into itself +* `cp -a --one-file-system' now copies any mount point directories it + encounters on the selected file system. +[3.16t] +* cp (with --update) and ls compare time stamps with subsecond resolution when + available (e.g., on systems with recent Linux kernels and on Solaris 2.6). +* install once again does the -m-specified chmod *after* running strip + (this fixes another bug introduced in 3.16o) +[3.16s] +* df accept a new option --local (-l) +* touch works around a system-specific bug so it now affects existing, + zero-length files on certain systems +* chown now works even on certain SVR3 systems where it used to fail +[3.16r] +* include gettext's m4 macros +* minor cp bug fixed +* non-portable cp tests removed +* --without-included-regex now means don't compile regex.c +* rx support removed +[3.16q] +* `df', `du', and `ls' now accept a new option --block-size=SIZE, + where SIZE can be a positive integer block size, followed by an + optional SI prefix (e.g. `k' for kilo, `M' for Mega), followed by an + optional `B' (for ``byte'', indicating powers of 1024, which is the + default) or `D' (for ``decimal byte'', indicating powers of 1000). + SIZE can also be `human-readable' (for -h or --human-readable + behavior) or `si' (for -H or --si behavior). +* These suffixes can also be used by `dd'; e.g. `dd bs=1MB' is equivalent + to `dd bs=1048576'. +* The default block size for the `df' command is now obtained from the + DF_BLOCK_SIZE environment variable or, if that is not set, from BLOCK_SIZE. + Similarly for `du' and `ls'. +* The output columns of `df' have been adjusted slightly to accommodate + larger filesystems. +* fix gettext-related link failures seen when configuring certain ways +[3.16p] +* fix install bug introduced in 3.16o +* build/test changes only +[3.16o] +* chown accepts new option, --dereference. --no-dereference is now the default. +* install now shares core copying code with mv and cp +* mv (between distinct filesystems) now uses more of the core copying code +* fixed a bug or two in mv +* df once again displays negative numbers when that's what's returned + by get_fs_usage +[3.16n] +* `mv dir dir' once again does *not* remove dir/ +* ls accepts new options: + --indicator-style=none (no indicators, the default) + --indicator-style=classify (all indicators) + (equivalent to -F or --classify) + --indicator-style=file-type (file type indicators) + (equivalent to -p or --file-type) + + --quoting-style=literal (do not quote output) + --quoting-style=shell (minimally quote output for the shell) + --quoting-style=shell-always (always quote output with '' for the shell) + --quoting-style=c (quote output as for a C-language string) + (equivalent to -Q or --quote-name) + --quoting-style=escape (like c but omit enclosing "") + (equivalent to -b or --escape) + + --show-control-chars is the opposite of --hide-control-chars + This option can be useful if output is to a terminal, + to override the default beahvior of hiding control characters. + +* The QUOTING_STYLE environment variable can now be used to specify the + default value for ls's --quoting-style option. If not specified, + the default quoting style is 'literal', but this default may change to + 'shell' in a future version of this package. +* ls's quoting style now affects operands in diagnostics, too. +* ls's --dired option now outputs the quoting style + using the format of the new --quoting-style option. +* ls's -e or --quote-shell option (introduced in 3.16j) has been removed; + use --quoting-style=shell to get its functionality. +[3.16m] +* mv can move (and doesn't read) special files +* remove maintainer mode +[3.16l] +* mv can finally move non-regular files between partitions +[3.16k] +* install accepts new option, -D +[3.16j] +* du accepts new options, --exclude=PAT and --exclude-from=FILE (-X FILE) +* ls now quotes file names for the shell by default, if they contain + characters that need quoting. Use -N to get the old default behavior. + The new behavior is also enabled by the new option -e or --quote-shell. +* ln --backup is now consistent with cp and mv in that --force is no longer + required when the destination is an existing non-directory. +* install accepts new option, --verbose (-v) +* mkdir -p is a lot faster when creating very deep directories on some systems +* rm -i no longer exits with status indicating failure solely because the + user declines to remove a file +* rm -r is a lot faster on some systems when removing deep hierarchies +* chgrp, chmod, and chown no longer give contradictory output when --verbose + is used and an operation fails +* ls's multicolumn option now uses variable width columns to conserve + vertical space +* install accepts new option, --preserve-timestamps +* du --megabytes --total now shows total in megabytes +* ls accepts new option, -h or --human-readable +* df, du, and ls now accept new option, -H or --si, for powers of 1000 not 1024 +* df, du, and ls now consistently round to nearest, with ties going to even +* df, du, and ls now use `k' instead of `K' for `kilo', + and support larger abbreviations T(era), P(eta), E(xa), Z(etta), Y(otta) +* touch -d DATE now works on Unicos +* du accepts new option --max-depth=N +* rmdir accepts new options: --ignore-fail-on-non-empty and --verbose +* on most hosts df, du, and ls now overflow at 2**64 bytes, not 2**31 bytes +* all programs now work on large files on LFS systems like Solaris 2.6 and + Linux with the pre-2.1 development version of GNU libc. +* df now works with OpenBSD 2.1 beta +* cp -d FILE SYMLINK-TO-FILE doesn't erase FILE. Now it gives an error. + +Changes in release 3.16: +* du --megabytes (-m) works +* ls -l works even on systems with non-POSIX strftime in their C library + +Changes in release 3.15: +* touch --date=DATE bug (due to broken getdate.y) has been fixed +* ls -l no longer misformats the date when run in a locale for which the + locale's abbreviated week-day name (strftime's %a format) is shorter or + longer than the `normal' three bytes (with LANG=de it's a two-byte string). +* Using --program-prefix no longer applies the prefix twice +* ls --color properly restores color attributes upon completion when the + normal (`no') color attribute is not the default color. +* with ls -s --color, the `total' and size of the first file are printed +* ls --color stats symlinks and distinguishes between regular symlinks + and orphan ones. +* cp --preserve preserves owner and group of symlinks on Linux when run + with EUID == 0 +* dircolors no longer accepts --print-data-base (alternate spelling of + --print-database) + +Changes in release 3.14: +* ls --color highlights based on suffix rules only for regular files +* touch --date=DATE accepts dates like those in an RCS log listing, e.g., + `1992/11/01 05:44:34'. +* install SRC DST no longer rejects non-regular, non-directory SRC +* df accepts -F as a synonym for -t for compatibility with Solaris +* cp -i /dev/null existing-file now prompts before overwriting the target +* ls --color highlights orphaned symlinks text on terminals that support it +* ls -l honors current locale with respect to abbreviated month names (and, + with --full-time day names) on systems with a locale-supporting strftime + function, e.g., ones based on recent versions of the GNU C library +* ls -l recognizes Cray's migrated dmf files. +* chgrp no longer aborts when given a group number larger than INT_MAX +* chgrp now fails when run by root with an unrecognized group name +* when possible, cp -p preserves owner/group even on symlinks in case + they're in a directory that has the sticky-bit set. +* cp --recursive --parents SRC DEST works when SRC is an absolute file name. + +Changes in release 3.13: +* ls properly determines window size on SunOS and Solaris systems +* ls accepts new option --color[=WHEN] where WHEN is `always', `never', + or `auto'. --color=never is the default. --color is equivalent + to --color=always. +* new program: dircolors +* ls allows 0 as argument to --tabsize (-T) option. Using --tabsize=0 + inhibits the use of TAB characters for separating columns. +* you can create a backup of FILE with cp --force --backup FILE FILE. Before, + that command failed saying that ``FILE' and `FILE' are the same file'. +* uses automake-generated Makefile templates +* chown and chgrp accept new option --no-dereference (-h) +* ln -f FILE FILE fails with a diagnostic rather than silently removing FILE +* when building on systems that have getopt_long (most GNU-oriented ones), + the system-provided function will be used -- so executables may be a + little smaller +* cp -p, and mv modify owner and/or group of symlinks on systems + (like Solaris) that provide the lchown system call. +* df no longer invokes the sync system call by default. You can use the + --sync option to make df invoke sync before getting file system sizes. +* internationalized diagnostic messages +* mkdir accepts new option: --verbose +* `cp file D/' uses the full file name `D/file' instead of `D//file'. +* cp --backup a~ a fails instead of silently destroying the source file +* df and du have new options --human-readable (-h) and --megabytes (-m). +* install now honors --backup (-b), --suffix=SUFFIX (-S SUFFIX), and + --version-control=WORD (-V WORD) options just as cp, ln, and mv do. +* ln --verbose output is less prone to misinterpretation +* ls -o works like -lG; for compatibility with other versions of ls +* cp has a new option to control creation of sparse files: + --sparse={auto,always,never}. --sparse=auto is the default. +* rm -rf '' behaves properly on SunOS 4 systems +* touch: rename long option name, --file, to --reference. + `touch --file' will continue to work a little longer. +* df fails if the same file system type is both selected and excluded. +* df works around SunOS statfs brokenness wrt filesystems larger than 2GB +* df better handles inconsistent mtab entries +* `ls -lDR dir dir2' works +* `ls -c' does what it's supposed to +* all programs include program name in --version output +* `ls --quote-name' works +* mv properly determines whether src and dest are the same file + Before, it could (though with very low probability) fail to do the move, + reporting that distinct source and destination are the same file. +* du --dereference (-L) works with directory symlinks +* du works on SunOS 4 systems even when accounting is enabled +* many programs that convert strings to integers now use strtol or strtoul + and detect overflow + +User-visible changes in release 3.12: +* None. +User-visible changes in release 3.11: +* None. +User-visible changes in release 3.10: +* mkdir -p now ignores arguments that are existing directories. Before, + (contrary to POSIX spec) it would attempt to change ownership and/or + protections of existing directories listed on the command line. And + it would fail when such a directory was owned by another user. +* Fix bug in cp that made the commands `mkdir dir; touch foo; cp -P foo dir' + incorrectly change the permissions on directory, dir. +* df accepts a new option, --no-sync, that inhibits the default invocation + of the sync system call. +* ls accepts a new option, --dired, that makes emacs' dired mode more efficient +* skeletal texinfo documentation (mainly just the `invoking' nodes) +* ln accepts a new option: --no-dereference (-n). With this option, + if the destination command line argument is a symlink to a directory, + use that as the destination instead of the file in the directory. +* `ln -i no-such-file existing-file' gives a diagnostic and fails. + Before, if you responded `yes' to the prompt it would both remove + `existing-file' and fail to make a link. +* du no longer requires read access to all of the directory components + of the current working directory on systems with fchdir. +* touch -d 'date' is no longer off by one hour. +* New program: sync. +* Fix bug in cp that made the commands `ln -s . s; cp -rd s r' incorrectly + create `r' as a symlink instead of as a regular file. +* du's -S and -c options now work when used together. + Before, the grand total was always reported to be zero. + +Major changes in release 3.9: +* --help gives a one-line description of each option and shows the + correspondence between short and long-named options. +* work around systems with BROKEN_STAT_MACROS +* work around problem where $(srcdir)/config.h was used instead of + ../config.h -- this happened only when building in a subdirectory + and when config.h remained in $(srcdir) from a previous ./configure. +* GNU chmod treats symlinks the same way other vendor's versions do. + Now symlinks listed on the command line are processed (they were + ignored before); the permissions of the dereferenced files are + changed. Symlinks encountered in recursive traversals are still + ignored. This makes GNU chmod act more like e.g. Sun's. +* configure uses config.h, so DEFS won't exceed preprocessor limits of + some compilers on the number of symbols defined via -D. +* ls and cp can handle mount points on more systems +* cp, mkdir, and rmdir long option --path renamed to --parents; --path + will still work for a while +* cp, ln, and mv convert `cp A B/' to cp A B/A when A is not a directory. + This change affects only the two-argument form of the commands. It makes + such commands fail when the target has a trailing slash but is not a + directory or symlink to a directory and the source is not a directory. + They used to succeed, ignoring the implicitly contradictory trailing slash. + +Major changes in release 3.8: +* install isn't as likely to produce spurious errors +* avoid redundant compilations for `dir' and `vdir'; +* configure properly defines STAT_STATFS2_BSIZE on a Pyramid MIServer + running OSx 5.1 + +Major changes in release 3.7: +* none +Major changes in release 3.6: +* `ln -s dir_pathname .' works when the pathname has a trailing slash +* with the --version option programs print the version and exit immediately +* GNU ls -f works like Unix ls -f +* mktime replacement works + +Major changes in release 3.5: +* adds support for DEC Alpha under OSF/1 +* configuring with gcc uses CFLAGS='-g -O' by default +* all programs accept --help and --version options +* long-named options must be introduced with `--'; `+' is no longer + accepted since it is incompatible with the POSIX.2 standard +* chmod accepts long-named options +* dd conv=unblock doesn't hang +* new df option --exclude=fstype +* new ls option --full-time + +Major changes in release 3.4: +* cp -p and mv preserve setuid and setgid bits +* chown works on systems where sizeof(uid_t) != sizeof(int) + or sizeof(uid) != sizeof(gid) +* catch errors from spurious slashes at ends of arguments + +Major changes in release 3.3: +* df sped up by not calling sync for every filesystem +* df ported to AIX (RS/6000 and PS/2), and SVR2 port fixed +* df -i now also prints the total number of inodes per filesystem +* ls sped up by not reading symlink contents unnecessarily +* du doesn't die on POSIX systems when the root filesystem is NFS mounted +* cp and mv report chown Permission denied errors when run by root diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/ChangeLog new file mode 100644 index 0000000..9005a62 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/ChangeLog @@ -0,0 +1,4850 @@ +2002-08-08 Jim Meyering + + * Version 2.0.15. + +2002-08-05 Paul Eggert + + Fix some minor time-related bugs with POSIX time arguments. + Some valid time stamps were being rejected (notably -1, and + time stamps before 1900 on 64-bit hosts). And some invalid + time stamps were being accepted, e.g. September 31. + + * src/date.c (main): Adjust to posixtime signature change. + +2002-08-05 Jim Meyering + + * configure.ac: Change $am_cv_sys_posix_termios to + $ac_cv_sys_posix_termios. From Andreas Schwab. + +2002-08-04 Jim Meyering + + * Version 2.0.14. + +2002-07-30 Paul Eggert + + * src/chroot.c (main): Exit with status 126 or 127 when execvp or + execv fails, for consistency with POSIX commands like env and nice. + * src/su.c (run_shell): Likewise. + +2002-07-29 Paul Eggert + + * src/nohup.sh: Change behavior to conform to POSIX 1003.1-2001: + - Do not adjust scheduling priority. + - Redirects stderr to stdout, if stderr is not a terminal. + - Exit status is now 126 if command was found but not invoked, + 127 if nohup failed or if command was not found. + Fix bug: command was run if nohup.out wasn't writeable. + * NEWS, doc/coreutils.texi: Document the above. + +2002-07-28 Jim Meyering + + * configure.ac: Require automake-1.6b. + +2002-07-27 Jim Meyering + + * Version 2.0.13. + + * src/who.c (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Remove definitions. + Now they're defined in readutmp.h. + (print_deadprocs): Remove obsolete FIXME comment. + +2002-07-07 Paul Eggert + + * src/nohup.sh: Port to POSIX 1003.1-2001 "nice", which + requires the option "-n 5" rather than "-5". This matters + with GNU "nice" if the user has set the _POSIX2_VERSION + environment variable. + +2002-07-24 Jim Meyering + + * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt false. + +2002-07-20 Jim Meyering + + * Upgrade to cvs automake -- required to work with 2.53b. + * configure.ac: Require automake-1.6a. + + * tests/Makefile.am (TESTS_ENVIRONMENT): Remove now-unused parts + of this definition. + (EXTRA_DIST): Add priv-check. + * tests/priv-check: New file. + + * Upgrade to gettext-0.11.3. + * Upgrade to autoconf-2.53b. + +2002-07-18 Jim Meyering + + * src/uname.c (main): Test sysctl(...) >= 0, not == 0, since + on NetBSD the return value may well be positive. + Use one-line aggregate initializations. + Use tightly scoped static buffers to avoid warnings about + unused variables on some systems. + +2002-05-07 Paul Eggert + + Add support for BSD-style sysctl to get the strings needed for + uname -p and uname -i. Unfortunately the different BSDs vary, + but I've surveyed FreeBSD, NetBSD, and OpenBSD. + + * src/uname.c (UNAME_HARDWARE_PLATFORM, UNAME_PROCESSOR): New macros. + (main): Use them, along with sysctl, to support uname -i and uname -p + on BSD hosts. + +2002-07-17 Jim Meyering + + * src/uptime.c (print_uptime): Restore use of (equivalent, but + more readable) `>=' from Bruno's patch. + + * configure.ac (jm_BOOT_TIME): Remove. (moved/renamed to m4/boottime.m4) + Use the replacement: GNULIB_BOOT_TIME. + +2002-07-13 Bruno Haible + + * src/uptime.c: Include sys/sysctl.h. + (print_uptime): Add support for determining the boot time on FreeBSD. + +2002-07-15 Jim Meyering + + * src/uptime.c (print_uptime): Use STREQ in place of !strcmp. + + * src/uname.c (main): Remove unnecessary uses of `defined' when + operating on `HAVE_...' symbols. Remove unnecessary parentheses. + +2002-07-02 Jim Meyering + + * src/basename.c, src/chroot.c, src/date.c, src/dirname.c (usage): + Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it. + * src/echo.c, src/env.c, src/expr.c, src/factor.c: Likewise. + * src/hostname.c, src/id.c, src/kill.c, src/logname.c: Likewise. + * src/nice.c, src/pathchk.c, src/pinky.c, src/printenv.c: Likewise. + * src/printf.c, src/pwd.c, src/seq.c, src/sleep.c, src/stty.c: Likewise. + * src/su.c, src/tee.c, src/test.c, src/true.c, src/tty.c: Likewise. + * src/uname.c, src/uptime.c, src/users.c, src/who.c: Likewise. + * src/whoami.c, src/yes.c: Likewise. + + * src/Makefile.am (.sh): Also substitute @PACKAGE_BUGREPORT@. + * src/groups.sh (usage): Use @PACKAGE_BUGREPORT@, rather than + hard-coding a deprecated address. + * src/nohup.sh (usage_help): Likewise. + + * src/date.c (usage): Mention that the expansions of %p and %P are + empty in many locales. From matthew arnison. + +2002-06-22 Jim Meyering + + * configure.ac: Invoke AC_GNU_SOURCE very early. + +2002-05-24 Jim Meyering + + * tests/nice: Move this file... + * tests/misc/nice: ...to here. + * tests/Makefile.am (TESTS): Remove nice. + * tests/misc/Makefile.am (TESTS): Add nice. + * configure.ac (AC_CONFIG_FILES): Add tests/misc/Makefile. + + * src/pathchk.c (validate_path): Compare the result of the function -- + not its (constant) address -- against zero. + Patch from Tim J. Robbins + * tests/misc/pathchk1: New test for the above. + * tests/misc: New directory. + * tests/Makefile.am (SUBDIRS): Add misc. + * tests/misc/Makefile.am: New file. + +2002-05-03 Jim Meyering + + * src/uptime.c (print_uptime): Use ngettext for day/days and user/users. + Suggestion from Karl Eichwalder. + + * src/kill.c (usage): Add a little to the description of --list. + Uncapitalize first word and remove period at end of each one line + option description. + + * src/who.c (usage): Tweak description of --users. + From Karl Eichwalder. + +2002-04-29 Jim Meyering + + * Version 2.0.12. + + Avoid warnings from gcc. + * src/who.c (PIDSTR_DECL_AND_INIT): Cast ut_pid value to int. + (make_id_equals_comment): Cast sizeof expression (used as field + width argument) to `int'. + + * configure, config.hin, Makefile.in, etc.: Regenerate using + autoconf-2.53a. + +2002-04-28 Jim Meyering + + * src/who.c: Don't include xalloc.h. + It's already included via system.h. + +2002-04-28 Paul Eggert + + * src/kill.c: Rewrite from scratch. Support everything + required by POSIX 1003.1-2001; when this conflicts with Bash, + stick with POSIX. The conflicts are kill -l output format, + and lower case signal names preceded by `-' (e.g., "kill -hup" + is no longer supported). Remove -L or --long-list option. + Add -t or --table option. Rename --sigspec to --signal; + remove --signum and do not advertise obsolescent option -n. + Use str2sig and str2sig to convert between signal names and + numbers. + + * doc/coreutils.texi (kill invocation): Document the above. + Document POSIX signals better. + + * lib/sig2str.h, lib/sig2str.c: New files. + * configure.ac (AC_CHECK_DECLS): Add str2signal, strtoimax, + sys_siglist, _sys_siglist. + * lib/Makefile.am (libfetish_a_SOURCES): Add sig2str.h. + * m4/jm-macros.m4 (jm_MACROS): Add AC_REPLACE_FUNCS(sig2str). + * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_SIG2STR. + (jm_PREREQ_SIG2STR): New macro. + +2002-04-28 Jim Meyering + + * src/test.c (test_syntax_error): Add `const' to paramater + declarations to avoid new warning from gcc. + (integer_expected_error): Likewise. + +2002-04-25 Jim Meyering + + * configure.ac (AM_GNU_GETTEXT): Add external arg. + (AC_CONFIG_FILES): Remove intl/Makefile. + * Makefile.am (SUBDIRS): Remove intl. + * src/Makefile.am (INCLUDES): Remove -I../intl. + +2002-04-16 Jim Meyering + + * src/who.c (BOOT_TIME): Define. + (NEW_TIME): Define to 0, not INT_MAX. + (UT_PID, UT_ID, UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define. + Replace literal uses of ut_pid, ut_id, and ut_exit members with + uses through macros. + (make_id_equals_comment): New function, factored out of three others. + (UT_TYPE_UNDEF, UT_TYPE, IS_USER_PROCESS): Define. + (print_line): Use "%-8.8s" for the format: the user name is not + always NUL terminated. + (scan_entries) [need_users]: Use IS_USER_PROCESS, so that this works + even on systems without ut_type. + +2002-04-15 Jim Meyering + + * src/who.c: Include xalloc.h. + Use xmalloc everywhere, not malloc. + +2002-04-12 Jim Meyering + + * src/Makefile.am (LDADD): List ../lib/libfetish.a both before + and after @LIBINTL@. Thanks to Paul Eggert for the fix and to + Bruno Haible for diagnosing the problem. + +2002-02-26 Paul Eggert + + * src/test.c (age_of): Return -1 and 0 rather than 0 and 1. + Might as well keep it simple, and like bash. + (binary_operator): Fix bug with -nt and -ot, when one of the + files did not exist. We want to be compatible with the ksh93 + documentation, and with Bash. + +2002-03-17 Jim Meyering + + * src/seq.c (usage): Mention that --format=FORMAT must be + a *floating-point* format, also in description of that option. + Reported by Karl Eichwalder. + (usage): Also add the `=' signs here: --format=FORMAT, + --separator=STRING. + +2002-03-16 Jim Meyering + + * src/Makefile.am (datadir): Don't override $(datadir) + which might be set by --datadir and different from $(prefix)/share. + Patch from Albert Chin-A-Young. + +2002-03-10 Jim Meyering + + * configure.ac (AM_INIT_AUTOMAKE): Specify here the required version + of automake (1.6), and options (gnits dist-bzip2), rather than... + * Makefile.am (AUTOMAKE_OPTIONS): ...here. Remove definition. + +2002-03-09 Jim Meyering + + * Makefile.am (EXTRA_DIST): Remove config/config.rpath, + now that automake knows about it. + +2002-03-05 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add config/config.rpath. + +2002-03-02 Jim Meyering + + * tests/nice: Export _POSIX2_VERSION=199209, so we can continue + to exercise the now-obsolete options. + + * Makefile.maint (strftime-check): Add `N'. + +2002-02-27 Paul Eggert + + * doc/coreutils.texi (Time directives): Add %N for nanoseconds. + This documents the recent change to 'ls'. But for this to + be accurate we also have to update 'date', as follows: + + * src/Makefile.am (date_LDADD): New macro. + + * src/date.c: Include timespec.h. + (strftime, time, stime): Remove declarations; no longer needed. + (usage): Document %N. + (main): Use gettime rather than time to get the time of day, + so that we can get fractional times. + Similarly for settime and stime, so that we can set fractional times + (though this currently is not available to the user since we don't + parse fractional times; add FIXMES for that). + Check for gettime failures; e.g. this can occur if it + is past 2038 and we are a 32-bit app running on a 64-bit OS. + Get fractional part of file time stamps. + Do not falsely report failures just because time_t happens to be -1 + (e.g. a file time stamp 1 second before the epoch). + (show_date): 2nd arg is now struct timespec, not time_t. + All uses changed. Use nstrftime rather than strftime, so that + we can format fractional seconds. + +2002-02-24 Jim Meyering + + * src/nice.c: Include posixver.h. + * src/date.c: Likewise. + +2002-02-17 Jim Meyering + + * ABOUT-NLS, intl/*: Update to Gettext 0.11. + * INSTALL: Update to Autoconf 2.52h. + + * src/Makefile.am (datadir): Use `share' in place of @DATADIRNAME@, + per Gettext-0.11. + (LDADD): Use @LIBINTL@ instead of @INTLLIBS@, per Gettext-0.11. + + * configure.ac (AC_CONFIG_AUX_DIR): New macro invocation. + (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11. + + * config: New subdirectory, containing the following files from .: + config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs. + Move the following files here from doc: texinfo.tex, mdate-sh. + +2002-02-15 Paul Eggert + + Add support for _POSIX2_VERSION, which lets you pick which POSIX + version you want the utilities to conform to. Remove warnings about + failure to conform to a future POSIX version. + + * src/date.c (ISO_8601_OPTION): Remove; no longer needed. + All uses changed to back to the corresponding short options. + (short_options): Remove; no longer needed. + (COMMON_SHORT_OPTIONS): New macro. + + * src/date.c (usage): Document only the intersection of the + old and new behaviors, to encourage portability. + (main): Parse options using POSIX 1003.1-2001 rules if + conforming to that standard. Do not warn of obsolete options. + * src/nice.c (usage, main): Likewise. + +2002-02-11 Paul Eggert + + * src/nice.c (main): Output warnings only if OBSOLETE_OPTION_WARNINGS. + +2002-02-11 Jim Meyering + + * src/date.c (usage): Describe %F, %g, %G, %P, and %R. + Tweak the description of %p. + + * tests/stty/basic-1: Use `tail -n +2', rather than `tail +2'. + +2002-02-03 Paul Eggert + + Add more support for POSIX 1003.1-2001, which requires removal + for support of obsolete "-DIGITS" option syntax in nice, and + which prohibits options with optional arguments like date's + -I option. + + * NEWS, coreutils.texi: Document this. + + * src/date.c (ISO_8601_OPTION): New enum value. + (long_options): Use it. + (short_options): New constant. + + * src/date.c (usage): Document the change. + * src/nice.c (usage): Likewise. + + * src/date.c (main): Conform to POSIX 1003.1-2001 if + POSIX2_VERSION says to, otherwise warn of obsolete usage if + OBSOLETE_OPTION_WARNINGS is nonzero and if not POSIXLY_CORRECT. + * src/nice.c (main): Likewise. + +2002-02-02 Bruno Haible + + * printf.c (print_esc): Call print_unicode_char with exit_on_error = + false. + +2002-01-28 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5d. + * configure.ac (AM_INIT_AUTOMAKE): Use zero-arg form of this macro. + +2002-01-22 Jim Meyering + + * po/POTFILES.in: Add lib/xmemcoll.c and src/sys2.h. + +2002-01-21 Jim Meyering + + * Makefile.maint (strftime-check): New rule. + (local-check): Convert this target to a list. Update uses. + Mark them as .PHONY. + (header-check): New rule. + (local-check): Add header-check. + + * src/dirname.c: Don't include "xalloc.h", as system.h already + does that via sys2.h. + * src/expr.c: Likewise. + +2002-01-19 Jim Meyering + + * configure.ac: Remove code that set LIBOBJS in support of ansi2knr. + The latest version of autoconf objected to it, and besides, I don't + care too much about K&R support these days. + +2002-01-14 Paul Eggert + + * src/date.c, src/logname.c, src/pathchk.c: Comment fixes + to bring us up to date with respect to POSIX 1003.1-2001. + In particular, POSIX.2 is now obsolete. + +2001-12-28 Jim Meyering + + * configure.ac (ALL_LINGUAS): Add Catalan (ca). + +2001-12-17 Jim Meyering + + * Makefile.maint (real_dir): Remove unused variable. + (url_dir_list): Don't set define it here, but... + * Makefile.cfg (url_dir_list): ...define it here instead. + (hosts, a_host, b_host): Remove now-unused variables. + (alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables. + +2001-12-15 Jim Meyering + + * src/basename.c, src/chroot.c, src/date.c, src/dirname.c, src/echo.c, + * src/env.c, src/expr.c, src/factor.c, src/hostid.c, src/hostname.c, + * src/id.c, src/kill.c, src/logname.c, src/nice.c, src/pathchk.c, + * src/pinky.c, src/printenv.c, src/printf.c, src/pwd.c, src/seq.c, + * src/sleep.c, src/stty.c, src/su.c, src/tee.c, src/test.c, src/true.c, + * src/tty.c, src/uname.c, src/uptime.c, src/users.c, src/who.c, + * src/whoami.c, src/yes.c (usage): Use fputs, not printf. + Split --help output into smaller pieces. + Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION + instead of hard-coding --help and --version descriptions. + +2001-12-08 Jim Meyering + + * Makefile.cfg (wget_files): Remove ansi2knr.c, since it's + no longer available at that location. + +2001-11-25 Jim Meyering + + * basename.c, dirname.c, expr.c, factor.c, hostname.c (usage): + * logname.c, printenv.c, printf.c, pwd.c, sleep.c, test.c (usage): + * true.c, whoami.c, yes.c (usage): + Indent --help and --version strings to start in the 7th column. + +2001-11-17 Jim Meyering + + * configure.ac: Replace use of the one-arg form of AC_INIT + with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR. + +2001-11-11 Jim Meyering + + * src/Makefile.am (printf_LDADD): Reflect spelling change: + s/POW_LIBM/POW_LIB/. + (sleep_LDADD): Likewise. + +2001-11-10 Jim Meyering + + * src/date.c (usage): Document %u. Reported by Albert Hopkins. + +2001-11-09 Jim Meyering + + * configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no + arguments. + +2001-09-28 Jim Meyering + + * configure.ac: Tell automake to use the file name `config.hin' + rather than the two-`.' config.h.in. + +2001-09-26 Jim Meyering + + * man/Makefile.am (common_dep): Define it, so we depend on configure.ac. + + * configure.ac: Renamed from configure.in. + +2001-09-25 Jim Meyering + + * src/Makefile.am: + (factor_DEPENDENCIES, printf_DEPENDENCIES seq_DEPENDENCIES): + (sleep_DEPENDENCIES uptime_DEPENDENCIES su_DEPENDENCIES): + Remove unnecessary definitions. They can cause trouble + when @INTLLIBS@ expands to -lintl. + +2001-09-23 Jim Meyering + + * Makefile.am (SUBDIRS): When using newer gettext (in which + intl/libintl.h is created by rules intl/Makefile) + `intl' must precede `lib'. + +2001-09-17 Jim Meyering + + * src/printf.c (main): Change the `ignoring excess arguments' diagnostic + to list the first one we're ignoring. Suggestion from Karl Berry. + +2001-09-16 Jim Meyering + + * src/stty.c (usage): Prefix each line with a space, so that + help2man produces a better stty.1 man page. + From Colin Watson, via Michael Stone. http://bugs.debian.org/95816 + + * src/test.c (usage): Describe -h option. + From Colin Watson, via Michael Stone. http://bugs.debian.org/99272 + + * man/pwd.x: Add note to help people understand that this documentation + may not refer to the (shell built-in) command they're running. + * man/echo.x: Likewise. + * man/printf.x: Likewise. + From Michael Stone. + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5. + + * man/Makefile.am: Revamp this file, as for fileutils. + +2001-09-11 Jim Meyering + + * configure.in: Move HOST_OPERATING_SYSTEM code from this file + into a new macro defined in m4/host-os.m4. + +2001-09-09 Jim Meyering + + * src/test.c (binary_operator): Correct typo in diagnostic. + From Jochen Hein. + +2001-09-03 Paul Eggert + + * NEWS: New 'uname' options -i or --hardware-platform, + and -o or --operating-system. + 'uname -a' now outputs -i and -o information at the end. + New uname option --kernel-version is an alias for -v. + Uname option --release has been renamed to --kernel-release, + and --sysname has been renamed to --kernel-name; + the old options will work for a while, but are no longer documented. + + * configure.in (HOST_OPERATING_SYSTEM): New macro; set it + from $host_os with a translation table and other heuristics. + + * src/uname.c: Correct copyright notice as per latest coding standards. + Remove list of options in comment, which wasn't + worth maintaining separately from usage(). + + (print_element): Move definition up, avoiding the need for + declaration and allowing inlining on some platforms. + Keep track of whether something has been printed; this is more + natural than modifying `toprint'. + + (PRINT_KERNEL_NAME): Renamed from PRINT_SYSNAME. + (PRINT_KERNEL_RELEASE): Renamed from PRINT_RELEASE. + (PRINT_KERNEL_VERSION): Renamed from PRINT_VERSION. + (PRINT_HARDWARE_PLATFORM, PRINT_OPERATING_SYSTEM): New macros. + (toprint): Remove global var; now local in `main'. + (long_options, usage, main): Implement changes described in NEWS. + Reorder options to reflect output order. + (main): Use buffers one byte longer, for compatibility with Solaris 8. + Output newline at end. -a sets `toprint' to -1 now; this is simpler. + Do not bother invoking system calls like uname if the resulting + information does not need to be printed. + Do not fail if sysinfo fails; just print "unknown". + +2001-08-30 Paul Eggert + + * src/tee.c (full_write): Remove decl; not needed. + +2001-06-19 Paul Eggert + + * NEWS: expr now uses LC_COLLATE for string comparison, as per POSIX. + * src/expr.c (nextarg): Use strcoll, not strcmp. + +2001-08-24 Jim Meyering + + * src/pinky.c (main): Fail if -l is specified with no username. + + * src/pinky.c (usage): Clarify description of -l. From Clark Morgan. + +2001-06-21 Paul Eggert + + * NEWS: 'expr' now requires '+' rather than 'quote' to quote tokens. + + * src/expr.c (posixly_correct): Remove; no longer needed. + (main): Do not worry about POSIXLY_CORRECT, as it's OK for + expr to have options (so long as they do not begin with digits). + (eval6, usage): Use "+" rather than "quote" to quote tokens. + +2001-08-19 Jim Meyering + + * src/Makefile.am (bin_PROGRAMS): Add kill. + * src/kill.c: New program. Written by Marcus Brinkmann. + +2001-08-19 Jim Meyering + + * po/POTFILES.in: Add src/kill.c + +2001-06-21 Paul Eggert + + * src/expr.c (nextarg): Advance ARGS by one if the next token matches. + All callers changed. + +2001-06-21 Paul Eggert + + * src/expr.c (isstring): Remove. + (eval2): Do comparisons as strings first, before trying to convert to + integer. This avoids loss of information and wrong result, e.g. for + "expr '00' '<' '0!'", where you don't want to convert '00' to '0'. + +2001-08-18 Jim Meyering + + * tests/expr/basic (00): New test for the above. + +2001-06-21 Paul Eggert + + * src/expr.c: Code cleanup to avoid tricky macros and + old-style function declarations. + + (cmpf, less_than, less_equal, equal, not_equal, greater_equal, + greater_than, arithf, arithdivf, plus, minus, multiply, divide, mod): + Remove. + + (eval4, eval3, eval2): Rewrite to avoid the need for the above macros + and functions. + +2001-08-18 Jim Meyering + + * src/test.c (binary_operator): Move declarations of lt,rt `down' + into the scopes where they're actually used. + (unary_operator): Likewise for `fd'. + +2001-06-20 Paul Eggert + + * src/test.c (isint, binary_operator, unary_operator): + Use intmax_t for argument integers, not long. + (age_of, binary_operator): Use time_t for times, not long. + (unary_operator): If N is out of int range, -t N now returns false. + +2001-06-20 Paul Eggert + + * src/expr.c (main): Handle a leading "--" option as POSIX requires. + +2001-08-18 Jim Meyering + + * tests/expr/basic: Add a test for the above. + +2001-06-20 Paul Eggert + + * src/expr.c (toarith): Don't accept plain "-" as a valid integer. + +2001-06-20 Paul Eggert + + Modify 'expr' so that it uses intmax_t, not int, to calculate + the value of integer expressions. + + * src/expr.c (struct valinfo.i): Now intmax_t, not int. + (docolon, int_value, str_value, isstring, nextarg, toarith, + freev, tostring, trace): Remove unnecessary forward decls. + (int_value, printv, tostring, toarith, arithf, arithdivf, docolon, + eval6, eval4, eval3): Do integer arithmetic using intmax_t, not int. + (docolon): Don't assume size_t fits in int. + +2001-08-18 Jim Meyering + + * tests/expr/basic: New test for the above. + * tests/expr/Makefile.am: New file. + * tests/expr: New directory. + * tests/Makefile.am (SUBDIRS): Add expr. + * configure.in (AC_OUTPUT): Add tests/expr/Makefile. + +2001-08-18 Jim Meyering + + Revert part of last change and solve the problem a better way. + * src/date.c (show_date) [--rfc-822]: Set LC_ALL=C just before + calling strftime and restore it just afterwards. + Suggestion from Ulrich Drepper. + +2001-08-18 H. Peter Anvin + + * src/date.c (show_date) [--rfc-822]: Don't space-pad the day of + the month. + Set only LC_TYPE to the "C" locale. Setting LC_ALL is overkill, + and would have unwanted side effects if there is an error message. + +2001-08-16 Jim Meyering + + * src/date.c (main): When there are too many non-option arguments, + include the first offending argument in the diagnostic. + Suggestion from Karl Berry. + +2001-08-14 Jim Meyering + + * src/Makefile.am (INCLUDES): Add -I../lib so sys2.h can include + the new, generated file, unlocked-io.h. + + * tests/Makefile.am (TESTS_ENVIRONMENT): Remove first definition + of this variable, and move its RHS into the RHS of the second. + Thanks, automake! + + * src/su.c (xputenv): Remove parameter's const qualifier. + + * src/dirname.c, src/env.c, src/id.c, src/pathchk.c, src/pinky.c, + * src/printenv.c, src/sleep.c, src/tee.c, src/test.c, src/uptime.c, + * src/users.c, src/who.c: (AUTHORS): Mark string for translation, + since it contains the English word `and'. + +2001-08-12 Jim Meyering + + * src/pathchk.c (PATH_MAX_FOR): Use pathconf via wrapper. + (NAME_MAX_FOR): Likewise. + Guard the above pathconf-using definitions with `#if HAVE_PATHCONF' + rather than with `#ifdef _POSIX_VERSION'. + (pathconf_wrapper): New function. + (validate_path): Declare length variables to be `long', not `int'. + Adjust corresponding printf-style specs to use %ld. + Reported by Neal H Walfield. + +2001-08-07 Jim Meyering + + * src/printf.c (cfcc_msg): Remove now-inaccurate part of comment. + From Bruno Haible. + +2001-07-04 Jim Meyering + + * Makefile.cfg: New file with package-specific definitions. + * Makefile.am (EXTRA_DIST): Add Makefile.cfg. + +2001-06-09 Jim Meyering + + (PIDSTR_DECL_AND_INIT): Define. + +2001-06-05 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Turkish (tr). + +2001-05-27 Jim Meyering + + * src/dirname.c (main): Add `const' to declaration of local, `result'. + +2001-04-01 Jim Meyering + + Add options to make `who' more POSIX compliant. + * who.c: Accept new options: --all (-a), --boot (-b), --dead (-d), + --login, --process (-p), --runlevel (-r), --short (-s), --time (-t), + --users (-u). + The -u option now produces POSIX-specified results and is the same as + the long option `--users'. --idle is no longer the same as -u. + (time_string, print_line, print_boottime, print_deadprocs, print_login, + print_initspawn, print_clockchange, print_runlevel): New functions. + (print_user): Renamed from print_entry and reworked. + (search_entries): Remove function. + (who_am_i): Likewise. + (usage): Describe new options. + (main): Handle new options. + Mostly from Michael Stone. + +2001-05-11 Paul Eggert + + dirname code cleanup. base_name now behaves more compatibly + with POSIX basename when given file names that have trailing + slashes, and similarly for dir_name. Add new primitives + base_len and dir_len. Put the directory-name-related decls + into dirname.h. + + * basename.c: Include "dirname.h". + (base_name, strip_trailing_slashes): Remove decls; now in dirname.h. + (main): Use base_len instead of strip_trailing_slashes to strip + trailing slashes. + + * dirname.c (strip_trailing_slashes): Remove decl; + now in dirname.h. + (main): Use dir_len rather than dir_name_r. + + * su.c: Include "dirname.h". + (base_name): Remove decl; now in dirname.h. + +2001-04-20 Jim Meyering + + * doc/sh-utils.texi (false invocation): Describe how --help and + --version are treated with and without POSIXLY_CORRECT. + (true invocation): Likewise. Forwarded by Michael Stone. + +2001-03-18 Jim Meyering + + * tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL + to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a + suggestion from Eli Zaretskii. + +2001-03-10 Jim Meyering + + * doc/sh-utils.texi (date invocation): Correct the description of how + date works when given no format. Reported by Ole Laursen. + + * src/factor.c: Include wheel-size.h. + (WHEEL_START): Adjust definition. + (wheel_tab[]): Remove body of definition. + Include generated file, wheel.h, instead. + + * src/wheel-gen.pl: New file. + * src/Makefile.am (noinst_HEADERS): Add wheel.h wheel-size.h. + (EXTRA_DIST): Add wheel-gen.pl. + (PERL): Define. + (wheel-size.h, wheel.h): New rules. + (BUILT_SOURCES): Add wheel.h and wheel-size.h. + (MAINTAINERCLEANFILES): Define. + +2001-03-09 Jim Meyering + + * Makefile.maint (my_distdir): Define new variable, and use this + in place of most old uses of $(distdir). + + * src/date.c (usage): Describe %C. + * doc/sh-utils.texi (Date directives): Likewise. + + * tests/help-version: Ensure that /dev/full is a character device + (using test -c) as well as being writable, before trying to write to it. + Otherwise, the test could mistakenly append a newline to an existing, + regular, writable, /dev/full file. + Suggested by Ulrich Drepper. + +2001-03-07 Jim Meyering + + * tests/stty/Makefile.am (EXTRA_DIST): Remove input-tty. + * tests/Makefile.am (EXTRA_DIST): Add input-tty. + + * tests/stty/basic-1: Reflect change in location of input-tty. + * tests/stty/row-col: Likewise. + * tests/stty/input-tty: Move this file... + * tests/input-tty: ... to here. + +2001-02-24 Paul Eggert + + * doc/sh-utils.texi: Fix typo: '-d=1may' -> '-d 1may'. + Fix and clarify time zone usage in 'date' examples. + +2001-02-04 Jim Meyering + + * src/factor.c (usage): Tweak --help output: it prints the _prime_ + factors, not just any factors. + +2001-02-03 Jim Meyering + + Improve the performance of `factor' (more than 2x speed-up for large N). + * src/factor.c (wheel_tab): New global table. + (WHEEL_START, WHEEL_END): Define. + (factor): Remove the loop that special-cased `2'. + Instead of incrementing by `2', use the offsets from the wheel table. + From Michael Steffens. + +2000-11-27 Prashant TR + + * src/test.c (eaccess) [__MSDOS__]: Just use access. + +2001-01-26 Jim Meyering + + * src/dirname.c (main): Declare local result as non-const, now + that it's freed. + +2001-01-20 Jim Meyering + + * configure.in: Remove jm_CHECK_ALL_TYPES. + Now it's invoked by jm_MACROS. + +2001-01-04 Jim Meyering + + * src/date.c (main): Fail when --rfc-822 (-R) is specified along + with a format string. Reported by Jochen Hein. + +2000-12-17 Jim Meyering + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + + * djgpp: New directory. + * djgpp/*: New files. + * Makefile.am (SUBDIRS): Add djgpp. + * configure.in (AC_OUTPUT): Add djgpp/Makefile. + From Prashant TR. + +2000-12-08 Jim Meyering + + * src/dirname.c: Include xalloc.h. + (main): Use dir_name rather than the underlying dir_name_r. + The former now handles cwd-relative names with drive-letter prefixes. + +2000-12-02 Jim Meyering + + * src/seq.c (valid_format): Move pre-increment to a separate statement + to avoid a warning. + + * src/id.c: Move dcls of globals used only in main... + (main): ...to here. + (usage): Clarify option descriptions. + +2000-11-18 Jim Meyering + + * po/Makefile.in.in: Sync with the one from fileutils. + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + +2000-11-17 Jim Meyering + + * GNUmakefile (.NOTPARALLEL): New target. Prevent unwanted parallelism. + Suggestion from Ulrich Drepper. + + * src/pinky.c: Explicitly include sys/types.h before including system.h. + * src/uptime.c: Likewise. + * src/users.c: Likewise. + * src/who.c: Likewise. + +2000-11-13 Paul Eggert + + * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should + be tested with #ifdef, not with #if. + +2000-11-12 Jim Meyering + + * src/date.c (show_date): Add a comment explaining why the + format string must not be translatable via _(). From Paul Eggert. + +2000-10-31 Jim Meyering + + * doc/sh-utils.texi: Clean up indentation and punctuation. + Fix a couple typos. From Brian Youmans. + +2000-10-30 Jim Meyering + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + +2000-10-29 Jim Meyering + + * Version 2.0.11. + +2000-10-27 Jim Meyering + + * src/date.c (usage): Mention the time zone, UTC, and write the date + in ISO format in the description of %s. Suggestion from Karl Berry. + +2000-10-25 Jim Meyering + + * src/dirname.c: Include dirname.h. + (main): Use dir_name_r rather than open-coding it. + +2000-10-23 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add .prev-version. + +2000-10-18 Paul Eggert + + * src/date.c (universal_time): Remove; it's just a temptation to + do the wrong thing. + (main): The -u option now just sets TZ; it doesn't do anything else. + (show_date): Do not do anything special if -u is set. + This affects the behavior of the -I and -R options. + * doc/sh-utils.texi: Document the above. + +2000-10-18 Jim Meyering + + * doc/sh-utils.texi (Examples of date): Fix a typo. + +2000-10-11 Jim Meyering + + * doc/sh-utils.texi (Time directives) [%S]: Range is 0..60, not 0..61. + +2000-10-06 Paul Eggert + + Undo the effect of the 1997-07-12 change to date.c; it + broke "date -u MMDDhhmm" and it wasn't documented. + This reverts to the behavior of the 1996-01-03 patch. + + * src/date.c (TZ_UTC0, MAYBE_SET_TZ_UTC0, set_tz): Remove. + (batch_convert): Don't futz with TZ. + (main): -u now parses all dates as UTC, not just some. + Reported by Karl-Michael Schneider. + * tests/date/Test.pm (utc-0, utc-1, relative-2): Adjust to + above change. + +2000-09-29 Jim Meyering + + * src/yes.c (usage): Add a separate usage line, just for `OPTION'. + Suggestion from M. P. Suzuki. + +2000-09-09 Jim Meyering + + * src/date.c (usage): Make the second `Usage' line more precise + (also making it match the texinfo documentation). + From Karl Eichwalder. + + * doc/sh-utils.texi (Setting the time): Correct the capitalization of + `HHMM' in the info-rendering of the texinfo documentation. + Reported by Karl Eichwalder. + +2000-08-14 Jim Meyering + + * src/tee.c (main): Remove incorrect `FIXME' comment. + +2000-08-07 Paul Eggert + + * src/su.c (xputenv): Invoke xalloc_die instead of printing + our own message. + +2000-07-30 Jim Meyering + + * src/tee.c (tee): Use SET_BINARY and SET_BINARY2. + From Prashant TR. + + * src/help-version: Remove file. Move it to ... + * tests/help-version: ...here + * tests/Makefile.am (TESTS): Add help-version. + (TESTS_ENVIRONMENT): Define. + * src/Makefile.am (EXTRA_DIST): Remove help-version. + (TESTS): Remove definition. + (TESTS_ENVIRONMENT): Remove definition. + +2000-07-23 Jim Meyering + + * src/help-version (su_args): Punt, so we don't try to start a shell. + + * src/su.c: Include if HAVE_SYS_PARAM_H is defined, + rather than if _POSIX_VERSION is defined. Remove declarations of + getpwuid, getgrgid, and getuid, now that they're in sys2.h. + Prompted by a report from John David Anglin. + + * src/sys2.h [!HAVE_DECL_GETPWUID]: Declare getpwuid. + [!HAVE_DECL_GETGRGID]: Declare getgrgid. + [!HAVE_DECL_GETUID]: Declare getuid. + +2000-07-19 Jim Meyering + + * src/date.c (batch_convert): Free `initial_TZ' only if it was set. + Reported by Michael Hohn. + +2000-07-17 Jim Meyering + + * src/stty.c (visible): Don't mark `' for translation. + The standard requires that exact string. + +2000-07-09 Jim Meyering + + * config.guess: Update from FSF. + * config.sub: Likewise. + + * src/Makefile.am (seq_LDADD): Don't hard-code `-lm' -- some systems + don't have/need it. From Bruno Haible. + +2000-07-06 Jim Meyering + + * src/help-version: Punt on `groups' test, since all it does + is run `id -Gn', and groups fails if GNU id is not installed. + Reported by Christian Krackowizer. + +2000-07-05 Bruno Haible + + * tests/nice: Avoid syntax error in "test" when `nice` generates + no output. + +2000-07-04 Jim Meyering + + * Version 2.0j. + + * tests/date/Test.pm (test_vector): Disable test #2 for all systems, + even though it fails only on SunOS4. + +2000-07-01 Jim Meyering + + * configure.in (jm_DUMMY_1): Wrap a snippet in a macro definition + so we can use AC_REQUIRE. + (jm_BOOT_TIME): Likewise. + +2000-06-17 Bruno Haible + + * configure.in: Add pinky, users, who to OPTIONAL_BIN_PROGS if either + or exists. Add uptime only if either or + exists. + * src/Makefile.am (bin_PROGRAMS): Remove pinky, users, who from here... + (EXTRA_PROGRAMS): ... and add them here. + +2000-06-26 Jim Meyering + + `id -Gn' (invoked by groups) would fail without giving a diagnostic + on malconfigured systems. + * src/id.c (print_user): Give a diagnostic if number->name lookup fails. + (print_group): Likewise. + +2000-06-25 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Danish (da). + +2000-06-21 Jim Meyering + + * tests/stty/basic-1: New test for that. + * src/stty.c (valid_options): Don't segfault on `stty erase -'. + Patch from Harry Liu. + +2000-06-15 Jim Meyering + + * tests/date/Test.pm: Add tests for getdate.y fix. + +2000-06-14 Jim Meyering + + * src/help-version: Punt on nohup; give it --version. + +2000-06-10 Jim Meyering + + * doc/sh-utils.texi: Typo-fixes and some clean-up from Brian Youmans. + +2000-05-29 Jim Meyering + + * tests/nice: Remove now-unused reference to srcdir. + + * src/help-version: Use `WARNING', not just `Warning' in the + broken-/bin/sh diagnostic, to be consistent with other such warnings. + +2000-05-21 Jim Meyering + + * tests/nice: Disable test on djgpp. + +2000-05-15 Jim Meyering + + * tests/date/Test.pm (test_vector): Skip the %c test on SunOS4 systems. + Suggested by Paul Eggert. Reported by Volker Borchert. + +2000-05-13 Jim Meyering + + * src/groups.sh: Detect and report write failure of --help/--version. + * src/nohup.sh: Likewise. + +2000-05-11 Jim Meyering + + * src/date.c (usage): Don't call close_stdout_status directly, + since that didn't cover --version output. + (main): Instead, call close_stdout_set_status and arrange to + call close_stdout via atexit. + * src/printenv.c: Likewise. + * src/tty.c: Likewise. + + * src/true.c (usage): Don't call close_stdout directly, since that + didn't cover --version output. + (main): Arrange to call close_stdout via atexit, instead. + * src/yes.c: Likewise. + * src/sleep.c: Likewise. + +2000-05-09 Jim Meyering + + * src/sys2.h (case_GETOPT_VERSION_CHAR): Don't call close_stdout. + * src/help-version: New test. + * src/Makefile.am (TESTS): Define. + (TESTS_ENVIRONMENT): Likewise. + (EXTRA_DIST): Add help-version. + +2000-05-08 Jim Meyering + + * Version 2.0i. + +2000-05-07 Jim Meyering + + * Version 2.0h. + + * src/basename.c: Include "closeout.h". + (main): Call atexit with close_stdout. + * src/chroot.c: Likewise. + * src/dirname.c: Likewise. + * src/echo.c: Likewise. + * src/env.c: Likewise. + * src/expr.c: Likewise. + * src/factor.c: Likewise. + * src/hostid.c: Likewise. + * src/hostname.c: Likewise. + * src/id.c: Likewise. + * src/logname.c: Likewise. + * src/nice.c: Likewise. + * src/pathchk.c: Likewise. + * src/pinky.c: Likewise. + * src/printf.c: Likewise. + * src/pwd.c: Likewise. + * src/seq.c: Likewise. + * src/stty.c: Likewise. + * src/su.c: Likewise. + * src/test.c: Likewise. + * src/uname.c: Likewise. + * src/uptime.c: Likewise. + * src/users.c: Likewise. + * src/who.c: Likewise. + * src/whoami.c: Likewise. + * src/tee.c: Likewise. Remove explicit close_stdout. + + * src/yes.c Include "closeout.h". + (usage): Call close_stdout just before exit. + * src/sleep.c: Likewise. + * src/true.c: Likewise. + * src/date.c (usage): Call close_stdout_status. + * src/printenv.c (usage): Likewise. + + * tests/date/Test.pm ($Test::env{'rfc822-1'}): Add TZ=UTC0. + +2000-05-06 Jim Meyering + + * src/Makefile.am (sleep_LDADD): Add @LIB_CLOCK_GETTIME@ and + @LIB_NANOSLEEP@. + + * src/tty.c (main): Warn about arguments, don't fail. + (usage): Call close_stdout_status from here as well as from main. + +2000-05-05 Jim Meyering + + Exit nonzero upon write failure. + * src/printf.c: Include "closeout.h". + (main): Call close_stdout. + Reported by Ian Jackson via Michael Stone. + +2000-05-04 Jim Meyering + + * Makefile.maint (my-distcheck): Remove spurious blank line. + Remove $(DEPDIR) *after* making distclean, not before. + +2000-04-30 Jim Meyering + + * src/yes.c: Detect and terminate upon write failure. + +2000-04-14 Jim Meyering + + * src/seq.c: Shorten `#ifdef HAVE_...' to `#if HAVE_...' and + remove unnecessary uses of `defined' (aesthetics). + +2000-04-12 Jim Meyering + + Move some code into m4/. + * configure.in (_GNU_SOURCE): Don't define here. + (AC_SYS_LARGEFILE): Don't use here. + (AM_C_PROTOTYPES): Don't use here. + (AC_DEFINE): Use 3-arg form. + * acconfig.h: Remove now-unused file. + +2000-04-09 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Estonian (et). + +2000-04-01 Jochen Hein + + * src/date.c: Use the "C" locale when using --rfc-822 (-R), as + required by rfc822. Before, in the de_DE locale, date would + print the German weekday and month abbreviations. + + * tests/date/Test.pm: Add test for rfc822 format and foreign + locale settings. + +2000-04-04 Jim Meyering + + * man/Makefile.am (man_MANS): Add uptime.1. + * man/uptime.x: New file. + + * man/Makefile.am (man_MANS): Add factor.1. + * man/factor.x: New file. + + * tests/seq/basic: Split a long line and tweak for font-lock mode. + * tests/factor/basic: Likewise. + * tests/basename/basic: Likewise. + +2000-03-29 Paul Eggert + + * src/date.c: Include if it exists. + (DATE_FMT_LANGINFO): New macro. + (show_date): Use it to get the locale-specific default format for + "date" if it exists. + +2000-03-19 Jim Meyering + + * Version 2.0g. + + * doc/sh-utils.texi (chroot invocation): Include a couple tips and + a simple example. + + * doc/getdate.texi (Calendar date item): Fix typos. + From Per Cederqvist. + +2000-03-18 Jim Meyering + + * src/uptime.c (print_uptime): Use `buf' only if fgets succeeds. + +2000-03-12 Jim Meyering + + Merge from textutils. + * src/system.h (O_BINARY, O_TEXT): Define if necessary. + (SET_BINARY, SET_BINARY2): Define. + (DEV_BSIZE): Define to BBSIZE if appropriate. + +2000-03-11 Jim Meyering + + * tests/date/Test.pm: Set the default TZ value to UTC0, not UTC. + The latter didn't have any effect on alphaev56-dec-osf4.0f. + + Final merge with fileutils. + * src/system.h: Use standard `#if TIME_WITH_SYS_TIME...' block + rather than `#if TM_IN_SYS_TIME' one. + +2000-02-02 Bruno Haible + + * printf.c: Include "unicodeio.h". + (usage): Mention \u and \U directives. \x outputs a byte, not a + character. + (print_esc): Implement \u and \U. + * Makefile.am (printf_LDADD): Add @LIBICONV@. + +2000-03-03 Jim Meyering + + Make it so stty's rprnt attribute works on HPUX 10.20. + * src/stty.c [CREPRINT && !CRPRNT] (CRPRNT): Define. + (control_info): Recognize HPUX's CREPRINT. + +2000-03-02 Jim Meyering + + * doc/sh-utils.texi (printf invocation): Describe new unicode syntax. + From Bruno Haible. + + Unify with fileutils/src/system.h. + * src/system.h (ST_NBLOCKS): Sync with recent changes in fileutils. + [!_POSIX_VERSION]: Remove declarations of getlogin, ttyname, geteuid. + * src/sys2.h: Declare them here, if needed. + +2000-03-01 Jim Meyering + + * Makefile.am (EXTRA_DIST): Include GNUmakefile. + + * src/seq.c (get_width_format): Fix portability problem with + `-0' vs. `0'. + +2000-02-22 Jim Meyering + + * tests/date/Test.pm (datevtime-1): New test. + From John Kendall. + +2000-02-15 Jim Meyering + + * man/Makefile.maint ($(man_MANS)): Remove $@-t1. + +2000-02-13 Jim Meyering + + * tests/Fetish.pm (run_tests): Discard stderr. + Reverse diff args, so `expected' is last, as in mk-script. + +2000-02-12 Jim Meyering + + * tests/mk-script: Invoke `diff' when differences are found. + * tests/Fetish.pm (run_tests): Likewise. + +2000-02-09 Jim Meyering + + * src/su.c (correct_password): Correct HAVE_STRUCT_* name in #if guard + to go along with corrected autoconf test: Reported by Gaël Quéri. + +2000-02-05 Jim Meyering + + * Version 2.0f. + + * src/who.c: Use UT_USER in place of hard-coded `->ut_name' here, too. + * src/pinky.c: Likewise. + Reported by Tom Tromey and Andreas Schwab. + * src/uptime.c (print_uptime): Likewise. + * src/users.c (list_entries_users): Likewise. + +2000-01-30 Jim Meyering + + * Version 2.0e. + + * src/su.c (correct_password): Guard with `HAVE_GETSPNAM && + HAVE_STRUCT_PASSWD_SP_PWDP', rather than just `#ifdef HAVE_SHADOW_H'. + + * po/POTFILES.in: Add lib/makepath.c, lib/obstack.c, lib/rpmatch.c, + and lib/same.c. + +2000-01-29 Jim Meyering + + * configure.in: Move library-related tests into m4/lib-check.m4. + Remove lib-check for cposix now that we use m4/isc-posix.m4. + + * src/seq.c: Back out most of the 2000-01-21 and 01-22 changes. + [Instead, merely give examples showing how to accomplish the same + task with fewer limitations using existing tools. ] + Suggestion from Bruno Haible. + (valid_format): Rename from check_format. + * tests/seq/basic: Remove associated tests and add two equal-width ones. + + * tests/stty/row-col-1: Set COLUMNS envvar, just to be safe. + +2000-01-28 Jim Meyering + + * src/stty.c (wrapf): Emit a newline only if 0 < current_col. + (screen_columns): Use xstrtol, not atoi. + If get_win_size fails and $COLUMNS == 0, then return 80, not `0'. + +2000-01-23 Jim Meyering + + * configure.in (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN): + AC_SUBST these not here, but rather in m4/, so that the now-shared + lib/Makefile.am are all the same. + (AC_CHECK_FUNCS): Remove check for utmpname, since it's already + in m4/prereq.m4. + Remove many function checks (moved to m4/.) + + * configure.in (AM_FUNC_STRTOD): Move to m4/. + (AC_SUBST(POW_LIBM)): Likewise. + + * configure.in (SEQ_LIBM): Remove AC_SUBST of a constant. + * src/Makefile.am (seq_LDADD): Add -lm rather than constant $(SEQ_LIBM). + +2000-01-22 Jim Meyering + + * src/sys2.h [! HAVE_DECL_STRTOUL]: Declare strtoul. + [! HAVE_DECL_STRTOULL]: Declare strtoull. + Required for some AIX systems. Reported by Christian Krackowizer. + + * configure.in (ALL_LINGUAS): Add Slovenian (sl). + (AC_CHECK_HEADERS): Move these checks into m4/. + + * src/seq.c (enum Format_type): Declare. + (format_type): New global to take place of intconv. + (format_str): Move global declaration... + (main): ... to here. + (check_format): Rename parameter to avoid shadowing global. + (DO_printf): New macro. + (main): Use it. + Topologically sort the functions and remove fwd declarations. + +2000-01-21 Bruno Haible + + Add support for octal and hexadecimal output. + * seq.c (intconv): New variable. + (usage): Update. + (main): Call scan_arg instead of scan_double_arg. Call check_format + before scan_arg. + (scan_int_arg, scan_arg): New functions. + (check_format): Add intconv argument. Accept %d, %u, %o, %x, %X. + (print_numbers): If intconv is true, pass an int argument to printf. + +2000-01-21 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Galician (gl). + +2000-01-16 Jim Meyering + + * lib/Makefile.am: Sync with fileutils/lib/Makefile.am. + + * src/date.c (usage): Correct error in %V description. + From Wolfram Kleff. + + * configure.in: Remove jm_FUNC_GROUP_MEMBER, jm_FUNC_PUTENV, + AM_FUNC_GETLOADAVG, jm_SYS_PROC_UPTIME, AM_SYS_POSIX_TERMIOS, + jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL. + +2000-01-15 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Remove gethostname, getusershell, + memcpy, and memset. Now that's done in m4/. + Remove these, too: stime strcspn stpcpy strstr strtol strtoul. + +2000-01-12 Jim Meyering + + * configure.in: Remove the tests that are now in jm_PREREQ_CANON_HOST. + +2000-01-11 Jim Meyering + + Sync lib/ directories of sh-utils, and textutils. + + * lib/Makefile.am (libfetish_a_SOURCES): Add diacrit.c, hard-locale.c, + linebuffer.c, md5.c, memcasecmp.c, memcoll.c, obstack.c, safe-read.c + (noinst_HEADERS): Add bumpalloc.h, diacrit.h, hard-locale.h, + linebuffer.h, md5.h, memcasecmp.h, memcoll.h, obstack.h, safe-read.h. + + * lib/Makefile.am: s/su/fetish/ + * src/Makefile.am: s/libsu/libfetish/ + +2000-01-10 Jim Meyering + + * Version 2.0d. + + * src/Makefile.am (sleep_LDADD): Add @POW_LIBM@, for systems that use + lib/strtod.c and need -lm to resolve its pow reference. + +2000-01-07 Jim Meyering + + * Version 2.0c. + + * tests/basename/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix + to exported PATH value (though not strictly necessary, here). + * tests/factor/Makefile.am (TESTS_ENVIRONMENT): Likewise. + * tests/seq/Makefile.am (TESTS_ENVIRONMENT): Likewise. + * tests/stty/Makefile.am (TESTS_ENVIRONMENT): Likewise. + +2000-01-06 Paul Eggert + + * tar/lib/getdate.y: Sync tm_diff with the GNU C Library. + (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed. + (tm_diff): Renamed from difftm. All uses changed. + Replace body with that taken from GNU C Library 2.1.3pre1. + (get_date): Prefer tm_gmtoff to tm_diff if available. + +2000-01-05 Paul Eggert + + Minor code cleanup. + * src/sleep.c (clock_get_realtime): Return argument, for convenience. + (main): Use this to simplify main sleep loop. + +2000-01-05 Jim Meyering + + Some systems lack a definition of struct timespec (AIX, Ultrix) + Reported by Christian Krackowizer. + * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h. + * lib/nanosleep.h: New file. + * lib/nanosleep.c: Include it. + Don't include time.h or sys/time.h here. + * src/sleep.c: Include it. + (AUTHORS): Add Paul Eggert. + +2000-01-04 Jim Meyering + + * lib/nanosleep.c: Include both time.h and sys/time.h only + #if TIME_WITH_SYS_TIME. + +2000-01-03 Paul Eggert + + Fix some porting and rounding problems with the new `sleep' code. + + * configure.in (AC_CHECK_HEADERS): Add fenv.h. + (FESETROUND_LIBM): New macro. + + * lib/xstrtod.c: Add #pragma STDC FENV_ACCESS ON if C99. + * src/sleep.c: Likewise. + + * src/Makefile.am (sleep_LDADD, sleep_DEPENDENCIES): New macros. + + * src/sleep.c (): Include if available. + (main): Always round floating-point interval calculations upwards, + as we must sleep for at least the specified time. + Do the right thing with NaNs. + + (main): Sleep forever if the time calculations overflow. + (apply_suffix): Don't assert that *s <= TIME_T_MAX. + + (clock_get_realtime): Fix typo; address was improperly taken. + +2000-01-02 Jim Meyering + + * Version 2.0b. + + * lib/Makefile.in: Regenerate. + + * Version 2.0a. + +1999-12-26 Jim Meyering + + * lib/nanosleep.c (nanosleep): New file. + +1999-12-23 Jim Meyering + + * src/sleep.c (USE_CLOCK_GETTIME): Define. + [USE_CLOCK_GETTIME]: Include sys/time.h. + (timespec_subtract): New function. + (clock_get_realtime): New function. + (sighandler): Remove function. + (main): Reimplement again, using nanosleep and clock_gettime. + + * configure.in: Remove check for gettimeofday. + Now it's in m4/jm-macros.m4 + + * man/Makefile.summ: Remove now-unused summaries. + +1999-12-22 Jim Meyering + + * lib/getdate.y (get_date): Fix typo in time_t overflow test. + From Michael Stone. + + * tests/date/Test.pm (regress-1): New test for the above. + +1999-12-18 Jim Meyering + + * src/who.c (print_entry): Correct do_lookup test so that who + prints whatever host information it has, even without --lookup. + Reported by Bill Peters. + +1999-12-12 Jim Meyering + + Move 120+ lines of stat.h-related macros from system.h (not shared) + to sys2.h, which is shared between fileutils, sh-utils, textutils. + * src/system.h: Move them from here... + * src/sys2.h: ... to here. + +1999-11-27 Jim Meyering + + Rewrite to allow fractional seconds and to handle SIGCONT. + * src/sleep.c (main): Rewrite. + (sighandler): New function. + (apply_suffix): New function. + (timeval_subtract): New function. + Reported by Raul Miller. + + * src/sleep.c (argdecode): Move definition to precede use. + Remove prototype. + (usage): Add elipses to show that sleep allows more than one argument. + +1999-11-22 Jim Meyering + + * lib/Makefile.am (DISTCLEANFILES): Add lstat.c and stat.c. + +1999-11-09 Jim Meyering + + * src/expr.c (NEW): Undefine to avoid warning about redefinition. + (NEW): Redefine in terms of XMALLOC. + + * lib/xalloc.h (XMALLOC): Correct misnamed macro parameter name: + s/N_bytes/N_items/. + (XCALLOC): Likewise. + (XREALLOC): Likewise. + +1999-11-05 Jim Meyering + + * src/system.h: Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated + HAVE_ST_BLOCKS. + + * configure.in: Move some type/header/member tests into + m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of + fileutils, textutils, and sh-utils. + +1999-11-01 Jim Meyering + + * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES). + +1999-10-07 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Japanese (ja). + +1999-10-04 Jim Meyering + + * depcomp: New file, for automake's new dependency support. + * missing: New version, from automake's user-dep-gen-branch. + +1999-09-28 Jim Meyering + + * src/system.h: Update from the system.h from fileutils. + Now they're finally almost identical... + +1999-09-09 Jim Meyering + + * src/Makefile.am (EXTRAdir): Remove unused variable. + (installed_su): Use `$(DESTDIR)$(bindir)' in place of $(bindir). + (install-exec-local): Likewise. + (.sh): Substitute `$(bindir)' rather than @bindir@. + Based on a patch from Andreas Schwab. + +1999-09-08 Andreas Schwab + + * tests/nice: Instead of failing, exit with 77 if running niced. + +1999-09-08 Jim Meyering + + * src/su.c: Remove declaration of xstrdup. + +1999-09-02 Jim Meyering + + * src/expr.c: Remove xstrdup declaration. + * src/date.c: Likewise. + * src/pathchk.c: Likewise. + * src/su.c: Likewise. + +1999-08-29 Jim Meyering + + * tests/nice: Use `nice' instead of $nice. + * tests/Makefile.am (TESTS_ENVIRONMENT): Prepend ../src to PATH so + the above works. + + * src/env.c (main): Call exit explicitly to avoid warning from gcc. + * src/nice.c (main): Likewise. + Include "xstrtol.h". + (isinteger): Remove function and prototype. + (main): Use xstrtol in place of atoi. Remove associated FIXME comments. + + * configure.in (AC_YACC): Remove use, now that we require bison. + + * tests/date/Test.pm (test_vector): Add a test for the Risks-reported + problem with syntax like this: Nov 11 1996. + + * lib/getdate.y (get_date): Rename outermost local `probe' to `quarter'. + (get_date): Rename latter local `tm' to probe_tm. + + * lib/getdate.y (relative_time_table): Change `type' of `THIS' from + tMINUTE_UNIT to tUNUMBER. From Urs Thuermann. + * tests/date/Test.pm (test_vector): Add tests for use of `this'. + +1999-08-25 Jim Meyering + + * man/Makefile.summ (seq-summary): Define. + * man/Makefile.am (man_MANS): Add seq.1. + Reported by Dirk-Jan Faber. + +1999-08-23 Jim Meyering + + * src/pathchk.c (longopts): Restore accidentally-removed entry for + `--portability' long option. + * src/chroot.c (usage): Correct --help message. + * src/hostid.c (usage): Likewise. + * src/hostname.c (usage): Likewise. + * src/logname.c (usage): Likewise. + * src/nice.c (usage): Likewise. + * src/printenv.c (usage): Likewise. + * src/sleep.c (usage): Likewise. + * src/stty.c (usage): Likewise. + Reported by Daniel Bergstrom. + +1999-08-22 Jim Meyering + + * src/sys2.h (ATTRIBUTE_NORETURN): Define. + * src/test.c: Use ATTRIBUTE_NORETURN instead of NO_RETURN_ATTRIBUTE. + (NO_RETURN_ATTRIBUTE): Remove definition. + + * src/su.c (run_shell): Declare with gcc's noreturn attribute. + Use an explicit exit(1) rather than doing that through error. + + * src/sys2.h (IF_LINT): Define new macro. + * src/date.c (batch_convert): Use IF_LINT macro instead of #ifdef lint. + * src/pathchk.c (validate_path): Likewise. + +1999-08-21 Jim Meyering + + * src/hostid.c (usage): Remove the ` [-v]' from the Usage: line. + Reported by Daniel Bergstrom. + +1999-08-17 Jim Meyering + + * tests/stty/input-tty: New file, containing code factored out of + the two test scripts. Mention `at' and `batch' in addition to `rsh'. + * tests/stty/basic-1: Source it. + * tests/stty/row-col-1: Source it. + * tests/stty/Makefile.am (EXTRA_DIST): Add input-tty. + +1999-08-14 Jim Meyering + + * Version 2.0. + + * tests/stty/basic-1: Fail-77 if stdin is not a tty. + * tests/stty/row-col-1: Likewise. + Suggestion from Volker Borchert. + +1999-08-07 Jim Meyering + + * Version 1.16m. + + * Makefile.maint (po-check): New rule. + (alpha): Make it. + + * po/POTFILES.in: Add the following from lib/: argmatch.c, closeout.c, + error.c, getopt.c, human.c, long-options.c, version-etc.c, xmalloc.c. + Add these from src/: false.c, hostid.c, true.c. + + * lib/getdate.y (OtherTable[]): Use tDAY_UNIT for `tomorrow,' + `yesterday,' `today,' and `now' rather than tMINUTE_UNIT. Of course + with correspondingly smaller numbers for tomorrow and yesterday. + This change does not change the way the code works, since the + grammar rules for the two symbols are analogous. + From Tadayoshi Funaba. + +1999-08-04 Jim Meyering + + false and true once again generate --help and --version output + * src/true.c: Honor --help and --version once again, bug ignore + those options when POSIXLY_CORRECT is set. + * src/false.c: Fail even for --help and --version. + * src/Makefile.am (false.c): Generate automatically from true.c. + (BUILT_SOURCES): Add false.c. + * man/Makefile.am (EXTRA_DIST): Remove false.1in and true.1in. + * man/Makefile.summ: Remove the rules added on 1999-07-31. + * man/Makefile.maint: Likewise. + * man/true.1in: Removed. + * man/false.1in: Removed. + + * configure.in: Remove getline-testing code. Now it's in m4/. + +1999-08-01 Jim Meyering + + * src/date.c (usage): Correct description of %S; (00..60, not 00..61). + From Ken Pizzini. + +1999-08-01 Paul Eggert + + * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS. + +1999-07-31 Jim Meyering + + * Version 1.16l. + + false and true are now C programs rather than shell scripts + * src/true.c: New file. + * src/false.c: New file. + * src/true.sh: Removed. + * src/false.sh: Removed. + * src/Makefile.am (bin_PROGRAMS): Add true and false. + (bin_SCRIPTS): Remove true and false. + (EXTRA_DIST): Remove false.sh and true.sh. + * man/true.1in: New file. + * man/false.1in: New file. + * man/Makefile.am (EXTRA_DIST): Remove extra (shadowed) assignment. + (EXTRA_DIST): Add false.1in and true.1in. + * man/Makefile.maint (helpful-men): Define. + * man/Makefile.summ ($(helpless-men)): New manual-generating rules to + accommodate the fact that false and true no longer accept --help. + * doc/sh-utils.texi: Include a couple of sentences from the + truefalse package. + Prompted by Christi Alice Scarborough's truefalse package. + +1999-07-30 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR). + +1999-07-26 Jim Meyering + + * src/tee.c (tee): Convert from open/fds to using fopen/streams for + output, in preparation for addition of new compression option. + +1999-07-21 Jim Meyering + + * tests/stty/basic-1 (options): Avoid Solaris' broken /usr/ucb/tr by + removing offending use of tr altogether and removing hyphens with sed. + Reported by Kaveh Ghazi. + +1999-06-01 Volker Borchert + + * tests/Makefile.am: Make envvar-check depend on check-recursive rather + than on `check' so that its tests are performed before any real tests. + +1999-07-15 Jim Meyering + + * src/false.sh: Always exit unsuccessfully, even with + --help and --version. Suggested by Felix Lee. + +1999-07-12 Jim Meyering + + * src/sys2.h (mempcpy): Define only if not already defined. + Reported by Collin Rogowski. + +1999-05-27 Volker Borchert + + * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix. + +1999-05-25 Jim Meyering + + * tests/stty/basic-1: Fix non-portable use of `tr' that caused + this test to fail when run with a SysV-style tr. + Based on a patch from Kaveh Ghazi. + +1999-05-21 Jim Meyering + + * Version 1.16k. + * configuration fixes: see m4/ChangeLog. + +1999-05-16 Jim Meyering + + * Version 1.16j. + + * configure.in (AC_SEARCH_LIBS): Set LIB_CRYPT to $ac_cv_search_crypt, + to go along with the new macro in m4/search-libs.m4. + +1999-05-14 Jim Meyering + + * lib/getugroups.c (getugroups): Don't dereference a null pointer when + running `id USER' for some USER that is listed on the RHS in /etc/group. + From Sander van Malssen. + Add some curly braces, use STREQ, reverse the sense of a test + and use `continue' to save a level of nesting. + + * tests/Makefile.am (envvar-check): Renamed from check-local. + (check): Depend on envvar-check so the envvar check is performed + before all other tests. Reported by Volker Borchert. + * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects, + so CDPATH is mentioned in the message. Reported by Volker Borchert. + +1999-05-10 Jim Meyering + + * src/uptime.c (AUTHORS): add Kaveh. + + Expand each `&' character in the gecos field. + * src/pinky.c (count_ampersands): New function. + (create_fullname): New function. + (print_entry): Use create_fullname here. + (print_long_entry): Use it here, too. + From Kaveh Ghazi. + +1999-05-09 Jim Meyering + + * lib/regex.c: Update from libc. + + * Version 1.16i. + + * configure.in: Clean up checks for libraries so that we don't add + -lshadow unless necessary. Reported by Joseph S. Myers. + +1999-05-05 Jim Meyering + + Add definitions to help read utmpx on systems with utmpname. + * lib/readutmp.h (UTMP_NAME_FUNCTION): Define. + (SET_UTMP_ENT): Likewise. + (GET_UTMP_ENT): Likewise. + (END_UTMP_ENT): Likewise. + * lib/readutmp.c (read_utmp): Use the new definitions. + From Kaveh Ghazi. + + * src/date.c (show_date): Change an automatic aggregate initializer + to be a static one. For SunOS4's cc. From Kaveh Ghazi. + +1999-05-03 Jim Meyering + + * configure.in: Remove duplicate use of jm_FUNC_GNU_STRFTIME. + Kaveh Ghazi reported that strftime.o was listed twice in the command + to build libsu.a. + +1999-05-02 Jim Meyering + + * Version 1.16h. + + * src/hostname.c (main): Give a better diagnostic when we fail to + set the hostname. + + * man/Makefile.summ (hostid-summary): Use correct description. + Reported by Joseph S. Myers. + + * lib/readutmp.c (read_utmp): Ignore the return value from utmpname. + +1999-04-30 Jim Meyering + + * src/dirname.c (main): Manually handle `--', since we no longer + call getopt. Reported by Joseph S. Myers. + * src/basename.c (main): Likewise. + * src/factor.c (main): Likewise. + +1999-04-25 Jim Meyering + + * src/seq.c (main): Handle the case in which seq is given no args. + Reported by John Gotts. + (main): Revert last change. + Instead, loop on `optind < argc' to protect use of argv[optind]. + + * lib/human.c : Don't include it here. + * lib/human.h : Include it here instead. + : Include it here too. + Reported by Andreas Jaeger. + + * src/nice.c [NDEBUG]: Remove definition. + Reported by Andreas Jaeger. + +1999-04-24 Jim Meyering + + * src/who.c (print_entry): Use `#if', not `#ifdef HAVE_UT_HOST'. + + * Version 1.16g. + + * configure.in: Use AC_CANONICAL_HOST. + +1999-04-20 Jim Meyering + + Update factor to use `uintmax_t'. + * src/factor.c : Include this, not xstrtoul.h. + : Include. + Use uintmax_t in place of unsigned long. + Use human_readable to convert to strings for printing. + * lib/xstrtoumax.c: New file. + * lib/human.c: New file. + * lib/human.h: New file. + * lib/Makefile.am (libsu_a_SOURCES): Add human.c and xstrtoumax.c. + (noinst_HEADERS): Add human.h. Remove xstrtoul.h. + +1999-04-19 Jim Meyering + + * src/seq.c (main): Restore `+' in getopt_long string. Otherwise, + commands like `seq 10 -2 0' wouldn't work. From Andreas Schwab. + * tests/seq/basic: Add tests for that. + +1999-04-17 Jim Meyering + + * tests/seq: New directory and basic tests. + * tests/Makefile.am (SUBDIRS): Add seq. + * configure.in (AC_OUTPUT): Add tests/seq/Makefile. + +1999-04-17 Andreas Schwab + + * configure.in: Check for localeconv. + + * src/seq.c (decimal_point): New variable. + (main): Set it to locale's decimal point. Fix recognition of + negative number as argument. + (get_width_format): Correctly handle a negative min_val or step + when computing fraction width. Use decimal_point. + +1999-04-08 Jim Meyering + + 1999-03-25 James R. Van Zandt + * doc/sh-utils.texi (Options for date): Document --iso-8601 + * src/date.c: Accept new option: --iso-8601. + * lib/Makefile.am (libsu_a_SOURCES): Add argmatch.c and quotearg.c. + (noinst_HEADERS): Add argmatch.h and quotearg.h. + * lib/argmatch.c: New file. + * lib/argmatch.h: New file. + * lib/quotearg.c: New file. + * lib/quotearg.h: New file. + +1999-03-30 Jim Meyering + + * src/sys2.h: Include "closeout.h" and "version-etc.h" + + * src/*.c (PROGRAM_NAME, AUTHORS): Define and use. + + * src/date.c: No longer include long-options.h. + [long_options]: Add entries for --help and --version. + Remove parse_long_options call. + (main) [getopt switch]: Add a case for each of --help and --version. + * src/env.c: Likewise. + * src/id.c: Likewise. + * src/pinky.c: Likewise. + * src/seq.c: Likewise. + * src/su.c: Likewise. + * src/sys2.h: Likewise. + * src/tee.c: Likewise. + * src/tty.c: Likewise. + * src/uname.c: Likewise. + * src/who.c: Likewise. + +1999-03-29 Jim Meyering + + * configure.in (GNU_PACKAGE): Remove related code -- now it's in + the catch-all for shared autoconf code, m4/jm-macros.m4. + (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use + this instead. + +1999-03-28 Jim Meyering + + * src/test.c (PROGRAM_NAME): Rename from COMMAND_NAME. + +1999-03-28 Paul Eggert + + * lib/getdate.y (get_date): Reuse tm_isdst of first localtime + call; this is an improvement on a bug fix suggested by + martin@dresden.nacamar.de. Do not assume that localtime and + gmtime return non-null. + +1999-03-27 Jim Meyering + + * src/false.sh (usage): Change `[OPTION]...' to `[OPTION]' to show + that only one of --help or --version is recognized at a time. + Reported by Meelis Roos. + * src/true.sh: Likewise. + + * src/id.c (print_user): Use uid_t instead of int. + (print_group): Use gid_t instead of int. + From John Bley. + +1999-03-26 Jim Meyering + + * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c. + (noinst_HEADERS): Add version-etc.h. + +1999-03-20 Jim Meyering + + * src/nohup.sh: Don't modify PATH just to get GNU nice. Instead, + try to find an absolute path for GNU nice. From Bruno Haible. + +1999-03-19 Jim Meyering + + * configure.in: Use new macro, jm_WINSIZE_IN_PTEM, instead of + open-coding it. + +1999-03-17 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Italian (it) and Slovak (sk). + +1999-03-13 Jim Meyering + + * lib/basename.c (base_name): If NAME is all slashes, return `/' (in + conformance with the single unix spec). Reported by Peter Moulder. + +1999-03-10 Jim Meyering + + * src/uptime.c: Declare getloadavg so I can build with -Werror. + + * tests/stty/basic-1: Skip failing tests: parenb, -parenb, -cread. + + * lib/canon-host.c (canon_host): Don't use he->h_addr directly. + Based on a patch from Savochkin Andrey Vladimirovich. + +1999-03-09 Jim Meyering + + Running `id USER' doesn't report any groups if there is no entry + for USER in /etc/group. Always include the one from /etc/passwd. + * src/id.c (xgetgroups): Take new parameter, gid, and pass + it to getugroups. + (print_group_list): Call getpwuid and adjust calls to xgetgroups + to include new parameter. + * lib/getugroups.c (getugroups): Take new parameter, gid. + Add gid to the list of groups. + From Ulrich Drepper. + * lib/getgroups.c (getgroups): Protoize. + +1999-03-08 Jim Meyering + + * tests/basename: New directory and tests. + * tests/Makefile.am (SUBDIRS): Add basename. + * configure.in (AC_OUTPUT): Add tests/basename/Makefile. + +1999-03-06 Jim Meyering + + * src/date.c (batch_convert): Use a `%s' format in error call, + in case the argument string contains a `%'. + + * man/Makefile.am (man_MANS): Add pinky.1. + * man/Makefile.summ (pinky-summary): Define. + + * src/date.c: Include long-options.h. + [long_options]: Remove the "help" and "version" entries. + Remove declarations of show_help and show_version. + (main): Use parse_long_options, including author name(s). + Remove the show_version and show_help blocks. + * src/env.c: Likewise. + * src/id.c: Likewise. + * src/logname.c: Likewise. + * src/pathchk.c: Likewise. + * src/pinky.c: Likewise. + * src/printenv.c: Likewise. + * src/seq.c: Likewise. + * src/sleep.c: Likewise. + * src/su.c: Likewise. + * src/tee.c: Likewise. + * src/tty.c: Likewise. + * src/uname.c: Likewise. + * src/uptime.c: Likewise. + * src/users.c: Likewise. + * src/who.c: Likewise. + * src/whoami.c: Likewise. + +1999-03-04 Jim Meyering + + * src/basename.c (main): Include author name argument in call to + parse_long_options. + * src/chroot.c: Likewise. + * src/dirname.c: Likewise. + * src/echo.c: Likewise. + * src/expr.c: Likewise. + * src/factor.c: Likewise. + * src/hostid.c: Likewise. + * src/hostname.c: Likewise. + * src/nice.c: Likewise. + * src/printf.c: Likewise. + * src/pwd.c: Likewise. + * src/stty.c: Likewise. + * src/test.c: Likewise. + * src/yes.c: Likewise. + +1999-03-02 Jim Meyering + + * lib/readutmp.c (read_utmp) [HAVE_UTMPNAME]: Rewrite. + +1999-02-15 Jim Meyering + + * src/stty.c (main): #ifdef-out unreachable code. + + * src/pinky.c (usage): Add a one-line description. + Suggestion from Karl Berry. + +1999-02-08 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Czech (cs). + +1999-02-07 Jim Meyering + + * tests/stty/basic-1: Run all tests even if some fail. + Don't use trap. + + * tests/stty/basic-1: Use `stty', not $STTY. + Fix typo in VERBOSE code: s/\$RM/stty/. + * tests/stty/row-col-1: Likewise. + + * tests/stty/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not STTY. + + Include stdio.h before defining `_unlocked' macros. + * src/pinky.c: Include stdio.h. + * src/uptime.c: Likewise. + * src/users.c: Likewise. + * src/who.c: Likewise. + * lib/readutmp.c: Include stdio.h here... + * lib/readutmp.h: ...not here. + From Ulrich Drepper. + + * Version 1.16f. + + * Makefile.maint (my-distcheck): Don't depend on dist, now that this + is hooked up to the distcheck rule. + * Makefile.am (distcheck-hook): New target and rule -- link to shared + rule, my-distcheck, in Makefile.maint. + + * configure.in (jm_FUNC_GETGROUPS): Move the test into a new file, + group-member.m4, and just use this new macro. + +1999-01-31 Jim Meyering + + * doc/sh-utils.texi: Wrap the @top node in @ifnottex instead of + @ifinfo so `makeinfo --html ...' works. From Karl Berry. + + * src/chroot.c (main): Call chdir ("/") after chroot. + Suggestion from James Youngman. + + * src/uptime.c (print_uptime): Use the C numeric locale for sscanf + of /proc/uptime data, then restore. + * lib/getloadavg.c: Include locale.h. + [!HAVE_SETLOCALE]: Define-away setlocale. + (getloadavg): Ensure the sscanf of /proc/getloadavg data uses the + `C' numeric locale. Restore afterwards. + Based on a suggestion from Thomas Quinot. + + * lib/strtod.c: Protoize. + +1999-01-30 Jim Meyering + + * acconfig.h: Remove lots of now-unnecessary #undefs. + + * configure.in: Require autoconf 2.13. + + * doc/Makefile.am (DISTCLEANFILES): Arrange to remove sh-utils.fl. + + * configure.in (ALL_LINGUAS): Add Greek (el). + * po/el.po: New file. + +1999-01-25 Jim Meyering + + * src/date.c (usage): Remove static attribute. + Move function be the first in the file. + * src/env.c: Likewise. + * src/id.c: Likewise. + * src/nice.c: Likewise. + * src/pathchk.c: Likewise. + * src/tty.c: Likewise. + * src/uname.c: Likewise. + + * src/*.c (usage): Remove static attribute. + +1999-01-14 Jim Meyering + + * src/date.c: Include closeout.h. + (main): Use close_stdout_status. + * src/printenv.c: Likewise. + * src/tty.c: Likewise. + + * src/hostid.c: Include closeout.h. + (main): Use close_stdout. + * src/tee.c: Likewise. + +1999-01-10 Jim Meyering + + * src/Makefile.am (pinky_LDADD, pinky_DEPENDENCIES, who_LDADD, + who_DEPENDENCIES): Remove definitions. + + * lib/Makefile.am (BUILT_SOURCES): Add lstat.c and stat.c. + (lstat.c, stat.c): New rules. + + * lib/canon-host.c (main) [TEST_CANON_HOST]: Add a simple test driver. + + * configure.in: Require autoconf-2.13. + Use new AC_SEARCH_LIBS to see if we need nsl or inet libraries + to resolve gethostbyname. + +1998-12-22 Jim Meyering + + * configure.in (ALL_LINGUAS): Add chinese (zh). + +1998-12-13 Jim Meyering + + * lib/putenv.c: Don't include stdlib.h and declare malloc and free. + This works around Solaris 5.7's conflicting prototype. + Reported by Karl Berry. + + * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in. + (stat.c): Likewise. + (EXTRA_DIST): Add xstat.in. + * lib/stat.c: Remove file. + * lib/lstat.c: Remove file. + * lib/xstat.in (xstat@): New file. + +1998-12-10 Andreas Schwab + + * src/date.c (main): Arrange to exit unsuccessfully when stime fails. + +1998-12-07 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Russian (ru). + +1998-10-31 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Add Fetish.pm. + * tests/Fetish.pm: New file. + + * tests/factor/Makefile.am: Rewrite to use new testing framework. + * tests/factor/Test.pm: Remove file. + * tests/factor/factor-tests: Remove file. + * tests/factor/basic: New file (rewrite of Test.pm). + + * acconfig.h (stat): New #undef. + +1998-10-03 Jim Meyering + + * man/Makefile.am: Switch to using help2man. + (EXTRA_DIST): Add Makefile.summ. + + * man/help2man: Invoke program with --manhelp option only if + --name=STRING not specified. Otherwise, this would fail with `yes'. + * man/Makefile.summ: New file. + * man/Makefile.maint: Include it. + * man/help2man: New file. + * man/GNUmakefile: New file. + * man/Makefile.maint: New file. + * man/*.x: New files. + * man/*.1: Remove files. + + * src/Makefile.am (install-exec-local): Change comments to use `##' + to avoid automake warning. + + * lib/Makefile.am (noinst_HEADERS): s/posixtm.c/posixtm.h/ + (libsu_a_SOURCES): s/posixtm.y/posixtm.y/ + (libsu_a_SOURCES): Remove getdate.c. Add fnmatch.h. + + * src/date.c (main): Update to use new version of posixtime. + * lib/posixtm.c: New file. + * lib/posixtm.h: New file. + * lib/posixtm.y: Remove file. + + * lib/fnmatch.c: New file. (unused) + * lib/fnmatch.h: New file. (unused) + +1998-09-27 Jim Meyering + + * src/seq.c (main): Decrement optind when we find an `option' that + looks like -N. Reported by Clark Morgan. + +1998-09-26 Jim Meyering + + * lib/xstrtol.c (__xstrtol) [STRING_TO_UNSIGNED]: Return + LONGINT_INVALID for strings that begin with `-'. + + * tests/factor/Test.pm: Add a test for negative argument. + Tweak postprocessing framework. + +1998-09-19 Jim Meyering + + * src/stty.c (main): Revamp option processing, again. + stty couldn't parse some of its options. + * tests/stty/basic-1: New test. + * tests/stty/Makefile.am (TESTS): Add basic-1. + +1998-08-29 Jim Meyering + + * src/su.c (longopts): Use corresponding short-option character + in place of `1', and `NULL' in place of pointer in initialization. + +1998-08-11 Jim Meyering + + * src/uptime.c (usage): Correct description. Reported by John Murphy. + +1998-07-16 Jim Meyering + + * lib/Makefile.am (noinst_HEADERS): Add lchown.h. + * lib/lchown.h: New file, just to define ENOSYS on systems that lack it. + * lib/lchown.c: Include lchown.h. + +1998-07-15 Jim Meyering + + * src/seq.c (check_format): Add `5' to the list of digits. + Reported by Donni Erpel. + +1998-07-12 Jim Meyering + + * tests/test: New directory and tests. + * tests/Makefile.am (SUBDIRS): Add test. + * configure.in (AC_OUTPUT): Add tests/test/Makefile. + +1998-07-04 Jim Meyering + + * lib/Makefile.am (libsu_a_SOURCES): Remove regex.c, now that it's + automatically discovered by automake. + (noinst_HEADERS): Remove unused safe-read.h. + + * src/Makefile.am (CLEANFILES): Put $(SCRIPTS) here rather than in + DISTCLEANFILES. + (CLEANFILES): Add su, since we build it unconditionally, yet it's + never put in @OPTIONAL_BIN_PROGS@. + +1998-06-29 Jim Meyering + + * src/uptime.c: Include system.h only after error.h and readutmp.h + so we don't get redefinition warnings about getc, etc. + * src/who.c: Likewise. + * src/users.c: Likewise. + +1998-06-28 Jim Meyering + + * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers. + +1998-06-06 Jim Meyering + + * src/test.c (unary_operator): Fail if the operand to -t is not valid. + (posixtest): Treat `test -t' the same as `test -t 1'. + +1998-05-26 Jim Meyering + + * src/test.c (two_arguments): Don't test argv[pos][2] if it's + past end of string. + +1998-05-25 Jim Meyering + + * configure.in (_GNU_SOURCE): AC_DEFINE it here. + * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section. + [!_GNU_SOURCE]: Add #undef instead. + +1998-05-16 Jim Meyering + + * lib/readutmp.c (read_utmp): Add variant for systems that have + the utmpname function. + Ansideclify. + * configure.in: Check for utmpname. + + * configure.in (jm_MACROS): New wrapper macro. + Remove uses of most jm_* macros. + + * acconfig.h (chown): Add undef. + (D_INO_IN_DIRENT): Likewise. + (D_TYPE_IN_DIRENT): Likewise. + (ssize_t): Likewise. + + * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS=' + lines from the m4/*.m4 macros, so the hack of including some + custom-replaced C source file names here is no longer needed. + +1998-05-03 Jim Meyering + + * po/: Update from gettext-0.10.35. + * intl/: Likewise. + * configure.in: Remove use of AC_LINK_FILES. + (AC_OUTPUT): Remove po/Makefile-generating sed command. + +1998-05-02 Jim Meyering + + * src/seq.c (check_format): Use ISDIGIT, not isdigit. + +1998-04-26 Jim Meyering + + * configure.in: Use jm_ASSERT. + * acconfig.h: Add NDEBUG. + +1998-04-13 Jim Meyering + + * lib/Makefile.am (noinst_HEADERS): Add safe-read.h. + +1998-04-09 Jim Meyering + + * configure.in (AM_MAINTAINER_MODE): Remove it. + No longer use AC_PATH_PROG to check for perl. + (jm_PERL): Use this instead. + +1998-04-04 Jim Meyering + + * lib/readutmp.h (PARAMS): Define. + + * tests/Makefile.am (SUBDIRS): Add stty. + * tests/stty/row-col-1: New file. + * tests/stty: New directory. + * configure.in (AC_OUTPUT): Add tests/stty/Makefile. + + * src/stty.c: Use STREQ in place of strcmp everywhere. + (valid_options): Indent. + Parenthesize assignment in while expr. + (main): s/case 'f':/case 'F':/ + Tweak error messages to make them consistent. + Remove #if-0'd block. + Move dcl of `fdflags' into scope where it's used. + Remove dcl of unused `cp'. + Use "%s", not device_name, as the format string, in case the + latter contains `%'. + + [1998-03-31 Theodore Ts'o ] + * src/stty.c (valid_options): New function. + (main): Fix broken options parsing that worked only + by serendipity (getopt_long_only already parsed short options; no + need to parse them again manually!). Add support for the --file + option, which allows the user to specify the device whose line + settings are to be set. This is necessary because POSIX ttys will + block waiting for carrier detect to go high if CLOCAL is not set, + unless the device is opened with the O_NONBLOCK flag. + Unfortunately, the shell doesn't use this flag, so users lose. + Opening the device in stty is the easist way to fix this. + (speeds): Add support for 230400 and 460800 line speeds, which are + supported by Linux. + + * acconfig.h (uintmax_t): Add #undef. + + * configure.in (jm_AC_HEADER_INTTYPES_H): Use it. + (jm_AC_TYPE_UINTMAX_T): Use it. + (jm_PREREQ): Use it. + + * src/system.h: Sync with system.c from fileutils. + + * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal + know about the m4/ subdirectory. + * Makefile.maint (aclocal-files): Remove now-unnecessary (with + automake-1.2h and the above change) aclocal-related rules and includes. + +1998-04-03 Jim Meyering + + * lib/closeout.c: New file. + * lib/closeout.h: New file. + * lib/Makefile.am (libsu_a_SOURCES): Add closeout.c. + (noinst_HEADERS): Add closeout.h. + +1998-03-27 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h. + +1998-03-26 Jim Meyering + + * src/date.c (batch_convert): Remove spurious space in error message. + Reported by Karl Berry. + +1998-03-13 Jim Meyering + + * lib/getugroups.c (getugroups): Don't add a group number if it + would be a duplicate. From Ulrich Drepper. + +1998-02-22 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Add mk-script. + * tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl. + (mk_script): Set to ../mk-script. + (x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script. + Remove @MAINT@ cruft. + (Makefile.am): Likewise. + Remove @MAINT@ cruft. Now `missing' will explain the failure + when people don't have Perl yet modify a file whose rebuilding + would lead to the use of Perl. + + * src/Makefile.am (pinky_LDADD): Explicitly add @GETHOSTBYNAME_LIB@. + (who_LDADD): Likewise. + (pinky_DEPENDENCIES): Set to $(LDADD) + (who_DEPENDENCIES): Likewise. + +1998-02-20 Jim Meyering + + * lib/getdate.h: Removed. Could cause confusion with an + automake-generated `.y.h' rule. + * lib/get-date.h: Renamed from getdate.h. + * lib/getdate.y: s/getdate.h/get-date.h/ + * lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/ + * src/date.c: s/getdate.h/get-date.h/ + +1998-02-16 Jim Meyering + + * configure.in (jm_FUNC_LSTAT): Use it. + (jm_FUNC_STAT): Use it. + * acconfig.h: Add lstat. + * lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c. + +1998-02-06 Jim Meyering + + * tests/nice: Fail immediately if this test is run with `nice' + level different from zero. Reported by Philippe De Muyter. + +1998-02-03 Philippe De Muyter + + * src/id.c (xgetgroups): Guard function defn with #if HAVE_GETGROUPS. + + * lib/putenv.c (sys/types.h): Include to get size_t on some systems. + (NULL): Define if needed. + +1998-01-31 Jim Meyering + + * configure.in (AC_LFS): Use it. + +1998-01-25 Jim Meyering + + * Makefile.maint: New file. + * Makefile.am: Move rules common to textutils, fileutils, sh-utils + into Makefile.maint. + Include Makefile.maint. + (EXTRA_DIST): Add Makefile.maint. + +1998-01-03 Jim Meyering + + * lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr. + + * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so + those files will be built via the ANSI2KNR-filtering rules if necessary. + +1997-12-25 Jim Meyering + + * configure.in: Remove AC_DEFINE of _GNU_SOURCE. + * acconfig.h (_GNU_SOURCE): Define if not already defined. + Put this code in @TOP@ section. + (_GNU_SOURCE): Remove #undef. + +1997-12-22 Jim Meyering + + * configure.in: AC_DEFINE _GNU_SOURCE. + * acconfig.h: Add _GNU_SOURCE. + +1997-12-21 Jim Meyering + + * src/date.c: s/__P/PARAMS/ + * src/env.c: Likewise. + * src/expr.c: Likewise. + * src/id.c: Likewise. + * src/nice.c: Likewise. + * src/pathchk.c: Likewise. + * src/seq.c: Likewise. + * src/sleep.c: Likewise. + * src/stty.c: Likewise. + * src/tee.c: Likewise. + * src/test.c: Likewise. + * src/tty.c: Likewise. + * src/uname.c: Likewise. + + * src/system.h: Merge in several things from fileutils' version of + this file. + + * src/factor.c: Don't include limits.h. + (UINT_MAX): Don't define. + (INT_MAX): Don't define. + These are all done in system.h now. + * src/hostname.c: Don't include limits.h. + * src/id.c: Don't include limits.h or sys/param.h. + * src/pathchk.c: Don't include limits.h. + * src/su.c: Likewise. + +1997-12-10 Jim Meyering + + * src/su.c (main): Make sure pw->pw_shell is non-NULL before trying + to strdup it. + Patch from Dick Streefland. + +1997-11-17 Paul Eggert + + * lib/mktime.c, lib/strftime.c (_REENTRANT): #define, + as some hosts need this to declare localtime_r properly. + +1997-11-15 Jim Meyering + + * intl/Makefile.in (distclean): Don't remove libintl.h here. + * Makefile.am (DISTCLEANFILES): Remove it here instead. + + * m4/Makefile.am (EXTRA_DIST): Add mktime.m4. + * m4/jm-mktime.m4: Require jm_AM_FUNC_MKTIME, not the one from automake. + + * m4/strftime.m4: Check for %F format. + +1997-11-14 Jim Meyering + + * m4/mktime.m4: Temporarily add a copy of this file from the automake + distribution. + (jm_AM_FUNC_MKTIME): Renamed from AM_FUNC_MKTIME. + (irix_6_4_bug): New function based on code from Ariel Faigon. + (bigtime_test): New function from Paul Eggert to detect SunOS4.1.4's + infinite looping mktime. + Portability tweaks from Paul Eggert. + +1997-11-13 Jim Meyering + + * lib/mktime.c: Update from FSF. + * lib/strftime.c: Update from FSF. + * m4/strftime.m4: Check for POSIX.2's %f format spec. + +1997-11-12 Jim Meyering + + * configure.in (AC_CHECK_FUNCS): Add mempcpy. + * src/system.h [!HAVE_MEMPCPY] (mempcpy): Define. + * src/date.c (batch_convert): Use mempcpy rather than stpcpy. + +1997-11-09 Jim Meyering + + * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Check for localtime_r. + * m4/strftime.m4 (jm_STRFTIME_PREREQS): Check for localtime_r. + (jm_FUNC_GNU_STRFTIME): Use new macro. + (jm_FUNC_STRFTIME): New macro. Likewise. + Reported by Noel Cragg. + +1997-11-02 Jim Meyering + + * acconfig.h: Add malloc and realloc. + +1997-10-25 Jim Meyering + + * lib/xmalloc.c (xalloc_fail): Renamed from fixup_null_alloc. + (xcalloc): #ifdef-out unused function. + (xrealloc): Remove code to work around deficient versions of realloc. + Now we have an autoconf-enabled replacement version. + (xmalloc): Remove code to work around deficient versions of malloc. + Now we have an autoconf-enabled replacement version. + + * configure.in (jm_FUNC_MALLOC): Use it. + (jm_FUNC_REALLOC): Use it. + * lib/Makefile.am (noinst_HEADERS): Add xalloc.h. + (EXTRA_DIST): Add realloc.c. + (EXTRA_DIST): Add malloc.c. + + * lib/malloc.c: New file. + * m4/malloc.m4: New file. + * m4/Makefile.am (EXTRA_DIST): Add malloc.m4. + + * lib/xalloc.h: New file. + * lib/xmalloc.c: Updated from textutils. + + * src/*.c: Remove old-style xmalloc and xrealloc decls. + * src/system.h: Include xalloc.h. + Remove dcls of xmalloc, xcalloc and xrealloc. + +1997-10-23 Jim Meyering + + * Makefile.am (aclocal-files): Also depend on m4/Makefile.am. + + * src/system.h [!HAVE_DECLARATION_FREE]: Declare free. + [!HAVE_DECLARATION_MALLOC]: Declare malloc. + [!HAVE_DECLARATION_REALLOC]: Declare realloc. + [!HAVE_DECLARATION_STPCPY]: Declare stpcpy. + [!HAVE_DECLARATION_STRSTR]: Declare strstr. + [STREQ]: Define. + * src/date.c: Remove stpcpy decl. + * src/expr.c: Remove strstr decl. + * src/test.c [STREQ]: Undef then redefine. + On some systems, strstr and stpcpy are macros, so declaring them + unconditionally gets syntax errors. + Reported by Mark M. Kettenis. + + * configure.in: Use jm_CHECK_DECLS. + * m4/Makefile.am (EXTRA_DIST): Add decl.m4 and check-decl.m4. + +1997-10-22 Jim Meyering + + * m4/decl.m4: New file. + * m4/check-decl.m4: New file. New macro, jm_CHECK_DECLS. + +1997-10-07 Jim Meyering + + * src/*.c: Update bug-reporting address. + * src/*.sh: Update bug-reporting address. + +1997-10-02 Jim Meyering + + * tests/date/Test.pm (test_vector): Remove _%Z from test `9'. + The timezone string was too system dependent. + +1997-09-25 Jim Meyering + + * src/echo.c: Make echo conform to POSIX. By default, don't + interpret backslash escape sequences. + [V9_DEFAULT]: Don't #define. + (usage): Document -e option. + (main): Recognize options iff POSIXLY_CORRECT is not set. + From Bruno Haible. + +1997-09-19 Jim Meyering + + * lib/getusershell.c (IN_CTYPE_DOMAIN): Define. + (ISSPACE): Define. + (readname): Use ISSPACE, not isspace. + * lib/strtod.c (IN_CTYPE_DOMAIN): Define. + (ISSPACE): Define. + (ISDIGIT): Define. + (TOLOWER): Define. + Use upper-case versions of ctype macros. + * lib/strtol.c (IN_CTYPE_DOMAIN): Define. + (ISSPACE): Guard with IN_CTYPE_DOMAIN. + (ISDIGIT): Guard with IN_CTYPE_DOMAIN. + (TOUPPER): Guard with IN_CTYPE_DOMAIN. + From Bruno Haible. + +1997-09-17 Jim Meyering + + * src/yes.c (main): Call parse_long_options only if POSIXLY_CORRECT + is *not* set. Reported by Frank T Lofaro. + + * src/hostid.c: New file. + * src/Makefile.am (EXTRA_PROGRAMS): Add hostid. + * configure.in (OPTIONAL_BIN_PROGS): Check for gethostid, + and if found add hostid to the list. + * man/hostid.1: New file. + * man/Makefile.am (man_MANS): Add hostid.1. + +1997-08-31 Jim Meyering + + * src/who.c (main): New option --lookup (-l). + (print_entry): Only call canon_host if user explicitly asks for it. + (usage): Describe --lookup. + From Galen Hazelwood. + + * configure.in (ALL_LINGUAS): Add Spanish (es). + +1997-08-02 Jim Meyering + + * src/Makefile.am (bin_PROGRAMS): Add pinky. + + * src/pinky.c: New file. From Kaveh Ghazi. + * po/POTFILES.in: Add pinky.c. + +1997-07-19 Andreas Schwab + + * src/date.c (show_date): Don't hang if strftime produces an empty + string. + +1997-07-16 Jim Meyering + + * src/groups.sh: Exit with status from subsidiary `id' command. + Don't print `$name : $groups' if id fails. + Reported by Austin Donnelly. + +1997-07-15 Jim Meyering + + * lib/getloadavg.c: Merge in changes from FSF. + +1997-07-13 Jim Meyering + + * doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi. + Now, automake includes it automatically. + +1997-07-12 Jim Meyering + + * po/Makefile.in.in (DISTFILES): Remove ChangeLog. + * po/POTFILES.in: Add who.c, users.c, uptime.c. + Remove who-users.c. + + * src/who.c: Rename lots of `this' locals. + Make some parameters `const'. + (who): Update read_utmp caller. + (search_entries): Take additional param: utmp_buf. + Update read_utmp caller. + (who_am_i): Update read_utmp caller. + + * src/users.c (users): Update read_utmp caller. + * src/uptime.c (uptime): Update read_utmp caller. + + * lib/readutmp.h (PARAMS): Update prototype. + (utmp_contents): Remove dcl. + + * lib/readutmp.c (read_utmp): Take new params: count and buffer. + Return boolean indicating failure. + Now, caller must give diagnostic upon failure. + +1997-07-12 Kaveh R. Ghazi + + * lib/readutmp.c, lib/readutmp.h: New files implementing shared + functionality from src/who-users.c. + + * lib/Makefile.am (libsu_a_SOURCES): Add readutmp.c. + (noinst_HEADERS): Add readutmp.h. + + * src/who.c, src/users.c, src/uptime.c: Split these so they no + longer derive from the template source file who-users.c. Use + shared functionality from lib/readutmp.c instead. + + * src/Makefile.am: Remove rules to build who.c, users.c and + uptime.c from template source file who-users.c. Handle these + files as stand-alone sources. + + * src/who-users.c: Remove file. It is no longer used. + +1997-07-12 Jim Meyering + + * src/date.c (MAYBE_SET_TZ_UTC0): New macro. + (set_tz): New function. + (batch_convert): If necessary, save the initial value of TZ and + for each date in the file, restore it before each call to get_date, + then set it to UTC0 before each show_date call. + (main): Don't set TZ before calling get_date. + Set TZ after get_date call and before show_date call. + Reported by Matthew Braun. + * tests/date/Test.pm: Add new tests for this bug. + Add tests based on new examples in documentation. + + * stpcpy.c: New file. + * configure.in (AC_REPLACE_FUNCS): Add stpcpy.c + +1997-07-05 Jim Meyering + + * src/Makefile.am (EXTRA_PROGRAMS): Add su here. + (bin_PROGRAMS): Remove su here. + (install-exec-local): Rewrite rule so that su is installed only if + it can be made setuid root. Before it was always installed and then + removed if it could *not* be made setuid root. That had the potential + undesirable side effect of removing (and not replacing) a working + version of su. + (all_local): New target. Dependend on su. Required now that su is + no longer in bin_PROGRAMS. + (uninstall-local): Remove su only if it comes from the GNU sh-utils. + + * src/su.c: Redefine/undef getusershell around inclusion of + (via system.h) so Cray's int-returning prototype doesn't conflict + with our char*-returning one. Reported by Johan Danielsson. + +1997-07-04 Jim Meyering + + * tests/Makefile.am.in (Makefile.am): Clean up and enable rule to + generate tests/*/Makefile.am. + + * configure.in (ALL_LINGUAS): Add Norwegian (no). + + * tests/date/mk-script.pl (validate): Create test files in $(srcdir), + not in build dir. + * tests/Makefile.am.in ($x-tests): Create $x-tests in $(srcdir), + not in build dir. + * Makefile.am (aclocal-files): Look in source directory, not build dir. + From Andreas Schwab. + +1997-07-03 Jim Meyering + + * tests/date/Test.pm (test_vector): Remove bogus TZ=GMT environment + setting. + +Wed Jul 2 11:05:09 1997 Jim Meyering + + * src/printf.c (STRTOX): Convert function header in macro definition + to K&R-style. Otherwise, ansi2knr would fail to convert the function + definitions to K&R for old style compilers. From Kaveh Ghazi. + +Tue Jul 1 06:28:00 1997 Jim Meyering + + * lib/putenv.c [putenv]: Undefine before including system headers. + Otherwise, the declaration of *rpl_putenv* conflicts with the system + prototype on at least Irix5.3. From Marcus Daniels. + +Sun Jun 29 07:18:25 1997 Jim Meyering + + * lib/putenv.c (rpl_putenv): Renamed from putenv. + [putenv]: Remove definition and subsequent #undef hack that avoided + conflicts with system prototypes. That didn't let the definition of + putenv to rpl_putenv from config.h get through. + Suggestion from Marcus Daniels. + + * configure.in (LIB_CRYPT): AC_SUBST new variable. Use it to add + crypt-related library (-lufc or -lcrypt) only for the program that + needs it (su), rather than to all executables. + * src/Makefile.am (su_LDADD): Set to `$(LDADD) @LIB_CRYPT@'. + Suggestion from Ulrich Drepper. + + * tests/date/mk-script.pl: Set and export LANGUAGE, LC_ALL, and LANG + so tests get english strings. From Ulrich Drepper. + +Mon Jun 16 11:06:57 1997 Jim Meyering + + * m4/putenv.m4 (jm_FUNC_PUTENV): New file and macro. + * configure.in (jm_FUNC_PUTENV): Use it. + * acconfig.h (putenv): Add #undef. + * lib/Makefile.am (EXTRA_DIST): Add putenv.c. + (libsu_a_SOURCES): Remove putenv.c. + * m4/Makefile.am (EXTRA_DIST): Add putenv.m4. + +Thu Jun 12 06:48:23 1997 Jim Meyering + + * src/expr.c (eval6): Accept new unary operator, quote. + From Karl Heuer. + +Wed Jun 11 15:13:56 1997 Jim Meyering + + * src/expr.c (docolon): Test (re_buffer.re_nsub > 0) rather than + searching for `\(' to determine whether to return 0 or the empty + string. Before it would improperly return '' if the pattern + contained a substring like this: `\\('. From Karl Heuer. + For example, running expr c : '\\(' should print `0'. + +Sun Jun 1 12:00:10 1997 Jim Meyering + + * lib/getdate.y (OtherTable): Interpret `next' as 1 (not 2) units. + Patch from Richard Sharman . + * tests/date/Test.pm: Add tests using `next'. + +Tue May 27 06:08:06 1997 Jim Meyering + + * lib/basename.c: Don't include backupfile.h. + + * lib/Makefile.am (noinst_HEADERS): Add backupfile.h. + + * src/basename.c: Use base_name, not basename. + * src/su.c: Use base_name, not basename. + + * configure.in: Don't replace basename. Now it's always required. + + * lib/Makefile.am (libsu_a_SOURCES): Add basename.c. + + * lib/getopt.c: Update from glibc via patch-2.2.93. + * lib/getopt1.c: Likewise. + * lib/getopt.h: Likewise. + * lib/basename.c: Likewise. + +Sat May 24 13:26:04 1997 Jim Meyering + + * man/Makefile.am (EXTRA_DIST): Put man_MANS here so they are + distributed. This seems to be necessary for automake-1.1p. + +Thu May 1 00:10:11 1997 Jim Meyering + + * ansi2knr.c echo.c factor.c hostname.c id.c nice.c pathchk.c + spline.c test.c uname.c: Indent cpp-directives. + + * src/system.h (N_): Define. + +Sun Apr 27 18:30:53 1997 Jim Meyering + + * src/printf.c (cfcc_msg): File-scope constant. + (STRTOX): Use new constant as error message format string in macro. + Suggestion from Andreas Schwab. + (STRTOX): Don't fail because of extra character(s) following a + character constant. Give the *warning* only if !POSIXLY_CORRECT. + +Sun Apr 6 14:29:14 1997 Jim Meyering + + * src/printf.c: Reorder functions to obviate forward decls. + Change most char* dcls to const char*. + (STRTOX): New macro to eliminate code duplication. + (xstrtod, xstrtol, xstrtoul): Remove functions. + Use the STRTOX instead. + + * src/printf.c (STRTOX): Interpret arguments like 'a and "a + as POSIX requires. Derived from a patch by Dennis Henriksen. + +Sun Mar 23 15:20:17 1997 Jim Meyering + + * configure.in (ALL_LINGUAS): Add polish (pl). + +Sat Mar 22 00:03:02 1997 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l. + (aclocal.m4): Use aclocal's new -I option. + + * missing: New file -- from the automake-1.1m distribution. + +Thu Mar 20 21:10:44 1997 Jim Meyering + + * m4/ccstdc.m4: Remove file. + * m4/init.m4: Likewise. + * m4/sanity.m: Likewise. + * m4/protos.m: Likewise. + * m4/dmalloc.m4: Likewise. + * m4/error.m4: Likewise. + * m4/header.m4: Likewise. + * m4/install.m4: Likewise. + * m4/lispdir.m4: Likewise. + * m4/maintainer.m4: Likewise. + * m4/obstack.m4: Likewise. + * m4/ptrdiff.m4: Likewise. + * m4/regex.m4: Likewise. + * m4/strtod.m4: Likewise. + * m4/termios.m4: Likewise. + * m4/winsz.m4: Likewise. + +Tue Mar 18 06:46:54 1997 Jim Meyering + + * src/su.c: Indent cpp-directives to reflect nesting. + Change a few #ifdef to #if. + Remove 3 spurious #ifdef that were guarding an #undef each. + + * src/seq.c (check_format): Rename local, FORMAT_STRING, to avoid + shadowing global. + (print_numbers): Likewise. + + * src/who-users.c (idle_string): Rename local, IDLE, to avoid + shadowing global. + + * src/su.c (log_su): Resort to getpwuid if getlogin fails. + If no tty name is found, use `none' in the log message. + Based on a patch from Galen Hazelwood. + +Thu Mar 13 21:27:36 1997 Jim Meyering + + * lib/mktime.c (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0. + +Wed Feb 19 23:06:46 1997 Jim Meyering + + * src/factor.c (factor): Rewrite inner loop to be more efficient. + Patch from Torbjorn Granlund. + +Tue Feb 18 21:18:04 1997 Jim Meyering + + * tests/date/Test.pm: Add tests for %U, %V, and %W and for a bug + fixed on 1996-03-05. + Remove misleading `-' from leap-1 test. + + * tests/Makefile.am (SUBDIRS): Add factor. + * tests/factor: New directory. + * configure.in (AC_OUTPUT): Add tests/factor/Makefile. + +Tue Feb 4 22:03:13 1997 Jim Meyering + + * src/stty.c: Bracket inclusion of termios.h with #if HAVE_TERMIOS_H. + Masami Takikawa reported that NeXTStep 3.0 doesn't have termios.h. + * configure.in (AC_CHECK_HEADERS): Add termios.h. + +Fri Jan 31 21:13:13 1997 Jim Meyering + + * src/*.c (usage): Bracket bug-reporting address with <> and append + a period. + * src/*.sh: Likewise. + + * src/*.c: Compare getopt_long return value against -1, not EOF. + Use NULL, not `(int *) 0' as last parameter in getopt_long call. + +Mon Jan 27 21:43:50 1997 Jim Meyering + + * src/chroot.c (usage): Remove one space in message to make + colons line up. + +Sun Jan 26 12:51:05 1997 Jim Meyering + + * Version 1.16. + + * src/who-users.c (usage): Fix typo (--writeable -> --writable) + in help output. From Galen Hazelwood. + +Sat Jan 25 21:01:13 1997 Jim Meyering + + * src/factor.c (print_factors): Reflect changes to xstrtoul interface. + + * tests/date/mk-script.pl: Generated script now reflects + specification (in Test.pm) of default and per-test environment + settings. + +Fri Jan 24 23:36:00 1997 Jim Meyering + + * lib/long-options.c (parse_long_options): Reset optind to zero + before just returning so that getopt internals get initialized from + the probably-new parameters when/if getopt is called later. + This solves the problem (reintroduced with 1.15) where `stty -tabs' + would not work as advertised but instead act like `stty -a'. + Reported by Arne Juul. + Suggested fix from Ulrich Drepper. + +Wed Jan 22 20:12:31 1997 Jim Meyering + + * lib/getopt.c: Update from GNU C library. + * lib/getopt1.c: Update from GNU C library. + * lib/getopt.h: Update from GNU C library. + + * tests/Makefile.am (EXTRA_DIST): Add README Makefile.am.in. + (SUBDIRS): Set to `date'. + + * configure.in: Check for perl. + (AC_OUTPUT): Add tests/date/Makefile. + * tests/date: New directory. + + * m4/getgroups.m4: Move the code from configure.in into + this macro that resorts to looking for getgroups in -lbsd. + Set new shell variable, GETGROUPS_LIB (that callers should check), + if it is found there. + * configure.in: Check $GETGROUPS_LIB just after jm_FUNC_GETGROUPS. + (AC_CHECK_FUNCS): Remove getgroups. + Remove code that resorts to looking for getgroups in -lbsd. + + * m4/mktime.m4 (AM_FUNC_MKTIME): Run tests for each of a few values + for the TZ environment variable. Andre Novaes Cunha provided the + hairy TZ setting that exercized the Solaris tzset bug. + +1997-01-22 Paul Eggert + + * lib/strftime.c (_strftime_copytm): + New function, to work around Solaris 2.5 tzset bug. + + * m4/mktime.m4 (AM_FUNC_MKTIME): Fix bug in mktime test -- don't + test now, test a couple of thousand times. + + * m4/strftime.m4 (main): Use TZ=GMT0, not TZ=GMT, since only GMT0 is + specified by Posix.1. + +Sat Jan 18 09:32:26 1997 Jim Meyering + + * lib/getdate.y (get_date): Change prototype to reflect const'ness + of parameters. + Indent cpp-directives to reflect nesting. + Indent with GNU indent. + + * lib/getdate.h: New file. + * src/date.c: Include getdate.h. + (, ): Don't include -- now getdate.h does it. + (get_date): Don't declare. getdate.h does it. + + * lib/Makefile.am (noinst_HEADERS): Add getdate.h. + + 1997-01-06 Paul Eggert + + * getdate.y: Rewrite to use mktime. + + : Don't include. + (mktime): Declare. + + (struct timeb, timezone, DOOMSDAY, SECSPERDAY, DSTMODE, yyDSTmode, + ToSeconds, Convert, DSTcorrect, RelativeDate, RelativeMonth): Remove. + (ToHour): New function (part of the old ToSeconds fn). + (ToYear): New function (part of the old Convert fn). + + (TABLE.value, yyDayOrdinal, yyDayNumber, yyTimezone, yyDay, yyHour, + yyMinutes, yyMonth, yySeconds, yyYear, yyRelMonth, yyRelSeconds, + Number): Now int instead of time_t. + (HOUR): Don't cast to time_t. + + (tDAY_UNIT, tHOUR_UNIT, tYEAR_UNIT): New %tokens. + (UnitsTable): Use new units that are closer to the keywords. + + (yyRelDay, yyRelHour, yyRelMinutes, yyRelYear): New variables. + (rel, relunit, get_date): Add support for them. + + (time): Fix timezone calculations for negative half-hour offsets + when integer division truncates towards minus infinity. + + (zone): Incorporiate DST calculation directly. + + (get_date): 2nd arg is now time_t *, not struct timeb *. + Use mktime to do most of the work, instead of computing it ourselves. + Guard against falsely reporting errors near the time_t boundaries + when parsing times in other time zones. + +Thu Jan 16 20:58:40 1997 Jim Meyering + + * m4/getloadavg.m4 (AM_FUNC_GETLOADAVG): Check for pstat_getdynamic. + * configure.in (AC_CHECK_FUNCS): Don't check for pstat_getdynamic here. + +Tue Jan 14 22:45:36 1997 Jim Meyering + + * configure.in (AC_CHECK_FUNCS): Add pstat_getdynamic. + Alphabetize functions. + + * lib/getloadavg.c [hpux && HAVE_PSTAT_GETDYNAMIC]: Use HPUX's + pstat_getdynamic function so we don't need any special privileges + to determine load averages. Patch from Kaveh Ghazi, based on a + sample implementation from Richard J. Rauenzahn. + Indent cpp-directives to reflect nesting. + +Wed Jan 8 16:38:24 1997 Jim Meyering + + * Version 1.15. + + * lib/getopt.c (_getopt_internal): Use `_', rather than the + (sometimes-)expansion `gettext'. + +Tue Jan 7 22:10:51 1997 Jim Meyering + + * src/nice.c (main): Work around failures induced by new version of + getopt.c by not modifying optind before the first getopt_long call + in main. With suggestions from Ulrich Drepper. + + * lib/getopt.c: New (more POSIX compliant) version from GNU libc. + [_]: Define to gettext also if ENABLE_NLS is defined. + This is temporary. + +Fri Jan 3 21:08:29 1997 Jim Meyering + + * acconfig.h (getgroups): Add #undef. + From Marcus Daniels. + +Fri Dec 27 17:25:18 1996 Jim Meyering + + * src/who-users.c [!WTMP_FILE]: Provide default path. + (UTMP_FILE) [UTMPX_FILE]: Use UTMPX_FILE in favor of UTMP_FILE. + Patch from Kaveh R. Ghazi. + Indent cpp directives. + + * m4/getgroups.m4: Rewrite the test so that systems lacking + getgroups don't try to use the supplied replacement function -- + that depends on the existence of such a function. + + * Makefile.am (aclocal.m4): No longer depend on acinclude.m4. + + * configure.in (jm_FUNC_GETGROUPS): Use it. + Reported by Marcus Daniels. + AC_REQUIRE version 2.12 of autoconf. + +Sun Dec 22 23:31:32 1996 Jim Meyering + + * configure.in: Increment version to 1.14a. + + * m4/Makefile.am (EXTRA_DIST): Add README. + +Fri Dec 20 19:28:37 1996 Jim Meyering + + * src/who-users.c (usage): Say that UTMP_FILE is the default FILE + rather than hard-coding /etc/utmp. Replace hard-coded /etc/wtmp + with WTMP_FILE. Suggestion from Eivind. + + * src/seq.c (usage): Tweak --help text. + + * configure.in (AC_OUTPUT): Add m4/Makefile. + + * lib/Makefile.am (EXTRA_DIST): Add getgroups.c. + + * Makefile.am (SUBDIRS): Add m4. + (aclocal-files): Add rules that rely on (GNU) make's include + directive that computes dependencies for aclocal.m4. + (aclocal.m4): Override automake-generated rule. + + * m4/Makefile.am: New file. + + * lib/strftime.c: Update from GNU libc. + + * m4/getline.m4: New file, extracted from acinclude.m4. + * m4/getloadavg.m4: Likewise. + * m4/jm-mktime.m4: Likewise. + * m4/jm-winsz1.m4: Likewise. + * m4/jm-winsz2.m4: Likewise. + * m4/memcmp.m4: Likewise. + * m4/strftime.m4: Likewise. + * m4/uptime.m4: Likewise. + + * m4/ccstdc.m4: Copied from automake-1.1l. + * m4/dmalloc.m4: Likewise. + * m4/error.m4: Likewise. + * m4/gettext.m4: Likewise. + * m4/header.m4: Likewise. + * m4/init.m4: Likewise. + * m4/install.m4: Likewise. + * m4/lcmessage.m4: Likewise. + * m4/lispdir.m4: Likewise. + * m4/maintainer.m4: Likewise. + * m4/mktime.m4: Likewise. + * m4/obstack.m4: Likewise. + * m4/progtest.m4: Likewise. + * m4/protos.m4: Likewise. + * m4/ptrdiff.m4: Likewise. + * m4/regex.m4: Likewise. + * m4/sanity.m4: Likewise. + * m4/strtod.m4: Likewise. + * m4/termios.m4: Likewise. + * m4/winsz.m4: Likewise. + + * m4/getgroups.m4: New file. + (jm_FUNC_GETGROUPS): New macro + * lib/getgroups.c: New file. + + * m4: New directory. + +Wed Dec 18 07:47:29 1996 Jim Meyering + + * configure.in (AC_CHECK_HEADERS): Add paths.h. + * src/su.c [HAVE_PATHS_H]: Include . + [_PATH_DEFPATH]: Use this to define DEFAULT_LOGIN_PATH. + [_PATH_DEFPATH_ROOT]: Use this to define DEFAULT_ROOT_LOGIN_PATH. + From Rik Faith. + + * acinclude.m4 (jm_FUNC_GNU_STRFTIME): Change m4 quote strings + outside the quoted test program. Quote the test program with <<, >>. + Reported by Andreas Schwab. + (AM_FUNC_GETLOADAVG): Likewise. + (jm_FUNC_GNU_STRFTIME): Add tests for new, upcasing ^ modifier + +Tue Dec 17 18:54:32 1996 Jim Meyering + + * src/Makefile.am (install-exec-local): Properly redirect stdout + and stderr to /dev/null. From Eric Backus. + + * lib/strftime.c: Update from GNU libc. + + * acinclude.m4 (jm_SYS_PROC_UPTIME): Require AC_PROG_CC, rather than + now-obsolete AC_C_CROSS. + (jm_FUNC_MKTIME): When redefining, use rpl_ prefix, not gnu_ one + since there's nothing GNU-specific about the replacement. Contrast + with gnu_ prefix added to strftime. + (jm_FUNC_MEMCMP): New macro. + * configure.in: Use jm_FUNC_MEMCMP instead of AM_FUNC_MEMCMP. + * acconfig.h: Add memcmp. + +Sun Dec 15 18:37:08 1996 Jim Meyering + + * configure.in (check for 3-argument setpriority function): Complete + partial change made on Dec 12. From Arne Juul. + +Sat Dec 14 14:51:50 1996 Jim Meyering + + * acinclude.m4 (jm_SYS_PROC_UPTIME): Fix typo in cache variable + name for cross compiling. + Remove definitions of gettext-related macros. The gettext + installation procedure installs corresponding .m4 files so that + aclocal will use them. + +Thu Dec 12 06:07:30 1996 Jim Meyering + + * Version 1.14. + + * src/system.h (ISDIGIT): Replace with smaller, faster edition + that yields nonzero only on ASCII digits. + (ISDIGIT_LOCALE): New macro, with same meaning that ISDIGIT + used to have. From Paul Eggert. + + * configure.in: Bump version to 1.14. + + * lib/getdate.y (IN_CTYPE_DOMAIN): Rename from ISASCII. + (ISDIGIT): New definition from Paul Eggert. + This one evaluates its argument exactly once. + (yylex): Move increment out of ISALPHA argument. Use a + comma-expression instead. + + * src/false.sh (usage): Update bug-reporting address. + * src/groups.sh (usage): Likewise. + * src/nohup.sh (usage): Likewise. + * src/true.sh (usage): Likewise. + Reported by Karl Heuer. + + * configure.in (check for 3-argument setpriority function): Add nohup + to list of scripts, not the list of programs. + From Karl Heuer. + + * POTFILES.in: Add chroot.c. Reported by Michel Robitaille. + +Wed Dec 11 19:33:36 1996 Jim Meyering + + * Version 1.13. + +Tue Dec 10 06:36:57 1996 Jim Meyering + + * acinclude.m4 (jm_SYS_PROC_UPTIME): New macro. Derived from the + code in configure.in, except now it punts when cross compiling. + Suggestion from Karl Heuer. + * configure.in (jm_SYS_PROC_UPTIME): Use it instead of open-coded + version. + + * lib/Makefile.am (EXTRA_DIST): Add mktime.c. + Reported by Thomas Bushnell. + + * configure.in: Bump version to 1.12t. + + * Regenerate all Makefile.in using a patched version of automake-1.1l. + + * acconfig.h (strftime): Add #undef. + From Karl Heuer. + + * acinclude.m4 (AM_GNU_GETTEXT): Don't require AC_ISC_POSIX. + From Karl Heuer. + +Mon Dec 9 06:58:11 1996 Jim Meyering + + * configure.in: Bump version to 1.12s. + + * lib/getdate.y (Convert): Don't reject all dates in 2038. + Some fit in 31 bits. + + * configure.in (jm_FUNC_GNU_STRFTIME): Use it. + + * acinclude.m4 (AC_REPLACE_GNU_GETOPT): Remove unused macro. + (jm_FUNC_GNU_STRFTIME): New macro. + + * lib/Makefile.am (libsu_a_SOURCES): Remove strftime.c. + (EXTRA_DIST): Add strftime.c. + + * configure.in (jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H): Fix typo: + Change $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h to + $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h. + Patch from Kaveh R. Ghazi. + + * src/stty.c: Include config.h before testing for + TERMIOS_NEEDS_XOPEN_SOURCE. + Patch from Karl Heuer. + + * configure.in (AC_ISC_POSIX): Remove kludgy macro. + Use this test instead: + (LIBS): Add -lcposix if it contains strerror. + Patch from Karl Heuer. + + * acinclude.m4 (AM_FUNC_GETLOADAVG): Put shell assignments to + ac_save_LIBS and LIBS on separate lines to avoid order-of-evaluation + problems -- some versions of sh (e.g. SunOS4.1.3's) evaluate such + space-separated assignments from right to left. Patch from Karl Heuer. + (AM_FUNC_GETLOADAVG): Fix typo: su_save_LIBS => am_cv_saved_LIBS. + Patch from Karl Heuer. + + * lib/strftime.c [HAVE_TZNAME]: Declare tzname. + Patch from Karl Heuer. + + * src/Makefile.am (.sh): Also substitute @bindir@. + Reported by Karl Heuer. + +Sun Dec 8 07:22:38 1996 Jim Meyering + + =========== Update for automake-1.1k. + * Makefile.am (AUTOMAKE_OPTIONS): Require 1.1k. + * configure.in (AM_CONFIG_HEADER): Use it. + (AC_OUTPUT): Remove stamp-h timestamping statement. + Now, AM_CONFIG_HEADER does it automatically. + * lib/Makefile.am (noinst_LIBRARIES): Rename to libsu.a as per + new automake requirement. + Rename su_* variables to libsu_a_*. + +Sun Dec 8 00:08:44 1996 Jim Meyering + + * src/stty.c (get_win_size): Rename formal parameter from fileno to FD. + +Sat Dec 7 12:52:00 1996 Jim Meyering + + * src/chroot.c (main): Call setlocale, bindtextdomain, and textdomain. + From Michel Robitaille. + + * configure.in (ALL_LINGUAS): Add Portuguese (pt). + + * lib/getloadavg.c [__SVR4]: Define SVR4. + Remove duplicate `|| defined(SVR4)' disjunct guarding the + #define KERNEL_FILE "/unix" definiton. + + * configure.in (jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Use this variant + of the AM_ prefixed macro. + (check for TIOCGWINSZ in sys/pty): In essence, require + jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H so that + $jm_cv_sys_tiocgwinsz_needs_termios_h (renamed from + $gwinsz_in_termios_h) is defined. + + * lib/strftime.c (strftime): Remove " %Z" part of format for %c. + Correction from Paul Eggert. + +Fri Dec 6 20:52:07 1996 Jim Meyering + + * acinclude.m4 (jm_FUNC_MKTIME): Rather than including the text of + AM_FUNC_MKTIME, simply AC_REQUIRE it. + +Mon Dec 2 20:59:38 1996 Jim Meyering + + * configure.in (su_cv_func_ut_host_in_utmp): Move test that can + define WINSIZE_IN_PTEM to precede test that checks whether + `TIOCGWINSZ in sys/pty.h'. The latter test uses the symbol. + (jm_FUNC_MKTIME): Use this instead of AM_FUNC_MKTIME. + +Sun Dec 1 13:07:39 1996 Jim Meyering + + * lib/getdate.y (date): Interpret the date, L/M/N, as YYYY/MM/DD + if L >= 1000, otherwise as MM/DD/YY. With this change, + date --date=DATE accepts dates like those in an RCS log listing. + +Sat Nov 30 22:08:00 1996 Jim Meyering + + * lib/strftime.c: Update from GNU libc. + +Fri Nov 29 22:16:40 1996 Jim Meyering + + * src/uname.c (main) [HAVE_SYSINFO && SI_ARCHITECTURE]: Support + --processor (-p). Print processor type. + (usage): Document it. + +Thu Nov 28 00:28:37 1996 Jim Meyering + + * configure.in (AM_GNU_GETTEXT): Renamed from ud_GNU_GETTEXT + for gettext-0.10.25. + (AM_FUNC_GETLINE): Move the test to just before the check for getdelim. + +Sun Nov 24 11:02:29 1996 Jim Meyering + + * src/system.h [!defined STDIN_FILENO]: Define it. + [!defined STDOUT_FILENO]: Define it. + [!defined STDERR_FILENO]: Define it. + + * src/stty.c (get_win_size): Take a FILENO parameter rather than + trying to get a size from both stdin and stdout. + Update callers. + Use STDIN_FILENO and STDOUT_FILENO instead of literal 0, 1. + + ========== From Karl Heuer ========= + * src/stty.c [TERMIOS_NEEDS_XOPEN_SOURCE]: Define _XOPEN_SOURCE. + i386-pc-isc3.0, needs that in order to cause all of the useful + termios symbols to be defined, instead of just those that are + required by POSIX. This enables all of: iuclc ixany olcuc ocrnl + onlcr onocr onlret ofill ofdel nl0 cr0 tab0 bs0 vt0 ff0 xcase. + + [GWINSZ_IN_SYS_PTY]: Include sys/ioctl.h, sys/tty.h, and sys/pty.h. + + [!VSUSP && !VSWTCH]: Map VSWTCH and CSWTCH to VSUSP and CSUSP resp. + termio.h defines VSWTCH, but termios.h defines VSUSP instead (since + POSIX requires that symbol). Define VSWTCH as a synonym if needed, + so that either one can be used on input. + (display_changed): If the slot for swtch is the same as the one for + susp, display only the setting for susp. + (display_all): Likewise. + + (display_changed): Some systems still have (VEOF,VEOL) == (VMIN,VTIME). + On such systems, it's confusing to print both pairs. So, skip eof and + eol when icanon is unset, and skip min and time when icanon is set. + (display_all): Likewise. + + (set_window_size): Check only stdin (the device being queried) for + window size info. You don't want "stty + + * lib/Makefile.am (EXTRA_DIST): Add getline.c now that getline + isn't mentioned in AC_REPLACE_FUNCS. + + * env.c (usage): Alphabetize option descriptions the way sort -f would. + * test.c (usage): Likewise. + * who-users.c (usage): Likewise. + From Karl Berry. + +Fri Nov 22 20:33:26 1996 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Don't try to replace getline this + way. AM_FUNC_GETLINE does it now. + + * configure.in New test to check for TIOCGWINSZ in sys/pty.h. + * config.h.in (GWINSZ_IN_SYS_PTY): Add #undef. + From Karl Heuer. + + * src/printf.c (main): Warn if excess arguments are ignored. + E.g., printf foo bar now warns that it is ignoring the single + non-format argument, bar. + +Wed Nov 20 20:37:54 1996 Jim Meyering + + * lib/xgethostname.c (xgethostname): Work around bug in SunOS5.5's + gethostname. Reported by Fletcher Mattox. + +Tue Nov 19 23:01:01 1996 Jim Meyering + + * configure.in (AM_SANITY_CHECK_CC): Remove it. Autoconf-2.11 + has this built-in. + (OPTIONAL_BIN_ZCRIPTS): Rename from OPTIONAL_SCRIPTS -- because + automake-1.1g couldn't deal with the _SCRIPTS suffix. + * src/Makefile.am (bin_SCRIPTS): Rename @OPTIONAL_SCRIPTS@. + +Sun Nov 17 20:49:37 1996 Jim Meyering + + * src/id.c (main): Ignore -a, for compatibility with SVR4. + Suggestion from Noah Friedman. + +Mon Nov 4 20:24:31 1996 Jim Meyering + + * configure.in (test for group_member): Handle it separately + so I can keep the hyphen (not the underscore) in the filename. + + Thu Oct 31 19:32:32 1996 Miles Bader + + * lib/xgethostname.c [ENAMETOOLONG] (xgethostname): If gethostname + returns an error other than buffer overflow, exit with an error + message instead of allocating infinite amounts of space. + [!EXIT_FAILURE] (EXIT_FAILURE): New macro. + : New include. + [!errno] (errno): New declaration. + + * acinclude.m4 (AM_FUNC_GETLINE): Use cache. + + * configure.in: Check for -linet library before checking for the + gethostbyname function. Suggested by Karl Heuer. + Use AM_FUNC_GETLINE. + + * acinclude.m4 (AM_FUNC_GETLINE): Add run-time test for getline. + Based on a test from Karl Heuer. + +Sun Nov 3 14:57:09 1996 Jim Meyering + + * acinclude.m4 (GETLOADAVG_LIBS): Unanchor the sed regexp that removes + am_cv_saved_LIBS from LIBS. From Karl Heuer. + + * src/stty.c (recover_mode): Fail also if there are too many fields. + From Karl Heuer. + + * lib/canon-host.c: Include sys/types.h for the definitions + (otherwise missing on some systems) of caddr_t (used by + sys/socket.h) and ushort (used by netinet/in.h). From Karl Heuer. + +Sat Nov 2 00:16:16 1996 Jim Meyering + + * doc/Makefile.am (MAKEINFO): Set to makeinfo --no-split. + Otherwise, the generated info files have names longer than + the 14-byte max of some old systems. + Reported by Karl Heuer. + + * src/date.c (main): Give better diagnostic. + Suggestion from Karl Berry. + +Thu Oct 31 18:28:05 1996 Jim Meyering + + * lib/posixtm.y: Remap yacc globals to have pt_ prefix. + * lib/getdate.y: Remap yacc globals to have gd_ prefix. + Suggestion to do as in gdb/c-exp.y from Tom Tromey. + +Mon Oct 28 17:40:54 1996 Jim Meyering + + * src/Makefile.am (install-exec-local): Redirect stderr of chown to + /dev/null and suggest running `make install-root' upon failure to + install su. Suggestions from François Pinard. + + * configure.in: Don't output confusing diagnostic: `checking for + shadow password routines'. Suggestion from François Pinard. + +Thu Oct 24 13:50:46 1996 Andreas Schwab + + * src/tee.c (main): Ignore SIGPIPE. + +Wed Oct 23 23:42:43 1996 Jim Meyering + + * src/stty.c: Guard inclusion of stdarg.h and definition of VA_START + with #if PROTOTYPES rather than with #ifdef __STDC__. The latter + loses with Dynix/PTX. + (wrapf) [PROTOTYPES]: Similarly, guard ANSI-style ... definition. + Suggestion from Marcus Daniels. + +Mon Oct 21 16:49:08 1996 Jim Meyering + + * lib/getloadavg.c [__linux__]: Don't bother with a.out/nlist/kernel + defines or includes -- Linux systems simply read /proc/loadavg. + From Ulrich Drepper. + + * lib/Makefile.am (EXTRA_DIST): Remove group-member.c. + + * configure.in: Remove hack that created link from group_member.c + to group-member.c. + + * lib/group_member.c: New file. Renamed from group-member.c. + * lib/group-member.c: Delete. + + * src/stty.c (main): Remove TAB from diagnostic, for consistency. + +Sun Oct 20 09:03:51 1996 Jim Meyering + + * Makefile.am (install-root): Add it here, too. + + * lib/Makefile.am (INCLUDES): Add -I../intl. Reported by Eric Backus. + + * src/Makefile.am (install-root): New rule. + Suggestion from François Pinard. + + * src/who-users.c (print_entry): Don't take address of UT_TIME_MEMBER + directly. From Ulrich Drepper. + + * Makefile.am (AUTOMAKE_OPTIONS): Set to `gnits'. + (EXTRA_DIST): Remove @README_ALPHA@. + + * configure.in: Remove README_ALPHA related code. Automake takes + care of it automatically now when in gnits mode. + + * acinclude.m4 (AM_FUNC_GETLOADAVG): Use $srcdir (not $top_srcdir) in + #include $srcdir/lib/getloadavg.c. The latter isn't defined at that + point in configure script. From Eric Backus. + +Fri Oct 18 21:31:58 1996 Jim Meyering + + * Makefile.am (cvs-dist): Uncomment cvs tag command. + (cvs-dist): Use cvs tag's -c option. + +Thu Oct 17 23:48:16 1996 Jim Meyering + + * configure.in (LIBS): Add -lypsec on m88k/svr3 DolphinOS systems + using YP. From Arne Juul. + +Sun Oct 13 07:34:15 1996 Jim Meyering + + * configure.in: Don't save and restore LIBS around AM_FUNC_GETLOADAVG. + * acinclude.m4 (AM_FUNC_GETLOADAVG): Don't modify LIBS in this macro + (by saving and restoring initial value). Instead, arrange for + substitution of @GETLOADAVG_LIBS@. + * src/Makefile.am (uptime_LDADD): Add @GETLOADAVG_LIBS@, + not @UPTIME_LIBS@. + + * configure.in (ALL_LINGUAS): Add swedish (sv). + +Fri Oct 11 22:51:50 1996 Jim Meyering + + * src/who-users.c (print_uptime): Change #ifdef guard on getloadavg + call from just HAVE_GETLOADAVG to HAVE_GETLOADAVG || C_GETLOADAVG. + From Kaveh R. Ghazi. + + * src/Makefile.am (uptime_LDADD): Add @UPTIME_LIBS@. + + * acinclude.m4 (AM_FUNC_GETLOADAVG): Like AC_FUNC_GETLOADAVG, but + with the following changes: + - include $top_srcdir/lib/getloadavg.c, not src/getloadavg.c. + Reported by Eric Backus. + - Check for Solaris' libkstat. + - Define C_GETLOADAVG if we end up using getloadavg.c. + From Kaveh R. Ghazi. + * acconfig.h (C_GETLOADAVG): Add it. + From Kaveh R. Ghazi. + + * configure.in: Use new AM_FUNC_GETLOADAVG and be careful to add + getloadavg-related libraries only when linking uptime. + +Thu Oct 10 23:50:05 1996 Jim Meyering + + * lib/Makefile.am (EXTRA_DIST): Remove posixtm.y and getdate.y. + (su_SOURCES): Put them here instead. + Remove rules for building getdate.c and posixtm.c; now automake + generates those rules. + * lib/ylwrap: New file. + * lib/interlock: New file. + +Wed Oct 9 00:26:55 1996 Jim Meyering + + * lib/getloadavg.c [__sun]: Define sun. Reported by Kaveh Ghazi. + + * lib/strftime.c (strftime): Accommodate the broken C compiler + that comes with SunOS -- don't initialize aggregates in decls of + automatic variables. Reported by Kaveh Ghazi. + + * tests/: Renamed checks/ directory. + * Makefile.am (SUBDIRS): Rename checks to tests. + * configure.in (AC_OUTPUT): Rename checks to tests. + + * configure.in (/proc/uptime check): Guard the read of /proc/uptime + with an existence test to avoid a messy configure-time warning on + systems that lack that special file. Reported by Kaveh R. Ghazi. + + * configure.in (check whether floor needs -lm): Fix typo: save $LIBS, + not $LIB. From Kaveh R. Ghazi. + + * checks/nice: Protect echoed args with leading `x' so echo doesn't + interpret leading -n on e.g. SunOS systems. + +Mon Oct 7 18:46:28 1996 Jim Meyering + + * lib/getloadavg.c [__hpux]: Define hpux. From Eric Backus. + + * lib/Makefile.am (EXTRA_DIST): Remove alloca.c, error.c, and mktime. + (su_SOURCES): Remove memcmp.c. + Automake automatically includes at least these, now. + From François Pinard. + + * lib/Makefile.am (su_SOURCES): Remove getline.c. + +Sat Oct 5 11:38:23 1996 Jim Meyering + + * lib/Makefile.am (su_SOURCES): Remove gethostname.c -- + it's AC_REPLACE'd and already in EXTRA_DIST. + + * configure.in: Use AM_SANITY_CHECK_CC. + + * configure.in: Use AM_FUNC_ERROR_AT_LINE. + * lib/Makefile.am (EXTRA_DIST): Put error.c here. + (su_SOURCES): Remove error.c + Suggested by Ulrich Drepper. + + * configure.in (GNU_PACKAGE): AC_SUBST it for the src/*.sh scripts. + * src/Makefile.am (.sh): Substitute for @GNU_PACKAGE@ and @VERSION@ + in the four installed scripts. + * src/*.sh: Update --version output to conform to the coding standard. + + * acinclude.m4 (AC_HEADER_SYS_TIME_H): New macro. + (AM_FUNC_MKTIME): Require AC_HEADER_SYS_TIME_H so that configure's + checking... messages don't get nested. + + * configure.in (GNU_PACKAGE): New variable. + (PACKAGE_VERSION): Remove it. + + * acconfig.h (GNU_PACKAGE): New variable. + (PACKAGE_VERSION): Remove now-unused variable. + + * src/*.c: Update --version output to conform to the coding standard. + +Sun Sep 22 22:41:54 1996 Jim Meyering + + * configure.in (AC_CHECK_HEADERS): Alphabetize. + Update for automake-1.1e. + +Thu Sep 19 07:47:18 1996 Jim Meyering + + * lib/regex.c: Merge with FSF version. + * lib/getloadavg.c: Replace with FSF version. + +Mon Sep 16 23:13:04 1996 Jim Meyering + + * lib/strftime.c (strftime): New version, from GNU libc. + +Sun Sep 15 23:08:48 1996 Jim Meyering + + * Makefile.am (EXTRA_DIST): Remove acinclude.m4. + +Mon Sep 9 22:10:45 1996 Jim Meyering + + * configure.in: Improve handling of math library so -lm is used + only when it's actually required. That makes a difference when + using dynamic linking. + Remove check that added -lm to LIBS. + (SQRT_LIBM): Test for and AC_SUBST it. + (POW_LIBM): Likewise. + (SEQ_LIBM): Likewise. + Motivation and suggestions from Ulrich Drepper. + + * src/Makefile.am (factor_LDADD, printf_LDADD, seq_LDADD): + Set these using new @SQRT_LIBM@, @POW_LIBM@, and @SEQ_LIBM@ resp. + Also set corresponding _DEPENDENCIES variables. + +Sat Sep 7 12:41:39 1996 Jim Meyering + + * src/system.h: Add comments justifying IS* versions of ctype.h macros. + + * lib/getdate.y: Define and use upper case variants of ctype.h + is* macros. From Bruno Haible. + +Thu Sep 5 22:12:20 1996 Jim Meyering + + * lib/strftime.c: New version from glibc. + +Wed Sep 4 23:39:51 1996 Jim Meyering + + * configure.in (ALL_LINGUAS): Add dutch (nl). + +Mon Sep 2 10:52:55 1996 Jim Meyering + + * src/*.c (usage): Tell where to report bugs. + +Sun Sep 1 07:56:07 1996 Jim Meyering + + * configure.in (AM_FUNC_MKTIME): Use it. + (AC_REPLACE_FUNCS): Remove mktime. + (AM_INIT_AUTOMAKE): Use it. + (AM_PROG_INSTALL): Remove. AM_INIT_AUTOMAKE does this. + (AC_PROG_MAKE_SET): Likewise. + (jm_MAINTAINER_MODE, fp_C_PROTOTYPES): Rename with + AM_ prefix for latest automake/aclocal. + + * Makefile.am (EXTRA_DIST): Add acinclude.m4. + + * acinclude.m4: New file -- derived from aclocal.m4. + * aclocal.m4: This file is now generated by the aclocal program + (which comes with the automake package.) + +Sat Aug 17 00:14:55 1996 Jim Meyering + + * lib/strftime.c: Update from GNU libc -- this adds back %z and %s + formats and reverts to old behavior where unrecognized format like + %E is treated as eqivalent to `E'. + +Sun Aug 4 09:14:28 1996 Jim Meyering + + * checks/: New directory. + * checks/Makefile.am: New file. + * checks/nice: New file. Derived from tests from Eric Backus. + * configure.in (AC_OUTPUT): Add new directory: checks. + * Makefile.am (SUBDIRS): Likewise. + + * src/nice.c (main): Allow `+' in options like -+8 and -+13. + +Fri Aug 2 21:45:06 1996 Jim Meyering + + * src/nice.c (main): Set minus_flag to zero in two places. + Otherwise, `nice --1 -3' would mistakenly do the equivalent of + `nice --3'. Thanks to Eric Backus for the + test cases. + + * configure.in (check for /proc/uptime): New check. + * acconfig.h (SAVE_PROC_UPTIME): #undef it. Reorder so symbols + are sorted again. + *src/who-users.c (print_uptime) [HAVE_PROC_UPTIME]: Read from + /proc/uptime. + From Ulrich Drepper. + +Thu Aug 1 22:38:38 1996 Jim Meyering + + * configure.in (AC_REPLACE_GNU_GETOPT): No longer use it. + It isn't necessary because the cpp-time checks of getopt.c and + getopt1.c are at least as good. + * lib/Makefile.am (EXTRA_DIST): Remove getopt.c and getopt1.c. + (su_SOURCES): Add getopt.c and getopt1.c + This reverts much of the April 23 change. + +Sat Jul 27 17:22:14 1996 Jim Meyering + + * src/system.h (bindtextdomain) [!ENABLE_NLS]: Undefine to avoid + redefinition warnings on solaris. + (textdomain) [!ENABLE_NLS]: Likewise. + +Sun Jul 21 09:47:55 1996 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Replace getline.c. + Add related check for the getdelim function. + From Ulrich Drepper -- as done in gettext. + + * src/stty.c (usage): Correct typo (-iucl -> -iuclc) in usage message. + From Thomas Olsson . + +Sat Jul 20 17:01:56 1996 Jim Meyering + + * configure.in (PACKAGE_VERSION): Use space instead of hyphen to + separate PACKAGE and VERSION. + +Wed Jul 17 23:13:19 1996 Jim Meyering + + * src/chroot.c: Include before system.h. + * src/seq.c: Likewise. + * src/yes.c: Likewise. + From Arne Juul. + +Tue Jul 16 00:06:33 1996 Jim Meyering + + * lib/strftime.c (strftime): Use `(void)0' as second arg to add macro. + Omitting that second arg made some HPUX C compiler report an error. + From Kaveh R. Ghazi. + +Mon Jul 15 23:42:57 1996 Jim Meyering + + * src/who-users.c (print_uptime): Reverse `days' and `day' in + uptime message. From Kaveh R. Ghazi. + + * Many files: Update FSF address. + +Sun Jul 14 20:05:34 1996 Jim Meyering + + * src/who-users.c (print_uptime): Use 0, not undefined errno in + couldn't-get-boot-time diagnostic. From Ulrich Drepper. + +Sat Jul 13 14:22:54 1996 Jim Meyering + + * src/chroot.c (usage): Add a `\' after `\n' in usage message. + Otherwise, SunOS's /bin/cc chokes. + + * src/stty.c [GWINSZ_BROKEN]: Remove thus-guarded `#undef TIOCGWINSZ'. + GWINSZ_BROKEN can't be defined anymore. + + * configure.in (boot time test): Use AC_EGREP_CPP instead of + AC_EGREP_HEADER; #endif, instead of #fi. + (AM_SYS_POSIX_TERMIOS, AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Use + these macros instead of the tests from which they were derived. + ($am_cv_sys_posix_termios): Renamed to have am_ prefix instead of su_. + +Wed Jul 10 22:57:29 1996 Jim Meyering + + * aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program + so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with + those options on that system, sys/stat.h gets compile errors. + With help from Marcus Daniels. + + * getopt.c: Update from gettext-0.10.23. + * getopt1.c: Likewise. + * getopt.h: Likewise. + +Sun Jul 7 22:40:08 1996 Jim Meyering + + * aclocal.m4 (AM_SYS_POSIX_TERMIOS): New macro, derived from test + in configure.in. + (AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Likewise. + +Sat Jul 6 12:47:48 1996 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Add group_member. + (AC_LINK_FILES): Create link lib/group_member.c to lib/group-member.c. + * lib/Makefile.am (su_SOURCES): Remove group-member.c. + (EXTRA_DIST): Add group-member.c here. + +Thu Jul 4 22:40:06 1996 Jim Meyering + + * src/expr.c (docolon): Remove space before newline in usage message. + +Sat Jun 29 18:58:20 1996 Jim Meyering + + * configure.in (PACKAGE_VERSION): Add `GNU ' prefix so we see + it in the output of --version. Reported by RMS. + +Tue Jun 18 22:14:42 1996 Jim Meyering + + * aclocal.m4: Update from gettext-0.10.20. + * ABOUT-NLS: Likewise. + * intl/*: Likewise. + +Sun Jun 16 13:44:36 1996 Jim Meyering + + * doc/Makefile.am (EXTRA_DIST): Add texinfo.tex. + +Thu Jun 6 21:57:08 1996 Jim Meyering + + * po/Makefile.in.in: Update from gettext-0.10.16. + * intl/*: Likewise. + * ABOUT-NLS: Likewise. + * aclocal.m4 (AC_REPLACE_GNU_GETOPT): Move definition to precede + gettext-related ones. + Update from gettext-0.10.16. + +Wed May 29 21:28:53 1996 Jim Meyering + + * expr.c (docolon): Give a warning when the first character + of the basic regular expression is `^'. + +Mon May 20 22:56:06 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * id.c (xgetgroups): New function, factored out of + print_group_list and print_full_info. + (print_group_list): Call it. + (print_full_info): Call it. + + * lib/Makefile.am (getdate.c): Disable dependencies that can + require rerunning YACC when not in maintainer mode. + (posixtm.c): Likewise. + +Tue May 14 18:47:35 1996 Andreas Schwab + + * id.c (print_group_list): When USERNAME is specified use + getugroups to get the number of groups. + (print_full_info): Likewise. + +Sun May 19 21:45:49 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * seq.c (usage): Make it clearer. + +Sat May 18 13:29:46 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * expr.c (main): Don't recognize --help, --h, --he, --version, + --v, etc. if the POSIXLY_CORRECT environment variable is set. + * echo.c (main): Likewise. + * printf.c (main): Likewise. + * test.c (main): Likewise. + + * expr.c (docolon) [RE_SYNTAX_POSIX_BASIC]: Revert change of Mar 1. + +Tue May 7 22:10:20 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in: Require autoconf-2.10. + + * aclocal.m4 (jm_MAINTAINER_MODE): New macro. + * configure.in (jm_MAINTAINER_MODE): Use it. + +Mon May 6 22:40:54 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * lib/strftime.c: Update from GNU libc. + +Sat May 4 20:54:32 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * system.h [IN_CTYPE_DOMAIN]: Rename from ISASCII. + * seq.c: Remove useless void casts of *printf return values. + +Mon Apr 29 22:23:40 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * basename.c (usage): Mark translatable strings. + * chroot.c (main): Likewise. + * basename.c (main): Separate messages about `too few' and `too many' + arguments to ease translation. + * dirname.c (main): Likewise. + * date.c (usage): Change TAB in message to spaces. Doing that seems + to have worked around a problem with something in gettext that was + producing a truncated usage message for date's usage. + From François Pinard. + +Sun Apr 28 17:10:03 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in: Make fp_C_PROTOTYPES precede AC_C_INLINE. + Otherwise, some systems lose because the value AC_C_INLINE choses + with plain `cc' is different from that chosen when using the ANSI-mode + C compiler. From Kaveh Ghazi. + +Tue Apr 23 22:05:35 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * aclocal.m4 (AC_REPLACE_GNU_GETOPT): New macro. + * configure.in: Use it. + * lib/Makefile.am (su_SOURCES): Remove getopt.c and getopt1.c. + (EXTRA_DIST): Add getopt.c and getopt1.c + + * whoami.c (main): Declare to return int, not void. + * who-users.c (main): Likewise. + * yes.c (main): Likewise. + + * src/*.c, src/*.h: Update Copyright years to include 1996. + +Sun Apr 21 08:04:51 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * date.c (usage): Describe new %V format. From Karl Berry. + + * Makefile.am (LDADD): Put @INTLLIBS@ before package library. + +Sat Apr 20 22:22:01 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * chroot.c (usage): Improve help message. + Enclose message strings in _(). + * seq.c (usage): Improve help message. + * factor.c (usage): Likewise. + From Karl Berry. + +Fri Apr 19 23:48:53 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * Makefile.am (cvs-dist): New rule. Based on the one from + Tom Tromey's automake. + +Thu Apr 18 23:16:41 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * basename.c (basename): Rewrite so it doesn't rely on strrchr, + and hence doesn't need to include string.h -- on some alpha-based + OSF systems, there's a conflicting prototype for basename in string.h. + Reported by Kaveh Ghazi. + + * configure.in (AC_REPLACE_FUNCS): Add basename. + * lib/Makefile.am (EXTRA_DIST): Add basename.c. + (su_SOURCES): Remove basename.c. + From Kaveh Ghazi. + +Tue Apr 16 20:24:44 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * src/Makefile.am (who.c): Qualify who-users.c reference with + $(srcdir)/ prefix. + (users.c): Likewise. + (uptime.c): Likewise. + From François Pinard. + + * configure.in: Always invoke AC_GETLOADAVG, not just if we're + building uptime. + +Sat Apr 13 13:24:35 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * getloadavg.c: Test cpp-defined __sun as well as sun, because + in strict ANSI mode, only __sun is defined. From Kaveh Ghazi. + + * date.c (usage): Add missing `\n\' at the end of newly added + lines for %e and %z. + + * who-users.c (print_uptime): Call getloadavg only if we have it. + +Fri Apr 12 22:03:13 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (LINGUAS): Add de. + + * date.c (usage): Describe %e and %z. Reported by Karl Berry. + + * who-users.c: Mark translatable strings in new code. + +Wed Apr 10 21:26:30 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in: Add test for boot_time. + From Kaveh Ghazi. + + * lib/Makefile.am (EXTRA_DIST): Add getloadavg.c. + + * src/Makefile.am (EXTRA_PROGRAMS): Add uptime. + (BUILT_SOURCES): Add uptime.c. + (MOSTLYCLEANFILES): Add uptime.c. + (uptime.c): Add rule to build it from who-users.c. + + * who-users.c: Reindent. + (UT_TIME_MEMBER): New macro. + (print_uptime): Use it instead of #ifdef HAVE_UTMPX_H #else. + (print_entry): Likewise. + +Tue Apr 9 23:57:19 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * who-users.c (print_uptime) [UPTIME]: New function. From Kaveh Ghazi. + +Sun Apr 7 11:58:13 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * seq.c (print_numbers): Rearrange loops to get it right. + Reported by Karl Eichwalder . + + * seq.c (print_numbers): Give more precise diagnostic when INCREMENT + is inconsistent with START and LIMIT. + (usage): Clean up help message. + + * factor.c (usage): Give minimal description of the program. + (print_factors): Give a better diagnostic. + (main): Suggest --help upon failure. + Reported by Karl Eichwalder . + + * seq.c (print_numbers): Fix off-by-one error in + backwards-counting loop. Reported by Karl Eichwalder. + + * strftime.c (mon_week_ISO): New function to implement new %V format. + (sun_week): Make TM parameter `const'. + (mon_week): Likewise. + (mon_week): Rewrite to implement %W format correctly. + (strftime): Handle %V format. + Reported by Arne Juul. + +Fri Apr 5 07:33:00 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * strftime.c (sun_week): Make %U work properly. + Before, `date -d '1 Jan 1995' +%U' output `00'. Now it prints `01'. + + * nice.c (main): Simplify option handling. Before, `nice -18 -- nice' + improperly printed `8'. Patch from Frank Korz. + (main): Use `if' stmt, not while loop, around getopt invocation. + Otherwise, `./nice --a=1 -1 ./nice' (in which old-style option + follows a long option) gets an error. + +Thu Apr 4 20:14:02 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * aclocal.m4 (fp_PROG_CC_STDC): Change -Xc -D_POSIX_C_SOURCE to + `-Xc -D__EXTENSIONS__' because of problems with Solaris header + files. Suggested by Kaveh Ghazi. + +Wed Apr 3 07:08:57 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * src/Makefile.am (INCLUDES): Add -I$(srcdir) to get system.h + when srcdir != builddir. From Kaveh Ghazi. + + * lib/getugroups.c: Include stdio.h before grp.h. Because + on alpha OSF1 V2.0 uses "FILE *". From Kaveh Ghazi. + +Sun Mar 31 16:26:06 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in: Simplify checking for math library. + This also eliminates some confusing output from configure. + Suggested by François Pinard. + +Fri Mar 29 22:13:10 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * src/Makefile.am (INCLUDES): Replace -I$(top_srcdir)/intl with + -I../intl. With the former, compiles didn't find libintl.h when + configured with `--srcdir=..'. Reported by Marcus Daniels + . + + * doc/Makefile.am (EXTRA_DIST): Set to getdate.texi so that file + gets distributed. + + * src/Makefile.am (EXTRAdir): Set to $(bindir). + +Thu Mar 28 23:01:48 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * ChangeLog.0: New file. + * Makefile.am (EXTRA_DIST): Add ChangeLog.0. + +Thu Mar 28 00:06:28 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * man/Makefile.am (man_MANS): Add chroot.1. + * src/Makefile.am (EXTRA_PROGRAMS): Add chroot. + +Sun Dec 24 10:55:34 1995 Roland McGrath + + * configure.in: Check for chroot a la uname. + * src/chroot.c, man/chroot.1: New files. + +Sun Mar 24 11:44:35 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * su.c: Protoize and reorder functions to obviate forward decls. + + * seq.c: Make parameters const where appropriate. + Rename global FROM to START. + (print_numbers): Rewrite loops to avoid incrementing. Instead, + use `x = first + i * increment' paradigm. Otherwise, with inexact + increment, you could miss the last value. + + * xstrtod.c: New file. + * xstrtod.h: New file. + * lib/Makefile.am: Add xstrtod.c and xstrtod.h. + * seq.c: Include xstrtod.h. + (scan_double_arg): Use xstrtod rather than strtod directly. + + * src/*: Update FSF's address. + +Thu Mar 21 16:43:13 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * src/*.c (main): Declare to be of type int, not void. + +Sat Mar 16 10:07:49 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (PACKAGE_VERSION): New macro. + (OPTIONAL_BIN_PROGS): Rename from OPTIONAL_PROGS. + * acconfig.h (PACKAGE_VERSION): Add it. + * src/Makefile.am: Remove rules for generating version.c. + Remove references to version.o, version.h, and stamp-v. + [.sh]: Change @VERSION@ to @PKG_VERSION@. + On RHS of sed substitution, use @PACKAGE_VERSION@, not GNUVER. + (OPTIONAL_BIN_PROGS): Rename from OPTIONAL_PROGS. + (install-exec-local): New target/rules to make the installed su + binary setuid root or failing that, to delete it. + * false.sh groups.sh nohup.sh true.sh: Use @PKG_VERSION@, + not @VERSION@. + * version.c: Remove file. + * version.h: Remove file. + * basename.c date.c dirname.c echo.c env.c expr.c factor.c + hostname.c id.c logname.c nice.c pathchk.c printenv.c printf.c + pwd.c seq.c sleep.c stty.c su.c tee.c test.c tty.c uname.c + who-users.c whoami.c yes.c: Don't include version.h. + (main): Use PACKAGE_VERSION instead of version_string. + +Fri Mar 15 23:42:29 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * basename.c: Remove __P-protected prototype for basename. + Reported by François Pinard. + (remove_suffix): Move to precede use. Remove prototype. + Declare formal parameter SUFFIX to be const. + + * pathchk.c (validate_path): Cast path_max to size_t before + comparing with strlen(path). + + * who-users.c (read_utmp): Declare n_read to be of type size_t + rather than int. + +Tue Mar 12 17:52:05 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * basename.c date.c dirname.c echo.c env.c expr.c factor.c hostname.c + id.c logname.c nice.c pathchk.c printenv.c printf.c pwd.c seq.c + sleep.c stty.c su.c tee.c test.c tty.c uname.c who-users.c whoami.c + yes.c (main): Initialize for internationalized message support: + call setlocale, bindtextdomain, and textdomain. + * system.h: Add definitions and includes for NLS. + * Makefile.am (SUBDIRS): Add intl and po. + * src/Makefile.am (datadir): Define. + (localedir): Define. + (DEFS): Add LOCALEDIR definition. + (LDADD): Add @INTLLIBS@. + * aclocal.m4: Add NLS-related macro definitions from + gettext distribution. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES, + HAVE_STPCPY): New macros. + Add PACKAGE and VERSION. + * configure.in (PACKAGE): Define with AC_DEFINE_UNQUOTED. + (VERSION): Likewise. + (ALL_LINGUAS): Define. + (ud_GNU_GETTEXT): Use it. + Link an nls file. + (AC_OUTPUT): Reflect addition of two new directories, intl and po. + Create po/Makefile. + Mostly from François Pinard. + +Wed Mar 6 21:40:34 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * who-users.c (print_entry): Use STRUCT_UTMP, not `struct utmp' to + declare formal parameter. + +Tue Mar 5 22:49:33 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * getdate.y (RelativeMonth): Add 1900 to the year so that relative + date specs that push the year through the end of the century work. + For example, `date -d "01/01/1998 3 years" +%Y' now prints 2001. + From Peter Dalgaard (pd@kubism.ku.dk). + +Mon Mar 4 23:46:43 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * seq.c (main): Exit after processing --version. + Reported by François Pinard. + +Fri Mar 1 23:46:32 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * expr.c (docolon): Don't initialize re_syntax_options to + deceptively-named RE_SYNTAX_POSIX_BASIC -- it recognizes non-BRE + \?, \+, and \|. Use RE_SYNTAX_POSIX_MINIMAL_BASIC instead. + + * od.c (WINDOWS_SETFILEMODE_BINARY): New macro. + (skip) [_WIN32 && _O_BINARY]: Use it. + (read_char): Likewise. + (read_block): Likewise. + [_WIN32 && _O_BINARY]: Include malloc.h and io.h. + Based on changes by Gary Newman . + +Wed Feb 28 21:48:07 1996 Paul Eggert + + * configure.in (LOCALTIME_CACHE): + Also define if localtime mishandles unsetting TZ. + This works around a localtime bug in mips-dec-ultrix. + +Wed Feb 28 23:08:24 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * lib/Makefile.am (su_SOURCES): Add xstrtoul.c. + (noinst_HEADERS): Add xstrtoul.h. + + * factor.c: General cleanup. Use xstrtoul, not atoi. + Change output format. Allow inputs as large as ULONG_MAX. + Allow more than one command line argument. + + * stty.c (wrapf) [!__STDC__]: Indent by one space the first line + of the pre-ANSI function definition so ansi2knr doesn't munge it. + + * src/Makefile.am: Adapt for automake-0.30. + * lib/Makefile.am: Likewise. + + * expr.c (eval6): Cast strlen to int to avoid warning from gcc -Wall. + +Sun Feb 25 22:19:52 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * src/Makefile.am (BUILT_SOURCES): Set to `who.c users.c'. + (MOSTLYCLEANFILES): Add who.c and users.c. + (who.c): New rule to create this file. Concatenate definition of + WHO and contents of who-users.c. + (users.c): New rule to create this file. Concatenate definition of + USERS and contents of who-users.c. + +Sat Feb 24 12:20:58 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * readtokens.c: Unprotoize. + + * expr.c (cmpf): Indent macro uses so ansi2knr doesn't mistake them + for function dcls and munge them. + (arithf): Likewise. + (arithdivf): Likewise. + + * test.c: __P-protect forward declarations. + (main): Protoize function definition. + + * date.c (batch_convert): Declare BUFLEN local to be of type size_t, + not int. + + * expr.c (docolon): Set re_syntax_options to RE_SYNTAX_POSIX_BASIC + so expr's pattern matching uses BASIC (not GNU-extended) REs. + Reported by Jim Kingdon. + + * who-users.c (print_entry): Use strchr, not index. + + * configure.in (AC_CHECK_HEADERS): Add sys/socket.h. + * canon-host.c [HAVE_SYS_SOCKET_H]: Include for + definition of AF_INET on at least SunOS 4. + +Tue Feb 13 23:49:16 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * who-users.c (main): When failing because there were + `too many arguments,' say so. + +Mon Feb 12 23:26:05 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (AC_CHECK_FUNCS): Add gethostbyname, gethostbyaddr, + and inet_ntoa. + (AC_CHECK_HEADERS): Add netdb.h netinet/in.h arpa/inet.h. + * lib/canon-host.c: New file. + * lib/Makefile.am (su_SOURCES): Add canon-host.c. + * src/who.c (print_entry): If possible, canonicalize the host hame. + From Miles Bader (miles@gnu.ai.mit.edu). + + Update for automake-0.29. + * Makefile.am (CONFIG_HEADER): Don't define. Automake now does it. + * src/Makefile.am: Likewise. + * lib/Makefile.am: Likewise. + * doc/Makefile.am (info_TEXINFOS): Renamed from TEXINFOS. + * man/Makefile.am (man_MANS): Renamed from MANS. + +Wed Jan 31 23:40:50 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * lib/strftime.c (add_num_tz): New function. + (strftime): Handle new %z format. + * date.c (main): Accept new option, --rfc-822 (-R). + (show_date): Use RFC822-mandated strftime format. + From H. Peter Anvin (hpa@storm.net). + (usage): Add a line describing the new option. + + * lib/strftime.c (add_num_tz): Don't use local, LENGTH, + before it's defined. + +Mon Jan 29 19:24:04 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * acconfig.h (PROTOTYPES): Define it. + +Fri Jan 19 22:00:08 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * aclocal.m4 (fp_PROG_INSTALL): New macro. + * configure.in: Use it instead of AC_PROG_INSTALL. + + * who-users.c: Protoize. + +Wed Jan 17 23:37:59 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * stty.c: Protoize and __P-protect forward dcls. + (visible): Change parameter type to unsigned int from unsigned char. + (integer_arg): Use xstrtol instead of open-coding this. + + * lib/Makefile.am (su_SOURCES): Add xstrtol.c. + (HEADERS): Add xstrtol.h. + + * test.c (advance): Protoize function. + + * sleep.c (argdecode): Declare parameter const. + +Sat Jan 13 22:31:23 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * stty.c: Indent cpp directives. + +Sun Jan 7 23:56:03 1996 Jim Meyering (meyering@na-net.ornl.gov) + + Use automake to generate Makefile.in files. + * Makefile.am: New file. + * doc/Makefile.am: New file. + * lib/Makefile.am: New file. + * man/Makefile.am: New file. + * src/Makefile.am: New file. + + * configure.in (OPTIONAL_PROGS, OPTIONAL_SCRIPTS): New variables + used in place of PROGS. + +Sat Jan 6 05:13:40 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (PACKAGE, VERSION): New variables. + (fp_C_PROTOTYPES): Use it. + + * printf.c (print_esc_char): Change type of argument from char + to int to avoid potential promotion problem. + * uname.c (print_element): Likewise. + + * system.h [__P]: New macro. + + * basename.c, date.c, dirname.c, echo.c, env.c, expr.c, factor.c, + hostname.c, id.c, logname.c, nice.c, pathchk.c, printenv.c, + printf.c, pwd.c, seq.c, sleep.c, tee.c, test.c, tty.c, uname.c, + whoami.c, yes.c: Protoize and __P-protect forward dcls. + + * who-users.c: New file. Renamed from who.c. + * who.c: Define WHO and include who-users.c. + * uses.c: Define USERS and include who-users.c. + + * id.c Remove no-longer-used NGROUPS_MAX cpp macros. + (print_group_list) [HAVE_GETGROUPS]: Reorganize to use + getgroups (0, NULL) to compute number of groups at run time + rather than relying on NGROUPS_MAX at compile time. + (print_full_info) [HAVE_GETGROUPS]: Likewise. + Suggestion from Roland McGrath. + + * su.c: Remove NGROUPS_MAX junk. It wasn't being used. + +Wed Jan 3 19:03:26 1996 Paul Eggert + + * configure.in (LOCALTIME_CACHE): Define if tzset exists and + if localtime caches TZ. Check for tzset. + * acconfig.h (LOCALTIME_CACHE): New macro. + * date.c (putenv): Declare. + (universal_time): Remove. + (main): If -u is given, set TZ to "UTC0"; this causes date to use + UTC uniformly and fixes bugs in the handling of date -u +'%s %Z'. + (show_date): Just use localtime and a single format, since TZ will + be set properly if -u is given. + +Fri Dec 22 21:34:55 1995 Andreas Schwab + + * configure.in: Touch stamp-h only if config.h is remade. + +Sun Nov 26 16:09:33 1995 Jim Meyering (meyering@comco.com) + + * test.c (usage): Clarify usage. From Karl Berry. + +Wed Nov 22 23:12:47 1995 Jim Meyering (meyering@comco.com) + + * Makefile.in (all et. al.): If make was invoked with -k and a + sub-make fails, fail after the loop rather than exiting right away. + Otherwise, make's -k option could be ineffective. + +Thu Nov 16 21:25:45 1995 Jim Meyering (meyering@comco.com) + + * Makefile.in (default): New default target. Depend on `all' to work + around bug in AIX-3.2.5's /bin/make. Reported by Andreas Luik + . + +Tue Nov 7 23:53:20 1995 Jim Meyering (meyering@comco.com) + + * stty.c (usage): Clarify descriptions of ignpar and ignbrk. + From Theodore Ts'o and Ulrich Windl. + +Sun Oct 29 08:47:50 1995 Jim Meyering (meyering@comco.com) + + * test.c [TEST_STANDALONE]: Define. + * src/Makefile.in (test.o): Remove special rule. + +Sat Oct 28 00:49:13 1995 Jim Meyering (meyering@comco.com) + + * aclocal.m4 (jm_WITH_AUTODEPS): New directive. + * configure.in: Use it. + + * lib/Makefile.in (INCLUDE, COMPILE): New variables. + (.c.o): Rewrite to be more like src/Makefile.in. + Add line that (--with-autodeps) will include mkdep-Makefile. + (distclean): Remove .deps. + * src/Makefile.in: Likewise. + + * mkdep-Makefile: New file. + * Makefile.in (DISTFILES): Add mkdep-Makefile. + + * doc/Makefile.in (mostlyclean): Remove *.info. + + * date.c: New option --reference=FILE (-r FILE) analogous to the + like-named touch option. + (main): Recognize it and give diagnostic for misuse. + (usage): Describe briefly. + From Franc,ois Pinard. + + * date.c (batch_convert): Close input stream also when it's not stdin. + (main): Reorganize to do option-consistency checks before all else. + +Tue Sep 26 23:05:01 1995 Jim Meyering (meyering@comco.com) + + * man/Makefile.in (install-data, uninstall): Use sed not basename. + The GNU Coding Standard suggests that only a select set of + relatively standard utilities be used in Makefiles. basename is + not among them. Suggested by Ulrich Drepper. + +Tue Aug 8 22:57:34 1995 Jim Meyering (meyering@comco.com) + + * yes.c: Include system.h to get definition of _. + +Mon Aug 7 23:27:54 1995 Jim Meyering (meyering@comco.com) + + * system.h (_): Define macro -- as empty for now. + * src/*.c: Annotate localizable strings with _(...). From Franc,ois. + + * Makefile.in (DISTFILES): Don't distribute unneeded COPYING.LIB. + From Franc,ois. + +Fri Jun 23 23:04 1995 Jim Meyering (meyering@comco.com) + + * configure.in (AC_REPLACE_FUNCS): Add memcpy and memset. + Add checks for floor, modf, and rint -- all used by seq.c. + +Mon Jun 12 00:26:54 1995 Jim Meyering (meyering@comco.com) + + * getdate.y (Convert): Use 2037 as threshold, not 1999. + Before years after 1999 were treated as invalid. + From Andreas Schwab. + +Sat May 27 00:35:47 1995 Jim Meyering (meyering@comco.com) + + * system.h [!STDC_HEADERS && HAVE_MEMORY_H]: Include memory.h. + Without this, SunOS doesn't get type for memchr. + Reported by Kaveh Ghazi. + +Sun May 21 07:20:55 1995 Jim Meyering (meyering@comco.com) + + * Makefile.in (.PHONY): TAGS is not a phony target. From Franc,ois. + + * All Makefile.in (install-exec, install-exec): New targets. + From Karl Berry. + + * all Makefile.in (maintainer-clean): Renamed from realclean + per GNU Standards. + +Mon May 15 01:00:08 1995 Jim Meyering (meyering@comco.com) + + * all source files (usage): Include one- or two-line synopsis + in --help output. From Karl Berry. + +Sat May 13 08:57:20 1995 Jim Meyering (meyering@comco.com) + + * lib/Makefile.in (maintainer-clean): Rename from realclean. + (.PHONY): New dependencies. + [.c.o]: Remove -I. since safe-l?stat.h are no longer used. + +Fri May 12 21:25:50 1995 Jim Meyering (meyering@comco.com) + + * test.c (usage): Remove duplicate descriptions of --help + and --version. From Karl Berry. + + * pathchk.c: Use stat (lstat), not safe_stat (safe_lstat). + * test.c: Likewise. + * who.c: Likewise. + + * lib/Makefile.in (SOURCE): Add memcpy.c, memset.c. + Remove all reference to (now unused) safe-xstat.hin. + +Tue Apr 18 22:57:43 1995 Jim Meyering (meyering@comco.com) + + * configure.in (AC_OUTPUT): Use echo, not date, to avoid creating + unnecessary conflicts for people using version control software + like RCS and CVS. + (AC_ARG_PROGRAM): Use it. + +Fri Mar 10 21:14:11 1995 Jim Meyering (meyering@comco.com) + + * src/*.c: Update Copyright dates. + +Mon Feb 27 08:05:25 1995 Jim Meyering (meyering@comco.com) + + * system.h: Separate errno declaration from STDC_HEADERS. + Remove bcopy, bzero, strchr, strrchr definitions. + + * stty.c (main, set_window_size): Use memset instead of bzero. + * su.c (correct_password): Likewise. + + * seq.c Remove \n's from error format strings. + (main): Let `seq 1 1' work. + Invoke usage always with 1 when failing. + +Sat Feb 11 08:27:12 1995 Jim Meyering (meyering@comco.com) + + * src/Makefile.in (install): Fix rules for su to avoid relying on + just-built `id' executable. That would lose when cross-compiling and + on systems like GNU in which a user may have several effective IDs. + (SOURCES, OBJECTS, PROGS): Add seq. + * Makefile.in (PROGS): Add seq. + + * configure.in (AC_REPLACE_FUNCS): Add memcmp, memcpy, and memset. + (AC_CHECK_FUNCS): Add strchr and strrchr. + * lib/Makefile.in (SOURCES): Add memcmp.c, memcpy.c, and memset.c. + + * system.h: Remove index/rindex and bcmp/bcopy/bzero references. + Separate errno declaration from STDC_HEADERS. + +Thu Jan 26 23:38:04 1995 Jim Meyering (meyering@comco.com) + + * getdate.y (ToSeconds): Properly convert 12am and 12pm. + From Takeshi Sone . + + * lib/Makefile.in (SOURCES, OBJECTS, DISTFILES): Add readtokens.[coh]. + (all): Depend on safe-stat.h and safe-lstat.h. + + * date.c (batch_convert): Remove any trailing newline from offending + line before including it in the `invalid date' error from `date -f'. + Reported by Franc,ois Pinard. + +Sat Dec 31 09:25:09 1994 Jim Meyering (meyering@comco.com) + + * factor.c: New file. + * Makefile.in (PROGS): Add factor. + * src/Makefile.in (SOURCES, OBJECTS, PROGS): Add factor. + (factor): New rule. + +Mon Dec 26 18:31:08 1994 Jim Meyering (meyering@comco.com) + + * test.c (term): Running `./test \( a -o b' got a seg fault. + From from Klaus.Reichl@aut.alcatel.at. + +Mon Dec 19 22:05:12 1994 Jim Meyering (meyering@comco.com) + + * src/*.c: Include "error.h" rather than simply declaring + `void error ();'. + * src/Makefile.in (OBJECTS): Depend on ../lib/error.h. + + * lib/Makefile.in (DISTFILES): Remove safe-xstat.cin. + (distclean): Remove references to safe-l?stat.c. + Remove all related rules and dependencies. + + * safe-xstat.hin (SAFE_LSTAT, SAFE_STAT): Remove macros. + Now that we always define the functions, these are no longer needed. + + * pathchk.c (dir_ok): Use safe_stat instead of SAFE_STAT. + * who.c (print_entry): Likewise. + * test.c (test_stat, binary_operator): Likewise. + (unary_operator): Use safe_lstat instead of SAFE_LSTAT. + +Mon Dec 12 22:42:09 1994 Jim Meyering (meyering@comco.com) + + * expr.c (docolon): Zero out re_buffer and re_regs before using them. + From H.J. Lu . + +Sun Dec 4 14:53:12 1994 Jim Meyering (meyering@comco.com) + + * dirname.c (main): Use strchr and strrchr instead of index and rindex. + * echo.c (main): Likewise. + * env.c (main): Likewise. + * pathchk.c (validate_path): Likewise. + * printf.c (print_formatted, print_esc): Likewise. + * test.c [member]: Likewise. + * who.c (extract_trimmed_name): Likewise. + * system.h [!HAVE_STRING_H]: Define strchr to index and strrchr to + rindex instead of the other way around. + + * doc/Makefile.in (DISTFILES): Add getdate.texi. + +Sat Dec 3 07:59:55 1994 Jim Meyering (meyering@comco.com) + + * configure.in (AC_CHECK_FUNCS): Add strchr and strrchr. + (AC_CHECK_HEADERS): Add stdlib.h. + (LIBS): If the strtod replacement is required, check for pow in -lm. + * src/Makefile.in (printf): Remove hard-coded -lm. Not every + system has it. + +Thu Nov 17 23:47:26 1994 Jim Meyering (meyering@comco.com) + + * who.c (list_entries): Delete. Split in two actually... + (list_entries_users, list_entries_who, userid_compare): New functions. + (list_entries_users): Sort the user names. Reported by + Michael I Bushnell. + Topologically sort the functions and remove fwd declarations. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/NEWS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/NEWS new file mode 100644 index 0000000..7da709d --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/sh-utils/NEWS @@ -0,0 +1,272 @@ + [2.0.15] +* date no longer accepts e.g., September 31 in the MMDDhhmm syntax +* fix a bug in this package's .m4 files and in configure.ac + [2.0.14] +* nohup's behavior is changed as follows, to conform to POSIX 1003.1-2001: + - nohup no longer adjusts scheduling priority; use "nice" for that. + - nohup now redirects stderr to stdout, if stderr is not a terminal. + - nohup exit status is now 126 if command was found but not invoked, + 127 if nohup failed or if command was not found. + [2.0.13] +* uname and uptime work better on *BSD systems +* pathchk now exits nonzero for a path with a directory component + that specifies a non-directory + [2.0.12] +* kill: new program +* who accepts new options: --all (-a), --boot (-b), --dead (-d), --login, + --process (-p), --runlevel (-r), --short (-s), --time (-t), --users (-u). + The -u option now produces POSIX-specified results and is the same as + the long option `--users'. --idle is no longer the same as -u. +* The following changes apply on systems conforming to POSIX 1003.1-2001, + and are required by the new POSIX standard: + - `date -I' is no longer supported. Instead, use `date --iso-8601'. + - `nice -NUM' is no longer supported. Instead, use `nice -n NUM'. +* New 'uname' options -i or --hardware-platform, and -o or --operating-system. + 'uname -a' now outputs -i and -o information at the end. + New uname option --kernel-version is an alias for -v. + Uname option --release has been renamed to --kernel-release, + and --sysname has been renamed to --kernel-name; + the old options will work for a while, but are no longer documented. +* 'expr' now uses the LC_COLLATE locale for string comparison, as per POSIX. +* 'expr' now requires '+' rather than 'quote' to quote tokens; + this removes an incompatibility with POSIX. +* date -d 'last friday' would print a date/time that was one hour off + (e.g., 23:00 on *thursday* rather than 00:00 of the preceding friday) + when run such that the current time and the target date/time fall on + opposite sides of a daylight savings time transition. + This problem arose only with relative date strings like `last monday'. + It was not a problem with strings that include absolute dates. +* factor is twice as fast, for large numbers + [2.0.11] +* setting the date now works properly, even when using -u +* `date -f - < /dev/null' no longer dumps core +* some DOS/Windows portability changes + [2.0j] +* `date -d DATE' now parses certain relative DATEs correctly + [2.0i] +* fixed a bug introduced in 2.0h that made many programs fail with a + `write error' when invoked with the --version option + [2.0h] +* all programs fail when printing --help or --version output to a full device +* printf exits nonzero upon write failure +* yes now detects and terminates upon write failure +* date --rfc-822 now always emits day and month names from the `C' locale +* portability tweaks for Solaris8, Ultrix, and DOS + [2.0g] +* date now handles two-digit years with leading zeros correctly. +* printf interprets unicode, \uNNNN \UNNNNNNNN, on systems with the + required support; from Bruno Haible. +* stty's rprnt attribute now works on HPUX 10.20 +* seq's --equal-width option works more portably + [2.0f] +* fix build problems with ut_name vs. ut_user + [2.0e] +* stty: fix long-standing bug that caused test failures on at least HPUX + systems when COLUMNS was set to zero +* still more portability fixes +* unified lib/: now that directory and most of the configuration framework + is common between fileutils, textutils, and sh-utils + [2.0d] +* fix portability problem with sleep vs lib/strtod.c's requirement for -lm + [2.0c] +* fix portability problems with nanosleep.c and with the new code in sleep.c + [2.0b] +* Regenerate lib/Makefile.in so that nanosleep.c is distributed. + [2.0a] +* sleep accepts floating point arguments on command line +* sleep's clock continues counting down when sleep is suspended +* when a suspended sleep process is resumed, it continues sleeping if + there is any time remaining +* who once again prints whatever host information it has, even without --lookup +Changes in release 2.0 +* disable stty tests (otherwise they fail) when `make check' is run via rsh + [1.16m] +* false and true now ignore --help and --version when POSIXLY_CORRECT is set + [1.16l] +* false and true are now C programs rather than shell scripts + [1.16k] +* fix typos in my version of AC_SEARCH_LIBS. +* fix dates on config files so builders don't need autoconf/automake + [1.16j] +* work around problems with my use of AC_SEARCH_LIBS +* fix a bug in id + [1.16i] +* portability tweaks for lib/readutmp.[ch] and src/date.c + [1.16h] +* seq with no arguments now elicits a useful diagnostic rather than a segfault +* portability tweaks to work around utmpname differences +* who works on Solaris + [1.16g] +* factor now uses uintmax_t, so the largest number it can factor is now 2^64 - 1 + on systems with type `long long'. +* nohup no longer modifies the shell's search path +* `basename /' now prints `/', per the single unix spec +* `who --lookup' no longer erroneously reports `localhost' for IP addresses + for which it could not do a reverse lookup. +* `id user' wouldn't report a group id in some situations. Now it always does. + [1.16f] +* chroot now calls chdir ("/") after chroot. +* `date -s' now exits with nonzero status upon failure +* new autoconf tests detect bugs in vendor mktime from Irix-6.4 and SunOS4.1.4 + Your executables will be a little larger on such systems because you'll use + GNU's mktime function, but date will work more reliably. +* hostid: new program +* `yes --help' and `yes --version' print those strings when the POSIXLY_CORRECT + environment variable is set +* who no longer does DNS lookups by default -- the new option, --lookup (-l), + enables lookups + [1.16e] +* pinky: new lightweight finger-style program + [1.16d] +* the groups script now exits non-zero and doesn't print anything more + when `id' fails + [1.16c] +* date -u -d DATE now prints the correct date +* don't remove already-installed su unless it is possible to install the + new one setuid root. + [1.16b] + [1.16a] +* expr accepts new unary operator, quote. +* expr now returns 0 for failed matches where pattern contained e.g., `\\(' +* date -d DATE now works on Unicos systems +* add tests for factor and more for date. +* factor runs a lot faster for large 64-bit inputs +* date works with relative offsets involving the `next' keyword + +Changes in release 1.16 +* stty -tabs works properly +* add tests for date +* date --date "02/29/1996 - 1 year" now works properly + +Changes in release 1.15 +* nice works with very recently-changed GNU libc getopt +* fix several bugs in m4 macros used to create `configure' script +* id works on systems with disfunctional getgroups function +* uptime configure test detects /proc/uptime on Linux + +Changes in release 1.14 +* fix bug in getdate.y that broke date's --date=DATE option on systems + like SunOS4. +* expr treats unadorned ? and + as literals. To make expr treat them as + operators you have to use \? and \+. + +Changes in release 1.13 +* two patches for ISC +* Regenerate all Makefile.in using a patched version of automake-1.1l. + [1.12s] +* lots of little bug fixes -- see ChangeLog + [1.12r] +* uname --processor (-p) works on systems that have sysinfo and define + SI_ARCHITECTURE. +* stty works better on systems like i386-pc-isc3.0 +* date --date=DATE accepts dates like those in an RCS log listing, e.g., + `1992/11/01 05:44:34'. +* printf now warns if excess arguments are ignored. +* tee no longer fails immediately upon receipt of SIGPIPE + [1.12q] +* running `make check' runs tests of nice +* lots of configuration-related improvements +* nice allows `+' in options like -+8 and -+13. +* when matching, expr warns about non-portability when the first character + of the basic regular expression is `^' +* `id user' no longer prints bogus group list +* uses automake-generated Makefile templates +* date accepts new %V format +* date's %U and %W formats work properly +* nice option handling works with 2-digit old-style-option adjustments. + Now, `nice -18 -- nice' prints `18'. Before it printed `8'. +* internationalized diagnostic messages +* `date -d "01/01/1998 3 years" +%Y' now works properly. It prints 2001. +* New programs: chroot, factor, seq, uptime. +* date accepts new option: --rfc-822 (-R) +* date accepts new format, %z, for RFC-822 style numeric timezone (-0500) +* date: fix bugs in the handling of date -u +'%s %Z'. +* date accepts new option --reference=FILE (-r FILE) analogous to the + like-named touch option. +* date can now format dates up to and including ones in the year 2037 +User visible changes in release 1.12 +* None. +User visible changes in release 1.11 +* date accepts new option: (-f) --file=DATEFILE +* skeletal texinfo documentation (mainly just the `invoking' nodes) +* `stty werase ^W' works. Before, werase wasn't enabled for AIX-3.2.5. +* su with no arguments works properly +* nice accepts options like `--5' (this is interpreted like `-n -5') +* nice now interprets `-1 -1' like `-1' not like `-11' +* `stty speed' and `stty size' no longer output a spurious newline +User visible changes in release 1.10 +* change package name from shellutils to sh-utils +* add hostname, pwd, and users commands +* --version outputs the name of the utility as well as the package name + and version number. +* Configure properly determines options for stty on SCO ODT 3.0 systems. +* `date -d' works better. Before, `date -d '4apr94'' produced + `Sun Apr 3 23:00:00 CDT 1994'. +User visible changes in release 1.9.4 +* Repair stty option handling. +User visible changes in release 1.9.3 +* `stty -a -g' gets a diagnostic +* `stty {-a|-g} any-other-argument' gets a diagnostic +* stty no longer ignores some of its arguments +* basename and dirname no longer treat `--' specially +* `basename -- file.c .c' generates a usage error. Before, it output `file'. +* `basename file-dist -dist' outputs `file'. Before it output `file-dist'. +* stty defaults `swtch' to undefined for Solaris so `susp' (^Z) will work. + Before, with the default settings ^Z did nothing. +* stty no longer gives an error message when it finds a spurious difference + (due to buggy tcgetattr/tcsetattr) between requested and current tty + modes under SunOS 4.1.x. +* stty no longer fails if the ioctl to determine the display width fails + when displaying settings. +* stty works around SunOS 4.x kernel bug that made `stty rows 0 cols 0' fail. +* who and tee no longer fail gratuitously when continued after an + interrupted read or write system call. +* date accepts new format: %s time in seconds since 1970-01-01 00:00:00 UCT +* date -d can parse dates like `11-JUL-1991' +* expr '' == 0 works (before, it printed 1) +* stty no longer fails on telnet sessions to Solaris systems +* `cd /etc; who utmp' now works. Before, any filename argument had to be + absolute or relative to /dev. + +User visible changes in release 1.9.2: +* who output is better formatted on Solaris and other SysVr4 systems +* fix a minor problem in formatting the output from `stty -a' +* yes with arguments outputs newlines again +* partial stty failures are reported + +Major changes in release 1.9.1: +* stty can be built on Suns again +* minor fix for who -q + +Major changes in release 1.9: +* su fails gracefully when getpass is unable to open /dev/tty. +* printenv and tty detect and report write errors +* fix bug in stty +* stty accepts the new options status and flush on systems that provide them +* `expr 1 / 0' gives an error message rather than trying to divide by zero +* expr's `substr' doesn't overrun malloc'd buffer +* expr recognizes the string `0' as zero +* better support for Linux, Dec Alpha, and SGI Irix +* all programs (even true and false) accept --version and --help options +* uname's --version option is no longer equivalent to its -v option +* configure uses config.h, so DEFS won't exceed preprocessor limits of + some compilers on the number of symbols defined via -D. +* work around problem where $(srcdir)/config.h was used instead of + ../config.h -- this happened only when building in a subdirectory + and when config.h remained in $(srcdir) from a previous ./configure. +* make may be run from the subdirectories + +Major changes in release 1.8: +* add echo command +* fix some incorrect warnings in pathchk +* look at the right utmp file on 386BSD +* date doesn't dump core on some systems now + +Major changes in release 1.7: +* add su, who, true, false commands +* add more tests to expr +* fix printf program handling of \ escapes +* printf can re-use format string for multiple groups of arguments +* printf catches numeric conversion errors with an ANSI C library +* stty nl and -nl were backwards +* date can format an arbitrary date without setting it diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/ChangeLog new file mode 100644 index 0000000..12ceb73 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/ChangeLog @@ -0,0 +1,8738 @@ +2002-07-29 Jim Meyering + + * Version 2.1. + + * src/tail.c: Adjust command examples in comments to use + POSIX 1003.1-2001 option syntax. + * src/sort.c: Likewise. + From Paul Eggert. + +2002-07-28 Jim Meyering + + * configure.ac: Require automake-1.6b. + +2002-07-20 Jim Meyering + + * Version 2.0.22. + + * Upgrade to cvs automake -- required to work with 2.53b. + * configure.ac: Require automake-1.6a. + + * Upgrade to gettext-0.11.3. + * Upgrade to autoconf-2.53b. + +2002-07-02 Jim Meyering + + * src/cat.c, src/cksum.c, src/comm.c, src/csplit.c, src/cut.c (usage): + Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it. + * src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/join.c: Likewise. + * src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c: Likewise. + * src/sort.c, src/split.c, src/sum.c, src/tac.c, src/tail.c: Likewise. + * src/tr.c, src/tsort.c, src/unexpand.c, src/uniq.c, src/wc.c: Likewise. + +2002-06-22 Jim Meyering + + * configure.ac: Invoke AC_GNU_SOURCE very early. + +2002-06-15 Jim Meyering + + * src/cksum.c: Include before system.h. + +2002-05-22 Jim Meyering + + * src/od.c [struct dummy]: Renamed. Don't rely on portability of + zero-length arrays. Instead, use sizes of -1 or +1. + Reported by Eric Backus. + +2002-05-14 Jim Meyering + + `od -t f8' didn't work. + This bug was introduced with my change of 2000-10-22 (textutils-2.0.8). + * src/od.c (ulonglong_t): Move declaration to precede new use. + [enum size_spec] (N_SIZE_SPECS): New member. + (width_bytes): Add initializer corresponding to ulonglong_t type. + (struct assert_width_bytes_matches_size_spec_decl): Declare. + Based on a patch from Tony Kocurko. + +2002-04-29 Paul Eggert + + Use ENABLE_NLS only for gettext-related stuff, not also for + setlocale-related stuff. From a patch suggested by Bruno + Haible. + + Since setlocale is now almost universal, this patch also + removes some of the optimizations that clutter up the code and + which don't help all that much even on hosts that lack + setlocale. + + * lib/hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1. + * m4/prereq.m4 (jm_PREREQ_HARD_LOCALE): Check for stdlib.h. + Do not check for alloca.h (no longer used) or stdbool.h (was never + used?). Add AM_C_PROTOTYPES since hard-locale.h uses it. + + * src/sys2.h (HAVE_SETLOCALE): Define to 0 if not defined. + * src/comm.c (compare_files): Replace #ifdef ENABLE_NLS + with if (HAVE_SETLOCALE). + * src/join.c (keycmp): Likewise. + * src/sort.c (keycompare, compare): Likewise. + + * src/comm.c (hard_LC_COLLATE): Define even if ! ENABLE_NLS. + * src/join.c (hard_LC_COLLATE): Likewise. + * src/sort.c (hard_LC_COLLATE): Likewise. + + * src/comm.c (main): Always initialize hard_LC_COLLATE. + Put initialization next to other locale-related stuff. + * src/join.c (main): Likewise. + * src/sort.c (main): Likewise. + + * src/sort.c: Include even if ! ENABLE_NLS. + (decimal_point, th_sep): Depend on HAVE_SETLOCALE, not ENABLE_NLS. + (main): Likewise. + (MONTHTAB_CONST): Remove; all uses removed. + (struct_month_cmp, inittables): Do not depend on ENABLE_NLS. + (main): hard_LC_TIME locale does not depend on ENABLE_NLS. + +2002-04-29 Jim Meyering + + * src/tail.c (parse_obsolescent_option): Do not limit the maximum + line/byte count (when specified via obsolete option syntax) to be + less than ULONG_MAX on systems where OFF_T_MAX is larger. + +2002-04-28 Paul Eggert + + * src/tail.c (tail_forever): Do not treat + max_n_unchanged_stats_between_opens specially (as if it were + infinite) if it has its maximal value. Similarly for + max_n_consecutive_size_changes_between_opens. + +2002-04-28 Jim Meyering + + Avoid new warnings from gcc. + * src/pr.c [struct COLUMN] : Declare member to be const. + (init_fps): Declare local variable `firstname' to be const. + +2002-04-25 Jim Meyering + + * src/wc.c (usage): Adjust ordering to match that of default output. + Suggestion from Gaute Hvoslef Kvalnes. + + * configure.ac (AM_GNU_GETTEXT): Add external arg. + (AC_CONFIG_FILES): Remove intl/Makefile. + * Makefile.am (SUBDIRS): Remove intl. + * src/Makefile.am (INCLUDES): Remove -I../intl. + +2002-04-15 Jim Meyering + + * src/tr.c (usage): Give a verbose description of --squeeze-repeats, + including the mention of SET1. Reported by Dan Jacobson. + +2002-04-12 Jim Meyering + + * src/Makefile.am (LDADD): List ../lib/libfetish.a both before + and after @LIBINTL@. Thanks to Paul Eggert for the fix and to + Bruno Haible for diagnosing the problem. + +2002-03-16 Jim Meyering + + * src/Makefile.am (datadir): Don't override $(datadir) + which might be set by --datadir and different from $(prefix)/share. + Patch from Albert Chin-A-Young. + +2002-03-10 Jim Meyering + + * configure.ac (AM_INIT_AUTOMAKE): Specify the required version + of automake (1.6), and options (gnits dist-bzip2), rather than... + * Makefile.am (AUTOMAKE_OPTIONS): ...here. Remove definition. + +2002-03-09 Jim Meyering + + * Makefile.am (EXTRA_DIST): Remove config/config.rpath, + now that automake knows about it. + +2002-03-05 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add config/config.rpath. + +2002-02-23 Paul Eggert + + * src/cat.c (simple_cat, cat, main): Use char * rather than + unsigned char *, to avoid some technical violations of the C + standard, and to avoid the need for casts. I guess the + unsigned char * was probably there for improved performance + with ancient compilers, but the code wasn't using the + unsignedness any more. + Reported by Nelson H. F. Beebe. + + (cat): int -> size_t for full_write arg. This doesn't + fix any bugs since the buffer size is small, but it makes + the code a bit clearer. + +2002-02-18 Jim Meyering + + * Version 2.0.21. + + * tests/tail/Test.pm: For tests matching /^(obs|err-[134])/, + put _POSIX2_VERSION=199209 in the environment, so the tests succeed + even when the environment would have contained _POSIX2_VERSION=200112. + * tests/uniq/Test.pm (test_vector): Rename tests of obsolete usage + to have prefix of `obs'. Adjust environment for those tests as above. + + * tests/mk-script: When getting input via a pipe, apply the + environment settings to the command in question, not to `cat'. + No longer allow more than one element in the $Test::env or + $Test::env_default arrays. No caller used that feature. + +2002-02-17 Jim Meyering + + * tests/head/Test.pm: Accept pre-POSIX 1003.1-2001 options. + * tests/pr/Test.pm: Likewise. + * tests/sort/Test.pm: Likewise. + + * Makefile.cfg (wget_files): Reflect new location of these files. + +2002-02-16 Jim Meyering + + * ABOUT-NLS, intl/*: Update to Gettext 0.11. + * INSTALL: Update to Autoconf 2.52h. + + * src/Makefile.am (datadir): Use `share' in place of @DATADIRNAME@, + per Gettext-0.11. + (LDADD): Use @LIBINTL@ instead of @INTLLIBS@, per Gettext-0.11. + + * configure.ac (AC_CONFIG_AUX_DIR): New macro invocation. + (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11. + + * config: New subdirectory, containing the following files from .: + config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs. + Move the following files here from doc: texinfo.tex, mdate-sh. + +2002-02-15 Paul Eggert + + Add support for _POSIX2_VERSION, which lets you pick which POSIX + version you want the utilities to conform to. Remove warnings about + failure to conform to a future POSIX version. + + * NEWS, doc/coreutils.texi: Document _POSIX2_VERSION. + * doc/coreutils.texi (Standards Conformance): New section. + + * src/expand.c: Include posixver.h. + (usage): Document only the intersection of the old and new behaviors, + to encourage portability. + * src/fold.c: Likewise. + * src/head.c: Likewise. + * src/od.c: Likewise. + * src/pr.c: Likewise. + * src/sort.c: Likewise. + * src/split.c: Likewise. + * src/uniq.c: Likewise. + * src/tail.c: Likewise. + * src/unexpand.c: Likewise. + + * src/expand.c (shortopts): Remove; no longer needed. + * src/od.c (short_options): Likewise. + * src/pr.c (short_options): Likewise. + * src/sort.c (short_options): Likewise. + * src/split.c (shortopts): Likewise. + * src/uniq.c (shortopts): Likewise. + * src/unexpand.c (shortopts): Likewise. + + * src/od.c (COMMON_SHORT_OPTIONS): New macro. + * src/pr.c (COMMON_SHORT_OPTIONS): Likewise. + * src/sort.c (COMMON_SHORT_OPTIONS): Likewise. + + * src/expand.c (main): Revert to previous behavior, except report + an error and exit if the obsolete syntax is used and if conforming + to the new standard. + * src/fold.c (main): Likewise. + * src/head.c (main): Likewise. + * src/split.c (main): Likewise. + * src/uniq.c (main): Likewise. + * src/tail.c (main, parse_obsolescent_option): Likewise. + * src/unexpand.c (main): Likewise. + + * src/od.c (STRINGS_OPTION, WIDTH_OPTION): Remove; no longer needed. + All uses changed back to the corresponding short options. + * src/pr.c (SEP_STRING_OPTION): Likewise. + + * src/od.c (main): Parse options using POSIX 1003.1-2001 rules if + conforming to that standard. Do not warn of obsolete options. + * src/pr.c (main): Likewise. + * src/sort.c (main): Likewise. + + * src/system.h (_POSIX2_VERSION, POSIX2_VERSION): Remove definitions. + (OPTARG_POSIX, OBSOLETE_OPTION_WARNINGS): Likewise. + +2002-02-16 Jim Meyering + + * tests/misc/split-a: New test for change of 2002-02-05. + * tests/misc/Makefile.am (TESTS): Add split-a. + +2002-02-12 Jim Meyering + + * src/split.c (DEFAULT_SUFFIX_LENGTH): Define constant. + (suffix_length): Use it here. + (usage): Use it here. + +2002-02-05 Paul Eggert + + Change 'split' to conform to POSIX. It now accepts an -a or + --suffix-length option, and refuses to generate more files + than there are suffixes. + + * NEWS, doc/coreutils.texi: Document this. + * src/split.c: Include "dirname.h". + (outbase): Now a global var. + (outfile_end): Remove. + (suffix_length): New var. + (shortopts, longopts, main): Add -a or --suffix-length. + (next_file_name): Implement -a. Do not extend the suffix length. + Check for file names that are too long. + (main): Move outfile initialization to next_file_name. + + * src/split.c (shortopts): Remove -v (a typo). + +2002-02-11 Jim Meyering + + * tests/misc/head-pos: New file/test for the change of 2002-02-08. + * tests/misc/Makefile.am (TESTS): Add head-pos. + + * src/tr.c (unquote): Make comment a little clearer. + +2002-02-08 Paul Eggert + + * src/head.c (head_lines): If we have read too much data, try + to seek back to the position we would have gotten to had we + been reading one byte at a time. POSIX currently doesn't + require this, but it's easy to do and some software relies on it. + +2002-02-02 Jim Meyering + + * src/uniq.c (main): Prepend `warning: ' to the diagnostic, so it's + consistent with all of the other `... is obsolete...' diagnostics. + +2002-01-31 Paul Eggert + + Add more support for POSIX 1003.1-2001, which requires removal for + support of obsolete "-N" option syntax in expand, head, fold, + split, tail, unexpand, uniq, and which prohibits options with + optional arguments in od and pr. + + * NEWS: Document this. + * doc/coreutils.texi: Likewise. + * src/expand.c (usage): Likewise. + * src/fold.c (usage): Likewise. + * src/head.c (usage): Likewise. + * src/od.c (usage): Likewise. + * src/pr.c (usage): Likewise. + * src/split.c (usage): Likewise. + * src/unexpand.c (usage): Likewise. + * src/uniq.c (usage): Likewise. + + * NEWS: Improve doc for previous fix in this area. + + * src/expand.c (shortopts): New constant. + * src/od.c (short_options): Likewise. + * src/pr.c (short_options): Likewise. + * src/sort.c (short_options): Likewise. + * src/split.c (shortopts): Likewise. + * src/unexpand.c (shortopts): Likewise. + * src/uniq.c (shortopts): Likewise. + + * src/expand.c (main): Check for obsolete options. + * src/fold.c (main): Likewise. + * src/head.c (main): Likewise. + * src/od.c (main): Likewise. + * src/pr.c (main): Likewise. + * src/sort.c (main): Likewise. + * src/split.c (main): Likewise. + * src/tail.c (parse_obsolescent_option, main): Likewise. + * src/unexpand.c (main): Likewise. + * src/uniq.c (main): Likewise. + + * src/head.c (header_mode_option): New constant. + + * src/od.c: New enum for long options. + + * src/pr.c (SEP_STRING_OPTION): New enum value. + (long_options): Use it. + + * src/split.c (main): Use -1, not EOF, for getopt_long. + + * src/system.h (OPTARG_POSIX, OBSOLETE_OPTION_WARNINGS): New macros. + + * src/fold.c (main): Fix bug: -- -N was treated as -N --. + +2002-02-01 Jim Meyering + + * src/tail.c (start_lines): Handle the case in which bytes_read is zero. + +2002-01-28 Jim Meyering + + * Makefile.maint (ac-check): Remove, now that we no longer have + to duplicate that information. + (local-check): Remove ac-check. + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5d. + + * configure.ac (AM_INIT_AUTOMAKE): Use zero-arg form of this macro. + (ALL_LINGUAS): Add the bokmÃ¥l dialect of Norwegian (nb). + +2002-01-27 Jim Meyering + + tail -n +2 would perform an extra read after encountering EOF + * src/tail.c (start_lines): Detect EOF, inform caller. + (tail_lines): Upon EOF in start_lines, return immediately. + +2002-01-22 Jim Meyering + + * Version 2.0.20. + +2002-01-22 Paul Eggert + + * src/od.c (skip): Remove redundant check for overflow. + fseeko's seek argument is already known to be in range, + since it is less than the file size. + +2002-01-22 Jim Meyering + + * po/POTFILES.in: Add lib/xmemcoll.c. + +2002-01-22 Paul Eggert + + * src/tac.c (save_stdin): Report proper errno value after + fwrite failures. Do not bother to rewind the temp file, as + it'll be read backwards anyway. + +2002-01-22 Paul Eggert + + * src/ptx.c (swallow_file_in_memory): Work even if `open' returns 0. + Check for `close' error. + +2002-01-22 Paul Eggert + + Port to glibc 2.2.5, whose mmap stdio positions the underlying + file descriptor at a nonzero offset after an fopen. + + * m4/jm-macros.m4 (jm_MACROS): Require AC_FUNC_FSEEKO. + * src/od.c (skip): Use fseeko rather than lseek. + (Also, check for overflow when converting uintmax_t to off_t.) + * src/sys2.h (EOVERFLOW, fseeko): New macros. + +2001-01-21 Paul Eggert + + * src/comm.c: Include xmemcoll.h, not memcoll.h. + Use xmemcoll instead of memcoll. + * src/join.c: Likewise. + * src/sort.c: Likewise. + + * src/sort.c (die): Do not invoke cleanup; atexit does this now. + (main): Use atexit to invoke cleanup on exit. + Set xmemcoll_exit_failure to SORT_FAILURE. + +2002-01-20 Paul Eggert + + * src/comm.c (compare_files): Don't assume that the difference + between two size_t values can be stored in an int; this doesn't + work, for example, on 64-bit Solaris. + * src/sort.c (CMP_WITH_IGNORE): Likewise. + * src/join.c (keycmp): Likewise. Also, fix the type of two locals + to be size_t instead of int. + +2002-01-20 Paul Eggert + + * src/csplit.c: Don't include "xalloc.h", as system.h already + does that via sys2.h. + * src/sort.c: Likewise. + +2002-01-19 Jim Meyering + + * configure.ac: Remove code that set LIBOBJS in support of ansi2knr. + The latest version of autoconf objected to it, and besides, I don't + care too much about K&R support these days. + +2002-01-18 Jim Meyering + + Fix tr so it no longer gets a failed assertion for [::] or [==]. + + * src/tr.c (xmemdup): Rename from `substr' and rewrite to + take only pointer/length parameters. + (build_spec_list): Update sole caller. + Properly diagnose the invalid specs [::] and [==]. + Pawel Prokop reported that `tr '[::]' x' elicits a failed assertion. + * tests/tr/Test.pm: Add tests for the above fix. + +2002-01-14 Paul Eggert + + * src/sort.c (main): Issue a warning for obsolete usage, unless + POSIXLY_CORRECT. + * src/tail.c (parse_obsolescent_option): Likewise. + * src/uniq.c (main): Likewise. + +2002-01-14 Paul Eggert + + Add support for POSIX 1003.1-2001, which requires removal for + support of obsolete "+" option syntax in sort, tail, and uniq. + + * NEWS: Document this. + + * src/sort.c (usage, main): Implement this. + * src/tail.c (usage, parse_obsolescent_option): Likewise. + * src/uniq.c (usage, main): Likewise. + * src/system.h (_POSIX2_VERSION, POSIX2_VERSION): New macros. + + * src/sys2.h (ISDIGIT, S_ISVTX, S_IXUGO): Comment fix. + +2002-01-14 Jim Meyering + + * tests/misc/sort: New test, for just-fixed bug. + * tests/misc/Makefile.am (TESTS): Add sort. + (TESTS_ENVIRONMENT): Add PROG=$$tst. This is a gross kludge + that depends on the name of an automake-generated local variable. + +2002-01-13 Paul Eggert + + * src/sort.c (mergefps): Fix bug when eliminating empty files. + Bug reported by James Hutt. + +2002-01-13 Jim Meyering + + * tests/help-version: Tweak to work with the programs in diffutils. + +2002-01-09 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Turkish (tr). + +2001-12-18 Paul Eggert + + * src/sort.c (usage, specify_sort_size): Accept 'K' (which is + now preferred, as it connotes 1024) as well as 'k'. + * NEWS: Document this change. + +2001-12-17 Jim Meyering + + * src/uniq.c (usage): Remove stray `)' in --help output. + Reported by Padraig Brady. + + * Makefile.maint (real_dir): Remove unused variable. + (url_dir_list): Don't set define it here, but... + * Makefile.cfg (url_dir_list): ...define it here instead. + (hosts, a_host, b_host): Remove now-unused variables. + (alpha_subdir, a_url_dir, b_url_dir): Remove now-unused variables. + +2001-12-12 Bruno Haible + Paul Eggert + + * src/wc.c (wc): Use ISSPACE and iswspace in addition to hard-coding + the ASCII space character. + +2001-12-08 Jim Meyering + + * Version 2.0.19. + + * Makefile.cfg (wget_files): Remove ansi2knr.c, since it's + no longer available at that location. + +2001-12-03 Jim Meyering + + * src/od.c, src/tail.c, src/tr.c (usage): I will not split translatable + strings in the middle of a sentence. I will not split translatable + strings in the middle of a sentence. I will not split translatable + strings in the middle of a sentence. ... + * src/join.c (usage): Merge lone "\n" into adjacent string. + * src/md5sum.c (usage): Likewise. + * src/paste.c (usage): Likewise. + Reported by Karl Eichwalder. + +2001-12-02 Jim Meyering + + * Makefile.maint (emit-upload-commands): Fix typo: s/distdir/PACKAGE/. + +2001-12-01 Jim Meyering + + * Version 2.0.18. + + * Makefile.maint (po-check): Check for uses of _() not just in .c + files, but also in .h files. + + Ideally, there would be just one translation for all --help + and --version description strings. Before this change, they + differed only in the number of blanks between the option name + and the description. Someday gettext may be smart enough + to merge such strings and to reconstruct the proper spacing at + run time. In the mean time, now there is one string for each, + and those descriptions in the --help output are no longer aligned + with the others. + * src/sys2.h (HELP_OPTION_DESCRIPTION): New macro. + (VERSION_OPTION_DESCRIPTION): New macro. + * src/cat.c, src/cksum.c, src/comm.c, src/csplit.c, src/cut.c: + * src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/join.c: + * src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c, src/ptx.c: + * src/sort.c, src/split.c, src/sum.c, src/sys2.h, src/tac.c: + * src/tail.c, src/tr.c, src/tsort.c, src/unexpand.c, src/uniq.c: + * src/wc.c (usage): Use new macros, HELP_OPTION_DESCRIPTION and + VERSION_OPTION_DESCRIPTION instead of hard-coding --help and + --version descriptions. + * po/POTFILES.in: Add src/sys2.h. + +2001-11-27 Jim Meyering + + * src/system.h (SET_MODE) [O_BINARY]: Call setmode, not set_mode. + From Matthew Smith. + +2001-11-26 Jim Meyering + + * src/cat.c (cat): Don't test whether the full_write return value + (of type size_t) is less than 0. Reported by Nelson H. F. Beebe, + as a warning from Irix 6.5's C compiler. + +2001-11-25 Jim Meyering + + * src/cksum.c (usage): Indent --help and --version strings to + start in the 7th column. + * src/pr.c (usage): Likewise. + +2001-11-23 Jim Meyering + + Factor out some common strings to make translation easier. + + * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fmt.c, fold.c: + * head.c, join.c, md5sum.c, nl.c, od.c, paste.c, pr.c, ptx.c: + * sort.c, split.c, sum.c, tac.c, tail.c, tr.c, tsort.c, unexpand.c: + * uniq.c, wc.c: Split usage strings so that --help and --version + descriptions are alone in their own string. + Likewise for the one that says ``Mandatory arguments to long + options are mandatory for short options too.'' + Suggestion from Karl Eichwalder. + + * src/ptx.c (main): Don't split copyright string in the middle + of a sentence. + +2001-11-22 Jim Meyering + + * Version 2.0.17. + + csplit could get a failed assertion: printf 'a\n\n'|csplit - '/^$/' 2 + * src/csplit.c: No longer include assert.h. + (process_line_count): Remove invalid assertion. The test that caused + the failure has been in the code since before 1992-11-08, but since + 1996 it's been in an assertion. That assertion was disabled by default + until textutils-1.22g (1999-01-10). Reported by Eric Pemente. + + * tests/misc/csplit: New file. Test for the above fix and others. + * tests/misc/Makefile.am (TESTS): Add csplit. + * tests/Makefile.am (EXTRA_DIST): Add lang-default. + +2001-11-19 Jim Meyering + + * src/tail.c (xlseek): New function. + Call it instead of lseek, in most cases, so any failure is reported. + +2001-11-18 Jim Meyering + + * config.sub: Update from master repository. + * config.guess: Likewise. + +2001-11-17 Jim Meyering + + * Makefile.cfg ($(srcdir)/m4/jm-glibc-io.m4): Use $(move_if_change), + not the literal `move-if-change'. + + * src/tail.c (tail_forever): Add a cast. + + Avoid compiler warnings. + * src/fmt.c: Remove `unsigned' attribute from type of global `prefix'. + (copy_rest): Cast to (unsigned char *) before dereferencing. + (get_prefix): Likewise. + + * configure.ac: Replace use of the one-arg form of AC_INIT + with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR. + +2001-11-14 Paul Eggert + + * src/tail.c (file_lines): Remove unnecessary cast. + (tail_lines): Could have called file_lines even though the first + lseek failed. Fix that. + +2001-11-14 Jim Meyering + + * src/tail.c (file_lines): Add a parameter, start_pos. + Work properly even when the read pointer is not at beginning of file. + (tail_lines): Call file_lines for any regular file, as long as lseek + can be used to seek to its end, not just when the initial read pointer + is at beginning of file. + +2001-11-13 Jim Meyering + + * src/tail.c (tail_lines): Move declaration of local `length' + into scope where it's used. + (tail_file): Likewise for local `stats'. + + * tests/tail-2/Makefile.am (TESTS): Add proc-ksyms and start-middle. + * tests/tail-2/start-middle: New test, for the bug fixed on 1995-07-24. + + `tail /proc/ksyms' would segfault on Linux. + * src/tail.c (tail_lines): Use status of lseek (...SEEK_END) call + in deciding whether to call file_lines or pipe_lines. + From Herbert Xu. + * tests/tail-2/proc-ksyms: New test, for the above fix. + +2001-11-11 Jim Meyering + + * src/od.c (struct tspec): Declare function pointer with prototype. + + * src/sum.c (main): Declare function pointer with prototype. + + * src/tsort.c (count_items): Mark parameter as unused. + + * src/sort.c (struct_month_cmp): Guard definition with the same + cpp condition that guards the use. + + * src/tail.c (xwrite): Remove assertion that size_t N >= 0. + + * src/pr.c (struct COLUMN) [print_func]: Declare with a protype. + (struct COLUMN) [char_func]: Declare with a protype. + + * src/od.c (parse_old_offset): Declare to be static. + + * src/join.c (make_blank): Declare to be static. + (prfield): Declare local to be of type size_t, not int. + + Some help strings were very long. Split them so that + they're no longer than the magic length 509 that ISO C89 + compilers are required to support. Sorry, translators :-( + + * src/md5sum.c (usage): Split --help output into smaller pieces. + * src/ptx.c (main, usage): Likewise. + * src/fmt.c (usage): Likewise. + + * src/wc.c (usage): Split --help output into smaller pieces. + Use fputs, not printf. + * src/cat.c (usage): Likewise. + * src/cut.c (usage): Likewise. + * src/csplit.c (usage): Likewise. + * src/expand.c (usage): Likewise. + * src/head.c (usage): Likewise. + * src/join.c (usage): Likewise. + * src/nl.c (usage): Likewise. + * src/od.c (usage): Likewise. + * src/pr.c (usage): Likewise. + * src/sort.c (usage): Likewise. + * src/split.c (usage): Likewise. + * src/tac.c (usage): Likewise. + * src/tr.c (usage): Likewise. + * src/unexpand.c (usage): Likewise. + * src/uniq.c (usage): Likewise. + * src/tail.c (usage): Likewise. + + * src/sys2.h (alloca) [__GNUC__]: Define only if not already defined. + + * src/Makefile.am (sort_LDADD): Reflect spelling change: + s/POW_LIBM/POW_LIB/. + +2001-11-10 Jim Meyering + + * src/nl.c (proc_text): Use `puts' to output a string of spaces, + not printf. This avoids a warning from gcc's -Wformat-security. + +2001-11-09 Jim Meyering + + * configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no + arguments. + +2001-11-05 Jim Meyering + + * src/sort.c (usage): Don't recommend setting LC_COLLATE=C. + That can cause problems (now documented in coreutils.texi). + +2001-11-04 Jim Meyering + + * uniq.c, unexpand.c, tail.c, tac.c, split.c, sort.c, pr.c, paste.c: + * od.c, nl.c, head.c, fold.c, expand.c, cut.c, csplit.c (usage): + Say that ``Mandatory arguments to long options are mandatory for + short options too.'' + + * src/ptx.c (usage): Add one-line description. + +2001-10-28 Jim Meyering + + * tests/sum/sysv: New test for the fix below. + * tests/sum/Makefile.am (TESTS): Add sysv. + +2001-10-27 Paul Eggert + + * src/sum.c: Include human.h. + (ROTATE_RIGHT): Remove; it was slow and the comment was + misleading anyway. + (bsd_sum_file): Avoid unsigned and long when they're not needed. + Compute total input bytes as uintmax_t, not long, so that the + code works even with files whose size does not fit in 'long'. + (sysv_sum_file): Likewise. + (sysv_sum_file): Do not reduce checksum until the end; this is + what System V does. + Reported by Nick Lawes. + +2001-10-27 Jim Meyering + + Give an accurate diagnostic when `head --bytes=30M' fails. + * src/head.c (string_to_integer): Check explicitly for overflow, + and lump everything else together as `invalid'. + +2001-10-04 Jim Meyering + + Rename --all-repeated argument `precede' to `prepend'. + * src/uniq.c (enum delimit_method): s/DM_PRECEDE/DM_PREPEND/ + and change all uses. + (delimit_method_string): s/precede/prepend/ + * tests/uniq/Test.pm: Adjust tests accordingly. + Patches by Padraig Brady. + + * src/uniq.c (usage): Correct typo in description of --all-repeated. + Patch by Padraig Brady. + +2001-09-30 Jim Meyering + + * Version 2.0.16. + + tail -F would segfault + * src/tail.c (parse_options): Add missing `break;' from last change. + +2001-09-28 Jim Meyering + + * configure.ac: Tell automake to use the file name `config.hin' + rather than the two-`.' config.h.in. + +2001-09-26 Jim Meyering + + * man/Makefile.am (common_dep): Define it, so we depend on configure.ac. + + * configure.ac: Renamed from configure.in. + +2001-09-25 Jim Meyering + + * src/Makefile.am (sort_DEPENDENCIES): Remove definition altogether. + It adds nothing to the existing: $(PROGRAMS): ../lib/libfetish.a. + +2001-09-24 Paul Eggert + + * src/Makefile.am (sort_DEPENDENCIES): Depend only on + ../lib/libfetish.a, not on $(LDADD), since the latter may + contain `-lintl'. This resembles yesterday's patch for the + `$(PROGRAMS)' rule. + +2001-09-23 Jim Meyering + + * Version 2.0.15. + + * src/Makefile.am ($(PROGRAMS)): Depend only on ../lib/libfetish.a, + not on $(LDADD), since the former may contain `-lintl'. + + * Makefile.am (SUBDIRS): When using newer gettext (in which + intl/libintl.h is created by rules intl/Makefile) + `intl' must precede `lib'. + +2001-09-22 Jim Meyering + + * ABOUT-NLS: Upgrade to gettext 0.10.40 + * intl: Upgrade entire directory to gettext 0.10.40 + * po/ChangeLog: New file. + + * Makefile.am (DISTCLEANFILES): Remove definition, since intl/libintl.h + is no longer created via configure. + + * tests/od/od-N: New test for the 2001-09-19 fix by Ian Bruce. + * tests/od/Makefile.am: New file. + * tests/od: New directory. + * tests/Makefile.am (SUBDIRS): Add od. + * configure.in (AC_OUTPUT): Add tests/od/Makefile. + +2001-09-19 Paul Eggert + + * src/od.c (MAX_ADDRESS_LENGTH, pseudo_offset, format_address, + n_bytes_to_skip, skip, format_address_none, + format_address_std, format_address_paren, + format_address_label, write_block, parse_old_offset, dump, + dump_strings, main): + Use uintmax_t, not off_t, for file addresses, so that we can + handle multiple large files even if the sum of their sizes + exceeds off_t limits. + + (print_s_char, print_char, print_s_short, print_short, + print_int, print_long, print_long_long, print_float, + print_double, print_long_double, dump_hexl_mode_trailer, + print_named_ascii, print_ascii, decode_one_format): + Use size_t, not off_t, for in-memory byte counts. + + (end_offset): New var. + (dump, dump_strings): Use it. + (main): Set it, but check for overflow while doing so. + + (skip): Report an error if an in-range lseek fails on a + regular file, as something's seriously wrong. Check for + negative regular file sizes (possible with some broken NFS + implementations). + + (parse_old_offset): Now all offsets are valid, so return a + success boolean and take a pointer to an offset as an argument. + All callers changed. + + (dump_strings): Check for overflow when computing end_offset - + string_min. + + (main): Remove OFF_T_MAX checks that are no longer needed. + Don't bother assigning through temporary when there's no size + limit to check. + +2001-09-19 Jim Meyering + + * src/od.c (open_next_file): Use SETVBUF, not setbuf. + (skip): Revert part of last change: use lseek, not fseek. + + When --read-bytes=N (-N N) is used, disable input buffering in + the standard I/O library. Otherwise, od would read more input + than requested. This could have caused problems when reading + from pipes, character devices, or open file descriptors inherited + from a parent process. + + * src/od.c (open_next_file): New function, factored out of... + (skip): Adapt to use open_next_file. + (read_char): Likewise. + (read_block): Likewise. + (main): Likewise. + (dump): Fix an off-by-one error that could have made od fail to + report a read error when reading from a named file (not stdin). + (check_and_close): Account for the fact that in_stream may now be NULL. + (usage): Correct descriptions of -j and -N options. + Patch by Ian Bruce. + +2001-09-16 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.5. + + * man/Makefile.am: Revamp this file, as for fileutils. + + * src/md5sum.c (digest_check): On systems for which setmode actually + does something, arrange to read the file containing checksum strings + in text mode. Based on a patch from Chris Faylor. + * src/system.h (SET_MODE): Define. + +2001-09-12 Jim Meyering + + The command `echo a|./fmt -2147483647' would cause fmt to segfault. + * src/fmt.c (fmt_paragraph): Test for sentinal directly, rather than + doing arithmetic with it's potentially large (INT_MAX) length. + * tests/fmt/basic: Add tests for the above. + + tail: accept new option: -F, equivalent to `--follow=name --retry', + for compatibility with FreeBSD and NetBSD versions of tail. + + * src/tail.c (usage): Describe new option. + (parse_options): Accept it. + Patch by Christian Kurz, via Herbert Xu. + + The command `echo foo|fmt -w N' for N>=32K would cause fmt to segfault. + + * src/fmt.c [struct Word]: Declare members length, space, and + line_length to be of type `int', not short. + (MAXCOST): Define using TYPE_MAXIMUM. + Reported by Herbert Xu. + +2001-08-31 Jim Meyering + + * src/fmt.c (bool): Remove typedef, now that it's in system.h. + (TRUE): Define to `true', not 1. + (FALSE): Define to `false', not 0. + +2001-08-30 Paul Eggert + + * src/cat.c: Include full-write.h. + (full_write): Remove decl; not needed. + * src/split.c: Likewise. + + * src/cat.c (simple_cat, cat): + Don't assume read and write size fits in int. + +2001-08-28 Jim Meyering + + * src/fmt.c (main): Correct the diagnostic for invalid argument to -w. + (main): Diagnose an invalid, old-style width option. + +2001-08-27 Jim Meyering + + * Makefile.maint: Undo last change. Instead, simply remove `N_(', + since the `Copyright ...' line should not be translated. + +2001-08-26 Jim Meyering + + * Makefile.maint (copyright-check): Update to reflect fact that + the copyright year is now defined separately. + +2001-08-08 Charles Randall + + * src/sort.c (mergefps): Do not allocate at least sort_size + bytes for each merge buffer. Instead, allocate at least + sort_size bytes total. + +2001-08-25 Jim Meyering + + * tests/uniq/Test.pm: Re-enable some commented-out tests. + +2001-08-25 Paul Eggert + + * src/uniq.c (main): Fix a typo in the previous patch: missing + a bounds check for examples like `uniq a b c'. + + * uniq.c (main): Fix some more incompatibilities with POSIX.2, + (e.g. `uniq +3 --' did not work) by invoking getopt_long with + leading '-', resembling what was done to 'sort' on 2001-03-20. + Recognize an +N option only if it is an integer in range, and + (if POSIXLY_CORRECT) only if a file name argument has not been seen; + otherwise silently treat it as a file name. + + If the user specifies too many operands, output the first one + in the error message, as a diagnostic aid. + +2001-08-24 Paul Eggert + + * src/uniq.c (main): Don't report an error when given the + valid options `+3 -d'. + +2001-08-24 Paul Eggert + + * src/uniq.c (different): Don't assume that lengths can fit + into size_t. Tune code for the common case where the line + lengths differ: we avoid comparing them entirely in that case. + +2001-08-25 Jim Meyering + + * tests/uniq/Test.pm: Add tests for -s 0 and -w 0. + +2001-08-24 Paul Eggert + + Remove arbitrary restrictions on sizes, fixing a bug reported + by Geoff Whale. + + * src/uniq.c (skip_fields, skip_chars, check_chars): Now size_t, + not int. + (size_opt): New function. Do not arbitrarily reject size zero. + Change the wording of the error message slightly, for convenience. + (find_field): Use size_t, not int, to compute sizes. + (different, main): check_chars==0 is no longer a special case, as + it defaults to SIZE_MAX. + (main): Check for overflow with args like -234234234234234. + Use 'size_opt' to convert optional arguments to sizes. + +2001-08-25 Jim Meyering + + * tests/uniq/Test.pm: Add new test, #54, for the just-fixed bug. + +2001-08-24 Paul Eggert + + * src/uniq.c (find_field): Don't count trailing newline to be + part of the field. This disagrees with POSIX.2, but it's + gotta be a bug in the standard. An interpretations request + has been submitted to PASC. + Reported by Geoff Whale. + +2001-08-18 Jim Meyering + + * Makefile.maint: Merge in changes from autoconf. + + * Makefile.maint ($(v_etc_file)): Define. + (copyright-check): Use the new variable. + (my-distcheck): Depend on local-check so those checks are once + again run by `make distcheck'. + + * src/head.c (head_bytes): Read no more than the specified + number of bytes. Patch by Ian Bruce. + + * tests/misc/head-c: New test for the above. + * tests/misc/Makefile.am: New file. + * tests/misc: New directory. + * tests/Makefile.am (SUBDIRS): Add misc. + * configure.in (AC_OUTPUT): Add tests/misc/Makefile. + +2001-08-14 Jim Meyering + + * src/Makefile.am (INCLUDES): Add -I../lib so sys2.h can include + the new, generated file, unlocked-io.h. + +2001-08-13 Jim Meyering + + * src/cat.c (AUTHORS): Mark string for translation, since it + contains the English word `and'. + * src/comm.c: Likewise + * src/csplit.c: Likewise + * src/cut.c: Likewise + * src/md5sum.c: Likewise + * src/nl.c: Likewise + * src/paste.c: Likewise + * src/pr.c: Likewise + * src/sort.c: Likewise + * src/split.c: Likewise + * src/sum.c: Likewise + * src/tac.c: Likewise + * src/uniq.c: Likewise + * src/wc.c: Likewise + +2001-08-12 Jim Meyering + + * tests/mk-script ($program_name): Define. + (main): Use $program_name, rather than long-inaccurate `build-script'. + (main): Iterate over the sorted keys (rather than `while...each...'), + so this script produces the same output regardless of which version + of perl (e.g., perl5.6) is used. + +2001-08-04 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add Makefile.cfg. + + * man/Makefile.am (EXTRA_DIST): Remove duplicate definition. + +2001-07-08 Jim Meyering + + * src/tail.c (usage): Reformat so help2man generates a properly + indented man page. Patch by Herbert Xu. + +2001-07-04 Jim Meyering + + * Makefile.cfg: New file with package-specific definitions. + * Makefile.am (EXTRA_DIST): Add Makefile.cfg. + +2001-07-01 Jim Meyering + + * src/sort.c (usage): Suggest setting LC_COLLATE=C, rather + than LC_ALL=C. + +2001-06-10 Jim Meyering + + * tests/sort/Test.pm: Add a test based on a report from Herbert Xu. + +2001-05-20 Jim Meyering + + * src/uniq.c: Rename new option values: s/all/precede/ and + s/minimum/separate/. + * tests/uniq/Test.pm: Reflect the above renamings. + +2001-05-12 Bruno Haible + + * src/tail.c (parse_obsolescent_option): Accept a b suffix. + +2001-05-19 Jim Meyering + + msgmerge-0.10.37 complains about some `invalid multibyte sequences.' + * po/el.po: Remove the offending entries. + * po/ko.po: Likewise. + * po/zh.po: Likewise. + +2001-05-19 Jim Meyering + + Support new modes for uniq's --all-repeated option. + The default behavior is unchanged. + + * src/uniq.c: Include argmatch.h. + (usage): Update. + (check_file): Implement it. + (main): Handle new, optional arguments. + * tests/uniq/Test.pm: New tests for the above. + Patch by Padraig Brady. + +2001-05-12 Bruno Haible + + * src/tail.c (parse_obsolescent_option): Use t_count_lines, not + count_lines, in error message. + +2001-05-05 Jim Meyering + + * src/comm.c (usage): Correct description of -3. + Reported by Soeren Sonnenburg. + +2001-04-22 Jim Meyering + + * Version 2.0.14. + + * configure: Regenerate using a patched copy of autoconf-2.49e to + work around a bug in its test for a working memcmp function. + +2001-03-28 Paul Eggert + + * src/cksum.c: Fix bugs when computing length of large files. + Add overflow and write error checks. Use uint_fast32_t, not + unsigned long, to do checksum calculation, as C99 says + uint_fast32_t should be no slower and might be faster. + + Include and "system.h" even if CRCTAB is defined, + so that the code will compile if CRCTAB is defined. + Include "human.h" if CRCTAB is not defined. + (uint_fast32_t): Define if it appears that stdint.h didn't. + (BIT, remainder, main, crctab): Use uint_fast32_t, not unsigned long, + for checksums. + (fill_r, remainder, main): Use ANSI prototypes. + (fill_r, remainder, main): Omit duplicate code. + (main): Use uintmax_t, not unsigned long, for file lengths. + Use size_t, not long, for result of fread. + Check for overflow when computing file lengths. + Check for write error immediately after printing a line, so that + we don't write to stdout indefinitely after an error. + +2001-04-14 Paul Eggert + + * src/sort.c (default_sort_size): Leave a 1/16 margin for RSS. + Suggestion from Solar Designer. + +2001-04-14 Jim Meyering + + * src/wc.c (usage): Tweak --help output: s/line,/newline,/ + +2001-04-13 Jim Meyering + + * src/sort.c (main): Add a comment justifying the use of + `multi-character' rather than `multibyte' in a diagnostic. + From Paul Eggert. + +2001-04-12 Paul Eggert + + * src/sort.c (RLIMIT_AS): Do not define; just use conditional + code, since RLIMIT_RSS is similar (and is not standardized). + (default_sort_size): Don't allocate more than the RSS limit, + if this host has such a limit. + +2001-03-20 Paul Eggert + + * NEWS, doc/textutils.texi: sort now accepts long options and + checks POSIX option syntax. + + * doc/textutils.texi: Document --, -, sort long options, and + sort -o after files. + + * src/sort.c: Include . + (usage, main): Add support for long options, and check option + syntax as POSIX requires, though (as usual for GNU apps) + options can follow file names unless POSIXLY_CORRECT is set. + Many diagnostic revamped. + (long_options): New constant. + (badfieldspec): New arg MSGID. Mark as noreturn. + (parse_field_count): New arg MSGID; if null, just return null on error. + (new_key): Renamed from key_init. All callers changed. Now allocates + the new key. + +2001-03-18 Jim Meyering + + * Version 2.0.13. + + * tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL + to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a + suggestion from Eli Zaretskii. + +2001-03-17 Paul Eggert + + * src/sort.c, src/tail.c, src/uniq.c (usage): + Warn that the +N form will be withdrawn. + * doc/textutils.texi: Likewise. + +2001-03-08 Paul Eggert + + * NEWS, doc/textutils.texi: Document pr changes. + + * src/pr.c: Include mbswidth.h. + (standard_header, header, test_suite): Remove. + (date_format, date_text, file_text, header_width_available): New vars. + (long_options, main, init_header, usage): + Add new -D or --date-format option. + (CHARS_FOR_DATE_AND_PAGE, T_BUF_FMT, T_BUF_SIZE, NO_DATE): Remove. + (init_header): Allow arbitrary width for date format. Change + "Page %5d" to "Page %d", since the code no longer assumes fixed width. + Do not assume that localtime succeeds. + (init_header, print_header, usage): Do not truncate headers. + (init_header, print_header): Defer width calculations until + page is printed, since "Page 100000" is wider than "Page 1". + Count columns, not bytes, in page headers. + Custom headers take up only the center, not the whole header. + (print_header): Use printf rather than fprintf(stdout). + + * po/Makefile.in.in (install-data-yes): Install LC_TIME locale + for all packages, not just for fileutils. + (uninstall): Remove LC_TIME locale too. + + * src/sys2.h (INT_STRLEN_BOUND): New macro. + + * tests/pr/0F, tests/pr/0FF, tests/pr/2-S_f-t_notab, + tests/pr/2-Sf-t_notab, tests/pr/2f-t_notab, + tests/pr/2s_f-t_notab, tests/pr/2s_w60f-t_nota, + tests/pr/2sf-t_notab, tests/pr/2sw60f-t_notab, + tests/pr/2w60f-t_notab, tests/pr/3-0F, tests/pr/3-5l17f-t, + tests/pr/3-FF, tests/pr/3a2l17-FF, tests/pr/3a3f-0F, + tests/pr/3a3l15-t, tests/pr/3a3l8f-t, tests/pr/3b2l17-FF, + tests/pr/3b3f-0F, tests/pr/3b3f-0FF, tests/pr/3b3f-FF, + tests/pr/3b3l15-t, tests/pr/3b3l8f-t, tests/pr/3f-0F, + tests/pr/3f-FF, tests/pr/3l17f-t, tests/pr/3l24-t, + tests/pr/3ml17f-t, tests/pr/3ml24-FF, tests/pr/3ml24-t, + tests/pr/3ml24-t-FF, tests/pr/4-7l24-FF, tests/pr/4l24-FF, + tests/pr/a2l15-FF, tests/pr/a2l17-FF, tests/pr/a3-0F, + tests/pr/a3f-0F, tests/pr/a3f-0FF, tests/pr/a3f-FF, + tests/pr/a3l15-t, tests/pr/a3l17f-lm, tests/pr/a3l8f-t, + tests/pr/b2l15-FF, tests/pr/b2l17-FF, tests/pr/b3-0F, + tests/pr/b3f-0F, tests/pr/b3f-0FF, tests/pr/b3f-FF, + tests/pr/b3l15-t, tests/pr/b3l17f-lm, tests/pr/b3l8f-t, + tests/pr/FF, tests/pr/Ja3l17f-lm, tests/pr/Jb3l17f-lm, + tests/pr/Jml17f-lm-lo, tests/pr/l17f-t, tests/pr/l24-FF, + tests/pr/l24-t, tests/pr/ml17f-0F, tests/pr/ml17f-lm-lo, + tests/pr/ml17f-t, tests/pr/ml17f-t-0F, tests/pr/ml20-FF-t, + tests/pr/ml24-FF, tests/pr/ml24-t, tests/pr/ml24-t-FF, + tests/pr/n+2-5l17f-0FF, tests/pr/n+2l17f-0FF, + tests/pr/n+2l17f-bl, tests/pr/n+3-7l24-FF, + tests/pr/n+3l17f-0FF, tests/pr/n+3l17f-bl, + tests/pr/n+3ml13f-bl-FF, tests/pr/n+3ml17f-bl-tn, + tests/pr/n+3ml17f-tn-bl, tests/pr/n+4-8a2l17-FF, + tests/pr/n+4b2l10f-0FF, tests/pr/n+5-8b3l10f-FF, + tests/pr/n+5a3l6f-0FF, tests/pr/n+6a2l17-FF, + tests/pr/n+6b3l6f-FF, tests/pr/n+7l24-FF, + tests/pr/n+8l20-FF, tests/pr/nJml17f-lmlmlo, + tests/pr/nJml17f-lmlolm, tests/pr/nl17f-bl, + tests/pr/nN1+3l17f-bl, tests/pr/nN15l17f-bl, + tests/pr/nSml13-bl-FF, tests/pr/nSml13-t-t-FF, + tests/pr/nSml13-t-tFFFF, tests/pr/nSml17-bl-FF, + tests/pr/nSml17-t-t-FF, tests/pr/nSml17-t-tFFFF, + tests/pr/o3a3l17f-tn, tests/pr/o3a3Sl17f-tn, + tests/pr/o3a3Snl17f-tn, tests/pr/o3b3l17f-tn, + tests/pr/o3b3Sl17f-tn, tests/pr/o3b3Snl17f-tn, + tests/pr/o3Jml17f-lm-lo, tests/pr/o3ml17f-bl-tn, + tests/pr/o3mSl17f-bl-tn, tests/pr/o3mSnl17fbltn, + tests/pr/Test.pm, tests/pr/W-72l17f-ll, tests/pr/W20l17f-ll, + tests/pr/W26l17f-ll, tests/pr/W27l17f-ll, + tests/pr/W28l17f-ll, tests/pr/W35a3l17f-lm, + tests/pr/W35b3l17f-lm, tests/pr/W35Ja3l17f-lm, + tests/pr/W35Jb3l17f-lm, tests/pr/W35Jml17f-lmlo, + tests/pr/W35ml17f-lm-lo, tests/pr/W72Jl17f-ll, + tests/pr/w72l17f-ll: + Adjust to minor spacing changes in pr headers. + +2001-03-11 Paul Eggert + + * src/sort.c (die): New message arg, to describe failures + better. All callers changed. + +2001-03-11 Paul Eggert + + * src/sort.c: Decrease buffer size when only merging or checking. + (sort_size): Now the user-specified sort size. + (MIN_MERGE_BUFFER_SIZE): New macro. + (MIN_SORT_SIZE): Use it. + (merge_buffer_size): New variable. + (fillbuf): Increase merge_buffer_size if a longer line is encountered. + (checkfp, mergefps): Do not allocate a buffer smaller than + merge_buffer_size. + (sort): Use the default_sort_size if sort_size is zero. + (main): Do not set sort_size to default_sort_size. + +2001-03-06 Paul Eggert + + * src/sort.c (sort): If all the input files are empty, create + an empty output file. + * tests/sort/Test.pm: Test for this. + +2001-03-13 Jim Meyering + + * src/sort.c (merge): Move declarations of local variables into + the inner scope where they're used. + (sort): Likewise. + +2001-03-06 Paul Eggert + + Avoid the need for a copy of the input file when the input and + output overlap, e.g. 'sort F -o F'. With -m, though, a copy + is still needed sometimes. + + * doc/textutils.texi: 'sort F -o F' no longer needs to copy F. + + * src/sort.c: Do not include closeout.h. + (xfopen): Use stdout if *how != 'r'. + (mergefps): Remove FPS arg. + Open all input files, and close all files when done. + If OFP is null, open the output file (but after opening input files). + All callers changed. + (first_same_file): New function. + (sort, merge): Remove arg OFP; we now open the output file as needed. + All callers changed. + (merge): New arg MAX_MERGE. All callers changed. + (sort): For "sort F -o F", close the input before opening the output. + (main): Do not use close_stdout; 'sort' and 'merge' now close stdout. + (This also fixes a close-stdout-twice bug.) + Remove test for overlapping input and output files, as 'sort' no longer + needs to worry about overlap, and 'merge' checks for overlap itself. + Use first_same_file to inform 'merge' about how much to merge at + the top level, to avoid overlap. + +2001-03-12 Jim Meyering + + `fmt --prefix=S' would not work properly for any string S containing + a byte with the high bit set. + * src/fmt.c (prefix): Declare to be of type unsigned char, not `char'. + (get_prefix): Likewise for local, `p'. + Reported by François Pinard. + + Add a test for the above-fixed problem. + * tests/fmt: New directory/files. + * configure.in (AC_OUTPUT): Add tests/fmt/Makefile. + * tests/Makefile.am (SUBDIRS): Add fmt. + +2001-03-05 Andreas Schwab + + * src/tac.c (save_stdin): Use mkstemp to create temporary file. + +2001-03-09 Jim Meyering + + * Makefile.maint (my_distdir): Define new variable, and use this + in place of most old uses of $(distdir). + + * tests/help-version: Ensure that /dev/full is a character device + (using test -c) as well as being writable, before trying to write to it. + Otherwise, the test could mistakenly append a newline to an existing, + regular, writable, /dev/full file. + Suggested by Ulrich Drepper. + +2001-03-08 Jim Meyering + + * tests/sha1sum/sample-vec: Insert the `--text' argument for each test. + Reported by Matthew Smith. + +2001-03-04 Jim Meyering + + * Makefile.maint (my_distdir): Define. + Use it in place of $(distdir) almost everywhere. + + * Version 2.0.12. + + * Makefile.maint (alpha): Use $(PACKAGE)-$(VERSION), not $(distdir), + since the latter now has a `$(top_distdir)/' prefix. + +2001-03-01 Paul Eggert + + * src/sort.c (die): New function. + (create_temp_file, xfopen, xfclose, write_bytes, sort_buffer_size, + fillbuf, main): Use it to regularize error messages. The only change + in behavior is that write_bytes and the final close used to say "write + error" but now give just the output file name, which should be enough. + +2001-03-01 Paul Eggert + + * src/sort.c (xfclose): Add FILE arg, and report the file name + on error. All callers changed. + +2001-03-01 Paul Eggert + + * src/sort.c (main): When fclose (stdin) fails, do not mention + the output file in the error message; mention "-" instead. + +2001-02-28 Paul Eggert + + * src/sort.c (xfopen): Set have_read_stdin to 1 only if file is "-". + Use fopen_safer, not fopen, to avoid subtle bugs when fopen returns + stdin, stdout, or stderr. + (xfclose): stdout is no longer a special case. + (main): Close output file, don't just flush it; there might be + an error on the close. + +2001-02-27 Paul Eggert + + * src/sort.c (initbuf): If the desired size cannot be + allocated, repeatedly halve it until allocation succeeds. + Reported by Solar Designer. + +2001-02-26 Paul Eggert + + * src/sort.c (parse_field_count): Comment fix. + +2001-02-25 Paul Eggert + + * src/sort.c: Tune allocation and comparison of nodes + representing temp files. This improved CPU performance of + 'sort -S 1 *.[ch]' by 17% on my host. + + (struct tempnode): name member now uses struct hack. + (temphead): Now a pointer, not a structure. All uses changed. + (create_temp_file): Allocate node using struct hack. + (zaptemp): Free node using struct hack. Use pointer comparison, not + string comparison. + +2001-02-25 Paul Eggert + + * src/sort.c (eolchar, trim_trailing_blanks): Now static. + +2001-02-25 Paul Eggert + + 'sort' race condition fixes. + + Defend against a DoS attack where someone else creates a + temporary file with the same name as ours. Use mkstemp to do + this, supplying our own mkstemp if the system doesn't have one. + + Also, fix a race condition during cleanup on hosts without + sigaction. + + * src/sort.c (NAME_MAX_IN_DIR): Remove. + (sigprocmask, sigset_t): New macros, defined only on older hosts. + (caught_signals): New var. + (xtmpfopen, tempname): Removed. + (create_temp_file): New function, combining the functions of the old + xtmpfopen and tempname. All callers changed. + Use mkstemp to create the file. + (sighandler): On hosts without sigaction, ignore signals while + cleaning up, instead of letting them interrupt cleanup. + (main): Initialize caught_signals. On hosts with sigaction, block all + caught signals while handling one. Remove duplicate code. + +2001-02-22 Jim Meyering + + * src/sort.c (keycompare): Move declarations of locals, lena and lenb, + into the inner scope where they are used. + +2001-02-19 Jim Meyering + + * src/sort.c (AUTHORS): Add Paul Eggert. + + * src/wc.c (wc): Rename innermost `buf' to avoid shadowing warning. + (wc): Rename local `wc' to avoid shadowing function name. + +2001-02-18 Paul Eggert + + Fix a race condition: freed storage accessed during a signal handler. + + * src/sort.c (struct tempnode.next): Now volatile. + (zaptemp): Free the file name after removing it from the temp list, + not before, because a signal can arrive between the two actions + and cleanup () traverses the list. + +2001-02-18 Paul Eggert + + Check for input size, and do not overallocate memory. + Also check for memory quotas. + + Revamp storage management so that line tables and character data are + taken from the same buffer. Line tables are now in reverse order, + since they grow down while the character data grow up. + + * src/sort.c: + (): Include if HAVE_SYS_RESOURCE_H. + (struct rlimit, getrlimit): Define a replacement if RLIMIT_DATA + is not defined. + (RLIMIT_AS): Define to RLIMIT_DATA if not defined. + (struct lines): Remove. + (struct buffer): New members nlines, line_bytes, eof. + Remove member newline_free; no longer needed, since the code no longer + runs out of line table space. + (SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): Remove. + (sort_size): Renamed from sortalloc; now applies to the sum of the + character data and the line table, not just the character data. + (MIN_SORT_SIZE, INPUT_FILE_SIZE_GUESS): New macros. + (linelength): remove. + (specify_sort_size): Don't worry about the distinction between the + character data and the line table; that is now the caller's + responsibility. + (default_sort_size): Return the value, instead of being executed for + side effect. Return half of available memory, or 1/16 of total memory, + whichever is greater; except do not exceed 1/2 of quota. + (sort_buffer_size): New function. + (initbuf): New arg LINE_BYTES. Ensure that the line array is properly + aligned. Initialize the new set of struct buffer members. + (buffer_linelim): New function. + (fillbuf): Return int, not size_t, since the callers merely care + whether the result is nonzero. New arg FILE so that error messages + can report the file name. Keep track of eof. Initialize the line + table too, taking its memory from the input buffer's memory; this + subsumes the old findlines function and removes the need for worrying + about running out of line table entries. + (checkfp, mergefps, sortlines, merge, sort): Adjust to the new storage + management regime, in particular the fact that line tables are now + filled in by fillbuf and are in reverse order. + (checkfp): Now takes char *, not const char *, since subroutines + require that now. Rewrite to avoid lint and duplicate code. + If line length alloc calculation overflows, + simply allocate enough memory to hold the line. + (mergefps): New arg FILES, used for buffer size calculation and error + messages. Rewrite to avoid lint. Do not loop if savealloc*2 + overflows. + (mergefps, merge): Zap temporary files eagerly rather than lazily; + this is needed because we now pass FILES to mergefps. + (sortlines): Args now point at end of arrays, not at beginnings. + (sort): Do not allocate temporary line array for sortlines; + instead, take the space from the same buffer. + (main): Adjust to sort_size and default_sort_size changes. + +2001-02-18 Jim Meyering + + Rename test input files to avoid conflicts on case-insensitive + file systems. + * tests/pr/2-Sf-t_notab: Rename from 2Sf-t_notab. + * tests/pr/2-S_f-t_notab: Rename from 2S_f-t_notab. + * tests/pr/W-72l17f-ll: Rename from W72l17f-ll. + * tests/pr/Test.pm: Update file names to reflect renamings. + Reported by Matthew Smith. + +2001-01-20 Jim Meyering + + * configure.in: Remove jm_CHECK_ALL_TYPES. + Now it's invoked by jm_MACROS. + +2001-01-17 Jim Meyering + + * src/cksum.c (main): Use PACKAGE, not GNU_PACKAGE. + * src/tsort.c (main): Likewise. + * src/sort.c (main): Likewise. + (usage): Convert each TAB in --help output to a sequence of 8 spaces. + +2001-01-07 Jim Meyering + + * src/tail.c (usage): Split a string that was longer than 2048 bytes. + +2001-01-03 Jim Meyering + + * src/sort.c (main): Remove embedded \n from diagnostic. + +2001-01-02 Jim Meyering + + * src/od.c (ulonglong_t): Define place-holder type to avoid some #if + directives. + (LONGEST_INTEGRAL_TYPE): Remove definition. + (MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of + LONGEST_INTEGRAL_TYPE. + (print_long_long): Compile this function even on systems without + long long support. + (decode_one_format): Remove #if directive. + + * src/od.c (decode_one_format): Guard use of print_long_long with + `#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt. + Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead. + +2000-12-23 Jim Meyering + + * src/sys2.h [HAVE_INTTYPES_H]: Include . + +2000-12-19 Jim Meyering + + * Version 2.0.11. + +2000-12-18 Paul Eggert + + * NEWS, doc/textutils.texi: New "sort" option -S SIZE. + + * src/sys2.h (UINTMAX_MAX): New macro, taken from C99. + + * src/sort.c: Include physmem.h. + (SORTALLOC, mergealloc, LINEALLOC): Remove. + (sortalloc): Default to zero at program startup. + (SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros. + (usage, main): Add support for new -S SIZE option. + (specify_sort_size, default_sort_size): New functions. + (initlines): Do not let alloc exceed limit. + (findlines): Likewise. + (checkfp, mergefps, sort): Use sortalloc to size everything + else, instead of relying on precomputed sizes. + +2000-12-17 Jim Meyering + + * doc/texinfo.tex: Update from master repository. + * config.sub: Likewise. + * config.guess: Likewise. + +2000-12-11 Jim Meyering + + * Version 2.0.10. + +2000-12-07 Jim Meyering + + * src/od.c (address_base): Declare to be static. + +2000-12-06 Paul Eggert + + * src/od.c (address_base, address_pad_len): New var. + (output_address_fmt_string, address_fmt_buffer, address_pad): Remove. + (flag_pseudo_start): Now int, not long int. + (pseudo_offset): Now off_t, not long int. + (n_specs, n_specs_allocated): Now size_t, not unsigned int. + (format_address, format_address_none, format_address_std, + format_address_label): Now accepts an extra char argument (an extra + char to print if nonzero), and prints instead of returning a string. + All callers changed. + (bytes_per_block): Now size_t, not int. + (format_address_none): Do not even print the extra char argument. + This simplifies the callers. + (format_address_std, format_address_label): Print off_t ourself + instead of trying to use autoconfigured format. This is faster and + more portable. + (format_address_paren): New function. + (dump): Remove unnecessary cast. + (expand_address_fmt): Remove. + (main): Use size_t, off_t, etc. instead of builtin types where this is + advisable. Adjust to above changes. Remove unnecessary cast. + +2000-12-03 Jim Meyering + + * src/tail.c (tail_file): Initialize ignore, dev, and ino members, + when tailing forever and the open failed. Otherwise, we could get + uninitialized memory references of those fields in recheck. + * tests/tail-2/Makefile.am (TESTS): Add assert-2. + * tests/tail-2/assert-2: New file. + + * Version 2.0.9. + + Make od print valid addresses for offsets of 2^32 and larger, and + allow byte offset (-j) and byte count (-N) to be 2^32 and larger. + + * src/od.c (MAX_ADDRESS_LENGTH): Don't hard-code as a literal. + Rather, define in terms of the type, off_t. + (string_min): Declare to be of type size_t. + (flag_dump_strings): Declare to be of type int. + (print_s_char): Declare the n_bytes parameter and the local, `i', + to be of type off_t. + (print_char): Likewise. + (print_s_short): Likewise. + (print_short): Likewise. + (print_int): Likewise. + (print_long): Likewise. + (print_long_long): Likewise. + (print_float): Likewise. + (print_double): Likewise. + (print_long_double): Likewise. + (dump_hexl_mode_trailer): Likewise. + (print_named_ascii): Likewise. + (print_ascii): Likewise. + (write_block): Likewise. + (print_ascii): Declare local, `print_function' with a prototype. + Change a few `>' comparisons to the equivalent `<' form. + (parse_options): Declare `tmp' to be of type uintmax_t. + Use xstrtoumax, not xstrtoul. + Fail if the specified offset if larger than OFF_T_MAX. + (dump_strings): Declare local `i' to be of type size_t. + Remove the now-unnecessary cast-to-off_t. + (main) [IF_LINT]: Initialize desired_width to avoid a warning. + Declare `tmp' to be of type uintmax_t. + Use xstrtoumax, not xstrtoul. + Fail if minimum string length is larger than SIZE_MAX. + Fail if specified width is larger than ULONG_MAX. + + * src/od.c (format_address): Use off_t, not long unsigned_int as the + parameter type. + (format_address_none): Likewise. Mark parameter as unused. + (format_address_std): Likewise. + (format_address_label): Likewise. + (print_ascii): Mark format string parameter as unused. + (write_block): Use off_t, not long unsigned_int as offset type. + (expand_address_fmt): New function. + (main): Use it to expand each address format string template. + Reported by Mark Nudelman, via Andreas Jaeger. + + * src/sys2.h (OFF_T_MIN): Define here instead. + (OFF_T_MAX): Likewise. + (CHAR_BIT): Define. + + * src/tail.c (parse_options): Use xstrtoumax to parse the byte and line + offset. Give a better diagnostic when the requested offset is still + representable but larger than OFF_T_MAX. + (OFF_T_MIN): Remove definition. + (OFF_T_MAX): Likewise. + +2000-12-02 Jim Meyering + + * src/sort.c (checkfp): Rename local `buf' to avoid shadowing previous + declaration. + + * src/sort.c (NONZERO): Define and use it to make the code a tiny + bit more readable. + + * doc/textutils.texi (sort invocation): Clarify how -t works + when a sort key specifies a range of fields. From Karl O. Pinc. + +2000-11-26 Paul Eggert + + * src/od.c (skip): Use lseek instead of worrying about fseeko or fseek. + This should be portable, as we seek before doing any I/O. + (fseeko): Remove; no longer used. + +2000-11-30 Jim Meyering + + * src/sort.c: s/SIZE_T_MAX/SIZE_MAX/. + +2000-11-30 Paul Eggert + + * src/sys2.h: Include if HAVE_STDINT_H. + (SIZE_MAX): Renamed from SIZE_T_MAX, as C99 uses SIZE_MAX. + All uses changed. + +2000-11-30 Jim Meyering + + * src/sort.c: SIZE_MAX is not defined, so s/SIZE_MAX/SIZE_T_MAX/, and... + * src/sys2.h (SIZE_T_MAX): ... define. + +2000-11-29 Paul Eggert + + Port GNU "sort" to hosts where sizes don't fit in "int", + e.g. 64-bit Solaris (sparc). + + * src/sort.c ("human.h", "xstrtol.h"): Include. + (struct line): length member is now size_t, not int. + (struct lines): Likewise for used, alloc, limit members. + (struct buffer): Likewise for used, alloc, left, newline_free members. + (struct keyfield): Likewise for sword, schar, eword, echar members. + (sortalloc, mergealloc, linelength): Now size_t, not int. + + (initbuf, fillbuf, initlines, begfield, limfield, findlines, + numcompare, getmonth, keycompare, compare, checkfp, mergefps, + sortlines, sort): Accept, return, and use size_t for sizes, not int. + + (fillbuf, initlines, findlines, checkfp, sort): Check for overflow + when computing buffer sizes. + + (begfield, limfield): Do not index past end of array. + + (checkfp): Return a boolean, not a line number, as the line + number may not fit in int. All callers changed. Use + uintmax_t for line numbers, not int. + + (sort): Don't allocate tmp until we need it (and know the right size). + + (parse_field_count): New function. + + (main): Use it to check for overflow in field counts. + "outfile" is now a pointer to const. + +2000-11-27 Jim Meyering + + * src/checksum.h: Don't include system.h here. + * src/md5.c: Include config.h, stdio.h, sys/types.h. and system.h here + instead. + * src/sha1sum.c: Likewise. + +2000-11-18 Paul Eggert + + * src/pr.c (main): Do not assume EOF == -1. + Handle the case correctly when digits options immediately precede a + non-option. + +2000-11-18 Jim Meyering + + * doc/textutils.texi: Change GNU to @sc{gnu} in many places. + Update to use the Free Documentation Licence. + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + +2000-11-17 Jim Meyering + + * GNUmakefile (.NOTPARALLEL): New target. Prevent unwanted parallelism. + Suggestion from Ulrich Drepper. + +2000-11-16 John David Anglin + + * tsort.c: Include sys/types.h before system.h. + +2000-11-16 Jim Meyering + + * src/join.c: Declare global `tab' to be of type *unsigned* char, + so join works with 8-bit delimiter characters. + Reported by Antonio Rendas. + * tests/join/Test.pm (8-bit-t): New test for the above fix. + +2000-11-13 Paul Eggert + + * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should + be tested with #ifdef, not with #if. + +2000-11-11 Jim Meyering + + * doc/textutils.texi: More minor rewording and grammar correction. + From Brian Youmans. + +2000-11-06 Paul Eggert + + * src/od.c (skip): st_size is not defined for directories. + +2000-11-03 Jim Meyering + + * tests/sha1sum/sample-vec: New file, with tests derived from + http://csrc.nist.gov/cryptval/shs/sha1-vectors.zip + * tests/sha1sum/Makefile.am (TESTS): Add sample-vec. + +2000-10-30 Jim Meyering + + * configure, config.h.in, Makefile.in, etc.: Regenerate using the + very latest version (in CVS) of autoconf. + + * src/wc.c: Include "system.h" after wctype.h (not before) + to avoid a compilation error on Solaris 5.5.1 systems. + Reported by Vin Shelton. + +2000-10-23 Jim Meyering + + * Makefile.maint: Clean up version-related variables. + + * Version 2.0.8. + + * Makefile.am (EXTRA_DIST): Add .prev-version. + +2000-10-22 Jim Meyering + + * tests/Makefile.am (SUBDIRS): Add sha1sum. + * tests/sha1sum/basic-1: New file. + * configure.in (AC_OUTPUT): Add tests/sha1sum/Makefile. + + * src/Makefile.am (bin_PROGRAMS): Add sha1sum. + (md5sum_SOURCES): Define. + (sha1sum_SOURCES): Define. + (noinst_HEADERS): Add checksum.h. + + * src/md5sum.c: Factor out the differences between MD5 and SHA1, + and parameterize so this code may be used by both md5sum and the new + program, sha1sum. Loosely based on a patch from Scott Miller. + * src/checksum.h: New file. + * src/md5.c: New file that simply defines `algorithm'. + * src/sha1sum.c: Likewise. + + * man/Makefile.am (man_MANS): Add sha1sum.1. + * man/sha1sum.x: New file. + + Support 8-byte integers, assuming they're printable with e.g., %lld. + * src/od.c: Add support for printing data as unsigned + long long integers. + +2000-10-21 Jim Meyering + + The command, `yes ''|./cat -n' would stop printing after INT_MAX lines. + * src/cat.c (cat): Never let `newlines' exceed 3. + +2000-10-21 Jim Meyering + + Prevent a counter buffer overrun when numbering lines and when + processing 100 billion lines (or more) of input. + * src/cat.c (LINE_COUNTER_BUF_LEN): Define to allow numbering as + many as 10^18 - 1 lines (the old limit was 10^11 - 1, and could + be exceeded without too much trouble). Use this symbol rather + than hard-coding the constant everywhere. + (next_line_num): Rather than overrunning for input with more lines, + mark the line number by putting a `>' in the leftmost slot. + Patch by Jan Nieuwenhuizen. + + * src/sort.c (SORT_OUT_OF_ORDER): Define. + (main): Use it instead of hard-coding the `1'. + +2000-10-10 Jim Meyering + + * src/sort.c (main): Use EXIT_SUCCESS rather than 0. + Fail when checking (-c) with more than one file argument, + rather than simply ignoring the extra arguments. + +2000-09-07 Jim Meyering + + * src/cut.c: Remove obsolete comment block. + (usage): Note that when using -f, lines with no delimiters are + also printed. + * doc/textutils.texi (cut invocation): Likewise. + +2000-08-23 Jim Meyering + + * src/md5sum.c: Include unconditionally, to be consistent + with all the other programs in this directory. + * src/tsort.c: Likewise. + +2000-08-19 Jim Meyering + + * src/comm.c (writeline): Correct comments. From Bruno Haible. + +2000-08-11 Paul Eggert + + * doc/textutils.texi: + + Portable shell scripts should specify global options before + key fields. + + Move global LC_CTYPE remark to each sort option that depends + on LC_CTYPE. + + sort -g depends on LC_NUMERIC. + + Add @vindex where it's missing. + + "radix character" -> "decimal-point character", to match Standard C + terminology, which is easier for most people to follow. + + "comm" does not consider trailing newlines to be significant. + +2000-08-10 Paul Eggert + + * doc/textutils.texi: Recommend against the System V syntax + for tr ranges, and don't use it in examples. Use POSIX + classes rather than ranges, for portability. + * src/tr.c (usage): Don't describe System V syntax, as it + doesn't always work. + + * src/sort.c (usage): Describe -d and -i in a locale-independent way. + + * doc/Makefile.am (constants.texi): Use the C locale so that + [A-Z] works as expected. + +2000-08-07 Paul Eggert + + * src/cut.c (cut_fields): Invoke xalloc_die instead of printing + our own message. + (cut_fields): Check for I/O error as well as end-of-file + +2000-08-06 Bruno Haible + + * src/wc.c: Add support for multi-byte locales. + (iswprint, mbrtowc, wcwidth): Provide default definitions. + (total_bytes): New variable. + (print_bytes): New variable. + (longopts): Change abbreviation for --chars from 'c' to 'm'. + (usage): Update. + (write_counts): Add `bytes' argument. + (wc): New variables `bytes', `count_bytes', `count_chars', + `count_complicated'. The old code determines `bytes', not `chars'. + New case for MB_CUR_MAX > 1. A non-printable non-space character does + not increment the line position or start a word. Update `total_bytes'. + (main): Initialize `print_bytes' and `total_bytes' to 0. Accept 'm' + option. Pass `total_bytes' to write_counts. + * doc/textutils.texi (wc invocation): Update accordingly. + +2000-08-06 Bruno Haible + + * src/head.c (head): Call write_header here. + (head_file): ... not here. + + * src/cat.c (closeout_func): Remove variable. + (close_stdout_wrapper): Remove unused function. + (main): Remove assignment to closeout_func. + + * src/fold.c (fold_file): Remove ferror(stdout) check, already done + in close_stdout. + +2000-08-06 Paul Eggert + + * src/sort.c (usage): Warn more succinctly about the effects of + the locale on sort order. + +2000-08-06 Jim Meyering + + * Version 2.0g. + + * src/tail.c (pipe_lines): Declare local `cp' to be const. + +2000-08-04 Greg McGary + + * src/tail.c (pipe_lines): Add variable `nbytes' so we can free + `tmp' immediately after read loop. Don't process an empty file. + [This fixes a buffer-underrun error -- detected thanks to + bounded pointers -jmm] + +2000-08-05 Jim Meyering + + Fix buffer-overrun error. + * src/pr.c (init_header): Allocated buffer was sometimes too small. + Reported by Greg McGary (who found this bug using his + bounded-pointers-enabled gcc). + (init_header): Move declarations of several variables into the + inner scope where they are used. + * tests/pr/Test.pm (narrow-1): New test, for the above. + + * src/csplit.c (MAX): Remove definition (It's in sys2.h). + +2000-08-04 Jim Meyering + + * src/sort.c (main): Rename local `t' to `tmp_dir' to avoid shadowing + a previous local by that name. + (usage): Warn that GNU sort is now locale-aware, and suggest + people put LC_ALL=POSIX in their environment. + + * src/pr.c (store_columns): Remove conjunct that would dereference + an out-of-bounds pointer. Reported by Greg McGary (who found this + bug using his bounded-pointers-enabled gcc). + +2000-08-03 Jim Meyering + + * tests/Makefile.am.in ($(srcdir)/$x-tests): Use -I$(srcdir), not `-I.'. + (Makefile.am): Likewise. Reported by Greg McGary. + +2000-08-01 Jim Meyering + + * doc/textutils.texi (tr invocation): Note that ranges are not portable. + Update examples not to use ranges. + +2000-07-31 Jim Meyering + + * src/cut.c (cut_fields): Use `virtual memory exhausted', + not `Memory exhausted'. + +2000-07-30 Jim Meyering + + * src/help-version: Remove file. Move it to ... + * tests/help-version: ...here + * tests/Makefile.am (TESTS): Set to help-version. + (TESTS_ENVIRONMENT): Define. + (EXTRA_DIST): Add $(TESTS). + * src/Makefile.am (EXTRA_DIST): Remove help-version. + (TESTS): Remove definition. + (TESTS_ENVIRONMENT): Remove definition. + +2000-07-28 Paul Eggert + + sort's -T option can now appear multiple times. + Thanks to Charles Randall for suggesting this idea. + + * doc/textutils.texi, NEWS: Document this. + + * src/sort.c (temp_dir): Remove. + (temp_dirs, temp_dir_count, temp_dir_alloc): New vars. + (process_id): New var. + (usage): Describe new use of -T. + (add_temp_dir): New function. + (tempname): Use new temp_dirs array. + Do not discard information from the process-id or sequence + number, unless we have short file names. + (sighandle): Use process_id instead of getpid. + (main): Initialize process_id. + Add support for the new use of -T. + +2000-07-23 Jim Meyering + + * tests/head/Test.pm: Rename tests (and hence files) to have a short + enough prefix so that they're not truncated on 8+3 file systems. + Reported by Eli Zaretskii. + +2000-07-09 Jim Meyering + + * config.guess: Update from FSF. + * config.sub: Likewise. + +2000-07-02 Jim Meyering + + * Version 2.0f. + +2000-07-01 Jim Meyering + + * src/cut.c: Change type of global, field_1_bufsize, from int to size_t. + +2000-06-29 Jim Meyering + + * src/tr.c (find_bracketed_repeat): Add a cast to suppress a warning. + Reported by Gerhard Poul. + + * src/tail.c (enum): Remove comma from end of enumerator list. + From Gerhard Poul. + +2000-06-25 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Danish (da). + +2000-06-24 Jim Meyering + + * doc/textutils.texi: Lots of minor rewording and grammar correction. + From Brian Youmans. + + * tests/sum/basic-1: New file. + * tests/sum/Makefile.am: New file. + * configure.in (AC_OUTPUT): Add tests/md5sum/Makefile. + * tests/Makefile.am (SUBDIRS): Add sum. + +2000-06-22 Bruno Haible + + * src/sum.c (sysv_sum_file): Avoid overflowing 32-bit accumulator + on files whose bytes sum to 2^32 or larger. The smallest such file + contains 16,843,010 bytes, nearly all of which have the value 0xff. + +2000-06-22 Bruno Haible + + * src/cat.c (main): Correct a comment. + +2000-06-21 Jim Meyering + + * src/cut.c (getstr): Remove private (and out of date) version of + this function. + (cut_fields): Adjust caller to use the just-extended one in ../lib. + Reported by Paul Sauer. + +2000-06-20 Jim Meyering + + * src/uniq.c (main): Fix off-by-argc test, so +N-style options are + recognized once again. Reported by Geoff Keunning. + Fix typo in diagnostic: s/compare/skip/. + +2000-05-27 Jim Meyering + + * src/tail.c: Arrange to call close_stdout upon exit. + Don't close stdout explicitly. + (usage): Add missing backslash at end of line. + (write_header): Remove now-unused COMMENT parameter. + Update all callers. + +2000-05-24 Jim Meyering + + * src/head.c (head_file): Use STDIN_FILENO in place of `0'. + (main): Likewise. + +2000-05-20 Jim Meyering + + * src/cat.c: Arrange to call close_stdout upon exit. + Don't close stdout explicitly. Replace uses of global constant, + output_desc, with uses of STDOUT_FILENO. + + Arrange to call close_stdout upon exit. Don't close stdout explicitly. + * src/cksum.c: Likewise. + * src/comm.c: Likewise. + * src/csplit.c: Likewise. + * src/cut.c: Likewise. + * src/expand.c: Likewise. + * src/fmt.c: Likewise. + * src/fold.c: Likewise. + * src/head.c: Likewise. + * src/join.c: Likewise. + * src/md5sum.c: Likewise. + * src/nl.c: Likewise. + * src/od.c: Likewise. + * src/paste.c: Likewise. + * src/pr.c: Likewise. + * src/ptx.c: Likewise. + * src/sort.c: Likewise. (but set exit status and file name, too) + * src/split.c: Likewise. + * src/sum.c: Likewise. + * src/tac.c: Likewise. + * src/tr.c: Likewise. + * src/tsort.c: Likewise. + * src/unexpand.c: Likewise. + * src/uniq.c: Likewise. + * src/wc.c:: Likewise. + +2000-05-13 Jim Meyering + + * src/help-version: Run each program successfully at least once. + +2000-05-12 Jim Meyering + + * src/head.c (string_to_integer): Restrict base to 10. + Reported by Joseph S. Myers. + * tests/head/Test.pm: Add a few tests for this. + + New option: --first-only + * src/unexpand.c (anonymous enum) [CONVERT_FIRST_ONLY_OPTION]: Define. + (long_options): Add `first-only'. + (main): Handle new option. + +2000-05-11 Jim Meyering + + * tests/unexpand/basic-1: New tests. + +2000-04-17 Bruno Haible + + * src/system.h [__BEOS__]: Ignore O_BINARY and O_TEXT. + +2000-04-16 Jim Meyering + + * src/tail.c: Prepare to remove option: --max-consecutive-size-changes. + Doesn't seem useful. + (usage): Remove description. + * doc/textutils.texi (tail invocation): Remove description. + +2000-04-12 Jim Meyering + + * src/tail.c (usage): Tweak --help output. Suggestions from Karl Berry. + + Move some macros into m4/. + * configure.in (_GNU_SOURCE): Don't define here. + (AC_SYS_LARGEFILE): Don't use here. + (AM_C_PROTOTYPES): Don't use here. + * acconfig.h: Remove now-unused file. + +2000-04-09 Jim Meyering + + * doc/textutils.texi: Include constants.texi. + (tail invocation): Use `@value's instead of referring to the + output of `tail --help' for defaults. + * doc/Makefile.am (constants.texi): New rule. + (EXTRA_DIST): Add constants.texi. + (MAINTAINERCLEANFILES): Add it here, too. + (textutils.dvi, textutils.info): Depend on constants.texi. + + * src/tail.c (usage): Clarify descriptions of the --max-* options. + From Karl Berry. + +2000-04-03 Jim Meyering + + * configure.in (AC_CHECK_HEADERS): Remove langinfo.h. Now it's in m4/. + (AC_CHECK_FUNCS): Remove nl_langinfo. Now it's in m4/. + +2000-03-17 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Slovenian (sl). + +2000-03-12 Jim Meyering + + Merge from fileutils. + * src/system.h "pathmax.h": Include. + : Include if appropriate. + : Likewise. + : Likewise. + : Likewise. + : Likewise. + (major, minor, makedev): Define if needed. + (struct utimbuf): Declare if missing. + (ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE): Define. + + * src/cksum.c (usage): Correct --help output. + Prompted by a report from Gregory Leblanc. + +2000-03-05 Paul Eggert + + * src/sort.c (struct buffer.newline_free): New member. + (initbuf, findlines): Set it. + (fillbuf): Do not double the size of a full buffer to append a newline + unless the buffer is known to be newline free. + +2000-03-05 Jim Meyering + + * Version 2.0e. + +2000-03-04 Jim Meyering + + Don't get failed assertion for `tail -f directory'. + * src/tail.c: Revert most of 1999-10-20 change. Instead, ... + (IS_TAILABLE_FILE_TYPE): Define to produce similar result. + (recheck): Use it here. + (tail_file): Use it here. + Reported by François Pinard. + + Once we encounter a file that is not of IS_TAILABLE_FILE_TYPE, + marke it as such and ignore it forever after. + * src/tail.c (struct File_spec): New member. + (recheck): Initialize new member. + (tail_file): Likewise. + (tail_forever): Skip the file if it's marked as ignorable. + +2000-03-03 Jim Meyering + + * src/sort.c (fillbuf): Move declaration of local, cc, into scope of + `while' loop where it's used. + +2000-03-02 Paul Eggert + + Big performance improvement when sorting many small files, + building on a suggestion by Charles Randall. + + * src/sort.c (fillbuf): Skip memmove if it would be a no-op, + as many memmove implementations are slow in that case. + Don't examine leftover bytes for eolchar, since they may be left + over from a previous file, and we want to read from this file. + + (sort): At end of file, if there is more input and buffer room, + concatenate the next input file. + +2000-02-29 Jim Meyering + + * src/join.c (make_blank): Add an explicit cast to `unsigned char *' + to placate HPUX's C compiler. Reported by Bob Proulx. + +2000-01-30 Jim Meyering + + * Version 2.0d. + + * Makefile.maint (my-distcheck): Depend on po-check, so I'll be warned + about any required changes at `make distcheck' time rather than at + `make alpha' time. + (writable-files): New target. + (my-distcheck): Depend on it. + (alpha): Likewise. + + * po/POTFILES.in: Add these: lib/makepath.c, lib/rpmatch.c, + and lib/same.c + +2000-01-29 Jim Meyering + + * configure.in: Remove lib-check for cposix now that we use + m4/isc-posix.m4. + (jm_LIB_CHECK): Use this even though the library checks aren't + required for this patchage (so all three lib/Makefile.in files + will be the same). + +2000-01-24 Mark Kettenis + + * src/tsort.c (exit_status): New variable. + (loop): New varibale. + (count_items, scan_zeroes): Change return type to int. + (detect_loop): Complete rewrite to correctly implement detection + of loops. Also change return type to int. + (recurse_tree): Stop if ACTION returns non-zero. This involves + changing the return type of this function and ACTION to int. + (walk_tree): Change return type of ACTION to int. + (tsort): Continue sort after a loop has been detected (and + broken). Set exit_status to 1 if a loop was detected. + (main): Use exit_status to determine exit code. + * tests/tsort/basic-1: Change expected output for cycle-1 and + cycle-2 tests. + +2000-01-23 Jim Meyering + + * configure.in (AM_FUNC_STRTOD): Move to m4/. + (AC_SUBST(POW_LIBM)): Likewise. + +2000-01-22 Jim Meyering + + * src/sort.c (keycompare): Use global, hard_LC_COLLATE in place of + local that is sometimes undeclared. + + * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR). + (AC_CHECK_HEADERS): Move these checks into m4/. + + * src/tr.c ("xstrtol.h"): Include. + (Filter): Rename from PFL. + (non_neg_strtol): Remove function. + (find_bracketed_repeat): Use xstrtoul instead of non_neg_strtol. + (squeeze_filter, set_initialize, main): Use size_t and ssize_t in + place of long and int in several decls. + (read_and_delete, read_and_xlate): Likewise, and remove assertion. + * tests/tr/Test.pm (o-rep-1, o-rep-2): New tests. + + * src/cut.c: Correct copying notice to use GPL, per author's request. + * src/paste.c: Likewise. + (AUTHORS): Add djm. + +1999-09-19 Bruno Haible + + * src/tr.c (PFI): Return `long', not `int'. + (PFL): Rename from PFI now that it returns long. + (squeeze_filter): Declare as `long': i, nr, out_len. + +2000-01-17 Paul Eggert + + Tweak sort performance. + + * src/sort.c (hard_LC_CTYPE): Remove. + (keylist): Renamed from keyhead. Now a pointer, not a + mostly-unused struct. All uses changed. + (findlines, keycompare, CMP_WITH_IGNORE, compare, checkfp, mergefps, + sort): Tune and use a more consistent style for reallocation. + (keycompare, main): Don't worry about LC_CTYPE; + it's buggy with multibyte chars anyway. + (compare): Invoke alloca (0) after each call to keycompare, + not just the ones that return nonzero. This avoids a memory + leak on architectures without builtin alloca that occurs + sometimes when a file contains all duplicate lines. + +2000-01-17 Paul Eggert + + * src/csplit.c (interrupt_handler, main): + Don't use SA_INTERRUPT to decide whether to call sigaction, as + POSIX.1 doesn't require SA_INTERRUPT and some systems + (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead; + it's been part of POSIX.1 since day 1 (in 1988). + * src/sort.c (sighandler, main): Likewise. + +2000-01-16 Jim Meyering + + * lib/Makefile.am: Merge with fileutils/lib/Makefile.am. + + * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_STRFTIME, + AC_FUNC_VPRINTF, and AC_FUNC_ALLOCA. Now they're in m4/. + +2000-01-15 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Remove these: memcpy memset stpcpy + strpbrk strtol strtoul. Now that's in m4/. + + unexpand could infloop + * src/unexpand.c (TAB_STOP_SENTINEL): Define. + (unexpand): Use it instead of INT_MAX. + Declare column and pending to be `unsigned'. + Increment pending and column counters only if column is smaller + than TAB_STOP_SENTINEL. + * tests/Makefile.am (SUBDIRS): Add unexpand. + * tests/unexpand/basic-1: New tests for the above-fixed bug. + * configure.in (AC_OUTPUT): Add tests/unexpand/Makefile. + Reported by John Kodis. + +2000-01-12 Paul Eggert + + * src/sort.c (fillbuf): Avoid quadratic behavior with long lines. + Also, stop worrying about ancient memchr bug (misbehavior when + size is zero), since other code doesn't worry either. + +2000-01-11 Jim Meyering + + Sync lib/ directories of sh-utils, and textutils. + + * lib/Makefile.am (libfetish_a_SOURCES): Add getdate.y, posixtm.c, + basename.c, canon-host.c, readutmp.c, stripslash.c, xgetcwd.c, + xgethostname.c. + (noinst_HEADERS): Add getdate.h, group-member.h, posixtm.h, + pathmax.h, readutmp.h + + * lib/Makefile.am: s/tu/fetish/ + * src/Makefile.am: s/libtu/libfetish/ + +2000-01-10 Jim Meyering + + * Version 2.0c. + + * Makefile.maint (announcement): Include URLs for xdelta files. + (alpha): Use scp, not ncftp. + + * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h. + +2000-01-08 Jim Meyering + + * Version 2.0b. + + More nits. + * src/cut.c (OUTPUT_DELIMITER_OPTION): Define this and use it + instead of `CHAR_MAX + n'. + * src/pr.c (PAGES_OPTION, COLUMNS_OPTION): Likewise. + +2000-01-07 Jim Meyering + + * tests/tsort/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix + to exported PATH value (though not strictly necessary, here). + * tests/md5sum/Makefile.am: Likewise. + + Nits. + * lib/memcasecmp.c: Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'. + Capitalize all macro parameters. + (memcasecmp): Ansideclify. + Don't cast away `const'ness of parameters. + * lib/strpbrk.c (strpbrk): Ansideclify. + Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'. + Suggestions from François Pinard. + +2000-01-06 Jim Meyering + + * tests/tail-2/assert: Tell the user just before sleeping for 7 seconds. + + * tests/tail-2/Makefile.am (TESTS): Remove fflush test. It didn't + test the losing behavior, and left a stray tail process to boot. + +2000-01-01 Jim Meyering + + * Version 2.0a. + + * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in. + +1999-12-12 Jim Meyering + + Move 120+ lines of stat.h-related macros from system.h (not shared) + to sys2.h, which is shared between fileutils, sh-utils, textutils. + * src/system.h: Move them from here... + * src/sys2.h: ... to here. + +1999-12-09 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Galician (gl). + +1999-12-06 Jim Meyering + + * tests/tail-2/fflush: New test for latest change. + * tests/tail-2/Makefile.am (TESTS): Add fflush. + +1999-10-26 Marc Boucher + + * src/tail.c (main): Flush stdout before switching to unbuffered mode + and calling tail_forever. Required only on Solaris 5.7 -- on other + systems, using setvbuf to switch to unbufferd mode does the flush. + +1999-11-22 Jim Meyering + + * lib/Makefile.am (DISTCLEANFILES): Put $(BUILT_SOURCES) here rather + than in $(MAINTAINERCLEANFILES). + + * src/tail.c (recheck): Handle a race condition (including + reuse) that would lead to a failed assertion. + Reported by Ken Pizzini. + (tail_forever): Record errno before using it in call to `error' + which might change it. + (tail_file): Likewise. + + New test for the above. + * tests/tail-2/assert: New file. + * tests/tail-2/Makefile.am: New file. + * tests/tail-2: New directory. + * tests/Makefile.am (SUBDIRS): Add tail-2. + * configure.in (AC_OUTPUT): Add tests/tail-2/Makefile. + +1999-11-05 Jim Meyering + + * src/system.h: Use HAVE_STRUCT_STAT_ST_BLKSIZE not HAVE_ST_BLKSIZE. + + * configure.in: Move some type/header/member tests into + m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of + fileutils, textutils, and sh-utils. + +1999-11-04 Paul Eggert + + * src/sort.c (SORTALLOC): New macro. + (sortalloc, mergealloc, LINEALLOC): Use it. + (sortalloc, mergealloc, linelength): Now const. + (sortalloc): Increase from 0.5 to 8 MB. + (mergealloc): Increase from 16 to 256 kB. + (LINEALLOC): Increase from 0.25 to 4 MB. + +1999-11-03 Paul Eggert + + * NEWS, doc/textutils.texi: + Do not consider newline to be part of a line when comparing lines + in `sort' and `comm'. POSIX.2 requires that we consider newline, + but this is a bug in the spec and the bug will likely be fixed. + * src/comm.c (compare_files): Likewise. + * src/sort.c (begfield, limfield, findlines, keycompare, compare): + Likewise. + * tests/sort/Test.pm: Update tests `use-nl' and `11d' to reflect + this change. + + * lib/linebuffer.c (readline): Do not leave room for an extra + byte after the newline; it's no longer needed. + * src/sort.c (sortalloc, mergealloc, fillbuf, checkfp, mergefps): + Likewise. + + * lib/memcoll.c (memcoll): The two arguments cannot be + adjacent any more, so remove the alloca/copy workaround for + that case. + +1999-11-03 Jim Meyering + + Fix so that `tail -fn 2 file' works again. + * src/tail.c (anonymous enum) [LONG_FOLLOW_OPTION]: Define. + (long_options): Use LONG_FOLLOW_OPTION here, instead of 'f'. + (main): Remove the `::' after the `f' in getopt_long string. + Add `case LONG_FOLLOW_OPTION' after `case 'f':'. + Based on a patch from Tim Waugh. + + * src/tail.c (anonymous enum) [RETRY_OPTION]: Define. + [MAX_UNCHANGED_STATS_OPTION]: Likewise. + [MAX_CONSECUTIVE_SIZE_CHANGES_OPTION]: Likewise. + [PID_OPTION]: Likewise. + (long_options): Use *_OPTION instead of CHAR_MAX + N. + (main): Likewise. + +1999-11-02 Jim Meyering + + * man/help2man: Import version 1.018. + * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option. + * man/*.x: Include one-line summary in [NAME] section. + * man/Makefile.summ (cat-summary): Remove now-unused file. + * man/Makefile.am (EXTRA_DIST): Remove Makefile.summ. + * man/Makefile.maint: Include Makefile.summ with leading `-'. + This file is shared by fileutils and sh-utils, both of which still + have the file (albeit nearly empty now). + Suggestion for clean-up from Akim Demaille. + +1999-11-01 Jim Meyering + + * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES). + +1999-10-20 Jim Meyering + + * src/tail.c (recheck): Don't refuse to tail a non-regular, non-pipe. + (tail_file): Likewise. + +1999-10-07 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Japanese (ja). + +1999-10-04 Jim Meyering + + * depcomp: New file, for automake's new dependency support. + * missing: New version, from automake's user-dep-gen-branch. + +1999-09-28 Jim Meyering + + * src/system.h: Update from the system.h from fileutils. + + * lib/error.c (error_at_line): Use strerror portably here, too, + just as was done in error. + +1999-09-02 Jim Meyering + + * src/cut.c: Remove xstrdup declaration. + * src/sort.c: Likewise. + * src/tsort.c: Likewise. + +1999-08-22 Jim Meyering + + * src/tsort.c (detect_loop): There's no loop if k->top is NULL. + Niklas Edmundsson showed how to make tsort segfault. + + * tests/tsort/Makefile.am: Rewrite to use Fetish.pm-based framework. + * tests/tsort/basic-1: New file. + Add a few more tests. + * tests/tsort/Test.pm: Remove. + + * man/help2man: Escape backslashes so tr's manual comes out right. + Reported by Andreas Schwab. + + * src/tsort.c (usage): Correct address for bug reports. + (tsort): Remove trailing `\n' in error format. + + * src/md5sum.c (md5_check): Remove trailing `\n' in error format. + + * src/sys2.h (IF_LINT): Define new macro. + * src/od.c (dump): Use IF_LINT macro instead of #ifdef lint... + (main): Likewise. + * src/paste.c (paste_parallel): Likewise. + * src/pr.c (read_line): Likewise. + * src/sort.c (checkfp): Likewise. + (mergefps): Likewise. + + * src/cksum.c (cksum): Constify a char*. + * src/comm.c (writeline): Likewise. + + * src/uniq.c (check_file): Move declarations of local variables + into the scopes where they're used. + (min): Remove macro definition. + (different): Use MIN, not min. + (SWAP_LINES): New macro. + (check_file): Use it here. + + * src/uniq.c (check_file): Generate each line of output earlier, + when possible. It is possible when using none of these options: + --count, -repeated, --all-repeated, --unique. + Based on a patch from Ian Turner. + +1999-08-15 Jim Meyering + + * src/tail.c (ENOSYS): Define to a bogus value if not already defined. + +1999-08-13 Eli Zaretskii + + * src/tail.c (parse_options): Warn if --pid=PID is used and kill() + returns ENOSYS (e.g. when compiled with DJGPP). + +1999-08-13 Jim Meyering + + * src/tsort.c (usage): Use consistent bug-reporting address. + + * tests/tsort/Test.pm: New file. + * tests/tsort/Makefile.am: New file. + * tests/tsort: New directory. + * tests/Makefile.am (SUBDIRS): Add tsort. + * configure.in (AC_OUTPUT): Add tests/tsort/Makefile. + +1999-08-11 Paul Eggert + + * doc/textutils.texi: Document how to ignore newline during sort. + +1999-08-07 Jim Meyering + + * po/POTFILES.in: Add lots of lib/*.c files. Remove src/system.h. + +1999-08-06 Jim Meyering + + * Version 2.0. + + * src/sort.c: Include file name in `write error' diagnostics. + (write_bytes): Add output_file parameter and use it. Update callers. + (mergefps): Likewise. + (merge): Likewise. + (sort): Likewise. + Reported by John Summerfield. + +1999-08-05 Jim Meyering + + * src/tail.c (Follow_mode): Remove comma at end of enumerator list. + Reported by Kaveh Ghazi. + + * config.sub: Update from autoconf. + * config.guess: Update from autoconf. + +1999-08-04 Jim Meyering + + * Version 1.22q. + + * configure.in: Remove inadequate getline-testing code. md5sum would + segfault on HPUX because of the getline function in their C library. + Use the AM_FUNC_GETLINE test in m4/ instead. + +1999-08-03 Jim Meyering + + * src/tail.c (tail_forever): When following by name and calling recheck + because of exceeding max_n_consecutive_size_changes_between_opens, + `continue' so we don't fall through and (assuming the file finally grew) + get the erroneous `file truncated' message. This was hard to reproduce. + +1999-08-01 Jim Meyering + + * Version 1.22p. + + * configure.in (AM_C_PROTOTYPES): Move test to precede a few + header tests -- merely on principle. + +1999-08-01 Paul Eggert + + * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS. + +1999-07-16 Paul Eggert + + * lib/quotearg.c (quotearg_buffer): + Don't quote spaces if C quoting style. + +1999-07-31 Jim Meyering + + * src/tail.c (tail_forever): Don't call kill if pid is 0. + Detect when `writer_is_dead' also when the writer is some other user. + From Karl Heuer. + + * src/tail.c (parse_options): Warn if --pid=PID is used without -f. + +1999-07-30 Jim Meyering + + * Version 1.22o. + + * src/tail.c: New option: --pid=PID. + Include signal.h for kill prototype. + (pid): New global. + (long_options): Add `pid'. + (usage): Describe it. + (tail_forever): Implement it. + (parse_options): Handle the new option and required arg. + Suggestion and pseudo-code from Karl Heuer. + +1999-07-27 Jim Meyering + + * lib/linebuffer.c: Include now that linebuffer.h uses + size_t. This is required on at least SunOS4. From Kaveh Ghazi. + +1999-07-26 Jim Meyering + + * src/sys2.h (PID_T_MAX): Define. + + * src/tail.c (struct File_spec) [n_stat_calls]: Remove unused member. + +1999-07-25 Jim Meyering + + * src/pr.c (usage): Remove `NEWS'-style paragraph (sorry to have + let that in, translators). + + * Version 1.22n. + +1999-06-01 Volker Borchert + + * tests/Makefile.am: Make envvar-check depend on check-recursive rather + than on `check' so that its tests are performed before any real tests. + +1999-07-20 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS) Remove memmove, now that it's + AC_REPLACE...'d in m4/jm-macros.m4. + + * src/wc.c (posixly_correct): Declare global. + (write_counts): Use it to select printf formats. + (main): Set posixly_correct from the POSIXLY_CORRECT envvar. + From Peter Moulder. + +1999-07-15 Jim Meyering + + * tests/md5sum/Makefile.am: Revert the 1999-02-15 change. + * tests/md5sum/basic-1, newine-1: Add --text for each individual test. + Reported by Eli Zaretskii. + +1999-07-12 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Slovak (sk). + +1999-07-11 Jim Meyering + + * src/tail.c (recheck): Use assert instead of unnecessary close_fd. + Remove a couple of unnecessary FIXME comments. + +1999-07-10 Jim Meyering + + * doc/textutils.texi: Document new tail options. + + * src/tail.c (struct File_spec) [tailable]: Rename from `missing' and + document. Change all uses and locals like was_missing to was_tailable. + Invert expressions as appropriate. + (reopen_inaccessible_files): Rename from allow_missing. + (sleep_interval): Describe. + (--allow-missing): Deprecate. + (--retry): New option, equivalent to --allow-missing. + (usage): Document name vs. descriptor differences. + Refer to manual for descriptions of --max-unchanged-stats=N + and --max-consecutive-size-changes=N. + (valid_file_spec): New function. + (recheck): Assert valid_file_spec. + Remove dead else-if block (suggestion from Eli Zaretskii). + Adjust stmts that set f->tailable -- unlike for `missing', tailable + doesn't depend on errno == ENOENT. + (parse_options): Give a warning if --retry is used when not following + by name. + + * tests/join/Test.pm: New test case (but commented out) for + Paul's 1999-06-01 fix. + +1999-07-09 Jim Meyering + + * configure.in (ALL_LINGUAS): Add Greek (el). + +1999-07-04 Jim Meyering + + * tests/join/Test.pm: New test case for Paul's 1999-06-03 fix. + +1999-07-03 Eli Zaretskii + + * src/tail.c (struct File_spec): New member, errnum. + (recheck): Record the new value of errno in f->errnum. Don't + output an error message unless the new value of errno differs from + the old one. Output a message if previously-inaccessible file + becomes accessible. + (tail_forever): Always recheck files whose fd is negative. If the + file cannot be fstat'ed, record the errno value in f[i].errnum. + (tail_file): If the file cannot be open, record the errno value in + f->errnum. If it can be opened, initialize f->errnum to zero. If + it's a non-regular non-fifo file, initialize f->errnum to -1. + +1999-06-21 Jim Meyering + + * doc/textutils.texi: Use lower case characters in sc{} context. + Reported by Eli Zaretskii. + +1999-06-03 Paul Eggert + + * src/join.c (xfields): Only s separate fields, not s. + +1999-06-01 Paul Eggert + + * lib/linebuffer.c (readline): Leave room for an extra byte + after the newline; comm needs this for memcoll. + +1999-06-01 Paul Eggert + + Add LC_COLLATE support to `join'. + + * doc/textutils.texi: Describe join and LC_COLLATE. + + * src/join.c: Add support for LC_COLLATE locale. + Include hard-locale.h, linebuffer.h, memcoll.h. + (struct line): New member `buf', replacing `beg' and `lim'. + All uses changed. + (hard_LC_COLLATE): New var. + (main): Initialize it. + (get_line): Use readline to read the line, + instead of doing it by hand. + That way, we get a buffer that we can pass to memcoll. + (keycmp): Use memcoll to compare lines if hard_LC_COLLATE is nonzero. + +1999-05-27 Volker Borchert + + * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix. + +1999-05-25 Paul Eggert + + Add LC_COLLATE support to `comm', so that `comm' is compatible + with `sort' in nontrivial locales. + + * doc/textutils.texi: Document locale-specific mode for comm. + + * lib/Makefile.am (libtu_a_SOURCES): Add hard-locale.c, memcoll.c. + (noinst_HEADERS): Add hard-locale.h, memcoll.h. + + * src/comm.c: Include hard-locale.h, memcoll.h. + (hard_LC_COLLATE): New variable. + (compare_files): Use memcoll to compare if hard_LC_COLLATE. + (main): Initialize hard_LC_COLLATE from locale. + + * src/sort.c: Include hard-locale.h, memcoll.h. + (hard_LC_COLLATE, hard_LC_CTYPE, hard_LC_TIME): New variables, + replacing `need_locale'. + (memcoll): Move to lib/memcoll.c. + (keycompare): No need to alloc (0), since our caller now does it. + (compare): alloca (0) before returning. + (my_setlocale): Remove; hard_locale now dows this. + (main): Invoke setlocale, bindtextdomain, and textdomain before + invoking anything that might print an error. + Use hard_locale to determine which locales are hard. + + * lib/hard-locale.c, lib/hard-locale.h, lib/memcoll.c, lib/memcoll.h: + New files. + +1999-05-25 Paul Eggert + + * lib/linebuffer.c (readline): + Append trailing newline to line. + * lib/linebuffer.h + [struct linebuffer] (size): Declare to be of type size_t, not long. + [struct linebuffer] (length): Likewise. + * src/comm.c, (writeline): Lines now contain trailing newline. + * src/uniq.c (find_field, different): Use size_t, not int, for lengths. + (writeline): Lines now contain trailing newline. + (check_file): Use size_t, not int, for lengths. + * src/nl.c (proc_text, check_section, main): More of the same. + + * lib/linebuffer.h (struct linebuffer): Use size_t for sizes. + src/nl.c (header_del_len, body_del_len, footer_del_len, main): + Likewise. + src/uniq.c (find_field, different, check_file): Likewise. + + * lib/linebuffer.c (readline): Silently append trailing + newline if needed. Do not bother setting buffer length to 0 + at EOF, since it's not part of the spec and nobody relies on + it. Do not compute the difference between unrelated pointers. + +1999-05-25 Paul Eggert + + * src/tac.c (memrchr): Ifdef out this unused function. + +1999-05-25 Jim Meyering + + * doc/textutils.texi (Squeezing): Remove misleading square brackets + from SET1 in the one-word-per-line example. + +1999-05-22 Jim Meyering + + * lib/Makefile.am (libtu_a_SOURCES): Remove memchr.c. + From Ulrich Drepper. + + * Version 1.22m. + +1999-05-22 Paul Eggert + + * doc/textutils.texi: Document locale-specific changes to `sort', + as well as the new, POSIX-compliant definition of line comparison, + and -g's more careful treatment of NaNs, infinities and zeros. + + * src/sort.c (general_numcompare): Put exceptional cases + first, not last, to be consistent with -M. + +1999-05-21 Paul Eggert + + * src/sort.c (strtod): Declare if STDC_HEADERS is not defined. + (general_numcompare): Use strtod, not xstrtod. + Do not consider partial conversions to be errors. + Put -infinity at the start, and +infinity at the end; + follow +infinity with NaNs (sorted by bit pattern), + and finally by conversion errors. + +1999-05-21 Jim Meyering + + * tests/sort/Test.pm (11d): Reverse lines in expected output + to reflect latest change. + (use-nl): New test from Paul Eggert. + +1999-05-20 Paul Eggert + + * src/sort.c: Treat the trailing newline as part of the line, + as required by POSIX.2. + + (struct line, findlines, compare, checkfp, mergefps, sort): + A line now includes its trailing newline. + (findlines): Do not replace newline with NUL. + (memcoll, keycompare): Work even if the data to be compared are + adjacent strings; this is possible now that lines contain the + trailing newline. + (fillbuf): Always have an unused byte at the end of the buffer, + since memcoll and keycompare want to modify a byte after the last line. + (sortalloc, mergealloc): Increase by 1, for trailing byte. + +1999-05-20 Jim Meyering + + * tests/sort/Test.pm: Add test case from Paul Eggert. + +1999-05-20 Paul Eggert + + * src/sort.c (keycompare): Ignore any length difference if the + localized comparison says the strings are equal. + + * src/sort.c (memcoll, keycompare, compare): Handle NUL + characters properly when comparing with LC_COLLATE semantics. + (NLS_MEMCMP): Remove. + (memcoll): Renamed from strncoll. + Take separate lengths for each string. + This function is now invoked only when need_locale. + (keycompare): Don't copy strings when ignore and translate + are both NULL. + +1999-05-18 Paul Eggert + + * src/sort.c (MONTHTAB_CONST): Renamed from NLS_CONST; the use + is also changed. Define to const also if !HAVE_NL_LANGINFO. + + (usage): `,' -> `;' (English typo). + +1999-05-17 Eli Zaretskii + + * src/cat.c (main): When stdout is in binary mode, make sure all + input files are also read in binary mode. + +1999-05-16 Jim Meyering + + * Version 1.22l. + +1999-05-11 Paul Eggert + + * src/sort.c: Don't autodetect the locale of numbers and + months, as this conflicts with POSIX.2 and is tricky to boot. + + (FLOATING_COMMA, NLS_STRNCMP, NLS_MAX_GROUPS, + NLS_ONE_CHARACTER_STRING): Remove macros no longer used. + + (nls_grouping, nls_fraction_found, nls_month_found, nos_monthtab, + nls_months_collide, nls_keyhead, us_monthtab): Remove variables no + longer used. + + (struct nls_keyfield): Remove types no longer used. + + (strncoll_s2_readonly, nls_set_fraction, look_for_fraction, + nls_month_is_either_locale, nls_numeric_format): Remove functions no + longer used. + + (monthtab): Now has the role that us_monthtab had, but it's const only + if ENABLE_NLS is not defined. + + (C_DECIMAL_POINT): Renamed from FLOATING_POINT. All uses changed. + (MONTHS_PER_YEAR): Renamed from NLS_NUM_MONTHS. All uses changed. + (struct_month_cmp): Renamed from nls_sort_month_comp. All uses changed. + Use strcmp, not strcoll, since the user doesn't care about collating + here. + + (inittables): Read locale data into monthtab, rather than modifying a + separate month table and futzing with indirection. Do not worry about + colliding months, since we no longer autodetect month locale. + + (fraccompare): Don't set no-longer-used variable nls_fraction_found. + + (getmonth): Use strncmp to compare months, since user doesn't care + about collating here. Fix bug where code incorrectly assumed that + strlen (monthtab[lo].name) == strlen (monthtab[ix].name). + + (keycompare, main): Don't autodetect month locale. + + (compare): Don't use NLS_MEMCP in code that can't be executed if + need_locale is false, as NLS_MEMCP is equivalent to memcmp in that + case. + + (sort, insertkey, main): Don't autodetect numeric locale. + +1999-05-15 Jim Meyering + + * tests/join/Test.pm (trailing-sp): New test for this fix. + * src/join.c (xfields): Don't interpret a trailing blank as a + delimiter when e.g. -t: was specified. From Tim Smithers. + +1999-05-12 Jim Meyering + + * tests/Makefile.am (envvar-check): Renamed from check-local. + (check): Depend on envvar-check so the envvar check is performed + before all other tests. Reported by Volker Borchert. + * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects, + so CDPATH is mentioned in the message. Reported by Volker Borchert. + +1999-05-11 Jim Meyering + + * src/sort.c (usage): Split the --help message into two pieces so that + neither is longer than 2048. For Irix4's cc. Reported by Kaveh Ghazi. + +1999-05-09 Jim Meyering + + * lib/regex.c: Update from libc. + + * Version 1.22k. + + * Makefile.maint (alpha): Put the announcement in + /tmp/announce-$(distdir) + + * tests/sort/Test.pm (neg-nls): New test. + +1999-05-08 Jim Meyering + + * src/system.h (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, + and all the *_MIN and *_MAX symbols): Remove definitions. + * src/sys2.h: Put the definitions here instead (this file is shared + between all three *utils packages, while system.h is not). + +1999-05-06 Paul Eggert + + * src/sort.c (fraccompare, numcompare): Merge the NLS and + non-NLS versions into a single function. + + (decimal_point): Now char, since we no longer convert to unsigned + char. + (th_sep): Now int, since we use a value out of char range to denote + the absence of a thousands separator. + (IS_THOUSANDS_SEP): New macro. + (USE_NEW_FRAC_COMPARE): Remove. + (nls_set_fraction): Arg is now char, not unsigned char. + Set th_sep to CHAR_MAX + 1 if there is no thousands separator. + (numcompare): Don't convert to unsigned char unless necessary. + (main): Turn off decimal points and thousand separators if they + are multibyte characters, as we don't support that yet. + +1999-05-06 Paul Eggert + + * src/system.h (CHAR_MIN, CHAR_MAX): New macros. + (SCHAR_MIN, SCHAR_MAX): Don't assume that char is signed. + +1999-05-06 Paul Eggert + + * src/sort.c (numcompare): Handle comparison of two negative + numbers correctly in the ENABLE_NLS case. + +1999-05-04 Jim Meyering + + * src/pr.c (usage): Break the usage message into 3 pieces instead of + only 2. The strings had grown to be longer than 2048, which evokes + errors when compiling with Irix4's cc. Reported by Kaveh Ghazi. + + * src/tsort.c (search_item): Use `1' instead of `+1'. The latter + elicits a syntax error from SunOS4's cc. From Kaveh Ghazi. + +1999-05-03 Jim Meyering + + * src/ptx.c : Don't include. + [!STDC_HEADERS]: Remove definitions of ctype macros. + Convert e.g., isspace to ISSPACE to use definitions from sys2.h. + Reported by Kaveh Ghazi. + + * src/sys2.h (TOLOWER): Define. + (TOUPPER): Define. + * src/join.c (TOLOWER): Remove definition. + * src/md5sum.c (TOLOWER): Remove definition. + +1999-04-30 Jim Meyering + + * src/sort.c (usage): Document the differences between the + obsolescent, +POS1[-POS2] form, and the POSIX -k option. + +1999-04-24 Jim Meyering + + * configure.in: Use AC_CANONICAL_HOST. + + * lib/Makefile.am (libtu_a_SOURCES): Add xstrtoumax.c + (noinst_HEADERS): Remove xstrtoul.h. + + * src/csplit.c: Include new "xstrtol.h", not "xstrtoul.h". + (struct control) [repeat]: Declare as uintmax_t, not int. + (struct control) [lines_required]: Likewise. + (handle_line_error): Use human_readable to print lines_required. + (parse_repeat_count): Parse a uintmax_t. + (parse_patterns): Parse a uintmax_t. + + * src/tail.c: Include new "xstrtol.h", not "xstrtoul.h". + * src/od.c: Likewise. + + * src/head.c: Include new "xstrtol.h", not "xstrtoul.h". + Change all U_LONG_LONG to uintmax_t. + (head_lines): Move a couple dcls into an inner scope. + (string_to_integer): Rename from string_to_ull. + +1999-04-19 Jim Meyering + + * Makefile.maint (b_host): Remove /pub suffix. + +1999-04-18 Jim Meyering + + * Version 1.22j. + + * Makefile.maint (my-distcheck): Use AMTAR, not TAR. + + * src/sort.c (usage): s/DIRECT/DIRECTORY/g + Rename global: s/temp_file_prefix/temp_dir/. + (NAME_MAX_IN_DIR): Rename from PATH_MAX_IN_DIR. Use _POSIX_NAME_MAX, + not _POSIX_PATH_MAX. Guard with #if HAVE_PATHCONF rather than + #if HAVE_UNISTD_H. + (tempname): Wrap after 99999 only for length-impaired file systems. + +1999-04-17 Jim Meyering + + * src/tail.c (file_lines): Fix serious bug introduced with last changes. + From Andreas Schwab. + +1999-04-15 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Rename .posix-warn to .env-warn. + (check-local): Warn about CDPATH in the same way + we warn about POSIXLY_CORRECT, since the cp/same-file test fails at + least when using bash with CDPATH set. Reported by Mark Hewitt. + + * src/pr.c Add comments. + (init_header): Tweak white space in Date/Time header. + * tests/pr/Test.pm: Updated all tests to reflect the big + 1999-02-13 change. From Roland Huebner. + +1999-04-12 Jim Meyering + + * src/cat.c (main): Declare out_dev to be of type dev_t, not `int'. + Declare out_ino to be of type ino_t, not `int'. + From John Bley. + + * src/od.c (MIN, MAX): Remove definitions. + * src/sys2.h (MIN, MAX): Define here instead. + Reported by John Bley. + +1999-04-11 Jim Meyering + + * Version 1.22i. + + * tests/pr/Test.pm (test_vector): Disable all tests while I wait for + an updated suite. + + Fix the problem whereby `yes > k & sleep 1; tail -2c k' would infloop. + * src/tail.c (COPY_TO_EOF): Define. + (dump_remainder): Add parameter, n_bytes, and rewrite to use it. + Update callers. + (file_lines): Rename parameter. + (tail_bytes): Remove obsolete comment. + + Fix the problem whereby `yes > k & sleep 1; tail -1 k' would infloop. + * src/tail.c (dump_remainder): Move this function to precede the + new use in file_lines. + (tail_lines): Don't call dump_remainder here. + (file_lines): Call dump_remainder here instead. + Reported by Lehti Rami. + + * lib/readtokens.c (readtoken, readtokens): Protoize. + +1999-04-10 Jim Meyering + + * src/tail.c (xwrite): Use STDOUT_FILENO instead of literal `1'. + +1999-04-04 Jim Meyering + + * src/cat.c: Standardize --help and --version processing. + * src/comm.c: Likewise. + * src/csplit.c: Likewise. + * src/cut.c: Likewise. + * src/expand.c: Likewise. + * src/fmt.c: Likewise. + * src/fold.c: Likewise. + * src/head.c: Likewise. + * src/join.c: Likewise. + * src/md5sum.c: Likewise. + * src/nl.c: Likewise. + * src/od.c: Likewise. + * src/paste.c: Likewise. + * src/pr.c: Likewise. + * src/ptx.c: Likewise. + * src/split.c: Likewise. + * src/sum.c: Likewise. + * src/tac.c: Likewise. + * src/tail.c: Likewise. + * src/tr.c: Likewise. + * src/unexpand.c: Likewise. + * src/uniq.c: Likewise. + * src/wc.c: Likewise. + +1999-03-29 Jim Meyering + + * configure.in (GNU_PACKAGE): Remove related code -- now it's in + the catch-all for shared autoconf code, m4/jm-macros.m4. + (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use + this instead. + +1999-03-26 Jim Meyering + + * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c. + (noinst_HEADERS): Add version-etc.h. + +1999-03-25 Jim Meyering + + * src/tail.c (recheck): Factor out a block of duplicated code. + Set f->size to 0 upon encountering a new file so we read it from + the beginning rather than from the end of the first line or + block. Otherwise, after a log rotation, tail would omit the first + line or block of the new file. Reported by Ed Avis. + +1999-03-20 Jim Meyering + + * tests/Makefile.am (SUBDIRS): Temporarily remove pr. + +1999-03-13 Jim Meyering + + * src/tac.c (tac_mem): `#if-0'-out this unused function. + (tac_stdin_to_mem): Likewise. + + * doc/textutils.texi (cut invocation): Describe --output-delimiter. + +1999-03-12 Jim Meyering + + * src/sys2.h (SETVBUF): Define new macro. + * src/tail.c (dump_remainder): Don't fflush stdout here. + (main) [if forever]: Make stdout unbuffered, instead. + Akim Demaille pointed out that when running `echo x>a; tail -f a>>a' , + the file `a' didn't grow longer than two lines. Now it grows + without bound. + +1999-03-07 Jim Meyering + + * tests/md5sum/newline-1: Test for the actual feature. + With help from Eli Zaretskii. + + * src/pr.c (usage): Add missing \n\. + + The newline test would always fail on MSDOS/Windows systems -- + so move it to a separate file where we can test for that. + * tests/md5sum/basic-1: Remove newline test. + * tests/md5sum/newline-1: New file. + * tests/md5sum/Makefile.am (TESTS): Add newline-1. + Pointed out by Eli Zaretskii. + + 1999-02-13 Roland Huebner + * src/pr.c + (main): Redefine options -s, -w to be POSIX compliant; introduce + new options -J, -S, -W to disentangle -s and -w when used together + with the three column options; + (add_line_number): Make POSIX compliant; use default number + separator TAB with single column output. + (add_line_number): Make POSIX compliant; with multicolumn output + now prefer `text columns of equal width' rather than a consequent + use of `default n-separator TAB'. + (add_line_number): Change line number cut-off from lower-oder to + higher-oder digit to avoid loss of information; no consequent + handling exists in different utilities and other UNIXes. + (char_to_clump): Expand input text tabs to 8 spaces, if + input_tab_char doesn't equal TAB (adapted to other UNIXes). + (usage): Update POSIX compliant options -s, -w; add new options -J, + -S, -W. + (main): Update the source internal documentation. + Some smaller BUGFIXES (print_sep_string, init_header, skip_to_page, + reset_status, print_header). + + * tests/md5sum/basic-1 (backslash): Use .\foo instead of \.foo so we + don't tramp on root directory in MSDOS/Windows. + Suggestion from Eli Zaretskii. + + 1999-02-15 Eli Zaretskii + + * tests/md5sum/Makefile.am (TESTS_ENVIRONMENT): Run md5sum with the + --text option (for MSDOS). + +1999-03-06 Jim Meyering + + * src/cut.c (getstr): Change type of `delim' parameter from char to int. + (cut_fields): Cast to `unsigned char' before comparing. + (main): Cast to `unsigned char' before assigning. + From Arne Juul. + * tests/cut/Test.pm: Add a test to exercise the bug. + + * src/ptx.c (swallow_file_in_memory): Use a `%s' format in error call, + in case the argument string contains a `%'. + (main): Likewise. + * src/fmt.c (main): Likewise. + * src/sort.c (main): Likewise. + + 1999-02-13 Eli Zaretskii + + * src/sys2.h [__DJGPP__]: Include and . + + * src/ptx.c (swallow_file_in_memory): Slurp up the whole file at + once on MSDOS as well, but we have to relax the test for whether + reading it succeeded. + +1999-03-03 Jim Meyering + + * src/cat.c: Include long-options.h + [long_options]: Remove the "help" and "version" entries. + Remove declarations of show_help and show_version. + (main): Use parse_long_options, including author name(s). + Remove the show_version and show_help blocks. + * src/cksum.c: Likewise. + * src/comm.c: Likewise. + * src/csplit.c: Likewise. + * src/cut.c: Likewise. + * src/expand.c: Likewise. + * src/fmt.c: Likewise. + * src/fold.c: Likewise. + * src/head.c: Likewise. + * src/nl.c: Likewise. + * src/od.c: Likewise. + * src/paste.c: Likewise. + * src/pr.c: Likewise. + * src/split.c: Likewise. + * src/sum.c: Likewise. + * src/tac.c: Likewise. + * src/tail.c: Likewise. + * src/tr.c: Likewise. + * src/unexpand.c: Likewise. + * src/uniq.c: Likewise. + * src/wc.c: Likewise. + + * src/ptx.c: Include long-options.h + [long_options]: Remove the "help" and "version" entries. + Remove declarations of show_help and show_version. + (main): Remove `const' attribute from dcl of argv parameter. + Call bindtextdomain and textdomain. + Use parse_long_options, including author name(s). + Remove the show_version and show_help blocks. + + * src/join.c (main): Include author name argument in call to + parse_long_options. + * src/md5sum.c (main): Likewise. + * src/sort.c (main): Likewise. + * src/tsort.c (main): Likewise. + +1999-02-07 Jim Meyering + + * Version 1.22h. + + * Makefile.maint (my-distcheck): Don't depend on dist, now that this + is hooked up to the distcheck rule. + * Makefile.am (distcheck-hook): New target and rule -- link to shared + rule, my-distcheck, in Makefile.maint. + +1999-01-31 Jim Meyering + + * doc/textutils.texi: Wrap the @top node in @ifnottex instead of + @ifinfo so `makeinfo --html ...' works. From Karl Berry. + +1999-01-30 Jim Meyering + + * acconfig.h: Remove lots of `#undef's, now that we use the + 3-argument forms of AC_DEFINE* macros. + + * configure.in: Require autoconf 2.13. + Use 3-argument form of AC_DEFINE*. + +1999-01-24 Jim Meyering + + * src/tac.c (DONT_UNLINK_WHILE_OPEN) [__MSDOS__ || _WIN32]: Define. + + * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n' + (and hence that of the local `n1', too) to `int' at Paul's request. + +1999-01-18 Akim Demaille + + * doc/textutils.texi: Harmonization of @samp use for options. + +1999-01-17 Jim Meyering + + * Makefile.am (SUBDIRS): Add djgpp. + * configure.in (AC_OUTPUT): Add djgpp/Makefile. + * djgpp/: New directory. + + * man/Makefile.maint ($(man_MANS)): Don't remove the target (the + man page) until after we've created its replacement. + +1999-01-16 Eli Zaretskii + + * GNUmakefile: Add SHELL = /bin/sh. + * man/GNUmakefile: Likewise. + +1999-01-16 Jim Meyering + + * acconfig.h: Remove @BOTTOM@ section. + Instead, add the define and decl via m4/jm-macros.m4. + + * lib/argmatch.h (XARGMATCH): Define to return a value once again. + (XARGCASEMATCH): Likewise. + + * lib/argmatch.c (EXIT_FAILURE): Define. + (ARGMATCH_DIE): Provide default. + (__xargmatch_internal): New function. + s/rogram_name/program_name. + From Akim Demaille. + +1999-01-14 Jim Meyering + + * tests/md5sum/basic-1: Use `f', not `x' as temp. file name to avoid + warnings from perl5.004. + Reported by Volker Borchert. + + * lib/long-options.c (parse_long_options): Rename `usage' parameter + to avoid shadowing globally scoped function. + +1999-01-14 Akim Demaille + + * acconfig.h: Add a @BOTTOM@ section. + (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1). + Declare usage. + * src/*.c: Don't prototype usage as static. + +1999-01-10 Jim Meyering + + * Version 1.22g. + + All of the following new code is protected by + `#if DONT_UNLINK_WHILE_OPEN' + * src/tac.c (file_to_remove): New global. + (fp_to_close): New global. + (unlink_tempfile): New function. + (record_tempfile): New function. + (save_stdin): Call record_tempfile. + Use SET_BINARY. + (main): Use SET_BINARY and SET_BINARY2. + From Eli Zaretskii. + +1999-01-09 Jim Meyering + + * tests/uniq/Test.pm: Add tests from Jochen Hein. + * src/uniq.c: New option: --all-repeated (-D). + (output_all_repeated) [output_mode]: New enum value. + (usage): Describe it. + (writeline): Test for new mode. + (check_file): Likewise. + Based on patches from Jochen Hein and Florin Iucha. + (main): Diagnose `too many arguments'. + + * tests/head/Test.pm (null-1): Add test from Jochen Hein. + + * src/tail.c (parse_obsolescent_option): Interpret `number' as decimal. + (parse_options): Likewise. + Reported by Kamal Paul Nigam. + + * src/tail.c: New option: --max-unchanged-stats=N. + New option: --max-n-consecutive-size-changes=N. + +1999-01-03 Jim Meyering + + * src/md5sum.c (usage): Remove third program_name argument -- there + were only two `%s' in the format string. + +1999-01-02 Jim Meyering + + * src/tsort.c (tsort): Use a single call to error instead of two + to fprintf. + (main): Remove `%s: ' prefix on format string. + + * src/tail.c (parse_options): Use XARGMATCH in place of argmatch. + + * src/ptx.c (format_vals): New array. + (main): Use XARGMATCH in place of argmatch. + + * lib/argmatch.h (XARGMATCH): Don't return a value; instead, + modify a parameter. Add a `Die_stmt' parameter. + Add parentheses. + * lib/argmatch.c (__xargmatch_internal): Remove now-unused function. + (argmatch_to_argument): Add `const' attribute to first parameter. + +1999-01-01 Jim Meyering + + * src/tsort.c: Move inclusion of assert.h to follow that of stdio.h. + Some losing systems require this. + Use STREQ macro instead of strcmp in a few places. + + * po/POTFILES.in: Add tsort.c. + + * man/Makefile.maint ($(man_MANS)): `exit 1' if any of help2man, + chmod, or mv fails. Otherwise, the failure could go unnoticed. + + * man/Makefile.summ: Add entries for ptx and tsort. + + * src/tsort.c: Include readtokens.h. + (zeros): Rename global from `rr'. + (getstr): Remove function. + (tsort) Use readtoken instead of getstr. + + * lib/readtokens.c: New file. + * lib/readtokens.h: New file. + * lib/Makefile.am (libtu_a_SOURCES): Add readtokens.c. + (noinst_HEADERS): Add readtokens.h. + + * man/Makefile.am (man_MANS): Add ptx.1. + * man/ptx.x: New file. + + * src/tail.c (parse_options): Use XARGMATCH in place of argmatch. + + * man/Makefile.am (man_MANS): Add tsort.1. + * man/tsort.x: New (essentially empty) file. + + * src/tsort.c: Rename globals N and R so they don't shadow locals. + (tsort): Rename from `sort'. + + 1998-11-07 Mark Kettenis + * src/Makefile.am (bin_PROGRAMS): Add tsort. + * src/tsort.c: New program. + + * lib/Makefile.am (libtu_a_SOURCES): Add quotearg.c. + (noinst_HEADERS): Add quotearg.h. + + ============================ + All of the following are from: + 1998-04-17 Eli Zaretskii + + * src/system.h (SET_BINARY, SET_BINARY2, fileno, setmode): New + macros. + + * src/cat.c (usage) [O_BINARY]: Describe -B,--binary option. + (main) [O_BINARY]: binary_files, binary_output, file_open_mode: + new variables. Add --binary to long_options[]. Switch stdin and + stdout to binary mode unless file contents are not important + anyway. Open files in binary mode when required. + + * src/cksum.c (cksum) [O_BINARY]: Read redirected stdin in binary + mode. + + * src/expand.c (expand): Use binary I/O where appropriate. + + * src/head.c (head_bytes, head_lines) [O_BINARY]: Use binary I/O. + + * src/md5sum.c (OPENOPTS) [O_BINARY]: Use binary I/O when non-zero + argument. + (md5_file) [O_BINARY]: Switch redirected stdin to binary mode. + (main) [O_BINARY]: Use binary reads by default on those systems + which care about the difference. + + * src/od.c (skip, read_char, read_block) [O_BINARY]: Switch input + stream to binary mode. + + * src/sort.c (PATH_MAX_IN_DIR) [HAVE_UNISTD_H]: New macro, for max + file name characters in a given directory. + (tempname): Make sure the temp file name is unique even if long + file names aren't supported. + + * src/split.c (cwrite) [O_BINARY]: Write output in binary mode. + (main) [O_BINARY]: Read input in binary mode. + + * src/sum.c (bsd_sum_file, sysv_sum_file) [O_BINARY]: Read input + in binary mode. + + * src/tac.c (record_tempfile, unlink_tempfile) + [DONT_UNLINK_WHILE_OPEN]: New functions, for systems where a file + cannot be removed before it is closed. + (save_stdin) [DONT_UNLINK_WHILE_OPEN]: Record the temporary file, + to be removed before exit. + (tac_file, save_stdin, main): Use binary I/O when appropriate. + + * src/tail.c (tail_lines, tail_bytes) [O_BINARY]: Use binary I/O + when appropriate. + + * src/tr.c (main) [O_BINARY]: Use binary I/O when appropriate. + + * src/unexpand.c (unexpand): Use binary I/O where appropriate. + + * src/wc.c (wc): Use binary mode for input. + + * doc/textutil.texi: Add comments about peculiarities of Textutils + operation on MS-DOS/MS-Windows. + +1998-12-22 Jim Meyering + + * configure.in (ALL_LINGUAS): Add chinese (zh). + +1998-12-17 Jim Meyering + + New options for tail: + --follow=name, --follow=descriptor, --allow-missing + * src/tail.c (Follow_mode): New enum. + (n_live_files): New function. + (tail_forever): Avoid starvation with --follow=name and a + continually-growing unlinked or renamed file. + +1998-12-13 Jim Meyering + + * tests/uniq/Test.pm: New file. + * tests/uniq/Makefile.am: New file. + * tests/uniq: New directory. + * tests/Makefile.am (SUBDIRS): Add uniq. + * configure.in (AC_OUTPUT): Add tests/uniq/Makefile. + From Jochen Hein. + + * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in. + (stat.c): Likewise. + (EXTRA_DIST): Add xstat.in. + * lib/stat.c: Remove file. + * lib/lstat.c: Remove file. + * lib/xstat.in (xstat@): New file. + + * configure.in (ALL_LINGUAS): Add Russian (ru). + +1998-10-31 Jim Meyering + + * acconfig.h (stat): New #undef. + +1998-10-22 Jim Meyering + + * src/fold.c (usage): Add mention of --version and --help. + Reported by Matej Vela . + +1998-10-04 Jim Meyering + + * lib/fnmatch.h: New file. (unused) + * lib/fnmatch.c: New file. (unused) + * lib/Makefile.am (noinst_HEADERS): Add fnmatch.h. + +1998-10-03 Jim Meyering + + * man/Makefile.am: Switch to using help2man. + (EXTRA_DIST): Add Makefile.summ. + + * man/help2man: Invoke program with --manhelp option only if + --name=STRING not specified. Otherwise, this would fail with `yes'. + * man/Makefile.summ: New file. + * man/Makefile.maint: Include it. + * man/help2man: New file. + * man/GNUmakefile: New file. + * man/Makefile.maint: New file. + * man/*.x: New files. + * man/*.1: Remove files. + + * src/md5sum.c (split_3): Rename local variable, to `escaped_filename'. + (main): Output the leading backslash not just when there's a newline + in the file name, but also when there's a backslash. + Reported by Jim Dennis. + + * tests/md5sum/basic-1: Add tests with filenames containing newline + and backslash characters. (for the bug fixed above) + + * tests/Makefile.am (EXTRA_DIST): Add Fetish.pm. + * tests/Fetish.pm: New file. + + * tests/md5sum/basic-1: New file: rewrite of old tests to use Fetish.pm. + * tests/md5sum/Test.pm: Remove file. + * tests/md5sum/Makefile.am: Rewrite. + +1998-09-19 Jim Meyering + + * src/ptx.c (program_name): Declare *not* to be const. + +1998-08-29 Jim Meyering + + * src/cut.c: Don't assume ASCII. + * src/pr.c: Likewise. + * src/tail.c: Likewise. + +1998-08-15 Jim Meyering + + * src/pr.c (usage): Reformat. + + * src/ptx.c: Add braces to suppress warning about ambiguous `else'. + * lib/bumpalloc.h: Likewise. + +1998-08-13 François Pinard + + * src/ptx.c: New file. + * src/Makefile.am (bin_PROGRAMS): Add ptx. + * lib/bumpalloc.h, lib/diacrit.h, lib/diacrit.c: New files. + * lib/Makefile.am (libtu_a_SOURCES): Add diacrit.c. + (noinst_HEADERS): Add bumpalloc.h and diacrit.h. + +1998-08-09 Andreas Schwab + + * src/pr.c (long_options): Add long names for all options. + (usage): Update help string. + (main): Handle the special options --pages and --columns. + +1998-08-02 Jim Meyering + + * lib/linebuffer.c (readline): Return zero upon error as well as upon + end of file. From James Youngman. + Ansideclify. + +1998-08-01 Jim Meyering + + * src/sort.c (my_setlocale): Guard definition within #ifdef ENABLE_NLS. + From Manfred Hollstein. + +1998-07-30 Jim Meyering + + * tests/cut/Test.pm: Avoid broken pipe message for tests that fail + with usage errors. + + * src/sort.c (usage): Add angle brackets to make `Report bugs...' + message consistent with all the rest. + +1998-07-28 Andreas Schwab + + * tests/cut/Test.pm: Avoid broken pipe for 'y' and 'z' tests. + + * src/sort.c (NEGATION_SIGN): Renamed from NEGATIVE_SIGN to avoid + clash with . All uses changed. + +1998-07-26 Jim Meyering + + * intl/localealias.c (read_alias_file): Avoid mixing `char*' and + `unsigned char*' variables. Again for irix4. + Mostly from Kaveh Ghazi. + + * src/join.c: Convert some char* dcls to `unsigned char*' and remove + a cast -- to placate irix4's cc. + * src/fmt.c (check_punctuation): Add cast to placate irix4's cc. + Reported by Kaveh Ghazi. + + * src/md5sum.c (split_3): Add cast to placate irix4's cc. + From Kaveh Ghazi. + +1998-07-25 Jim Meyering + + * Version 1.22f. + + * tests/cut/Test.pm: Add tests for new --output-delimiter option, + as well as for NUL input delimiter (--delimiter=''). + * src/cut.c (cut_fields): Honor new --output-delimiter option. + (main): Fix handling of --delimiter='' (-d ''). Until now, it has + never worked as advertised. I guess no one tried it. + + * tests/sort/Test.pm: Add two tests relating to this. + * src/sort.c (main): Stat all non-`-' input file files (and fail if a + stat fails) when an output file is specified by `-o' but doesn't exist. + Reported by Will Edgington. + + * tests/sort/Test.pm: New tests of -o. + +1998-07-16 Jim Meyering + + * lib/Makefile.am (noinst_HEADERS): Add lchown.h. + * lib/lchown.h: New file, just to define ENOSYS on systems that lack it. + * lib/lchown.c: Include lchown.h. + +1998-07-04 Jim Meyering + + * configure.in (AM_WITH_REGEX): Remove. Now the replacement + macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS. + * acconfig.h (WITH_REGEX): Remove undef. + * src/csplit.c: Remove #ifdef around inclusion. + * src/nl.c: Likewise. + * src/tac.c: Likewise. + * src/csplit.c (extract_regexp): Remove #if !WITH_REGEX...#endif block. + * lib/Makefile.am (noinst_HEADERS): Remove rx.h. + * lib/rx.c: Remove file. + * lib/rx.h: Remove file. + +1998-06-29 Jim Meyering + + * src/wc.c: Update calls to human_readable -- now there's one fewer arg. + + * lib/Makefile.am (libtu_a_SOURCES): Add argmatch.c. + (noinst_HEADERS): Add argmatch.h. + +1998-06-28 Jim Meyering + + * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers. + +1998-06-27 Jim Meyering + + * tests/pr/Test.pm: Add two tests for double spacing. + * src/pr.c (print_page): If cols_ready_to_print is zero, + break out of loop just before the double-space test. + Reported by Michael Stutz. + +1998-06-18 Jim Meyering + + * tests/Makefile.am.in (check): Depend on $(maint_gen) so + `make maintainer-clean; ./configure; make check' works. + +1998-05-25 Jim Meyering + + * configure.in (_GNU_SOURCE): AC_DEFINE it here. + * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section. + [!_GNU_SOURCE]: Add #undef instead. + +1998-05-16 Jim Meyering + + * configure.in (jm_MACROS): New wrapper macro. + Remove uses of most jm_* macros. + + * src/tac.c (tac_seekable): Fix error in handling regex separators. + * tests/tac/Test.pm (opt-b, opt-s, opt_sb, opt_r): New tests. + (opt_br): New test -- exercises above-fixed bug. + + * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS=' + lines from the m4/*.m4 macros, so the hack of including some + custom-replaced C source file names here is no longer needed. + + * acconfig.h (chown): Add undef. + (D_INO_IN_DIRENT): Likewise. + (D_TYPE_IN_DIRENT): Likewise. + (ssize_t): Likewise. + +1998-05-09 Jim Meyering + + * src/tac.c (tac_seekable): Rename from tac_stream. + Change `FILE *in' parameter to `int input_fd'. Adjust callers. + +1998-05-03 Jim Meyering + + * po/: Update from gettext-0.10.35. + * intl/: Likewise. + * configure.in: Remove use of AC_LINK_FILES. + (AC_OUTPUT): Remove po/Makefile-generating sed command. + +1998-04-26 Jim Meyering + + * tests/tail/Test.pm: Disable test f-1, now that it fails. + + * src/sort.c (keycompare) (CMP_WITH_IGNORE): Don't return 0 from inside + the keyspec-iterating loop. With this change, test 22a passes. + Reported by Zvi Har'El. + (strncoll): Remove bogus assertion. + * tests/sort/Test.pm: Add tests for the above fix. + + * configure.in: Use jm_ASSERT. + * acconfig.h: Add NDEBUG. + + * src/cut.c: Don't define NDEBUG. + * src/csplit.c: Likewise. + * src/join.c: Likewise. + * src/sort.c: Likewise. + * src/tr.c: Likewise. + + * src/cut.c: Don't define _GNU_SOURCE (now it's in config.h). + * src/expand.c: Likewise. + * src/fold.c: Likewise. + * src/join.c: Likewise. + * src/sort.c: Likewise. + * src/tr.c: Likewise. + * src/unexpand.c: Likewise. + * src/uniq.c: Likewise. + + * src/tail.c (close_fd): New function -- converted from macro. + [struct File_spec] (n_stat_calls): New member. + [struct File_spec] (n_unchanged_stats): New member. + (max_n_unchanged_stats): New global. + Initialize new members. + (xwrite): New function -- converted from macro. + [struct File_spec] (pretty_name): Remove member. + (pretty_name): New function. + + * src/md5sum.c (md5_check): Declare local, `md5num' as _unsigned_ char*. + (hex_digits): Declare parameter `s' as _unsigned_ char*. + (split_3): Declare parameter `u' as _unsigned_ char**. + +1998-04-17 Jim Meyering + + * src/fmt.c (check_punctuation): Used unsigned char* pointers to avoid + new warning. + * src/join.c (xfields): Likewise. + +1998-04-12 Jim Meyering + + * src/cat.c: Use STREQ macro rather than strcmp. + * src/cksum.c: Likewise. + * src/comm.c: Likewise. + * src/csplit.c: Likewise. + * src/cut.c: Likewise. + * src/fmt.c: Likewise. + * src/fold.c: Likewise. + * src/head.c: Likewise. + * src/join.c: Likewise. + * src/md5sum.c: Likewise. + * src/nl.c: Likewise. + * src/paste.c: Likewise. + * src/pr.c: Likewise. + * src/split.c: Likewise. + * src/sum.c: Likewise. + * src/tac.c: Likewise. + * src/uniq.c: Likewise. + * src/wc.c: Likewise. + +1998-04-11 Jim Meyering + + * lib/safe-read.h: New file. + * lib/safe-read.c: Include it. + * src/cat.c: Include it instead of merely declaring safe_read. + * src/csplit.c: Likewise. + * src/head.c: Likewise. + * src/split.c: Likewise. + * src/sum.c: Likewise. + * src/tac.c: Likewise. + * src/tail.c: Likewise. + * src/tr.c: Likewise. + * src/wc.c: Likewise. + + * lib/Makefile.am (noinst_HEADERS): Add safe-read.h. + + * src/wc.c [HAVE_INTTYPES_H]: Include inttypes.h. + Declare counters to be of type uintmax_t. + (write_counts): Use human_readable to format potentially-long-long + numbers. Suggestion from Rogier Wolff. + (wc): Declare per-file counters to be of type uintmax_t. + Declare bytes_read to be ssize_t. + * lib/Makefile.am (libtu_a_SOURCES): Add human.c. + (noinst_HEADERS): Add human.h. + + * lib/human.c: New file. + * lib/human.h: New file. + +1998-04-04 Jim Meyering + + * configure.in (jm_AC_HEADER_INTTYPES_H): Use it. + (jm_AC_TYPE_UINTMAX_T): Use it. + (jm_PREREQ): Use it. + + * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal + know about the m4/ subdirectory. + * Makefile.maint (aclocal-files): Remove now-unnecessary (with + automake-1.2h and the above change) aclocal-related rules and includes. + +1998-04-03 Jim Meyering + + * lib/closeout.c: New file. + * lib/closeout.h: New file. + * lib/Makefile.am (libtu_a_SOURCES): Add closeout.c. + (noinst_HEADERS): Add closeout.h. + +1998-03-31 Jim Meyering + + * lib/xstrtol.c: Merge with the version from fileutils. + +1998-03-27 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h. + +1998-03-23 Jim Meyering + + * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4 + automatically handles it. + +1998-03-19 Jim Meyering + + * src/system.h (SCHAR_MIN): Define. + (SHRT_MIN): Define. + od.c needs these when compiling with NCR's R2.0c C compiler. + (TYPE_MAXIMUM): Cast result to `(t)' so this macro works with + `unsigned char'. + From Greg Wooledge. + +1998-03-15 Jim Meyering + + * src/tail.c (tail_file): Merge largely-duplicated blocks of code. + +1998-03-03 Paul Eggert + + * src/sort.c (xtmpfopen): Open temporary file exclusively, to + foil a common denial-of-service attack. + * src/tac.c (save_stdin): Likewise. + +1998-02-16 Jim Meyering + + * configure.in (jm_FUNC_LSTAT): Use it. + (jm_FUNC_STAT): Use it. + * lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c. + +1998-02-06 Jim Meyering + + * configure.in: Don't use AM_MAINTAINER_MODE or + AC_PATH_PROG(PERL, perl). + (jm_PERL): Use this. + +1998-02-04 Jim Meyering + + * tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl. + (mk_script): Set to ../mk-script. + (x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script. + Remove @MAINT@ cruft. + (Makefile.am): Likewise. + Remove @MAINT@ cruft. Now `missing' will explain the failure + when people don't have Perl yet modify a file whose rebuilding + would lead to the use of Perl. + + * tests/Makefile.am (EXTRA_DIST): Add mk-script. + * tests/*/mk-script.pl: Remove files. + + * GNUmakefile: New file. + * Makefile.am (EXTRA_DIST): Add GNUmakefile. + Don't include Makefile.maint from here. It's included from GNUmakefile. + +1998-01-30 Paul Eggert + + * configure.in (AC_LFS): Put before anything that can affect or use + CPPFLAGS, LDFLAGS, or LIBS. + +1998-01-25 Jim Meyering + + * Makefile.maint: New file. + * Makefile.am: Move rules common to textutils, fileutils, sh-utils + into Makefile.maint. + Include Makefile.maint. + (EXTRA_DIST): Add Makefile.maint. + + * src/cat.c (cat): Convert comma-expressions to pairs of + semicolon-terminated stmts. + Add braces around compound if/else stmts. + +1998-01-24 Jim Meyering + + * src/tail.c (parse_obsolescent_option): Do not interpret `-f -n 1 ...' + as obsolescent options. + Accept new option: --sleep-interval=SECONDS (-s). + (parse_options): Recognize it. + (usage): Describe it. + (tail_forever): Use it. + (dump_remainder): Use it. + * tests/tail/Test.pm (f-1): Add test for option-processing of `-f -n 1'. + + * tests/cut/: Rename directory to remove `-test' suffix. + * tests/join/: Likewise. + * tests/md5sum/: Likewise. + * tests/pr/: Likewise. + * tests/sort/: Likewise. + * tests/tr/: Likewise. + * configure.in (AC_OUTPUT): Reflect renamings in tests/. + * tests/Makefile.am (SUBDIRS): Reflect renamings in tests/. + + * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around + bug in Cray C 5.0.3.0 when T == time_t. + +1998-01-18 Jim Meyering + + * src/sort.c (strncoll, strncoll_s2_readonly, look_for_fraction, + numcompare): Remove the `unsigned' from some `unsigned char*' + parameter types. Add casts via UCHAR where necessary to avoid + problems with unwanted sign extension. Based on a patch from + Kaveh Ghazi to appease Irix4's cc compiler. + +1998-01-17 Jim Meyering + + * src/split.c (next_file_name): Rewrite. This removes an artificial + limit (albeit already high, at INT_MAX :-) on the number of files + split could create. Reported by Ralf W. Stephan. + +1998-01-16 Jim Meyering + + * src/sort.c (mergefps): Add braces to avoid ambiguous `else' stmt. + (nls_set_fraction): Likewise. + + * src/sort.c: Guard inclusion of langinfo.h also with HAVE_LANGINFO_H, + for Irix-4.0.5. From Kaveh Ghazi. + * configure.in: Check for langinfo.h. + + * lib/getline.c: Make PARAMS-defining conditionals consistent. + * lib/linebuffer.h: Likewise. + * lib/long-options.h: Likewise. + * lib/memcasecmp.h: Likewise. + * lib/xstrtod.h: Likewise. + * lib/xstrtol.h: Likewise. + Suggestion from Kaveh Ghazi. + + * tests/head/Test.pm (fail-0): Disable test. It depends on + sizeof(long) being 32 bits. Reported by Kaveh Ghazi. + +1998-01-10 Jim Meyering + + * Version 1.22d. + + * src/system.h [HAVE_LIMITS_H]: Include limits.h + (TYPE_SIGNED): Define. + (TYPE_MINIMUM): Define. + (TYPE_MAXIMUM): Define. + (CHAR_BIT): Define. + (SCHAR_MAX): Define. + (UCHAR_MAX): Define. + (SHRT_MAX): Define. + (INT_MAX): Define. + (UINT_MAX): Define. + (LONG_MAX): Define. + (ULONG_MAX): Define. + * src/*.c: Remove definitions of those symbols. + + * src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h + since it now includes limit.h which defines RE_DUP_MAX. + * src/nl.c: Likewise. + * src/tac.c: Likewise. + + * lib/xstrtol.c (bkm_scale): Renamed from BKM_SCALE. + Rewrite macro as function. Return a value. Update caller. + Cast __ZLONG_MAX `__unsigned long int' before casting to double to + avoid SunOS /bin/cc compiler bug. + +1998-01-08 Jim Meyering + + * src/tac-pipe.c: New file. But not yet used. + * src/Makefile.am (EXTRA_DIST): Add tac-pipe.c. + + * src/tac.c (tac_stream): Don't perform arithmetic on now-void* pointer + result of xrealloc (until recently it was char*). + + * configure.in (AC_CHECK_FUNCS): Add nl_langinfo. + * src/sort.c (inittables): Add && HAVE_NL_LANGINFO to the #if-test + guarding the nls month-checking code. + (nls_numeric_format): Remove unnecessary (and error-evoking w/SunOS' cc) + `unsigned' from dcls of text and lim. + (main): Cast lconvp->grouping to `unsigned char*' to appease SunOS's cc. + +1998-01-03 Jim Meyering + + * lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr. + + * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so + those files will be built via the ANSI2KNR-filtering rules if necessary. + +1997-12-25 Jim Meyering + + * configure.in: Remove AC_DEFINE of _GNU_SOURCE. + * acconfig.h (_GNU_SOURCE): Define if not already defined. + Put this code in @TOP@ section. + (_GNU_SOURCE): Remove #undef. + +1997-12-22 Jim Meyering + + * configure.in: AC_DEFINE _GNU_SOURCE. + * acconfig.h: Add _GNU_SOURCE. + +1997-12-21 Jim Meyering + + * configure.in (AC_CHECK_HEADERS): Add stdlib.h. + + * src/system.h: Merge in things from fileutils' version of this file. + * src/csplit.c: s/__P/PARAMS/. + * src/fmt.c: s/__P/PARAMS/. + * src/od.c: s/__P/PARAMS/. + * src/pr.c: s/__P/PARAMS/. + +1997-12-14 Jim Meyering + + * src/sys2.h: s/HAVE_DECLARATION_/HAVE_DECL_/g. + +1997-12-13 Jim Meyering + + * src/fmt.c (main): Add some braces. + Check return code from fclose of each input file. + Close stdout and check for errors. + + * src/csplit.c (close_output_file): Check ferror before calling fclose. + (main): Close stdout and check for errors. + +1997-11-15 Jim Meyering + + * acconfig.h: Add mktime. + * configure.in (jm_FUNC_MKTIME): Use it. + * lib/mktime.c: New file. + * lib/Makefile.am (EXTRA_DIST): Add mktime.c + + * intl/Makefile.in (distclean): Don't remove libintl.h here. + * Makefile.am (DISTCLEANFILES): Remove it here instead. + +1997-11-13 Jim Meyering + + * lib/strftime.c: Update from FSF. + * m4/strftime.m4: Check for POSIX.2's %f format spec. + +1997-11-12 Jim Meyering + + * src/system.h [!HAVE_MEMPCPY] (mempcpy): Define. + * configure.in (AC_CHECK_FUNCS): Add mempcpy. + +1997-11-09 Jim Meyering + + * configure.in (jm_FUNC_STRFTIME): Use it. + * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Check for localtime_r. + * m4/strftime.m4 (jm_STRFTIME_PREREQS): Check for localtime_r. + (jm_FUNC_GNU_STRFTIME): Use new macro. + (jm_FUNC_STRFTIME): New macro. Likewise. + Reported by Noel Cragg. + +1997-11-08 Jim Meyering + + * m4/lfs.m4 (AC_LFS): New file/macro. + * m4/Makefile.am (EXTRA_DIST): Add lfs.m4. + * configure.in (AC_LFS): Use it. + (AC_CHECK_FUNCS): Add fseeko. + * src/od.c (fseeko): Define a stub if ! HAVE_FSEEKO. + (skip): Use fseeko if available. Don't use lseek; it causes + the stdio stream to become out of sync with respect to the + underyling file descriptor. + From Paul Eggert. + +1997-10-16 Paul Eggert + + * configure.in (AC_CHECK_FUNCS): Add fseeko. + + * src/od.c (skip): Use fseeko. Don't use lseek; it causes + the stdio stream to become out of sync with respect to the + underyling file descriptor. + +1997-11-06 Jim Meyering + + * src/sort.c (getmonth): Remove HAVE_ALLOCA #ifdefs. + We always have alloca. + (keycompare): Don't use variable size arrays (it's a gcc-extension). + Rewrite code that increments new lengths when not `ignoring'. + +1997-11-02 Jim Meyering + + * acconfig.h: Add malloc and realloc. + + * src/wc.c (main): New option, --max-line-length (-L). + (wc, write_counts): Implement it. + From Bruno Haible. + +1997-10-26 Jim Meyering + + * lib/memcasecmp.c: Convert to upper case before comparing. + This makes join -i work with sort -f. + Reported by Arthur Pool. + +1997-10-25 Jim Meyering + + * lib/xmalloc.c (xalloc_fail): Renamed from fixup_null_alloc. + (xcalloc): #ifdef-out unused function. + (xrealloc): Remove code to work around deficient versions of realloc. + Now we have an autoconf-enabled replacement version. + (xmalloc): Remove code to work around deficient versions of malloc. + Now we have an autoconf-enabled replacement version. + + * lib/memcmp.c (rpl_memcmp): Rename from memcmp. + + * src/sort.c (NLS_STRNCMP) [!ENABLE_NLS]: s/strcmp/strncmp/. + + * lib/xmalloc.c (xalloc_fail_func): Initialize to 0, not NULL. + + * configure.in (jm_FUNC_MALLOC): Use it. + (jm_FUNC_REALLOC): Use it. + + * lib/Makefile.am (EXTRA_DIST): Add malloc.c. + * lib/malloc.c: New file. + * m4/malloc.m4: New file. + * m4/Makefile.am (EXTRA_DIST): Add malloc.m4. + + * lib/Makefile.am (noinst_HEADERS): Add xalloc.h. + (EXTRA_DIST): Add realloc.c. + (EXTRA_DIST): Add malloc.c. + + * src/system.h: Include xalloc.h. + Remove dcls of xmalloc, xcalloc and xrealloc. + + * lib/xalloc.h: New file. + + * lib/xmalloc.c: Include xalloc.h. + Change VOID to void. + (xalloc_exit_failure): Renamed extern. + (xalloc_msg_memory_exhausted): New extern. + (xalloc_fail_func): New extern. + (fixup_null_alloc): Use new variables. + +1997-10-24 Jim Meyering + + * src/unexpand.c: Remove old-style xmalloc and xrealloc decls. + (add_tabstop): Cast first arg of xrealloc to char*. + + * src/sort.c: Include xalloc.h. + (xmalloc): Remove function. + (xrealloc): Remove function. + (main): Set xalloc_fail_func to cleanup. + Set xalloc_exit_failure SORT_FAILURE. + + * src/paste.c: Remove old-style xmalloc and xrealloc decls. + (paste_parallel): Cast first arg of xrealloc to char*. + + * src/od.c: Remove old-style xmalloc and xrealloc decls. + (decode_format_string): Cast first arg of xrealloc to char*. + + * src/expand.c: Remove old-style xmalloc and xrealloc decls. + (add_tabstop): Cast first arg of xrealloc to char*. + + * lib/xalloc.h: New file. + + * src/cut.c (ADD_RANGE_PAIR): Cast first arg of xrealloc to char*. + (getstr): Cast xmalloc return value to char*. + + * src/csplit.c: Include xalloc.h. + (xmalloc): Remove function. + (xrealloc): Remove function. + (main): Set xalloc_fail_func to cleanup. + + * src/*.c: Remove old-style xmalloc and xrealloc decls. + * src/system.h: Add prototyped xcalloc, xmalloc and xrealloc decls. + Suggestion from Achim Blumensath. + +1997-10-23 Jim Meyering + + * Makefile.am (aclocal-files): Also depend on m4/Makefile.am. + + * src/system.h [!HAVE_DECLARATION_FREE]: Declare free. + [!HAVE_DECLARATION_MALLOC]: Declare malloc. + [!HAVE_DECLARATION_REALLOC]: Declare realloc. + [!HAVE_DECLARATION_STPCPY]: Declare stpcpy. + [!HAVE_DECLARATION_STRSTR]: Declare strstr. + * src/cat.c: Remove stpcpy dcl. + * src/csplit.c: Remove malloc and realloc dcls. + * src/sort.c: Remove free, malloc, and realloc dcls. + * src/tac.c: Remove malloc, and realloc dcls. + * src/tr.c: Remove stpcpy dcl. + On some systems, strstr and stpcpy are macros, so declaring them + unconditionally gets syntax errors. + Reported by Mark M. Kettenis. + + * configure.in: Use jm_CHECK_DECLS. + * m4/Makefile.am (EXTRA_DIST): Add decl.m4 and check-decl.m4. + +1997-10-22 Jim Meyering + + * m4/decl.m4: New file. + * m4/check-decl.m4: New file. New macro, jm_CHECK_DECLS. + +1997-10-16 Paul Eggert + + * src/od.c (LONG_MAX): Define if not defined. + +1997-10-16 Jim Meyering + + * src/sort.c (look_for_fraction): Patch from Ørn Hansen. + (getmonth): Compare the two month names only to the length of the + string in the month table. Patch from Ørn Hansen. + (NLS_STRNCMP): New macro. + (strncoll_s2_readonly): New function. + (inittables): Don't use temporary `comp' to hide type of + comparator function. + (nls_sort_month_comp): Declare parameters to be void* to match + comparator function type required for qsort. + (getmonth): Use NLS_STRNCMP rather than #ifdef. + Use do-while, rather than while-loop. + +1997-10-14 Jim Meyering + + * src/sort.c (_NL_ITEM) [!defined]: Define. + From from Ørn E. Hansen. + + * src/sort.c: Use STREQ in place of most uses of strcmp. + (NLS_STRCMP): Define. + (getmonth): Remove ifdef and use NLS_STRCMP instead. + Use HAVE_ALLOCA, not _HAVE_ALLOCA. + (zaptemp): Make parameter `const'. + + * tests/sort-test/Test.pm: Add tests to exercise new fraccompare. + + * src/sort.c (CHARS_IN_ABM): Remove definition + (inittables): Remove assumption that all abbreviated month names have + length 3. + (getmonth): Likewise. + (main): Add #if's for more efficient code when using the GNU C library. + From Ulrich Drepper. + + * src/sort.c (strncoll): Rename parameter to LEN. + (keycompare): Move assignment out of if-expression. + + * lib/xstrdup.c: New file. + * lib/Makefile.am (libtu_a_SOURCES): Add xstrdup.c + + * src/sort.c: Declare xstrdup. + (my_setlocale): New function. + (main): Guard against failure of strdup (use xstrdup) and setlocale. + + * src/system.h (STREQ): Define. + * src/od.c (STREQ): Remove definition. + + * src/sort.c (look_for_fraction): Eliminate arbitrary limit on + number of `groups'. Declare as void, not int. + Patch from Ørn E. Hansen. + (main): When determining whether we're in the C or POSIX locale, + don't rely on the form of the string returned by setlocale. + Suggestion from Ulrich Drepper. + +1997-10-12 Jim Meyering + + * src/sort.c: Apply big patch from Ørn E. Hansen. + Clean up, indent. + (NLS_MEMCMP): Define. + (keycompare): Use it instead of open-coded #ifdefs. + (compare): Likewise. + (NLS_MAP): Remove unused definitions. + Replace with uses of UCHAR. + (nls_locale_map): Remove dcl of unused file-scope array. + +1997-10-10 Jim Meyering + + * tests/sort-test/Test.pm: Add a test. + From William Lewis. + +1997-10-07 Jim Meyering + + * src/*.c: Update bug-reporting address. + * src/cat.c: Indent cpp directives to reflect nesting. + * src/cksum.c: Likewise. + * src/csplit.c: Likewise. + * src/fmt.c: Likewise. + * src/nl.c: Likewise. + * src/paste.c: Likewise. + +1997-09-27 Jim Meyering + + * m4/memcmp.m4: Integrate test to detect bug in memcmp from the + Next x86 OpenStep C library. Test program from William Lewis. + +1997-09-21 Jim Meyering + + * src/od.c [struct tspec] (hexl_mode_trailer): Rename from `trailer.' + (dump_hexl_mode_trailer): Rename from dump_string_trailer. + Use fputs and putchar instead of trivial or %-less printfs. + (decode_one_format): Parenthesize each field_width assignment in an + argument list to make the side effect a little more apparent. + (write_block): Use fputs and putchar instead of trivial or %-less + printfs. + (dump_strings): Cast string_min to off_t to avoid long-standing warning. + + * src/od.c: Implement new `z' (hexl-mode) modifier. + [struct tspec] (trailer): New field. + (field_width): Likewise. + (dump_string_trailer): New function. + (decode_one_format): Save each field_width in the tspec. + Patch from John Kodis. + +1997-09-14 Jim Meyering + + * src/od.c (main) [--traditional]: Don't give diagnostic about there + being more than three arguments if there are *no* arguments specified. + Reported by Jochen Hein. + +1997-09-13 Jim Meyering + + * tests/sort-test/Test.pm: Add tests 19a and 19b. + +1997-07-21 Jim Meyering + + * src/tail.c (parse_obsolescent_option): #ifdef-out portability warning. + +1997-07-19 Jim Meyering + + * src/sort.c (checkfp): Print the `disorder' message. Include both + the number and the contents of the first out-of-order line, in addition + to the file name. Change meaning of return value. + (check): Don't print disorder message here. + Adjust test of checkfp's return value. + Feature suggestion from Karl Heuer. + +1997-07-13 Jim Meyering + + * doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi. + Now, automake includes it automatically. + + * src/head.c: Include xstrtoul.h. + Remove global variable, unit_size. + (atou): Remove now-unused function. + (parse_unit): Likewise. + (string_to_ull): New function. + (head): Take new parameter, count_lines. Use it instead of unit_size. + Update callers. + (head_file): Likewise. + (main): Use string_to_ull, not atou/parse_unit. + The problem was that overflow wasn't detected, so `head -c 4096m' + was treated just like `head -c 0'. + Reported by Jerome Abela. + + * tests/wc: New directory. + * tests/head: New directory. + * tests/Makefile.am (SUBDIRS): Add head and wc. + * configure.in (AC_OUTPUT): Add tests/head/Makefile and + tests/wc/Makefile. + +1997-07-05 Jim Meyering + + * src/tail.c (parse_obsolescent_option): If POSIXLY_CORRECT is set, give + a diagnostic and fail when there are two or more non-option arguments. + +1997-07-04 Jim Meyering + + * tests/tac/mk-script.pl: Redirect output of cmp to /dev/null. + + * configure.in (ALL_LINGUAS): Add Norwegian (no). + + * Makefile.am (aclocal-files): Look in source directory, not build dir. + From Andreas Schwab. + +Sun Jun 15 06:36:41 1997 Jim Meyering + + * src/pr.c (init_header) [T_BUF_FMT]: Output the 4-digit year (not the + 2-digit abbreviation) in each page header. Reported by Noah Friedman. + +Sat Jun 14 12:29:12 1997 Jim Meyering + + * src/cut.c (cut_fields): Detect when the input is empty and handle + that special case. Before `cut -f1 < /dev/null' would improperly + output a single newline. Reported by Phil Richards. + +Sun Apr 27 15:10:58 1997 Jim Meyering + + * man/Makefile.am (DISTFILES): Add $(man_MANS). + + * configure.in (ALL_LINGUAS): Add Czech (cs) and Swedish (sv). + +Thu Apr 3 21:14:02 1997 Jim Meyering + + * m4/Makefile.am (EXTRA_DIST): Update file list. + + * tests/cut-test/Test.pm: Add test from Phil Richards. + +Sat Mar 22 20:29:10 1997 Jim Meyering + + * missing: New file -- from the automake-1.1m distribution. + +Fri Mar 21 23:56:41 1997 Jim Meyering + + * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l. + (aclocal.m4): Use aclocal's new -I option. + +Thu Mar 13 21:46:04 1997 Jim Meyering + + * src/tr.c (main): Make sure c1 is not -1 before using it as an + array index. Patch from Greg McGary. Although this is truly a + bug, I believe it would not cause tr to misbehave on most systems. + I could not construct a test case with which this bug causes tr + to generate invalid output. + + * tests/pr-test/Test.pm: Add test that -o 0 works. + + * src/pr.c (main): Allow use of 0 (zero) as the margin offset + argument to the -o option. Patch from Gary Anderson. + +Fri Feb 28 22:32:51 1997 Jim Meyering + + * src/uniq.c (usage): Fix typo in --help output. From Andreas Schwab. + +Tue Feb 25 20:34:51 1997 Jim Meyering + + * lib/Makefile.am (noinst_HEADERS): Add obstack.h. + (libtu_a_SOURCES): Add obstack.c. + +Sun Feb 16 08:30:29 1997 Jim Meyering + + * tests/Makefile.am (SUBDIRS): Add tac. + * tests/tac: New directory. + * configure.in (AC_OUTPUT): Add tests/tac/Makefile. + + * tests/pr-test/{tt-0FF, tt-bl, tta3-0FF, ttb3-0FF, tt-FF, tt-t, + tta3-FF, ttb3-FF}: New files. Renamed (s/T/tt/) to avoid name clashes + on case-independent filesystems. + * tests/pr-test/Test.pm (Tests '7.*'): Reflect file-renaming. + + * src/tail.c (parse_obsolescent_option): Reverse order of args in + diagnostic. Remove `' quotes in diagnostic. + (parse_options): Remove `' quotes in diagnostic. + +Sat Feb 8 22:43:45 1997 Jim Meyering + + * src/tail.c (parse_obsolescent_option): Give warning diagnostic for + (but now accept) obsolescent usage with more than one file argument. + +Sun Feb 2 23:06:59 1997 Jim Meyering + + * src/join.c: Move alloca-related preprocessor code into system.h. + * src/od.c: Remove alloca-related preprocessor code. + * src/system.h: Add alloca-related preprocessor code. + +Sat Feb 1 07:21:43 1997 Jim Meyering + + * tests/pr-test/*: Rename files to avoid exceeding 14-character limit. + * tests/pr-test/Test.pm: Reflect renamings. + + * tests/pr-test/mk-script.pl (spec_to_list): Warn about all filenames + that exceed max-length before dying. + + * src/pr.c (init_parameters): For compatibility: use default + separator `TAB' with full length lines. From Roland Huebner. + +Fri Jan 31 19:53:54 1997 Jim Meyering + + * src/tac.c: Rename globals buffer and buffer_size to have G_ prefix + to avoid shadowing local variables. + + * lib/long-options.c (parse_long_options): Compare getopt_long return + value against -1, not EOF. Use NULL, not `(int *) 0' as last parameter + in getopt_long call. + + * src/pr.c (add_line_number): Rename from `number' to avoid shadowing + local variables. + + * src/*.c: Compare getopt_long return value against -1, not EOF. + Use NULL, not `(int *) 0' as last parameter in getopt_long call. + (usage): Bracket bug-reporting address with <> and append a period. + +Wed Jan 29 20:54:24 1997 Jim Meyering + + * tests/tr-test/Test.pm: Do each test twice: get input via REDIR + and PIPE. + + * tests/tail/Test.pm (test_vector): Do each (non-stdin-requiring) + test three times. + + * tests/pr-test/Test.pm: Remove common_option_prefix flag. + (test_vector): Prepend the common option here instead. + + * tests/md5sum-test/Test.pm: Remove input_via_stdin flag. + Do each test twice: get input via REDIR and PIPE. + + * tests/cut-test/Test.pm: Do each test three times. + + * tests/cut-test/mk-script.pl: Allow each test to be run any or all + of three different ways. Program input may be specified via a file + or files listed on the command line, via input redirection (if there's + only one file), or via a pipe. + +Tue Jan 28 20:54:06 1997 Jim Meyering + + * tests/cut-test/mk-script.pl: Remove `t' prefix on all generated + test file names. + Change suffixes from (.in, .exp, .out, .err) to (.I, .X, .O, .E). + Ensure that no test file (generated or maintainer-supplied) has a + name longer than 14 characters. + +Sun Jan 26 12:49:50 1997 Jim Meyering + + * Version 1.22. + + * src/tail.c (parse_options): Add quotes to make messages identical. + +Sat Jan 25 00:12:29 1997 Jim Meyering + + * src/tail.c (parse_obsolescent_option): Comment. + (parse_options): Remove unnecessary goto and label. + + * tests/sort-test/mk-script.pl: Interpret `input arg is a hash + reference' as meaning that the tested program will read no input. + Most of the tests for the date program use this feature. + Also for date, the generated script now reflects specification + (in Test.pm) of default and per-test environment settings. + + * src/csplit.c: Reflect changes to xstrtol and xstrtoul interfaces. + * src/fold.c: Likewise. + * src/head.c: Likewise. + * src/join.c: Likewise. + * src/nl.c: Likewise. + * src/od.c: Likewise. + * src/pr.c: Likewise. + * src/uniq.c: Likewise. + + * lib/xstrtoul.h (XSTRTOL_H): Undefine it. + + * lib/xstrtol.h [!_STRTOL_ERROR]: Define the type `enum strtol_error' + only if it hasn't already been defined. + (_STRTOL_ERROR): Undefine. + + * lib/xstrtol.c (__xstrtol): Change interpretation of + VALID_SUFFIXES == NULL vs VALID_SUFFIXES == "". Use the former + when any suffix is valid, the later when no suffix is allowed. + +Fri Jan 24 23:36:00 1997 Jim Meyering + + * lib/long-options.c (parse_long_options): Reset optind to zero + before just returning so that getopt internals get initialized from + the probably-new parameters when/if getopt is called later. + From Ulrich Drepper. + +Thu Jan 23 19:17:03 1997 Jim Meyering + + * src/tail.c (parse_obsolescent_option): Recognize and fail for + more malformed obsolescent options. Makes for better diagnostics. + +Wed Jan 22 21:34:50 1997 Jim Meyering + + * tests/Makefile.am (SUBDIRS): Add tail. + * tests/tail: New directory. + * configure.in (AC_OUTPUT): Add tests/tail/Makefile. + + * src/tail.c (parse_options): New function. + (parse_obsolescent_option): New function. + (main): Use the new functions instead of open-coding them. + This better fixes the bug in handling obsolescent `+Nc' options. + General cleanup. + +Tue Jan 21 22:49:00 1997 Jim Meyering + + * src/tail.c (main): Properly handle what the POSIX spec calls + the `obsolescent' usage (e.g., tail +2c). It didn't work. + Reported by Karl Heuer. + +Sun Jan 12 22:13:27 1997 Jim Meyering + + * tests/tr-test/Test.pm: Rename tests so that the associated files + have names that are distinct even on filesystems on which file + names are case insensitive. + Reported by Fred Fish. + * tests/cut-test/Test.pm: Likewise. + + * tests/tr-test/Makefile.am: Regenerated to reflect renamed tests. + * tests/cut-test/Makefile.am: Likewise. + +Wed Jan 8 16:38:24 1997 Jim Meyering + + * Version 1.21. + + * lib/getopt.c (_getopt_internal): Use `_', rather than the + (sometimes-)expansion `gettext'. + +Tue Jan 7 22:50:13 1997 Jim Meyering + + * lib/getopt.c: New (more POSIX compliant) version from GNU libc. + [_]: Define to gettext also if ENABLE_NLS is defined. + This is temporary. + +Thu Jan 2 21:17:50 1997 Jim Meyering + + * src/pr.c (init_fps): Initialize lines_stored field in three places. + This avoids uninitialized memory reads in close_file. + +Wed Jan 1 17:32:18 1997 Jim Meyering + + * configure.in (AC_ARG_PROGRAM): Remove explicit use. + It's implicit in AM_INIT_AUTOMAKE. From Wayne Stewart. + +Sun Dec 29 23:42:57 1996 Jim Meyering + + * src/pr.c (init_header): Plug a small memory leak by using stack + rather than heap for a 15-byte temporary buffer. + +Sat Dec 28 00:03:23 1996 Jim Meyering + + * src/pr.c (TAB_WIDTH): Parenthesize uses of parameters and renamed + from tab_width. + (POS_AFTER_TAB): Renamed from pos_after_tab. Define in terms of + TAB_WIDTH rather than duplicating the expression. + +Fri Dec 27 17:29:02 1996 Jim Meyering + + * tests/join-test/mk-script.pl: Fix a couple of thinkos and typos. + Now it works with pr's tests, too. + + * tests/pr-test/Makefile.am (explicit): Regenerate list of files, + this time with duplicates removed. + + * src/pr.c (usage): Break long string literal into two separate + printf statements to accomodate default maximum of 2048 characters + for Irix-4.0.5. Reported by Kaveh Ghazi. + + * Makefile.am (aclocal.m4): No longer depend on acinclude.m4. + + * tests/Makefile.am (SUBDIRS): Add pr-test. + + * configure.in: AC_REQUIRE version 2.12 of autoconf. + AC_OUTPUT: Add tests/pr-test/Makefile. + +Sun Dec 22 08:11:27 1996 Jim Meyering + + * acinclude.m4: Move macros to individual files in new directory, m4/. + See ChangeLog entries in sh-utils for the details. + + * configure.in: Increment version to 1.20a. + + * tests/md5sum-test/Makefile.am: Use same framework as other tests. + * tests/md5sum-test/Test.pm: New file. + +Sat Dec 21 20:32:58 1996 Jim Meyering + + * tests/Makefile.am (EXTRA_DIST): Add README and Makefile.am.in. + + * tests/Makefile.am.in: New file. + + * tests/sort-test/Makefile.am: Clone the Makefile.am from join-test. + Replace only the definition of $x and the auto-generated lists of + test files. + * tests/cut-test/Makefile.am: Likewise. + * tests/tr-test/Makefile.am: Likewise. + + * tests/join-test/Makefile.am: Add @MAINT@-protected rule for + verifying that Makefile.am is consistent with Test.pm. + +Fri Dec 20 00:08:36 1996 Jim Meyering + + * tests/join-test/Makefile.am (MAINTAINERCLEANFILES): Use $(in1) + and $(in2), not $(in). + + * tests/join-test/mk-script.pl: New option: --list. + Generate lists of files used/generated. + +Thu Dec 19 23:28:41 1996 Jim Meyering + + * tests/join-test/mk-script.pl: Rewrite to be more general -- so + it can be used for join, cut, sort, tr, and soon, pr test suites. + * tests/tr-test/mk-script.pl: Symlink through CVS repo to join's + mk-script.pl. + * tests/sort-test/mk-script.pl: Likewise. + * tests/cut-test/mk-script.pl: Likewise. + + * tests/tr-test/Test.pm: Adapted for new mk-script.pl. + * tests/join-test/Test.pm: Likewise. + +Tue Dec 17 16:48:51 1996 Jim Meyering + + * tests/join-test/Makefile.am (.pl): Make generated file read-only so + I don't accidentally modify it instead of the one with the .pl suffix. + + * acinclude.m4 (jm_SYS_PROC_UPTIME): Require AC_PROG_CC, rather than + now-obsolete AC_C_CROSS. + (jm_FUNC_MKTIME): When redefining, use rpl_ prefix, not gnu_ one + since there's nothing GNU-specific about the replacement. Contrast + with gnu_ prefix added to strftime. + (jm_FUNC_MEMCMP): New macro. + * configure.in: Use jm_FUNC_MEMCMP instead of AM_FUNC_MEMCMP. + * acconfig.h: Add memcmp. + * README: Remove warning about memcmp. The new macro handles it. + +Mon Dec 16 23:03:27 1996 Jim Meyering + + * tests/Makefile.am (pkgdata_DATA): Remove unnecessary assignment. + From Eric Backus. + (AUTOMAKE_OPTIONS): Likewise. + +Sat Dec 14 14:51:50 1996 Jim Meyering + + * acinclude.m4 (jm_SYS_PROC_UPTIME): Fix typo in cache variable + name for cross compiling. + Remove definitions of gettext-related macros. The gettext + installation procedure installs corresponding .m4 files so that + aclocal will use them. + +1996-12-12 Paul Eggert + + * system.h (ISDIGIT): Replace with smaller, faster edition + that yields nonzero only on ASCII digits. + (ISDIGIT_LOCALE): New macro, with same meaning that ISDIGIT + used to have. + + * tr.c (is_char_class_member): Use ISDIGIT_LOCALE instead of + ISDIGIT to test for characters in CC_DIGIT class. + + * sort.c (digits): Remove; subsumed by new ISDIGIT. + (inittables): Remove initialization of `digits'. + (fraccompare, numcompare, main): Use ISDIGIT (x) instead of digits[x]. + (fraccompare, numcompare): Avoid casts to unsigned char that are no + longer needed. + + * csplit.c (get_format_width, get_format_prec): Avoid + unnecessary comparison of digit to '\0'. + +Thu Dec 12 23:42:51 1996 Jim Meyering + + * src/sort.c (usage): Clarify description of -u option. + From Karl Berry. + +Wed Dec 11 19:32:18 1996 Jim Meyering + + * Version 1.20. + +Tue Dec 10 00:15:50 1996 Jim Meyering + + The file name, `build-script.pl' is longer than 14 characters. + Rename it. + * tests/cut-test/mk-script.pl: Rename from build-script.pl. + * tests/cut-test/Makefile.am: Reflect renaming. + * tests/tr-test/mk-script.pl: Rename from build-script.pl. + * tests/tr-test/Makefile.am: Reflect renaming. + * tests/sort-test/mk-script.pl: Rename from build-script.pl. + * tests/sort-test/Makefile.am: Reflect renaming. + * tests/join-test/mk-script.pl: Rename from build-script.pl. + * tests/join-test/Makefile.am: Reflect renaming. + Reported by Karl Heuer. + + * configure.in (VERSION): Bump to 1.19r. + (AC_ISC_POSIX): Remove kludgy macro. + Use this test instead: + (LIBS): Add -lcposix if it contains strerror. + Patch from Karl Heuer. + +Sun Dec 8 07:22:38 1996 Jim Meyering + + =========== Update for automake-1.1k. + * Makefile.am (AUTOMAKE_OPTIONS): Require 1.1k. + * configure.in (AM_CONFIG_HEADER): Use it. + (AC_OUTPUT): Remove stamp-h timestamping statement. + Now, AM_CONFIG_HEADER does it automatically. + * lib/Makefile.am (noinst_LIBRARIES): Rename to libtu.a as per + new automake requirement. + Rename tu_* variables to libtu_a_*. + +Wed Dec 4 21:03:18 1996 Jim Meyering + + * src/pr.c: Apply big patch from Roland Huebner. + + * src/tr.c (main) [!POSIXLY_CORRECT]: Allow the identity mappings: + [:upper:] to [:upper:] and [:lower:] to [:lower:]. + (main) [POSIXLY_CORRECT]: Give a more specific diagnostic for + the invalid identity mappings [:upper:] to [:upper:] and [:lower:] + to [:lower:]. + (class_ok): Update table to reflect that tr now allows these + identity mappings. Suggestion from Risto Kankkunen. + +Thu Nov 28 00:31:18 1996 Jim Meyering + + * configure.in (AM_GNU_GETTEXT): Renamed from ud_GNU_GETTEXT + for gettext-0.10.25. + +Tue Nov 26 23:05:14 1996 Jim Meyering + + * src/sort.c (fraccompare): Add explicit `int' in `register' dcls, + to avoid new warning from gcc. + +Sun Nov 24 21:02:15 1996 Jim Meyering + + * tests/sort-test/Makefile.am (t): Add names of those 5 tests. + + * tests/sort-test/Test.pm: Add 5 tests to exercize just-fixed code. + + * src/sort.c (set_ordering): Revert 1994-05-04 change to this function + so that blanks are not unconditionally ignored when computing start + and end positions for numeric keys with explicit character offsets. + Reported by Markus Demleitner. + +Sat Nov 23 16:07:08 1996 Jim Meyering + + * cat.c (usage): Alphabetize option descriptions the way sort -f would. + * fmt.c (usage): Likewise. + * join.c (usage): Likewise. + * md5sum.c (usage): Likewise. + * od.c (usage): Likewise. + * pr.c (usage): Likewise. + * sort.c (usage): Likewise. + * split.c (usage): Likewise. + * wc.c (usage): Likewise. + From Karl Berry. + +Fri Nov 22 20:20:37 1996 Jim Meyering + + * src/csplit.c (process_regexp): Update CURRENT_LINE only if + the new value would be larger. This avoids the infinite loop + otherwise provoked by situations like this: + printf "\na\n" | csplit - '/a/-1' '{*}' + From Jens Schmidt. + +Tue Nov 19 23:16:57 1996 Jim Meyering + + * configure.in (AM_SANITY_CHECK_CC): Remove it. Autoconf-2.11 + has this built-in. + +Sat Nov 2 08:50:01 1996 Jim Meyering + + * doc/Makefile.am (MAKEINFO): Set to makeinfo --no-split. + Otherwise, the generated info files have names longer than + the 14-byte max of some old systems. + Reported by Karl Heuer. + +Fri Nov 1 21:33:16 1996 Jim Meyering + + * lib/strtol.c: Update from GNU libc. + + * tests/sort-test/Test.pm: Add a test to exercize this fix. + + * src/sort.c [!ENABLE_ASSERTIONS]: Guard NDEBUG definition. + (checkfp): Fix off-by-one error that resulted in writing one byte + beyond the end of a malloc'd buffer. It caused `sort -c' to segfault + on Linux systems having a relatively recent libc. Before, running + the command, perl -e "print 'x' x 30, \"\n\";"|sort -c + would provoke the memory overrun (though not necessarily the failure). + Add an assertion. + Reported by Risto Kankkunen. + +Thu Oct 31 17:48:24 1996 Jim Meyering + + * src/sort.c (key_init): New function. + (main): Use key_init in the two places where it was open-coded. + This fixes a UMR of the general_numeric field. + + * src/join.c (decode_field_spec): Always give FIELD_INDEX a value. + This avoids a spurious UMR report from purify. + (prjoin): Add an assertion. + (add_field): Update assertion. + + * src/tr.c (es_free): New function. + (parse_str): Use it to plug a small memory leak. + +Wed Oct 23 22:02:24 1996 Jim Meyering + + * lib/md5.c: Update from GNU libc. + * lib/md5.h: Update from GNU libc. + +Mon Oct 21 16:48:12 1996 Jim Meyering + + * src/tr.c (validate): Remove TAB from diagnostic, for consistency. + +Sun Oct 20 13:44:07 1996 Jim Meyering + + * lib/Makefile.am (INCLUDES): Add -I../intl. Reported by Eric Backus. + + * Makefile.am (AUTOMAKE_OPTIONS): Set to `gnits' + (EXTRA_DIST): Remove. + + * configure.in: Remove README_ALPHA related code. Automake takes + care of it automatically now when in gnits mode. + + * lib/md5.c (md5_process_bytes): Cast void* pointer to char* before + doing arithmetic with it. + +Sat Oct 19 23:13:54 1996 Jim Meyering + + * lib/md5.c: Update from GNU libc. + * lib/md5.h: Update from GNU libc. + +Fri Oct 18 00:08:04 1996 Jim Meyering + + * configure.in (AC_OUTPUT): Add tests/join-test/Makefile. + + * tests/Makefile.am (SUBDIRS): Add join-test. + +Tue Oct 15 23:25:31 1996 Jim Meyering + + * src/tr.c (get_next): Rewrite to treat lower/upper mapping as a + special case. + (main): Write separate loops to initialize mapping for lower->upper + and upper->lower conversion. + Reported by Arne Henrik Juul. + +Sun Oct 13 12:52:42 1996 Jim Meyering + + * lib/xstrtol.c (__xstrtol): Return an error for invalid suffix. + Before, e.g., `split -b 1M' would be silently accepted and treated + like `split -b 1'. Reported by Franc,ois. + + * src/split.c (usage): Remove parameter, REASON. + (main): Update callers to use combination of error (0, 0, ... and + usage (EXIT_FAILURE). + (main): When a string operand cannot be converted to a number of + bytes or lines, include that string in the diagnostic. + +Sat Oct 12 00:05:11 1996 Jim Meyering + + * configure.in (AC_REPLACE_FUNCS): Add strpbrk and strtol. + + * lib/Makefile.am (EXTRA_DIST): Remove. + +Thu Oct 10 23:41:36 1996 Jim Meyering + + * lib/md5.c (md5_stream): Apply fix from Ralph Loader + via Ulrich Drepper. + +Wed Oct 9 07:26:40 1996 Jim Meyering + + * lib/Makefile.am (tu_DEPENDENCIES): Depend on $(tu_LIBADD). + +Tue Oct 8 21:32:17 1996 Jim Meyering + + * lib/error.c: Include error.h to align with libit -- + under protest, François :-). + +Sun Oct 6 08:02:28 1996 Jim Meyering + + * acinclude.m4 (AC_HEADER_SYS_TIME_H, AM_FUNC_MKTIME, + AM_FUNC_ERROR_AT_LINE, AM_FUNC_OBSTACK): Remove definitions. + They're included in automake-1.1f. + + * configure.in (AM_FUNC_ERROR_AT_LINE): Use it instead of + open-coding it. + +Sat Oct 5 12:40:22 1996 Jim Meyering + + * lib/memcpy.c [HAVE_CONFIG_H]: Include config.h. + From Karl Berry. + +Fri Oct 4 07:20:37 1996 Jim Meyering + + * configure.in (GNU_PACKAGE): New variable. + (PACKAGE_VERSION): Remove it. + + * acconfig.h (GNU_PACKAGE): New variable. + (PACKAGE_VERSION): Remove now-unused variable. + + * lib/long-options.c (parse_long_options): Separate package name + and version number to accomodate new --version output requirement. + * lib/long-options.h: Update prototype. + +Thu Oct 3 23:27:31 1996 Jim Meyering + + * src/md5sum.c (main): Remove dead code that used to print --version + output. + +Tue Oct 1 06:54:22 1996 Jim Meyering + + * configure.in: Use result of AM_FUNC_STRTOD to set POW_LIBM. + * src/Makefile.am (sort_LDADD): Use any library (-lm) that + gets substituted for @POW_LIBM@. + + * tests/md5sum-test/md5-rfc (md5sum): Use ../../src/md5sum. + +Mon Sep 30 23:35:46 1996 Jim Meyering + + * tests/md5sum-test/md5-rfc (md5sum): Set to $srcdir/md5sum. + + * acinclude.m4: Update definitions from gettext-0.24. + +Sun Sep 29 20:04:53 1996 Jim Meyering + + * tests/sort-test/build-script.pl: Die if close fails. + * tests/tr-test/build-script.pl: Likewise. + + * configure.in (AC_OUTPUT): Add tests/cut-test/Makefile. + * tests/Makefile.am (SUBDIRS): Add cut-test. + * tests/cut-test: New directory. + +Fri Sep 27 22:22:09 1996 Jim Meyering + + * configure.in (ALL_LINGUAS): Add spanish (es). + +Thu Sep 26 21:02:54 1996 Jim Meyering + + * src/md5sum.c (usage): Remove references in --help output to + the now-deprecated --string option. Support for it will be + removed soon. Using this option can provoke a memory access + violation on some systems because of (unavoidable in an efficient + implementation) alignment assumptions made by functions in md5.c. + md5sum.c could leave the option in and accomodate the alignment + restriction, but this option was intended solely for testing, and + the tests are now all file-oriented, so it's not necessary. + + * tests/md5sum-test/md5-rfc: Rewrite to avoid use of --string option. + +Wed Sep 25 21:43:10 1996 Jim Meyering + + * tests/sort-test/Makefile.am (t): Factor out .in suffix. + Include new test: t16a. + * tests/tr-test/Makefile.am (t): Likewise. + + * src/Makefile.am (EXTRA_DIST): Remove md5-test.rfc. + +Mon Sep 23 10:00:50 1996 Jim Meyering + + * tests/md5sum-test/Makefile.am (EXTRA_DIST): Distribute $(TESTS). + +Sun Sep 22 09:24:22 1996 Jim Meyering + + * src/sort.c (keycompare): Declare translate to be unsigned char *. + Otherwise, sign extension caused misordering when using e.g. -f. + Reported by Erick Branderhorst. + * tests/sort-test/Test.pm: Add Erick's test for that fix. + + * tests/Makefile.am (SUBDIRS): Add md5sum-test. + +Sat Sep 21 13:34:59 1996 Jim Meyering + + * src/Makefile.am (check): Remove tests for md5sum. + * tests/md5sum-test: New directory. Put them here instead. + * configure.in (AC_OUTPUT): Add tests/md5sum-test/Makefile. + +Thu Sep 19 08:54:05 1996 Jim Meyering + + * tests/: Rename from checks. + * Makefile.am (SUBDIRS): Change `checks' to `tests'. + * configure.in (AC_OUTPUT): Likewise. + + * configure.in ($PACKAGE, $VERSION): Don't AC_DEFINE_UNQUOTED these. + AM_INIT_AUTOMAKE now does it (as of automake-1.1e). + +Sun Sep 15 23:08:48 1996 Jim Meyering + + * Makefile.am (EXTRA_DIST): Remove acinclude.m4. + +Thu Sep 12 17:05:23 1996 Jim Meyering + + * lib/Makefile.am (EXTRA_DIST): Add getline.c. + (tu_SOURCES): Remove getline.c + From Kaveh Ghazi. + +Sun Sep 8 13:55:18 1996 Jim Meyering + + * checks/sort-test/build-script.pl: Prefix $in with \$srcdir/ + so make check works with VPATH build. From Uli Drepper. + +Sat Sep 7 12:25:42 1996 Jim Meyering + + * src/system.h: Add comments justifying IS* versions of ctype.h macros. + + * src/fmt.c (check_punctuation): Use ISPUNCT instead of ispunct. + (get_line): Use ISSPACE instead of isspace. From Bruno Haible. + +Mon Sep 2 10:34:46 1996 Jim Meyering + + * src/*.c (usage): Tell where to report bugs. + +Sun Aug 25 22:50:47 1996 Jim Meyering + + * checks/sort-test/Makefile.am (EXTRA_DIST): Add $x-tests. + ($x-tests): Guard dependencies with @MAINT@. + * checks/tr-test/Makefile.am: Likewise. + +Sat Aug 24 14:25:41 1996 Jim Meyering + + * src/cat.c (cat): Cast first arg to stpcpy to char* to avoid warnings. + +Wed Aug 21 22:28:26 1996 Jim Meyering + + * configure.in (ALL_LINGUAS): Add polish (pl). + +Sun Aug 18 09:34:42 1996 Jim Meyering + + * configure.in (AC_OUTPUT): Add checks/sort-test/Makefile. + * checks/Makefile.am (SUBDIRS): Add sort-test. + +Sat Aug 17 18:57:17 1996 Jim Meyering + + * Makefile.am (EXTRA_DIST): Add acinclude.m4. + +Tue Aug 13 21:47:23 1996 Jim Meyering + + * src/Makefile.am (EXTRA_DIST): Remove ansi2knr.1 and ansi2knr.c. + Automake includes them automatically. + + * configure.in (AM_INIT_AUTOMAKE): Use it. + (AM_PROG_INSTALL): Remove. AM_INIT_AUTOMAKE does this. + (AC_PROG_MAKE_SET): Likewise. + +Sun Aug 11 20:49:21 1996 Jim Meyering + + * configure.in: Rename a few macros for automake-1.1c. + (AC_REPLACE_GNU_GETOPT): Remove. + (AC_PATH_PROG): Find perl -- needed only for checks if you + change or remove things with e.g. make maintainerclean. + + + * lib/Makefile.am (tu_LIBADD): Remove @REGEXOBJ@. New AM_WITH_REGEX + adds .o files to @LIBOBJ@. + (tu_SOURCES): Add getopt.c and getopt1.c. + (EXTRA_DIST): Remove getopt.c and getopt1.c. + + * acinclude.m4: New file -- derived from aclocal.m4. + * aclocal.m4: This file is now generated by the aclocal program + (which comes with the automake package.) + +Sun Aug 4 10:50:46 1996 Jim Meyering + + * checks/: New directory. + * checks/Makefile.am: New file. + * configure.in (AC_OUTPUT): Add new directories: checks, + checks/tr-test. + * Makefile.am (SUBDIRS): Likewise. + +Sat Jul 27 17:22:14 1996 Jim Meyering + + * src/system.h (bindtextdomain) [!ENABLE_NLS]: Undefine to avoid + redefinition warnings on solaris. + (textdomain) [!ENABLE_NLS]: Likewise. + +Thu Jul 25 23:06:35 1996 Jim Meyering + + * src/unexpand.c (unexpand): Move EOF check to follow code that + processes and generates output for pending spaces. Before + `printf ' ' |unexpand -t 1,2' generated no output. + + * src/md5sum.c (md5_check): Remove parameter, BINARY. + Rename local TYPE_FLAG to BINARY, so md5_file uses the binary mode + from the input stream rather than the one from the command line. + (main): Fail with a diagnostic if --binary or --text is specified + when verifying checksums. + Reported by Eli Zaretskii . + +Sun Jul 21 11:58:48 1996 Jim Meyering + + * configure.in: Add check for error_at_line so systems with + GNU libc don't compile and link with distributed error.c. + * lib/Makefile.am (tu_SOURCES): Remove error.c. + (EXTRA_DIST): Add error.c. + + * configure.in (AC_REPLACE_FUNCS): Replace getline.c. + Add related check for the getdelim function. + From Ulrich Drepper -- as done in gettext. + +Sat Jul 20 15:59:36 1996 Jim Meyering + + * configure.in (PACKAGE_VERSION): Use space instead of hyphen to + separate PACKAGE and VERSION. + + * aclocal.m4 (AM_SANITY_CHECK_CC): New macro. Derived from + macros from Bruno Haible and from Cygnus. + * configure.in (AM_SANITY_CHECK_CC): Use it. + +Wed Jul 17 00:30:28 1996 Jim Meyering + + * install-sh: Get version with MIT copyright. + +Tue Jul 16 00:09:37 1996 Jim Meyering + + * aclocal.m4 (fp_C_PROTOTYPES): Improved version from + François Pinard. + Update all other macros to reference $fp_cv_prog_cc_stdc, rather + than $ac_cv_prog_cc_stdc. + + * src/od.c (OFF_T_MAX): Remove definition. + (main): Compare against LONG_MAX rather than OFF_T_MAX. + +Mon Jul 15 23:42:57 1996 Jim Meyering + + * Many files: Update FSF address. + +Sun Jul 14 16:53:50 1996 Jim Meyering + + * src/unexpand.c (unexpand): Fix bug that contributed to endless loop + when invoking `echo ' ' |unexpand -t 1,2': use print_tab_index, not + tab_index in inner flush_pend: while loop. From Keith Owens + . + + * src/unexpand.c [HAVE_LIMITS_H]: Include limits.h for INT_MAX. + [!INT_MAX]: Define it. + (main): Append INT_MAX to command-line-specified tab list to + ensure termination in unexpand's inner loop. + Derived from a patch from Keith Owens. + +Thu Jul 11 22:04:36 1996 Jim Meyering + + * Version 1.19. + + * configure.in (VERSION): Bump to 1.19. + +Wed Jul 10 22:57:29 1996 Jim Meyering + + * aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program + so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with + those options on that system, sys/stat.h gets compile errors. + With help from Marcus Daniels. + + * getopt.c: Update from gettext-0.10.23. + * getopt1.c: Likewise. + * getopt.h: Likewise. + +Tue Jul 9 18:07:23 1996 Jim Meyering + + * src/fmt.c (MAXCOST): Use `(unsigned long)1' rather than `(COST)1' + so the left operand of the << isn't signed. + From Kjetil Torgrim Homme. + + * po/Makefile.in.in (install-data): Don't install NLS files when + they're not requested. From Ulrich Drepper. Reported by + Kjetil Torgrim Homme . + +Fri Jul 5 21:55:58 1996 Jim Meyering + + * po/Makefile.in.in ($(PACKAGE).pot): Merge from gettext-0.10.23. + * ABOUT-NLS: Likewise. + * intl/*: Likewise. + * aclocal.m4: Likewise. + +Thu Jul 4 07:24:54 1996 Jim Meyering + + * src/uniq.c (usage): Remove space before newline in usage message. + + * src/md5sum.c (MIN_DIGEST_LINE_LENGTH): New macro. + [NEWLINE_REPLACEMENT_STRING*]: Remove macros. + (main): Output a leading backslash for a line describing a file + whose name contains a newline. Then translate each NEWLINE byte + in the file name to the string, "\\n", and each backslash to "\\\\". + File names that don't contain NEWLINE aren't translated. + (split_3): Rewrite to handle file names with embedded newlines. + Miles Bader and Jim Blandy suggested this new encoding scheme. + + * src/md5sum.c (md5_file): Replace obsolete comment with a description + of the function. + (md5_check): Don't use "s"-adding trick to form the plural of + `checksum.' That doesn't work well with translation. + Suggestions from Ulrich Drepper. + (split_3): Add missing semicolon so it compiles. From Jim Blandy. + +Wed Jul 3 23:21:09 1996 Jim Meyering + + * src/md5sum.c (split_3): Correct test for 35-byte line to accomodate + fact that leading blanks may be stripped. + +Tue Jul 2 21:51:40 1996 Jim Meyering + + * configure.in (ALL_LINGUAS): Add dutch (nl). + +Mon Jul 1 23:50:19 1996 Jim Meyering + + * src/md5sum.c [NEWLINE_REPLACEMENT_STRING]: Define. + (split_3): Translate NL bytes not to NUL, but to + NEWLINE_REPLACEMENT_STRING. + Suggested by Ulrich Drepper. + (main): Translate back to NL-containing filename. + +Sun Jun 30 22:42:17 1996 Jim Meyering + + * src/md5sum.c (split_3): Take an additional parameter, S_LEN. + Adapt caller. + Map translated NEWLINE-containing filename back into the original + NEWLINE-containing name. + (md5_check): Translate NEWLINE bytes to NUL bytes in filename. + +Sat Jun 29 18:59:07 1996 Jim Meyering + + * configure.in (PACKAGE_VERSION): Add `GNU ' prefix so it + appears in the output of --version. Reported by RMS. + +Wed Jun 26 21:35:10 1996 Jim Meyering + + * src/Makefile.am (LDADD): Remove sort-specific hack to link + with -lm. + * aclocal.m4 (AM_FUNC_STRTOD): New macro. + * configure.in (AM_FUNC_STRTOD): Use it. + (AC_REPLACE_FUNCS): Remove strtod. + Suggested by Tom Tromey. + + * po/Makefile.in.in (install-data): Add `else true;' to avoid + letting failing if-condition cause make failure. + From Fred Fish (fnf@ninemoons.com). + +Tue Jun 25 21:55:18 1996 Jim Meyering + + * Version 1.18a. + +Tue Jun 18 20:43:20 1996 Jim Meyering + + * aclocal.m4: Update from gettext-0.10.20. + * ABOUT-NLS: Likewise. + * intl/*: Likewise. + +Thu Jun 13 22:31:39 1996 Jim Meyering + + * configure.in (VERSION): Bump to 1.18a. + + * po/Makefile.in.in ($(PACKAGE).pot): Reapply change of May 30. + Depend on POTFILES only when using maintainer mode. + + * intl/*: Update from gettext-0.10.18. + +Tue Jun 11 23:32:10 1996 Jim Meyering + + * Version 1.18. + + * po/Makefile.in.in: Update from gettext-0.10.17. + * intl/*: Likewise. + * ABOUT-NLS: Likewise. + +Mon Jun 10 18:22:29 1996 Jim Meyering + + * Makefile.am (cvs-dist): Use -c option in cvs tag command. + +Fri Jun 7 22:06:46 1996 Jim Meyering + + * configure.in (VERSION): Set to 1.18. + + * src/Makefile.am (sort_LDADD): Set this to -lm to get pow when using + the strtod supplied with this package. Otherwise, linking failed on + Solaris-2.4 systems. Reported by Wayne Stewart . + +Thu Jun 6 21:57:08 1996 Jim Meyering + + * po/Makefile.in.in: Update from gettext-0.10.16. + * intl/*: Likewise. + * ABOUT-NLS: Likewise. + * aclocal.m4 (AC_REPLACE_GNU_GETOPT): Move definition to precede + gettext-related ones. + Update from gettext-0.10.16. + +Fri May 31 22:04:51 1996 Jim Meyering + + * Version 1.17. + + * Makefile.am (EXTRA_DIST): Set to texinfo.tex so that file is + distributed. + +Thu May 30 00:07:48 1996 Jim Meyering + + * Version 1.16. + + * tail.c (main): Interpret the old-style +VALUE and -VALUE options + like -c VALUE and -c +VALUE (resp) when VALUE has one of the [bkm] + suffix multipliers. This makes the code consistent with --help + output. Reported by Karl Heuer. + + * sort.c (limfield): #ifdef-out a block of code that makes + GNU sort incompatible with Unix sort when a key-end spec refers + to the N'th character in a field that has fewer than N characters. + The POSIX spec doesn't appear to specify behavior for this case. + From Karl Heuer. + + * po/Makefile.in.in (stamp-cat-id): Avoid using temp filename + longer than 14 characters. + (mostlyclean): Likewise. + From Karl Heuer. + + * po/Makefile.in.in ($(PACKAGE).pot): Depend on POTFILES only + when using maintainer mode. Reported by Karl Heuer. + + * po/Makefile.in.in (.po.mo): Reenable dependency and rule. + It is required when using native NLS, e.g. on Solaris. + From Marcus Daniels. + + * od.c (decode_one_format): Use %lu (not %d) printf format + corresponding to unsigned long, SIZE. + + * Version 1.15. + + * intl/Makefile.in (installcheck): New target. + * po/Makefile.in.in (installcheck): New target. + + * od.c (decode_one_format): Take another parameter. + Give a specific diagnostic for invalid format spec here rather + than an overly general one from caller's caller. + (decode_format_string): Update caller. + (main): Don't give diagnostic here when decode_format_string fails. + Remove assertions that could fail on some Crays because they don't + have a two-byte type. + Johan Danielsson (joda@pdc.kth.se) reported the failed assertions. + +Mon May 27 17:43:31 1996 Jim Meyering + + * cat.c (main): Use STDIN_FILENO and STDOUT_FILENO instead of + less portable fileno (stdin) and fileno (stdout). + * sort.c (main): Use STDIN_FILENO instead of less portable + fileno (stdin). + +Mon May 20 21:50:23 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * Makefile.am (distcheck): Remove target and rule -- automake-0.33 + adds it automatically. + +Sun May 19 13:15:49 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (LINGUAS): Add ko. + * Makefile.am (distcheck): Remove @MAINT@ prefix from first command. + +Thu May 16 22:18:41 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * Makefile.am (distcheck): New target. From Gord Matzigkeit. + +Fri May 10 20:46:13 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * po/Makefile.in.in (all-yes): Always depend on CATALOGS. Otherwise + they won't be built and install could fail. From Ulrich Drepper. + (.po.mo): Disable dependency and rule when not in maintainer mode. + + * aclocal.m4 (ud_WITH_NLS): Make DATADIRNAME and CATOBJEXT depend + on whether we're using GNU gettext. From Ulrich Drepper. + +Wed May 8 21:10:43 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * intl/Makefile.in (distdir): Renamed from dist. For compatibility + with automake-0.32. + * po/Makefile.in.in (distdir): Likewise. + + * po/Makefile.in.in (all-yes): Depend on GMOFILES. + Depend on CATALOGS and GMOFILES files only in maintainer mode. + +Tue May 7 22:10:20 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in: Require autoconf-2.10. + + * aclocal.m4 (jm_MAINTAINER_MODE): New macro. + * configure.in (jm_MAINTAINER_MODE): Use it. + +Sat May 4 20:40:01 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (LINGUAS): Add de. + * po/de.po: New file. + + * memcasecmp.c [IN_CTYPE_DOMAIN]: Rename from ISASCII. + * regex.c [IN_CTYPE_DOMAIN]: Likewise. + * system.h [IN_CTYPE_DOMAIN]: Likewise. + +Sun Apr 28 17:10:03 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * fmt.c (copy_rest): Don't copy past end of prefix. Output + trailing spaces if the prefix had any. Before, fmt would + improperly output NUL bytes. The command + perl -e 'print "| S";' |fmt -p' | '|tr '\0' @ + output `|@S'. Reported by François Pinard. + + * sort.c (main): Give a better diagnostic for `sort -0'. + Reported by Karl Berry. + + * configure.in: Make fp_C_PROTOTYPES precede AC_C_INLINE. + Otherwise, some systems lose because the value AC_C_INLINE choses + with plain `cc' is different from that chosen when using the ANSI-mode + C compiler. From Kaveh Ghazi. + +Tue Apr 23 22:05:35 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * aclocal.m4 (AC_REPLACE_GNU_GETOPT): New macro. + * configure.in: Use it. + * lib/Makefile.am (tu_SOURCES): Remove getopt.c and getopt1.c. + (EXTRA_DIST): Add getopt.c and getopt1.c + + * src/*.c, src/*.h: Update Copyright years to include 1996. + +Sun Apr 21 08:04:51 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * getline.c: New version from gettext-0.10.12. + * getline.h: Likewise. + * configure.in (AC_CHECK_FUNCS): Add getdelim. + Suggested by Ulrich Drepper. + + * md5sum.c (md5_check): Remove spurious newline at end of error + format string. + + * od.c (decode_one_format): Use printf's L modifier for long doubles, + not `l'. From Eric Backus. + + * Makefile.am (LDADD): Put @INTLLIBS@ before package library. + + * od.c: Include . + [!BITSPERBYTE]: Define. + [OFF_T_MAX]: Use BITSPERBYTE, not 8, and cast the result to off_t. + * configure.in (AC_CHECK_HEADERS): Add values.h. + +Fri Apr 19 23:48:53 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * Makefile.am (cvs-dist): New rule. Based on the one from + Tom Tromey's automake. + +Thu Apr 18 22:13:14 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * tail.c (main): Make code clearer: use new variable `n_files' in + place of `argc - optind'. Use `file' instead of `argv + optind'. + +Sat Apr 13 13:08:29 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * lib/Makefile.am (noinst_HEADERS): Include memcasecmp.h, + not memcasecmp.c. + + * memcasecmp.c: Unprotoize. + [ISASCII]: Define. + [ISUPPER]: Define. + + * join.c (decode_field_spec): Rename local variable `valid' + to invalid (and reverse sense) to avoid conflict with the + macro definition in /usr/include/locale.h on SunOS 4.1.3. + +Tue Apr 9 22:43:57 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * uniq.c: Add new option --ignore-case (-i). + Include memcasecmp.h. + (different): Compare with memcasecmp if ignoring case. + (main): Handle 'i'. + + * join.c (memcasecmp): Remove static definition of function. + Include memcasecmp.h instead. + + * memcasecmp.c: New file. + * memcasecmp.h: New file. + * lib/Makefile.am (tu_SOURCES): Add memcasecmp.c. + (noinst_HEADERS): Add memcasecmp.h. + +Thu Apr 4 17:05:33 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * tr.c: The following commands all failed unnecessarily. + tr -cs '[:upper:]' '[X*]' + tr -dcs '[:lower:]' n-rs-z + tr -ds '[:xdigit:]' [:alnum:]' + tr -dcs '[:alnum:]' [:digit:]' + tr -dc '[:upper:]' + Reported by Ross Ridge (ross@worf.mks.com). + (validate): Add missing conjunct (translating) in test for + `translating and complementing character classes' error. Before, + valid uses of tr could fail. E.g. `tr -dcs '[:cntrl:]' '[:alnum:]''. + (homogeneous_spec_list): New function. + (validate): Use it to relax the old (overly restrictive) restriction + that prohibited use of complemented character classes when translating. + Now, that is allowed as long as the translation maps many to one. + (get_spec_stats): Rename and redefine global has_char_class from + has_upper_or_lower. + +Wed Apr 3 07:08:57 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * aclocal.m4: Update NLS macros from gettext-0.10.11. + + * src/Makefile.am (INCLUDES): Add -I$(srcdir) to get system.h + when srcdir != builddir. From Kaveh Ghazi. + +Wed Mar 27 23:33:36 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * cksum.c (cksum): Use format "%lu %ld" (instead of "%10lu %8ld") + to be POSIX compliant. From Stephen Gildea . + +Sun Mar 24 08:47:40 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * join.c (main): Use EXIT_FAILURE, not 2, as exit code in error call. + * od.c (skip, main): Likewise. + * tr.c (main): Likewise. + + * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c fold.c head.c + join.c md5sum.c nl.c od.c paste.c pr.c split.c sum.c tac.c tail.c + tr.c unexpand.c uniq.c wc.c: Exit with status EXIT_SUCCESS or + EXIT_FAILURE, rather than 0 or 1. + +Sat Mar 23 23:14:40 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * system.h [EXIT_FAILURE]: Undefine and define to 1 also if it + is defined to zero. Suggested by Paul Eggert. + + * sort.c [SORT_FAILURE]: New macro. + Be careful to exit with 1 only when -c is used and the + input is not properly sorted. In all other cases, use + SORT_FAILURE as required by POSIX. + (main): Change some `error (1, ...' to use SORT_FAILURE. + Upon successful termination, exit with EXIT_SUCCESS instead of `0'. + Replace all uses of `2' (as exit code) with SORT_FAILURE. + +Thu Mar 21 22:47:50 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * csplit.c: Include assert.h, but disable assertions. + (process_line_count): Replace if-abort with a slightly relaxed + assertion. Before, `echo |csplit - 1 1' would abort. + Reported by Samuli.Karkkainen@hut.fi. + (parse_patterns): Disallow uses like `csplit FILE 0' with zero + line number, `csplit FILE 2 1' with decreasing line numbers, and + warn about uses like `csplit FILE 3 3' that have equal line numbers. + + * sort.c (main): Declare to be of type int, not void. + From Peter Seebach . + * cat.c cksum.c comm.c csplit.c cut.c expand.c fold.c head.c join.c + nl.c paste.c pr.c split.c sum.c tac.c tail.c tr.c unexpand.c uniq.c + wc.c (main): Likewise. + +Sat Mar 16 16:30:07 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (PACKAGE_VERSION): New macro. + * acconfig.h (PACKAGE_VERSION): Add it. + * src/Makefile.am: Remove rules for generating version.c. + Remove references to version.o, version.h, and stamp-v. + * version.c: Remove file. + * version.h: Remove file. + * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c fold.c + head.c join.c md5sum.c nl.c od.c paste.c pr.c sort.c split.c + sum.c tac.c tail.c tr.c unexpand.c uniq.c wc.c: Don't include + version.h. + (main): Use PACKAGE_VERSION instead of version_string. + +Mon Mar 11 16:07:08 CST 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * sort.c (write_bytes): Renamed from xfwrite. + Remove SIZE parameter. It was always 1. Update all callers. + Rename NELEM parameter to N_BYTES and change its type to size_t. + +Sat Mar 9 13:30:12 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c + fold.c head.c join.c md5sum.c nl.c od.c paste.c pr.c sort.c + split.c sum.c tac.c tail.c tr.c unexpand.c uniq.c wc.c (main): + Initialize for internationalized message support: call setlocale, + bindtextdomain, and textdomain. + * system.h: Add definitions and includes for NLS. + * Makefile.am (SUBDIRS): Add intl and po. + * src/Makefile.am (datadir): Define. + (localedir): Define. + (DEFS): Add LOCALEDIR definition. + (LDADD): Add @INTLLIBS@. + * aclocal.m4: Add NLS-related macro definitions from + gettext distribution. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES, + HAVE_STPCPY): New macros. + Add PACKAGE and VERSION. + * configure.in (PACKAGE): Define with AC_DEFINE_UNQUOTED. + (VERSION): Likewise. + (ALL_LINGUAS): Define. + (AC_CHECK_HEADERS): Add float.h. + (ud_GNU_GETTEXT): Use it. + Link an nls file. + (AC_OUTPUT): Reflect addition of two new directories, intl and po. + Create po/Makefile. + From François Pinard. + + * tr.c (star_digits_closebracket): Declare formal param, IDX, + and local I to be of type size_t (rather than int) to avoid + warnings from gcc -Wall. + +Wed Feb 28 20:32:48 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * src/Makefile.am: Adapt for automake-0.30. + (noinst_HEADERS): Rename from HEADERS. + (INCLUDES): Remove -I.. and -I$(srcdir). automake-0.30 adds these + to DEFS automatically. + * lib/Makefile.am (noinst_HEADERS): Rename from HEADERS. + +Wed Feb 21 18:56:27 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * join.c (xfields) [without -t]: Ignore leading blanks. + From David Dyck (dcd@tc.fluke.COM). + +Sun Feb 18 12:07:27 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * join.c [TOLOWER]: Define. + (usage): Briefly describe new --ignore-case (-i) option. + (memcasecmp): New function. + (main): Set IGNORE_CASE for -i. + (keycmp): Compare with memcasecmp if IGNORE_CASE is set. + Suggestion and an initial patch from Alberto Accomazzi + . + +Sat Feb 17 18:54:40 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * sort.c: Add -z option. Change all occurrences of '\n' to `eolchar'. + (usage): Describe it. + (main): Set eolchar to 0 for -z. + From Mark W. Eichin . + +Fri Feb 16 21:44:14 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * join.c (main): Mark two strings for translation. + * md5sum.c (md5_check): Mark a string for translation. + From François Pinard. + +Mon Feb 12 21:12:28 1996 Jim Meyering (meyering@na-net.ornl.gov) + + Update for automake-0.29. + * Makefile.am (CONFIG_HEADER): Don't define. Automake now does it. + * src/Makefile.am: Likewise. + * lib/Makefile.am: Likewise. + * doc/Makefile.am (info_TEXINFOS): Renamed from TEXINFOS. + * man/Makefile.am (man_MANS): Renamed from MANS. + + * fmt.c [TRUE]: Undefine before defining to avoid warning on NeXT. + [FALSE]: Likewise. + From Derek Clegg (dclegg@next.com). + +Sat Feb 3 16:20:40 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * Version 1.14. + +Wed Jan 31 23:26:13 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * tail.c (dump_remainder): Flush stdout when tailing-forever on + multiple files. From Carlos Canau . + +Fri Jan 5 18:30:28 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * aclocal.m4: For SVR4 systems, use -Xc -D_POSIX_C_SOURCE in CFLAGS, + not just -Xc. From François Pinard. + + * doc/Makefile.am (DIST_OTHER): Don't set to mdate-sh. mdate-sh is + distributed automatically. From Tom Tromey. + +Thu Jan 4 20:32:52 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * nl.c: Include rx.h after limit.h (not before) to avoid warning + about the redeclaration of RE_DUP_MAX in limit.h. rx.h protects + its definition. From Kaveh Ghazi. + + * src/Makefile.am (DIST_OTHER): Include md5-test.rfc so make check + works again. Reported by François Pinard and Kaveh Ghazi. + + * rx.c [SYNTAX]: Rename from SYNTAX_TABLE. + [SYNTAX_TABLE]: Remove extern dcl of re_syntax_table. + (RE_SEARCH_2_FN): Cast string1 and string2 to avoid pointer type + mismatch errors from e.g. SunOS's /bin/cc. + Reported by Kaveh Ghazi. + +Wed Jan 3 23:34:39 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * configure.in (VERSION): Set variable directly rather than from + a separate file. + * Makefile.am (DIST_OTHER): Remove VERSION. + * src/Makefile.am (version.c): Depend on Makefile, not ../VERSION. + (stamp-v): New target; depend on Makefile. + (DISTCLEANFILES): Add stamp-v, version.c. + +Tue Jan 2 00:08:08 1996 Jim Meyering (meyering@na-net.ornl.gov) + + * sort.c (keycompare): Rewrite cases handling ignored characters + so that they really are ignored. Reported by Carl Johnson + . + +Fri Dec 22 21:34:55 1995 Andreas Schwab + + * configure.in: Touch stamp-h only if config.h is remade. + + * csplit.c (extract_regexp) [!WITH_REGEX]: Intialize + syntax_parens field. + +Mon Dec 18 21:42:44 1995 Jim Meyering (meyering@comco.com) + + Use automake to generate Makefile.in files. + * Makefile.am: New file. + * doc/Makefile.am: New file. + * lib/Makefile.am: New file. + * man/Makefile.am: New file. + * src/Makefile.am: New file. + +Thu Dec 14 21:13:22 1995 Jim Meyering (meyering@comco.com) + + * fmt.c (main): Use xstrtol instead of atoi. + + * fold.c (main): Use xstrtol instead of atoi. + (fold_file): Make a couple locals `int', not size_t, and cast + fwrite's third parameter to size_t. + + * nl.c (main): Use xstrtol instead of atoi. + Rename misleading --first-page=N option to --starting-line-number=N. + (usage): Update. + + * uniq.c (main): Use xstrtol instead of atoi. + +Fri Dec 8 20:48:00 1995 Jim Meyering (meyering@comco.com) + + * aclocal.m4 (fp_C_PROTOTYPES): Set ANSI2KNR to ./ansi2knr. + +Thu Dec 7 19:55:03 1995 Jim Meyering (meyering@comco.com) + + * aclocal.m4 (ud_WITH_REGEX): New macro. + * configure.in: Use it. + * rx.c, rx.h: New files. + * lib/Makefile.in (REGEX): Set to @REGEXOBJ@, not regex.o. + (SOURCES, DISTFILES): Add rx.c, rx.h. + * acconfig.h (WITH_REGEX): Add it. + * csplit.c [!WITH_REGEX]: Include rx.h. + * nl.c [!WITH_REGEX]: Likewise. + * tac.c [!WITH_REGEX]: Likewise. + From Ulrich Drepper and François Pinard. + +Tue Dec 5 17:49:53 1995 Jim Meyering (meyering@comco.com) + + * sort.c (main): Diagnose invalid arguments to -k, then fail. + + * sort.c (numcompare): Properly handle all cases in which signs differ. + From Karl Heuer. + + * Makefile.in (mandir): @mandir@ is just $(prefix)/man. + Append `/man1'. Reported by Karl Heuer. + + * sum.c (bsd_sum_file): Remove misleading comment. From Karl Heuer. + + * src/Makefile.in [.c._o]: Don't create $<-tmp. From Kaveh Ghazi. + +Fri Dec 1 01:02:36 1995 Jim Meyering (meyering@comco.com) + + * lib/Makefile.in (default): New target. + + * sort.c (numcompare): Properly order `-' and valid integers; + treat `-' as if it were zero. Reported by Ross Alexander + . + + * Makefile.in (DISTFILES): Remove unused mkdep-Makefile. + (.PHONY): Depend on default. + +Wed Nov 29 21:50:53 1995 Jim Meyering (meyering@comco.com) + + * aclocal.m4 (jm_PROG_C_MKDEP): Remove, for now. + (jm_AUTODEPS): Likewise. + (jm_WITH_GNU_MAKE): Likewise. + * configure.in (jm_AUTODEPS): Remove. + + * sort.c (begfield): Replace loop with equivalent if-else. + (limfield): Fix bug that made field specs like -k1.5 return a + pointer into LINE beyond the first field. + Don't try to trim trailing blanks here; it's not + possible because we don't know where the field begins. + Replace loop with equivalent if-else. + (trim_trailing_blanks): New function. + (findlines): Call it. + (keycompare): Likewise. + (main): Don't decrement T2 corresponding to `x' in field + specs like -ku.v,w.x. + +Sun Nov 26 15:50:23 1995 Jim Meyering (meyering@comco.com) + + * csplit.c [!UINT_MAX]: Define. + [!INT_MAX]: Define. + Include xstrtoul.h. + (string_to_number): Remove function. + (check_for_offset): Use xstrtoul instead of string_to_number. + (parse_repeat_count): Likewise. + (parse_patterns): Likewise. + (main): Likewise. + +Wed Nov 22 23:12:47 1995 Jim Meyering (meyering@comco.com) + + * Makefile.in (all et. al.): If make was invoked with -k and a + sub-make fails, fail after the loop rather than exiting right away. + Otherwise, make's -k option could be ineffective. + +Sat Nov 18 12:04:30 1995 Jim Meyering (meyering@comco.com) + + * src/Makefile.in (version.c): Depend on ../VERSION, not Makefile. + + Update for autoconf-2.5: + * src/Makefile.in (libdir): Set to @libdir@. + (bindir): Set to @bindir@. + * doc/Makefile.in (infodir): Set to @infodir@. + * man/Makefile.in (exec_prefix): Remove it. + (mandir): Set to @mandir@. + (bindir): Remove it. + +Thu Nov 16 21:25:45 1995 Jim Meyering (meyering@comco.com) + + * Makefile.in (default): New default target. Depend on `all' to + work around bug in AIX-3.2.5's /bin/make. Reported by Andreas Luik + . + +Wed Nov 15 23:48:31 1995 Jim Meyering (meyering@comco.com) + + * mkdep-Makefile (.deps/empty.P): Depend on BUILT-HEADERS. + + * aclocal.m4 (jm_PROG_C_MKDEP): Rename from jm_PROG_MKDEP. + * src/Makefile.in (C_MKDEP): Rename from MKDEP. + * lib/Makefile.in (C_MKDEP): Likewise. + * mkdep-Makefile (C_MKDEP): Likewise. + Add comments. + + * csplit.c [__P]: Don't define it here. + * pr.c [__P]: Don't define it here. + * fmt.c [__P]: Don't define it here. + * system.h [__P]: Define it here. + + * aclocal.m4 (jm_AUTODEPS): Rename from jm_WITH_AUTODEPS. + Revamp, with suggestions from Franc,ois Pinard. + (jm_WITH_GNU_MAKE): New macro. + (jm_PROG_MKDEP): New macro. + * configure.in (jm_PROG_MKDEP): Use it. + * src/Makefile.in (MKDEP): Set it. + * lib/Makefile.in (MKDEP): Likewise. + * mkdep-Makefile: Use MKDEP, not DEP_CC. + (DEP_CFLAGS): Remove it. + +Tue Nov 14 23:10:54 1995 Jim Meyering (meyering@comco.com) + + * sort.c: Add support for sorting numbers in scientific notation. + Include xstrtod.h. + (struct keyfield): Add field: general_numeric. + (usage): Describe -g option. + (general_numcompare): New function. + (keycompare): Use new comparison function when general_numeric + flag is set. + (set_ordering): Honor `g' flag. + (main): Initialize and use new field. + From Marcus Daniels . + + * configure.in (AC_REPLACE_FUNCS): Add strtod. + * lib/Makefile.in (SOURCES): Add xstrtod.c. + (OBJECTS): Add xstrtod.o. + (DISTFILES): Add xstrtod.h. + + * csplit.c (cleanup): Don't exit. + (interrupt_handler): Rewrite to reset default signal handler + then repost caught signal. + (xmalloc, xrealloc, read_input, write_to_file, handle_line_error, + process_line_count, process_regexp, create_output_file, + close_output_file): Call cleanup_fatal, not cleanup. + Add const attribute to lots of parameters. + (cleanup_fatal): Renamed from cleanup. Call cleanup, then exit. + Update callers. + + * tac.c (cleanup): Don't exit. + (cleanup_fatal): New function. Call cleanup, then exit. + (sighandler): New function. + (cleanup_fatal): Renamed from cleanup. Call cleanup, then exit. + Update callers. + (tac_stdin): Set up sighandler as signal handler, not `cleanup'. + +Sat Nov 11 15:46:02 1995 Jim Meyering (meyering@comco.com) + + * od.c (skip): Cast fseek's offset argument to `long'. + Erik Bennett reported that this is + necessary on BSDI systems. And if offset doesn't fit in a long, + then try using lseek instead. + + * sort.c (xmalloc): Declare static. + (xrealloc): Likewise. + + * tac.c (cleanup): Add signal number parameter. + Update callers. + + * cat.c (main): Don't die when dev/ino of input and output are + the same and the file descriptors correspond to stdin and stdout. + This is necessary on at least Digital UNIX (aka OSF1) 3.2C. + Otherwise, running `cat << X > $$' would fail with `cat: -: input + file is output file'. From Jarkko Hietaniemi . + + * Makefile.in (DISTFILES): Add @README_ALPHA@. + (config.status) Depend on VERSION. + * configure.in: Set README_ALPHA if the version number ends in [a-z]. + +Fri Nov 10 21:13:42 1995 Jim Meyering (meyering@comco.com) + + * fold.c (usage): Clarify meaning of --spaces. From Karl Berry. + + src/Makefile.in (.c._c): Don't redirect directly to $@. + (._c._o, .c._o): Remove temporary src file. + +Tue Nov 7 23:55:24 1995 Jim Meyering (meyering@comco.com) + + * VERSION: New file. + * configure.in (VERSION): New variable. + (PACKAGE): New variable. + + * Makefile.in (DISTFILES): Add VERSION. + (distdir): Use @PACKAGE@-@VERSION@, not distname. + Remove all references to distname. + * src/Makefile.in (version.c): Generate it. + (SOURCES): Remove now-generated version.c. + (distclean): Delete version.c. + * doc/Makefile.in (version.texi): Use @PACKAGE@-@VERSION@, + not version.c + + * */Makefile.in (distdir): Use @PACKAGE@-@VERSION@, not distname. + Remove all references to distname. + + * split.c: New option: --verbose. + (main): Recognize it. + (usage): Document it. + From Marty Leisner . + +Sun Nov 5 06:59:27 1995 Jim Meyering (meyering@comco.com) + + * src/Makefile.in: Reflect protoization of csplit.c, fmt.c, pr.c, + and unexpand.c. + + * pr.c: Protoize. + (store_columns): Remove spurious 2nd argument in call to read_line. + [__P]: Define. Use it in prototyped forward decls. + + * csplit.c: Move prototypes after struct declarations. + Remove prototypes for xmalloc, xrealloc. + Protect prototypes with __P. + (new_control_record): Cast arg 1 to realloc. + + * fmt.c [__P]: Test PROTOTYPES, not __STDC__. + Protoize. + +Sat Nov 4 23:51:30 1995 Jim Meyering (meyering@comco.com) + + * csplit.c (close_output_file): Set output_stream to NULL so we + don't recurse endlessly between this function and cleanup. + + * unexpand.c: Reorder functions to obviate forward dcls. Remove + forward dcls. Protoize. Add `const' attribute to some parameters. + +Mon Oct 30 23:15:56 1995 Jim Meyering (meyering@comco.com) + + * wc.c: Reorder functions to obviate forward dcls. Remove + forward dcls. Protoize. Add `const' attribute to some parameters. + * uniq.c: Likewise. + * split.c: Likewise. + + * split.c (isdigits, convint): Remove these. + (main): Use xstrtol instead. + +Sun Oct 29 14:04:36 1995 Jim Meyering (meyering@comco.com) + + * paste.c (main): Move function body to end of file. + Remove forward dcls and protoize. + * sum.c (main): Likewise. + * nl.c: Protoize. Reorder functions to obviate forward dcls. + Remove forward dcls. + * tac.c: Likewise. + * src/Makefile.in (OBJECTS): Reflect that all of the above + now use prototypes. + + * sum.c (bsd_sum_file): Give file name parameter const attribute. + (sysv_sum_file): Likewise. + + * tac.c (xwrite): Give output buffer parameter const attribute. + (output): Likewise for both parameters. + (tac): Likewise for file name parameter. + (tac_file): Likewise. + +Sat Oct 28 16:02:39 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c (md5_check): Use the same message format when there is + a single file and it gets a read error or checksum mismatch as when + there are more. Write that warning to standard error, not standard + output. Suggestions from Greg Troxel (gdt@b-sgi.bbn.com). + +Thu Oct 26 00:11:35 1995 Jim Meyering (meyering@comco.com) + + * sort.c (xtmpfopen): New function to set proper permissions on + temporary files. Use it instead of xfopen. Reported by Erik Corry + (erik@kroete2.freinet.de). + +Mon Oct 23 23:17:04 1995 Jim Meyering (meyering@comco.com) + + * aclocal.m4 (jm_WITH_AUTODEPS): New directive. + * configure.in: Use it. + + * lib/Makefile.in (INCLUDE, COMPILE): New variables. + (.c.o): Rewrite to be more like src/Makefile.in. + + * src/Makefile.in (distclean): Remove .deps. + Include @top_srcdir@/mkdep-Makefile. + + * mkdep.Makefile: New file. + * Makefile.in (DISTFILES): Add mkdep-Makefile. + * doc/Makefile.in (mostlyclean): Also remove *.info. + +Thu Oct 19 17:38:28 1995 Jim Meyering (meyering@comco.com) + + * od.c: Indent cpp directives. + + * tr.c (BEGIN_STATE): Use INT_MAX - 1 so as not to interfere + with large repeat counts. + (struct E_string): New struct. + (find_closing_delim): Take E_string arg rather than char* and length. + (find_bracketed_repeat): Likewise. + (star_digits_closebracket): New function. + (append_char_class): No longer give diagnostic. + (append_equiv_class): Likewise. + (build_spec_list): Give them here instead, allowing string1 like + [:*][:upper:] that got errors before. + Take E_string arg rather than char*. + Convert switch stmts into if-then so as to use ES_MATCH. + +Tue Oct 17 22:48:00 1995 Jim Meyering (meyering@comco.com) + + * cat.c: Protoize. Reorder functions to obviate forward dcls. + Remove forward dcls. + * expand.c: Likewise. + * fold.c: Likewise. + * head.c: Likewise. + * od.c: Likewise. + * sort.c: Likewise. + * tail.c: Likewise. + + * src/Makefile.in (OBJECTS): Reflect that all of the above + now use prototypes. + + * head.c: Add `const' attribute to dcls of lots of formals. + + * sort.c: Add `const' attribute to dcls of lots of formals. + Move struct dcls to precede dcls of file-scope variables. + (monthtab, keyhead): Separate variable dcls from type dcls. + +Fri Oct 13 20:38:39 1995 Jim Meyering (meyering@comco.com) + + * join.c (add_field_list): Allow SPACE and TAB as well as `,' as + list item separators, per POSIX spec. + (prjoin): Rewrite loop that iterates over field specs. + Handle case in which file spec is 0. + +Sun Oct 8 22:41:15 1995 Jim Meyering (meyering@comco.com) + + * strpbrk.c: New file. + * lib/Makefile.in (SOURCES): Add strpbrk.c. + Remove bcopy.c. + +Sat Oct 7 22:27:01 1995 Jim Meyering (meyering@comco.com) + + * join.c (add_field): No longer return a value. + (decode_field_spec): New function. + (add_field_list): Rewrite to be more strict. + Before, `,1.2' was accepted as valid. + (main): Use xstrtol instead atoi. + Combine nearly identical -a and -v cases. + Close input files. + +Fri Oct 6 23:10:01 1995 Jim Meyering (meyering@comco.com) + + * join.c (main): Report `too few/many non-option arguments' + then print --help output rather than just the latter. + Properly interpret obsolescent usage like `join -o 2.1 2.1 2.2'. + (usage): Describe POSIX -1, -2 options and deprecate -j* ones + + * join.c (usage): Move to precede all other functions. + + * join.c: Protoize. + +Tue Oct 3 22:44:05 1995 Jim Meyering (meyering@comco.com) + + * csplit.c, sort.c, tac.c: Test SA_INTERRUPT, not _POSIX_VERSION, + to determine whether `sigaction' functions are available. + Reported by Paul Nevai . + Fix suggested by Karl Berry. + + * md5sum.c (main): Declare counter, N_STRINGS, to be an integral + type, not `char'. + + * cut.c: Convert many declarations using `int' to use `unsigned int' + to avoid warnings from `gcc -Wall' about comparing signed and + unsigned types. + (set_fields): Use memset (not open coded loop) to initialize array. + +Thu Sep 28 23:16:05 1995 Jim Meyering (meyering@comco.com) + + * Version 1.13. + + * Makefile.in (DISTFILES): Remove README.alpha for major release. + + * od.c (decode_one_format): Remove spurious semicolon. + From John Kodis. + +Tue Sep 26 23:05:01 1995 Jim Meyering (meyering@comco.com) + + * man/Makefile.in (install-data, uninstall): Use sed not basename. + The GNU Coding Standard suggests that only a select set of + relatively standard utilities be used in Makefiles. basename is + not among them. Suggested by Ulrich Drepper. + +Sun Sep 24 08:36:47 1995 Jim Meyering (meyering@comco.com) + + * cksum.c: Protoize. + * cut.c: Protoize. + + * src/Makefile.in (OBJECTS): Reflect that cksum.c and cut.c use + prototypes. + (cksum): Depend on cksum$O. + (cut): Depend on cut$O. + +Sat Sep 23 15:43:46 1995 Jim Meyering (meyering@comco.com) + + * Version 1.12.2. + + * Makefile.in (DISTFILES): Add README.alpha. + + * lib/Makfile.in (GETOPT, MEMCHR, REGEX): New variables. + (OBJECTS): Use them instead of hard-coding object file names. + Suggested by Ulrich Drepper. + + * md5sum.c (md5_check): Distinguish between open/read failure + and checksum mismatch. + +Mon Sep 18 23:15:05 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c: Protoize. + * src/Makefile.in (OBJECTS): Change md5sum.o to md5sum$O. + (join.o, md5sum$O, sort.o) Depend on ../lib/long-options.h. + (md5sum): Depend on md5sum$O. + + * md5sum.c (main, usage): Remove -h, -s, -v short options. + Rename --verbose to --warn, --quiet to --status. + (main): Handle --help and --version using parse_long_options. + (md5_check): Check ferror. + + * sort.c (tempname): Replace `16' with a more readable expansion. + Make sure that counter never exceeds 99999. + (checkfp): Rearrange loop to avoid duplicate test. + Move a couple dcls from function scope into inner block. + +Tue Aug 8 21:49:27 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c (main): Fail if either --verbose or --quiet is specified + when not verifying checksums. + + * md5sum.c (md5_check): Fail if no valid line is found. + Don't use the word `fail' unless there were failures -- + instead, say `all N tests passed.' + + * md5sum.c (main) [handling --string option]: Don't output + nonstandard `b' binary flag. From Greg Troxel (gdt@bbn.com). + * md5-test.rfc: Remove now-inconsistant `b' marker. + (usage): Clarify help message. With suggestions from Greg Troxel. + +Mon Aug 7 23:27:54 1995 Jim Meyering (meyering@comco.com) + + * sort.c (mergefps) [lint]: Initialize SAVEALLOC to avoid spurious + compiler warning. From Ulrich Drepper. + + * pr.c (read_line) [lint]: Initialize CHARS to avoid spurious + compiler warning. From Ulrich Drepper. + + * Makefile.in (DISTFILES): Don't distribute unneeded COPYING.LIB. + From Franc,ois. + +Mon Aug 7 00:02:59 1995 Jim Meyering (meyering@comco.com) + + * system.h (_): Define macro -- as empty for now. + * src/*.c: Annotate localizable strings with _(...). From Franc,ois. + +Sat Aug 5 23:51:25 1995 Jim Meyering (meyering@comco.com) + + * Version 1.12.1. + + * configure.in: Add fp_C_PROTOTYPES. + +Fri Aug 4 23:21:46 1995 Jim Meyering (meyering@comco.com) + + * src/Makefile.in (DISTFILES): Include ansi2knr.c and ansi2knr.1. + Add suffixes, dependencies, and rules to convert ANSI source to K&R + when required. Mark tr.o and comm.o as the only such files (for now). + + * tr.c: Protoize. + * comm.c: Protoize. + + * Makefile.in (DISTFILES): Add aclocal.m4 and acconfig.h. + (configure): Depend on aclocal.m4. + (stamp.h.in): Depend on aclocal.m4 and acconfig.h. + +Sun Jul 30 00:01:58 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c (md5_check): Use getline instead of fgets. + + * lib/Makefile.in (SOURCES): Add getline.c. + (OBJECTS): Add getline.o. + (DISTFILES): Add getline.h. + (getline.o): Depend on getline.h. + + * md5.c [memcpy]: Define to bcopy if needed. + (md5_buffer): Explicitely cast SWAP expressions to unsigned + to avoid warning. + + * lib/Makefile.in (strtoul.o): Depend on strtol.c. + + * sort.c (check): Print `disorder on...' message on standard error, + not stdout. This is a minor concession to POSIX which says + `no output shall be produced...'. + + * sort.c (main): Fix -k so it works. -k 2,3 was being treated + like -k 2. Reported by Marcus Daniels . + +Wed Jul 26 22:54:48 1995 Jim Meyering (meyering@comco.com) + + * man/Makefile.in (install, uninstall): Strip off `.1', not just `1' + before applying $(transform) to manual name. From Karl Berry. + + * md5sum.c (have_read_stdin): New global variable. + (md5_file, md5_check): Set it. + (main): Use it. + + * md5sum.c [OPENOPTS]: Depend explicitly on BINARY. + (md5_file): Take a new parameter, MD5_RESULT, and no longer + generate output. + (md5_check): Invoke md5_file instead of calling fopen directly. + When giving a diagnostic for a line with invalid format, also report + the line number. + (main): Generate output after a successful md5_file call. + [in many places]: Upon detection of an error, rather than exiting + immediately, issue a diagnostic, note that an error occurred and + exit later. + +Mon Jul 24 21:48:26 1995 Jim Meyering (meyering@comco.com) + + * tail.c (tail_bytes) [from_start]: For regular files, seek + relative to the initial input file pointer position, not + necessarily from the beginning of the file. + [!from_start]: Don't back up past the initial position of the + input file pointer. + (tail_lines): Call file_lines only if FD refers to a regular file + with its file pointer positioned at beginning of file. Otherwise, + call pipe_lines. This is a kludge. Once there's a decent test + suite, fix this properly. + Before, (echo 1; echo 2) > k; sh -c 'read x; tail' < k + would output both lines of the input file even though the first had + already been read. Reported by John Roll (john@panic.harvard.edu). + + * md5sum.c [_LIBC || STDC_HEADERS] (TOLOWER): Define to tolower. + + * csplit.c (main): When too few arguments are given, don't just + issue the usage message; also report why. + +Sat Jul 22 00:16:01 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c (md5_check): New function -- extracted from main. + +Fri Jul 21 01:21:49 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c (md5_file): New function -- extracted from main. + (main): Call the new function instead of doing all that in an + if-stmt. Always use "%s" format rather than raw filename as + format argument in printf-style functions like error. Otherwise, + filenames containing `%' are likely to lose. + Remove all mention of `old format'. + (split_3): No longer parse the `new format.' There is only one + valid format now: the compatible one. + + * lib/Makefile.in (SOURCES): Add md5.c. + (OBJECTS): Add md5.o. + (DISTFILES): Add md5.h. + (md5.o): Depend on md5.h. + + * system.h [!EXIT_FAILURE, !EXIT_SUCCESS]: Define them. + * lib/md5.c (md5_stream): Check for read failure and return + indication of success rather than second argument. + * lib/md5.h (md5_stream): Update prototype. + [__P]: Define macro. + * md5sum.c: Use EXIT_FAILURE and EXIT_SUCCESS. + (main): Report an error if md5_stream fails. Otherwise, running + `md5sum dir-on-mounted-filesystem' always reported the checksum + for an empty file. Now it gets the `is a directory' error. + Greg McGary (gkm@magilla.cichlid.com) reported that the released + version got stuck in an infinite loop with such arguments. + + * lib/md5.c: New file. + * lib/md5.h: New file. + * md5sum.c: Rewritten to use library interface. + From Ulrich Drepper. + +Sun Jul 16 18:42:34 1995 Jim Meyering (meyering@comco.com) + + * configure.in: Add AC_C_INLINE: md5sum.c uses inline keyword. + +Tue Jul 11 21:56:02 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c Add #else block after #ifdef VMS. + (main): Rename local variable. + Detect and report failed fclose calls on stdout and checkfile_stream. + + * tr.c (unqote): Comment out unreachable break stmts. + (append_range): Declare FIRST and LAST parameters to be unsigned int, + not size_t. + (find_closing_delim): Clean up interface, separating boolean success + indicator and index. + (find_bracketed_repeat): Likewise. + (build_spec_list): Adapt to use new interfaces. + Declare CLOSING_DELIM_IDX and CLOSING_BRACKET_IDX to be of + type size_t, not int. + (main): Declare NR and CHARS_READ to be of type long, not int. + + * sort.c (main): Comment out unreachable break stmt. + + * tail.c (tail): Explicitly cast to long the N_UNITS argumennt in + call to tail_lines. Otherwise, NetBSD lost because N_UNITS (of type + off_t, a 64-bit type on NetBSD) wasn't converted to the target type, + long. Reported by Dan Hagerty (hag@gnu.ai.it.edu). + + * comm.c: Reorder functions so main is last, so no forward dcls + are needed. + +Sun Jul 9 11:41:15 1995 Jim Meyering (meyering@comco.com) + + * sort.c (main): When using obsolescent +pos -pos syntax, allow + omission of field spec only when character offset is specified. + Otherwise, -. +. would be accepted. + +Sat Jul 8 13:48:06 1995 Jim Meyering (meyering@comco.com) + + * sort.c (main): Allow field spec, M, to be omitted in +M.N or -M.N + position specification. For compatibility with existing practice + (what vendors?), omitting M is now equivalent to specifying `0' for M, + but only when using the +pos -pos syntax, not with the -k option. + From Rick Sladkey (jrs@world.std.com). + +Thu Jul 6 23:44:20 1995 Jim Meyering (meyering@comco.com) + + * od.c (dump): Correct loop-termination criterion. + Before, running `printf 1234| ./od --width=4 --read-bytes=4' + printed output for 8 bytes -- the last four were garbage. + This happened only when the dump limit, N, was specified (with + --read-bytes=N) and N was a multiple of bytes_per_block + (usually 16, but 4 in this example). From Andreas Schwab. + +Sun Jul 2 22:12:40 1995 Jim Meyering (meyering@comco.com) + + * lib/Makefile.in (check): Depend on libtu.a. + + * md5sum.c (split_3): Rewrite to parse Plumb/Lankester format as well. + (main): Print each sum line in (de facto) standard Plumb/Lankester + format. + New option: --quiet. + Check option no longer takes an argument. + When checking, exit status reflects success. + +Sat Jun 24 16:18:01 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c [__GNUC__]: Don't conditionalize use of "inline". + Autoconf (via config.h) defines it away for compilers that don't + grok it. + + * cat.c, comm.c, join.c, sort.c, uniq.c: Undefine min/max before + defining to avoid redefinition warning on some systems. + + * csplit.c (read_input): Rename paramater MAX to MAX_N_BYTES. + This avoids potential conflict with max macro from some system's + header files when using bad pre-ANSI compilers. + + * uniq.c (usage): Fix typo in text of --help output. + From Steve McConnel + + * md5sum.c [uint32]: When testing for 32-bit arithmetic type, + also check `unsigned long', as a concession to systems with + int's smaller than 32 bits. + + * configure.in (AC_REPLACE_FUNCS): Remove memcmp (again!) since + AC_FUNC_MEMCMP already handles it. This avoids warnings from + ranlib on nextstep systems. From Kaveh Ghazi. + + * csplit.c (interrupt_handler): Declare to have a single integer + parameter. Otherwise, some compilers fail with a type mismatch + error in sa_handler assignment. + + * fmt.c [word]: Redefine. Otherwise, systems (Unicos for one) with + headers that typedef `word' get syntax errors because of the + variable by the same name. + + * join.c [join]: Redefine to avoid conflict with prototype in some + system header file. Also for Unicos. + + * md5sum.c (main): Remove spurious colon in getopt spec string. + From Ken Pizzini . + +Tue Jun 20 06:59:16 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c (md5_file): Initialize two elements of LEN portably, + rather than with ANSI aggregate initialization. Reported by + Edzer Pebesma . + +Sun Jun 18 09:15:57 1995 Jim Meyering (meyering@comco.com) + + * Version 1.12. + + * md5sum.c (process_buffer): Copy values from struct into + individual local variables before performing computation on them, + then copy results back into returned struct. Solely for better + optimization by compilers that can't keep struct members in + registers. From Ulrich Drepper. + +Thu Jun 15 22:09:14 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c: Remove unnecessary uses of `defined' in #if* tests. + Don't use #elif. Some older compilers don't grok it. + (split_3): New function to parse out sum, flag, and filename + when reading check file. + (hex_digits): Remove length parameter since string parameter is + now nul-terminated. + (main): Don't allocate separate arrays for filename and sum + when checking. Get pointers into line buffer with split_3 instead + of using sscanf. + (main): Treat `no file args' just like `-' when not checking + or using strings. + (hex_digits): Unprotoize. + + * md5sum.c (main): Don't use a separate loop to convert to lower + case. Suggested by Ulrich Drepper. + (CLOSE): New macro. + (md5_file): Use it. + From Ulrich Drepper. + + * md5sum.c: Don't include values.h. + [__P]: Undefine it. + + * md5sum.c: [UNIX || unix]: Also test __UNIX__, __unix__, + and _POSIX_VERSION. Reported by Arne H. Juul. + +Tue Jun 13 21:20:10 1995 Jim Meyering (meyering@comco.com) + + * tr.c [NDEBUG]: Define it to disable assertions. Some systems + have a broken header. + (is_char_class_member): Set a variable in each branch of switch + stmt and return that value after the switch (rather than returning + directly from every branch). + (unquote): More int->size_t changes. + (build_spec_list): More int->size_t changes. + Be very careful about comparison now that variables are unsigned: + Use i + 2 < len rather than i < len - 2. The latter didn't work + for len < 2. Caught early thanks to a thorough regression test + suite. + +Mon Jun 12 23:07:59 1995 Jim Meyering (meyering@comco.com) + + * sort.c (xfclose): Don't try to flush stdin, only stdout. + Otherwise, at least Ultrix-4.3's fflush would return EOF. + Reported by Jim Blandy (jimb@cyclic.com). + + * tr.c (non_neg_strtol): Don't compare signed and unsigned. + [struct Spec_list] (indefinite_repeat_element): New member. + Use size_t rather than int or unsigned long where reasonable. + (get_spec_status): Make interface cleaner. + (get_s1_spec_status): New function. + (get_s2_spec_status): New function. + (validate): Use new functions instead of get_spec_status. + +Sun Jun 11 00:39:50 1995 Jim Meyering (meyering@comco.com) + + * md5sum.c: New file. From Ulrich Drepper. + * md5-test.rfc: New file. + * Makefile.in (PROGS): Add md5sum. + (check): Run a recursive make in each subdirectory. + * man/Makefile.in (MANFILES): Add md5sum.1. + * src/Makefile.in (SOURCES): Add md5sum.c. + (OBJECTS): Add md5sum.o. + (PROGS): Add md5sum. + (check): Add basic checks for md5sum. + (md5sum): Add dependency and link rule. + (DISTFILES): Add md5-test.rfc. + + * tr.c (look_up_char_class, append_char_class, append_equiv_class): + Use const attribute when appropriate. + +Sun May 28 14:48:58 1995 Jim Meyering (meyering@comco.com) + + * join.c: Overhauled to make -a1 and -a2 options work. + Passed all tests in a fairly thorough test suite. + Reported by Michael Hasselberg (mikelh@zonta.ping.de). + +Sat May 27 00:35:47 1995 Jim Meyering (meyering@comco.com) + + * tail.c (main): Remove dcl of and statements that set now-unused + variable. + + * system.h [!STDC_HEADERS && HAVE_MEMORY_H]: Include memory.h. + Without this, SunOS doesn't get type for memchr. + Reported by Kaveh Ghazi. + +Thu May 25 00:06:50 1995 Jim Meyering (meyering@comco.com) + + * tail.c (tail_lines): Change one more `long' to `off_t'. + Otherwise, tail didn't work on NetBSD. From Arne H. Juul. + + * csplit.c [struct control]: Change type of `repeat' to unsigned + long to avoid conversion warning. + +Sun May 21 07:50:00 1995 Jim Meyering (meyering@comco.com) + + * Makefile.in (.PHONY): TAGS is not a phony target. From Franc,ois. + + * xstrtol.c (__strtol): Remove prototype altogether. + Move inclusion of xstrtol.h back so that it follows system headers. + + * Version 1.11.2. + +Sat May 20 06:44:14 1995 Jim Meyering (meyering@comco.com) + + * join.c (ADD_FIELD): Declare in K&R style, not ANSI. + From Kaveh Ghazi. + + * xstrtol.c: Define NDEBUG for systems with losing assert.h. + (__strtol): Add __unsigned to prototype and use __P. + Move inclusion of xstrtol.h to precede prototype. + From Kaveh Ghazi. + + * memmove.c: Include config.h for definition of const. + From Kaveh Ghazi. + + * All Makefile.in (install-exec, install-exec): New targets. + From Karl Berry. + + * tr.c (look_up_char_class): Take a string length argument -- required + because the argument is a string that is *not* NUL-terminated. + Use strncmp, not strcmp and add string lengths comparison. + (append_char_class): Update caller. Before this change, + tr '[:upper:]' '[:lower:]' read one uninitialized byte. + From Andreas Schwab. + + * split.c (next_file_name): Move dcls of file-scope variables into + this function. Don't rely on arithmetic being two's complement. + + * paste.c [CLOSED, ENDLIST]: Don't cast constants to FILE pointers. + Instead, declare two FILE structs and use their addresses. + + * csplit.c (record_line_starts): Remove set-but-not-used, + file-scope variable. + +Sat May 13 08:57:20 1995 Jim Meyering (meyering@comco.com) + + * all source files (usage): Include one- or two-line synopsis + in --help output. From Karl Berry. + + * lib/Makefile.in [.c.o]: Remove -I. since safe-l?stat.h are no + longer used. + +Wed May 10 22:26:35 1995 Jim Meyering (meyering@comco.com) + + * Version 1.11.1 + +Sun May 7 13:35:49 1995 Jim Meyering (meyering@comco.com) + + * all Makefile.in (maintainer-clean): Renamed from realclean + per GNU Standards. + +Thu May 4 23:15:58 1995 Jim Meyering (meyering@comco.com) + + * sort.c (main): Use stat, not safe_stat. The latter was unnecessary. + Don't include safe-stat.h. + + * lib/Makefile.in (DISTFILES): Remove safe-xstat.hin. + Remove all associated rules. safe-l?stat.h are no longer used. + + * sort.c Don't hard-code /tmp. + [DEFAULT_TMPDIR]: Use this instead. + * tac.c (save_stdin): Likewise. + + * sort.c (set_ordering): Properly parse arguments like `+x.yn'. + Reported by John Salmon (johns@mullet.anu.edu.au). + Patch from Mike Haertel. + +Wed Apr 26 23:48:13 1995 Jim Meyering (meyering@comco.com) + + * sort.c (tempname): AND-off high bits of pid so that its decimal + string representation is no longer than five digits. + From Hans Verkuil (hans@wyst.hobby.nl). + +Thu Apr 20 23:09:33 1995 Jim Meyering (meyering@comco.com) + + * expand.c (add_tabstop): Give correct size when reallocating + tab_list buffer. From Geoff Odhner (geoff@franklin.com). + Reproduce with expand --t=`perl -e "print join (',', (1..300));"`. + +Tue Apr 18 22:57:43 1995 Jim Meyering (meyering@comco.com) + + * configure.in (AC_OUTPUT): Use echo, not date, to avoid creating + unnecessary conflicts for people using version control software + like RCS and CVS. + (AC_ARG_PROGRAM): Use it. + +Thu Apr 13 23:22:57 1995 Jim Meyering (meyering@comco.com) + + * head.c: Remove block of redundant comments describing options. + (usage): Remove reference to -l option. It's not valid. + + * od.c (write_block): Declare index I as unsigned int, not int. + (get_lcm): Likewise. + (dump_strings): Likewise. + (main): Likewise. + (dump): Cast BYTES_PER_BLOCK to off_t in MIN expression. + (dump_strings): Declare bufsize to be of type size_t, not int. + + * split.c (next_file_name): Don't reuse X as an index. + Declare new variable I instead. + +Sat Mar 25 15:07:23 1995 Jim Meyering (meyering@comco.com) + + * csplit.c: Declare as `unsigned int' all variables that were + just `unsigned'. + (make_filename): Change type of arg to unsigned int. + (split_file): Change type of indices to unsigned int. + +Thu Mar 16 22:05:05 1995 Jim Meyering (meyering@comco.com) + + * od.c (main): Detect and fail when argument to -N is too large + to fit in an off_t. + +Sun Mar 12 12:02:39 1995 Jim Meyering (meyering@comco.com) + + * configure.in (AC_REPLACE_FUNCS): Add memcmp.c. + Remove check for sizeof long. + + * linebuffer.h: Undefine __P before defining it. + * long-options.h: Likewise. + * xstrtol.h: Likewise. + + * memcpy.c: New file. + * lib/Makefile.in (SOURCES): Add memcpy.c. + +Fri Mar 10 21:14:11 1995 Jim Meyering (meyering@comco.com) + + * src/*.c: Update Copyright dates. + +Sat Feb 11 07:31:08 1995 Jim Meyering (meyering@comco.com) + + * system.h: Remove index/rindex and bcmp/bcopy/bzero references. + Separate errno declaration from STDC_HEADERS. + + * wc.c (wc): For efficiency, handle separately the cases in which + words need not be counted. Suggested by Karl Heuer. + + * wc.c (wc): Don't overcount the number of bytes when reading + from a regular file on stdin with file pointer not at BOF. + From Karl Heuer . Before, the command + `(dd ibs=99k skip=1; wc -c) < /etc/group' made wc wrongly output + the size of the file. Now it outputs `0'. + +Sat Jan 28 07:07:23 1995 Jim Meyering (meyering@comco.com) + + * cat.c (cat): Use memmove rather than bcopy. + * csplit.c (load_buffer): Use memcpy rather than bcopy. + (extract_regexp): Use strrchr, not rindex. + * fmt.c (isopen, isclose, isperiod): Use strchr, not index. + (flush_paragraph): Use memmove instead of bcopy. + * fold.c (fold_file): Use memmove instead of bcopy. + * od.c (decode_format_string): Use memmove instead of bcopy. + [EQUAL_BLOCKS]: Use memcmp, not bcmp. + (parse_old_offset): Use strchr, not index. + (dump): Use memset, not bzero. + * sort.c (checkfp, mergefps): Use memcpy instead of bcopy. + (fillbuf): Use memmove instead of bcopy. + * split.c (main): Use memset, not bzero. + (line_bytes_split): Use memmove instead of bcopy. + * tac.c (tac): Use memmove instead of bcopy. + (output): Use memcpy instead of bcopy. + * tail.c (pipe_lines, pipe_bytes): Use memcpy instead of bcopy. + * tr.c (substr): Use memcpy instead of bcopy. + (card_of_complement, set_initialize): Use memset, not bzero. + + * tr.c (substr): Don't allocate a byte for trailing NUL in result + since the result needn't be NUL-terminated. Don't NUL terminate it. + + * configure.in (AC_REPLACE_FUNCS): Check for memmove and memcpy, + not bcopy. + (AC_CHECK_FUNCS): Add strchr and strrchr. + + * lib/Makefile.in (SOURCES): Add memmove.c and memcpy.c. + * memmove.c: New file. + * memcpy.c: New file. + +Tue Jan 24 22:18:19 1995 Jim Meyering (meyering@comco.com) + + * fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph + not followed by a newline would be followed by data copied from + uninitialized storage. Repeat by `printf abc|fmt|od -ac'. + Reported by Franc,ois Pinard. + + * od.c: Rename macros with FP_ prefix. Use FLOAT_ instead. + AIX-2.2.1 declares a typedef, FP_DOUBLE, that conflicted. + Be careful to use off_t instead of explicit `unsigned long'. + Otherwise, systems like 4.4BSD lose on calls to fseek that + expect off_t (which is long long on that system). + (parse_old_offset): Use xstrtoul + (main): Likewise. + + * src/Makefile.in (od.o, tail.o): Depend on ../lib/strtol.h. + +Mon Dec 19 22:13:55 1994 Jim Meyering (meyering@comco.com) + + * tail.c (numerous functions): Give char* filename arguments the + const attribute. + + * lib/Makefile.in (SOURCES): Remove xwrite.c. It was no longer used. + Add xstrtol.c and xstrtoul.c. + (OBJECTS): Likewise for .o files. + (DISTFILES): Add error.h and xstrtol.h and xstrtoul.h. + + * lib/Makefile.in (DISTFILES): Remove safe-xstat.cin. + (distclean): Remove references to safe-l?stat.c. + Remove all related rules and dependencies. + + * src/Makefile.in: $(OBJECTS): Depend on ../lib/error.h. + +Thu Dec 15 23:14:04 1994 Jim Meyering (meyering@comco.com) + + * tail.c (tail_file): Fix call to error with %s in format, but + no corresponding argument. + + * src/*.c: Include "error.h" instead of simply declaring + `void error ();'. + * od.c (main): Use %lu, not %d for unsigned long. + (my_strtoul, uint_fatal_error): Remove functions. Use xstrtoul + and STRTOL_FATAL_ERROR instead. + +Sun Dec 11 17:24:09 1994 Jim Meyering (meyering@comco.com) + + * sort.c (main): Fix interpretation of field offsets when specified + via -k option. They were being interpreted as zero-indexed. POSIX + says they are 1-based indices. From Rik Faith . + (keycompare): Don't ignore characters at the end of words when + otherwise they would compare equal. From Rik Faith. + + * tail.c (): Change the type of n_units/n_lines/n_bytes + to off_t because n_bytes is used as the option to fseek and off_t may + be long long (e.g. on BSD4.4). The only place where a 32-bit limit is + imposed is in the string-to-integer converstion of xstrtol. + (main): Use xstrtol instead of manual string to integer conversion. + + * csplit.c (get_format_width, get_format_prec): Use ISDIGIT instead of + comparisons against '0' and '9'. + + * tr.c [!ULONGMAX]: Define it. + [!LONGMAX]: Define in terms of ULONGMAX instead of as a 32-bit constant. + + * full-write.c: Declare (or not) errno based on definedness or + errno, not STDC_HEADERS. + * safe-read.c: Likewise. + * xwrite.c: Likewise. + +Thu Nov 17 06:37:33 1994 Jim Meyering (meyering@comco.com) + + * tail.c (dump_remainder): Flush standard output just before + sleeping so that `tail -f' will output partial lines sooner. + This applies only when following the end of a single file. + From Leonard N. Zubkoff . + + * tail.c (file_lines, pipe_lines, pipe_bytes, start_bytes, + start_lines, dump_remainder): Use STDOUT_FILENO instead of `1' in + XWRITE calls. + * tac.c (output): Use STDOUT_FILENO instead of `1' in xwrite call. + * system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Define if + not already defined. + +Wed Nov 16 07:01:38 1994 Jim Meyering (meyering@comco.com) + + * tr.c: Include instead of "getopt.h". + + * sort.c (tempname): Merge two very similar sprintf stmts into one. + + * tail.c: Use BUFSIZ instead of BUFSIZE. + + * cut.c: Declare DELIM to be `int' rather than unsigned char. + + * fmt.c: Use index, not strchr -- per GNU Standards. + Reported by Kaveh Ghazi. + Always include . + (main): Include program name in --version output. + +Sun Nov 06 00:17:21 1994 Jim Meyering (meyering@comco.com) + + * Version 1.11. + +Sat Nov 05 15:14:44 1994 Jim Meyering (meyering@comco.com) + + * memcmp.c, srtoul.c: Use up-to-date versions. + Reported by Franc,ois Pinard. + + * src/Makefile.in (DEFS): Remove -Dlint... again. + + * src/Makefile.in (PROGS): Add fmt! + Reported by Andreas Stolcke (stolcke@ICSI.Berkeley.EDU). + +Fri Nov 04 17:26:16 1994 Jim Meyering (meyering@comco.com) + + * Version 1.10. + +Thu Nov 03 23:23:08 1994 Jim Meyering (meyering@comco.com) + + * linebuffer.h: Use __P instead of _P since the latter conflicts + with a definition in some . From Kaveh Ghazi. + +Wed Nov 02 17:36:34 1994 Jim Meyering (meyering@comco.com) + + * tr.c: Add const attribute where appropriate. + + * tail.c (BUFSIZ): Use definition from . + +Tue Nov 01 23:54:09 1994 Jim Meyering (meyering@comco.com) + + * tail.c (XWRITE): Allow n_bytes == 0 but call fwrite only if + n_bytes is positive. Turn off assertions. `tail /dev/null' was + getting a failed assertion. Reported by Doug McLaren + (dougmc@comco.com). + + * cut.c (cut_bytes): Print at least a newline for every line of input. + (cut_fields): Print a newline even for lines whose only selected + field is empty. But print nothing when using -s without -f1. + And print nothing for empty input. Reported by + Richard_Sharman@software.mitel.com. + +Tue Nov 01 06:05:23 1994 Jim Meyering (meyering@comco.com) + + * fmt.c: Change #ifdef __STDC__ to #if defined (__STDC__) && __STDC__. + * linebuffer.h: Likewise. + +Mon Oct 31 06:53:32 1994 Jim Meyering (meyering@comco.com) + + * configure.in (AC_REPLACE_FUNCS): Remove memcmp since AC_FUNC_MEMCMP + already handles it. From Kaveh Ghazi. + + * {lib,src}/Makefile.in (DEFS): Don't use -Dlint. Some systems + get failures when it's defined. From Kaveh Ghazi. + + * cat.c (cat): Conditionalize test for errno == ENOSYS. It's not + defined on some Next and Alliant systems. From Kaveh Ghazi. + + * sort.c join.c (main): Include version.h and call parse_long_options + with the proper number of arguments. Reported by Franc,ois Pinard. + +Sun Oct 30 01:30:41 1994 Jim Meyering (meyering@comco.com) + + * (configure.in): Add AC_OFF_T and rearrange by type along the + same lines as autoscan. + + * fmt.c, fmt.1: New files. + Both from Ross Paterson (rap@doc.ic.ac.uk). + + * Makefile.in (PROGS): Add fmt. + * src/Makefile.in (SOURCES, OBJECTS): Add fmt.c and fmt.o respectively. + (fmt): Add a link rule. + * man/Makefile.in (MANFILES): Add fmt.1. + +Sat Oct 08 10:44:30 1994 Jim Meyering (meyering@comco.com) + + * Makefile.in (All of them): Update from the ones in sh-utils. + From now on, rules and definitions that are comon to the fileutils, + textutils, and sh-utils will get ChangeLog entries only in the + sh-utils. + +Tue Oct 04 20:42:46 1994 Jim Meyering (meyering@comco.com) + + * od.c (my_strtoul): Set errno to zero before calling strtoul. + Otherwise, od can fail complaining about a valid integer argument. + From Andreas Schwab. + +Sun Oct 02 17:57:09 1994 Jim Meyering (meyering@comco.com) + + * tr.c (main): Give an error and fail when squeezing repeats + and no non-options are given. Reported by Tony Robinson + (ajr@eng.cam.ac.uk). + + * sort.c (main): Temporarily copy each input file that might be + another name for the output file. When in doubt (e.g. a pipe), + copy. This allows the dangerous (historical -- in cnews) idiom + `cat file | sort -o file' to work properly. Don't rely on this + behavior in new shell scripts. From Paul Eggert (eggert@twinsun.com). + +Mon Sep 26 18:01:47 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * lib/xwrite.c safe-read.c memchr.c linebuffer.c full-write.c: + Remove CONFIG_BROKETS ifdef. + * src/Makefile.in lib/Makefile.in: Don't define it. + +Sat Sep 24 21:26:27 1994 Jim Meyering (meyering@comco.com) + + * full-write.c (full_write): Declare argument LEN to be size_t. + +Mon Sep 12 13:35:27 1994 Jim Meyering (meyering@comco.com) + + * tail.c (tail_file): [For multiple files only]: Report truncation + of monitored file and reset current file size. From Franc,ois Pinard. + +Sat Aug 27 16:57:20 1994 Jim Meyering (meyering@comco.com) + + * system.h [BROKEN_STAT_MACROS]: Remove unnecessary #ifdef's. + From Franc,ois Pinard. + +Tue Jul 26 11:33:53 1994 Jim Meyering (meyering@comco.com) + + * system.h: Remove `|| defined(_POSIX_VERSION)' from test that + decides whether to include . From Francois Pinard. + +Wed Jul 13 12:33:34 1994 Jim Meyering (meyering@comco.com) + + * tr.c (substr): Fix off-by-one allocation error. + +Wed Jun 22 01:02:50 1994 Jim Meyering (meyering@comco.com) + + * tac.c (tac_file): Use O_RDONLY instead of zero in call to open. + (tac): Fix typo that had `1' as arg #2 of error after failed read. + Use errno instead. From Michael I Bushnell . + +Thu May 26 08:46:32 1994 Jim Meyering (meyering@comco.com) + + * configure.in [INSTALL]: Revert change of March 25. autoconf + has been fixed. + +Mon Apr 11 17:25:43 1994 Jim Meyering (meyering@comco.com) + + * join.c (prline): Remove unused function. Indent. + +Fri May 6 05:44:24 1994 Jim Meyering (meyering@comco.com) + + * tail.c (tail_forever): Don't print headers when asked not to. + From Karsten Thygesen . + + * wc.c (wc): Optimize for the case when only bytes are being counted + and the input is not a regular file. From Jeff Moore . + +Sun Apr 24 10:54:08 1994 Jim Meyering (meyering@comco.com) + + * configure.in [AC_SIZEOF_TYPE]: Update for autoconf-1.9. + * memchr.c: Test SIZEOF_LONG instead of LONG_64_BITS. + +Mon Apr 11 17:55:52 1994 Jim Meyering (meyering@comco.com) + + * csplit.c (struct control): Add new field, repeat_forever. + Remove now-unneeded definition of INT_MAX. + (process_regexp): Test repeat_forever instead of comparing `repeat' + to INT_MAX. + (split_file): Don't even reference `repeat' count if repeat_forever + is set. + (new_control_record): Initialize repeat_forever field. + (parse_repeat_count): Set it instead of setting repeat count to + INT_MAX. + (process_line_count): Abort for internal error instead of calling + handle_line_error. + + * long-options.c (parse_long_options): Take a new argument indicating + the utility name (e.g. "join", not "gjoin") for version output. + Print both the utility and the package names, e.g. `join - GNU + textutils-1.9.1' instead of just the package name. + + * join.c (main): Call parse_long_options with program name arg. + * sort.c (main): Ditto. + + * All source except sort.c and join.c (main): Change --version output + to include utility name as well as package name and version info. + +Wed Mar 30 08:53:21 1994 Jim Meyering (meyering@comco.com) + + * configure.in: Use AC_SET_MAKE. + * Makefile.in: Edit MAKE assignments into @SET_MAKE@. + +Mon Mar 28 09:55:05 1994 Jim Meyering (meyering@comco.com) + + * tr.c (main): In addition to the --help usage pointer, give an + explicit error message for too many arguments. + +Fri Mar 25 18:11:19 1994 Jim Meyering (meyering@comco.com) + + * configure.in: Use AC_VERBOSE, AC_CHECKING, and AC_WARN instead + of explicit echo commands. + [INSTALL]: When AC_PROG_INSTALL resorts to setting this to + `./install.sh', make it `../install.sh' instead since that + script will be invoked only from subdirectories. + [AC_SIZEOF_TYPE]: Use this instead of deprecated AC_LONG_64_BITS. + + * cat.c (cat): The command `:|cat -s' failed on Irix5 because + ioctl (d, FIONREAD,... now returns ENOSYS for pipes -- under Irix4 + it returned EINVAL. Detect this. + (main) [lint]: Initialize variables to suppress `used before + initialized' warnings. + + * csplit.c: Change long option name from --suffix to --suffix-format. + + * od.c (skip): Correct a comment. + (main): Don't output anything to stdout if the sole input file + doesn't exist. Reported by Bauke Jan Douma . + + * od.c (dump) [lint]: Initialize a variable to suppress `used before + initialized' warning. + (main) [lint]: Ditto. + * paste.c (paste_parallel) [lint]: Ditto. + +Fri Jan 28 11:02:21 1994 Jim Meyering (meyering@comco.com) + + * configure.in: Don't set LDFLAGS since linking now uses both + LDFLAGS and CFLAGS. + +Wed Jan 18 16:14:00 1994 Jim Meyering (meyering@comco.com) + + * unexpand.c (unexpand): Don't segfault when given a name of a + nonexistent file. + * expand.c (expand): Ditto. + Both from Bauke Jan Douma . + +Thu Jan 13 17:27:38 1994 Jim Meyering (meyering@comco.com) + + * src/Makefile.in: Change all link commands to use both $(CFLAGS) + and $(LDFLAGS). + + * csplit.c (load_buffer): Rather than incrementing buffer size, + double it each time we fail to find a newline. Otherwise, csplit + would run out of memory when processing files with very long lines. + +Mon Jan 10 01:20:38 1994 Jim Meyering (meyering@comco.com) + + * man/Makefile.in (manprefix): Use binprefix as the default. + +Sat Jan 08 22:22:45 1994 Jim Meyering (meyering@comco.com) + + * cat.c: Use full_write and safe_read instead of write and read resp. + * csplit.c: Ditto. + * head.c: Ditto. + * split.c: Ditto. + * tac.c: Ditto. + + * sum.c: Use safe_read instead of read. + * tr.c: Ditto. + * wc.c: Ditto. + + * tail.c: Replace calls to xwrite with calls to fwrite. + Use fopen/fclose instead of open/close. + (write_header): Use a single call to printf instead of four to xwrite. + Use safe_read instead of read. + * head.c: Ditto. + +Tue Dec 28 15:49:32 1993 Jim Meyering (meyering@comco.com) + + * install.sh: New file. + Makefile.in [DISTFILES]: Add it. + +Wed Dec 22 18:52:44 1993 Jim Meyering (meyering@comco.com) + + * memcmp.c: Use the latest version from the GNU C library. + + * cut.c [ADD_RANGE_PAIR]: New macro. + (set_fields): Collect the list of all selected ranges before + allocating and initializing the boolean lookup table. + (cut_bytes, cut_fields): Complete rewrite. Avoid copying + into buffer whenever possible. Properly handle input without + trailing newline. + (getstr): New function. Copied from getline.c, but with minor changes. + + * sort.c (main): Properly handle -Tdir. + Before, `sort -T/var/tmp' gave `sort: unrecognized option `-v''. + Reported by Kristoffer Rose (kris@diku.dk). + + * cut.c (main): Give separate errors for `-s without -f' + and `-d without -f'. + (main): Now -d '' means `use the NUL byte as the delimiter'. + Before, it got an error. + +Mon Dec 20 23:29:30 1993 Jim Meyering (meyering@comco.com) + + * configure.in [test for 8-bit clean memcmp]: Add a test to detect + losing memcmp from SunOS4.1.x. From Robert H. de Vries + . + +Sat Dec 18 01:12:24 1993 Jim Meyering (meyering@comco.com) + + * configure.in (AC_OUTPUT): Put `touch stamp-config' in second arg + so it goes in config.status. This eliminates unnecessary second run + of configure. + +Thu Dec 02 23:53:03 1993 Jim Meyering (meyering@comco.com) + + * configure.in (AC_HAVE_FUNCS): Add isascii. + * system.h [!defined (isascii) || defined (STDC_HEADERS)]: This failed + on AIX PS/2 1.3 systems because isascii is a function and it is used + in definitions (with the necessary side effect of assigning to a + global variable) of the is* macros. Also test HAVE_ISASCII and + redefine ISASCII(c) instead of isascii. + Reported by Minh Tran-Le (tranle@intellicorp.com). + +Fri Nov 19 22:41:48 1993 Jim Meyering (meyering@comco.com) + + * configure.in: Don't run the test for 8-bit clean memcmp if we + already know we'll be using our replacement. + +Fri Nov 12 00:44:49 1993 Jim Meyering (meyering@comco.com) + + * Version 1.9.1. + + * tac.c (usage): Fix typo in long usage. + * sort.c (usage): Likewise. + From Philippe.Schnoebelen@imag.fr. + + * cut.c [FATAL_ERROR]: New macro. + (main): Call both error and usage (2) through FATAL_ERROR in + many places. Before, only `error (2...' was called. + (invalid_list): Removed. This function is subsumed by FATAL_ERROR. + + * cut.c (cut_fields): Properly handle input lacking a terminating + newline. Before, the command `printf "a\tb" |cut -f 1' generated + no output. + +Tue Nov 09 17:26:25 1993 Jim Meyering (meyering@comco.com) + + od.c (usage): Change --backward-compatible to --traditional in + the long usage message. + +Sun Nov 07 00:50:05 1993 Jim Meyering (meyering@comco.com) + + * Version 1.9. + +Sat Nov 06 22:51:31 1993 Jim Meyering (meyering@comco.com) + + * cut.c (cut_fields): Revert July 27 change. Instead, strip off + trailing delimiter unless given a range of fields like `3-' that + extends to end of line. + (set_fields): Moved local `eol_range_start' to file-scope. + Reported by Arne H. Juul (arnej@solan.unit.no). + +Tue Nov 02 00:53:41 1993 Jim Meyering (meyering@comco.com) + + * fold.c (fold_file): Don't get stuck in an endless loop when + width is smaller than 8 and there are TABs in the input. + +Sat Oct 30 15:31:28 1993 Jim Meyering (meyering@comco.com) + + * join.c: Remove now-unused dcls of show_help and show_version. + +Fri Oct 29 13:58:50 1993 Jim Meyering (meyering@comco.com) + + * csplit.c [INT_MAX]: Make sure it's defined. + [not HAVE_LIMITS_H]: Don't include limits.h. + From Kaveh R. Ghazi (ghazi@noc.rutgers.edu). + +Wed Oct 27 01:13:52 1993 Jim Meyering (meyering@comco.com) + + * Version 1.8.1. + +Mon Oct 25 20:16:33 1993 Jim Meyering (meyering@comco.com) + + * sort.c: Accept but ignore -y0 for compatibility with Solaris 2. + From Chuck Hedrick (hedrick@klinzhai.rutgers.edu). + + * sort.c (main): Handle --help and --version options. + * Makefile.in (sort.o): Depend on long-options.h. + +Sun Oct 24 00:31:02 1993 Jim Meyering (meyering@comco.com) + + * csplit.c, cut.c, expand.c, fold.c, head.c, nl.c, od.c, paste.c, + split.c, tac.c, tail.c, unexpand.c, uniq.c: Use the preferred + `--longopt=arg' syntax in --help message rather than `--longopt arg'. + From Francois Pinard. + + * tail.c: Don't include . It hasn't been necessary + since the Dec 12, 1992 change. + + * join.c (main): Accept `-v 1' again. Adding the --version + long option had broken it, although -v1 still worked. Call + parse_long_options instead of adding "help" and "version" + to join's longopt strct. + * Makefile.in [SOURCES, OBJECTS, DISTFILES]: Add long-options.c + and long-options.h. + * (join): Depend on and link with long-options.o. + * (join.o): Depend on long-options.h. + + * od.c: Change --compatible (-C) to --backward-compatible (-B). + + * csplit.c: Change --abandon-null-files to --elide-empty-files. + +Sat Oct 23 01:00:12 1993 Jim Meyering (meyering@comco.com) + + * tr.c (get_next, string2_extend): Add default: label to switch stmt. + + * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fold.c, head.c, + join.c, nl.c, od.c, paste.c, pr.c, split.c, sum.c, tac.c, tail.c, + tr.c, unexpand.c, uniq.c, wc.c (usage): Add long --help. + Exit successfully for --help, non-zero for usage error. + From Francois Pinard. + + * configure.in: Add AC_STAT_MACROS_BROKEN. + * system.h [AC_STAT_MACROS_BROKEN]: Test it. + +Fri Oct 22 23:26:17 1993 Jim Meyering (meyering@comco.com) + + * linebuffer.c, memchr.c [HAVE_CONFIG_H, CONFIG_BROKETS]: Include + or "config.h". + * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fold.c, head.c, + join.c, nl.c, od.c, paste.c, pr.c, sort.c, split.c, sum.c, tac.c, + tail.c, tr.c, unexpand.c, uniq.c, version.c, wc.c: Ditto. + + * configure.in: Use AC_CONFIG_HEADER. + * Makefile.in [DIST]: Add config.h.in. + + * Makefile.in: Convert so make may be run from subdirectories. + Add dependencies on config.h. + * src/Makefile.in: Ditto. + * lib/Makefile.in: Ditto. + * man/Makefile.in: Ditto. + +Wed Oct 20 20:05:48 1993 Jim Meyering (meyering@comco.com) + + * memchr.c (memchr): Do the 32-bit assignment only if !LONG_64_BITS. + In the 64-bit assignment, be careful to cast the shift operand to + long. + Abort if sizeof (unsigned long) > 8. + +Tue Oct 19 22:37:58 1993 Jim Meyering (meyering@comco.com) + + * csplit.c: Allow repeat counts to be specified via `{*}'. + New option --suffix=format. Supercedes --digits option. + New option --abandon-null-files. + From Ronald F. Guilmette (rfg@netcom.com). + + * csplit.1: Updated. + From Ronald F. Guilmette. + + * csplit.c: Remove register keyword (replace with `int' in two cases). + + * csplit.c: [MAX]: Macro renamed from max and moved to top of file. + (bytes_to_octal_digits): New static array. + (get_format_flags): Combine '+' and ' ' cases of switch stmt. + Return count if for loop terminates. + (get_format_width): Use `bytes_to_octal_digits' instead of just 11. + (get_format_prec): Make sure is_negative is defined before used. + (get_format_conv_type): Give a different error message if there + is no conversion specifier. + Test ISPRINT (ch) instead of `ch < '~' && ch > ' ''. + (max_out): Use `%%' rather than `%' in format string. + +Sat Oct 16 10:45:17 1993 Jim Meyering (meyering@comco.com) + + * pr.c (main): When argc == 1, don't try to xmalloc (0). + +Tue Oct 12 00:53:26 1993 Jim Meyering (meyering@comco.com) + + * xwrite.c [HAVE_CONFIG_H, CONFIG_BROKETS]: Include + or "config.h". + +Sat Oct 09 23:37:43 1993 Jim Meyering (meyering@comco.com) + + * configure.in: Remove AC_UNISTD_H; add unistd.h to AC_HAVE_HEADERS. + +Thu Sep 9 21:52:10 1993 Jim Meyering (meyering@comco.com) + + * src/*.c: Print version on standard output, not stderr. + + * configure.in: Add AC_LONG_64_BITS. + * memchr.c: Use #ifdef LONG_64_BITS instead of + `if (sizeof(longword) > 4)'. + +Tue Jul 27 22:19:39 1993 Jim Meyering (meyering@comco.com) + + * cat.c (cat): Don't fail just because ioctl (d, FIONREAD,... can't + always handle devices. Ignore errno == EINVAL and errno == ENODEV. + `cat -v /dev/null' was failing on many systems. + + * cut.c (cut_fields): Don't strip off trailing delimiter e.g. + `echo 'a:b:c:' | cut -d: -f3-' should print `c:', not just `c'. + From William Dowling . + +Thu May 27 01:37:51 1993 Jim Meyering (meyering@comco.com) + + * Version 1.8. + + * memchr.c: De-ansify the fixed version from glibc. + It is supposed to work on systems with 64-bit long ints. + +Mon May 24 00:32:43 1993 Jim Meyering (meyering@comco.com) + + * Version 1.7. + +Sat May 22 02:13:12 1993 Jim Meyering (meyering@comco.com) + + * Version 1.6. + +Fri May 21 22:57:53 1993 Jim Meyering (meyering@comco.com) + + * pr.c (cols_ready_to_print): New function. It replaces a global + variable by the same name and computes on the fly the value that + was supposed to be maintained through that variable. This should + put to rest the `pr -2a' bug. + (main): Don't let getopt_long reorder arguments so we can + distinguish between `pr -1 -2' and `pr -12'. Rework handling of + -n and +n options. + + * fold.c: Declare xmalloc. + +Wed May 19 19:12:18 1993 Karl Berry (karl@owl.hq.ileaf.com) + + * sort.c (main): fflush before exit, so a closed stdout doesn't lose. + +Tue May 18 23:49:26 1993 Jim Meyering (meyering@comco.com) + + * mkinstalldirs: New file. + * Makefile.in (installdirs): Use it to create installation directories. + +Fri May 14 23:45:52 1993 Jim Meyering (meyering@comco.com) + + * all source: With --version, print version and exit immediately. + +Thu May 13 01:03:16 1993 Jim Meyering (meyering@comco.com) + + * Makefile.in (installdirs): New rules for creating installation + directories. (install): depend on it. + + * tail.c (main): Remove --compatible since `+1f' may be used + to get the BSD `-0f' behavior portably. + + * fold.c (main): Turn -N arguments, where N is a digit, into -wN. + From Ian Lance Taylor (ian@cygnus.com). + +Mon May 10 22:33:44 1993 Jim Meyering (meyering@comco.com) + + * tail.c (main): New option -C, --compatible to make `tail -0f' + work like `tail +1f' for compatibility with BSD tail. + +Thu May 6 23:28:56 1993 Jim Meyering (meyering@comco.com) + + * pr.c (print_page): Decrement cols_ready_to_print even when + lines_to_print == 0. The command `echo |pr -2ta' *still* didn't + terminate. Add parentheses for clarity. + +Mon May 3 23:57:47 1993 Jim Meyering (meyering@comco.com) + + * Version 1.5. + + * od.c (main): Remove set-but-not-used variable, `usage_error'. + + * split.c (main): Call usage with an argument. + +Sun May 2 16:05:04 1993 Jim Meyering (meyering@comco.com) + + * configure.in: Reverse if-else branches in AC_TEST_PROGRAM test + for 8-bit clean memcmp. + + * cat.c (usage, main): Remove unused argument. + + * csplit.c (remove_line): Remove set-but-not-used variable, `line_got.' + (check_for_offset): Remove unused argument `argnum.' + + * configure.in: Add AC_SIZE_T. + +Sat May 1 09:03:19 1993 Jim Meyering (meyering@comco.com) + + * uniq.c (main): Interpret non-option arguments with a leading `+' + only if we haven't seen `--'. + + * tr.c (main): Change variable name to avoid shadowed dcl. + * wc.c (write_counts): Ditto. + + * sum.1: Make documentation agree with the code. + + * od.c: Depend only on HAVE_LONG_DOUBLE for long double support. + +Fri Apr 30 20:16:03 1993 Jim Meyering (meyering@comco.com) + + * configure.in [AC_HAVE_HEADERS]: Add limits.h. + + * configure.in [CFLAGS, LDFLAGS]: Assign reasonable defaults. + + * od.c (parse_old_offset): Don't use prototype in function + definition. Remove unnecessary conjunct from test for hexadecimal + prefix. + + * od.c: Depend on __GNUC__ || HAVE_LONG_DOUBLE rather than __STDC__ + for long double support; there are compilers (Stardent Vistra svr4) + without long double but still define __STDC__. + +Thu Apr 29 02:01:27 1993 Jim Meyering (meyering@comco.com) + + * src/*.c and man/*.c except for sort: Add --help and --version + options. + + * pr.c: Convert to use getopt_long. + + * lib/memcmp.c: Use version from glibc. + [WORDS_BIGENDIAN]: Test this instead of the using glibc's + __BYTE_ORDER macro. + * configure.in: Use AC_WORDS_BIGENDIAN to set it. + + * od.c (parse_old_offset): Allow `0X' as well as `0x' prefix to + indicate hex. + + * Makefile.in (dist): Depend on Makefile so that changes to + Makefile.in (like adding new files to DISTRIB) are reflected + in the new distribution. + +Fri Apr 23 21:53:47 1993 Jim Meyering (meyering@comco.com) + + * {lib,src}/Makefile.in [.c.o]: Make CPPFLAGS and CFLAGS follow + other options so users can use them to override DEFS. + * src/Makefile.in [.c.o]: Add -I$(srcdir) for version.h. + + * Makefile.in [CFLAGS, LDFLAGS]: Don't set to -g explicitely; + configure's AC_SUBST will set these. + + * Makefile.in [Makefile]: Add dependencies and a rule to remake it. + [targets that cd then run make in subdirectories]: Don't depend + on `cd ..'; use a subshell instead. + + * Makefile.in [info, install-info, dvi, check, installcheck]: + New targets but no rules; comply with standards. + + * configure.in [CFLAGS]: Default to -g -O if CC is gcc and the user + hasn't specified CFLAGS. + [LDFLAGS]: Substitute into Makefile. + +Tue Mar 30 21:36:11 1993 Jim Meyering (meyering@comco.com) + + * od.c: New option --compatible, -C. + (parse_old_offset): New function. + * od.1: Document new option. + +Mon Mar 29 21:27:56 1993 Jim Meyering (meyering@comco.com) + + * cut.c, expand.c, join.c, nl.c: Always call error with errno + (not zero) after failed fclose or non-zero ferror. + +Sun Mar 28 16:59:31 1993 Mike Haertel (mike@cs.uoregon.edu) + + * configure.in: Add check for working memcmp; use GNU's if + the system's doesn't grok the 8th bit. + * memcmp.c: Fix it so it groks the 8th bit. + TODO: We really need to provide a fast memcmp, since most + machines will have a broken memcmp. Probably should get + the one from glibc. + * sort.c (mergefps): Maintain keybeg and keylim when copying + the current line to `saved'. + (numcompare): Skip white space here since -n no longer implies -b. + (getmonth): Skip white space here since -M no longer implies -b. + (compare): Completely overhauled to make the 8th bit work right, + also to properly handle the global reverse option. + (set_ordering): -n no longer implies -b, according to Posix. + For consistency, -M also no longer implies -b. + (main): Correct treatment of -r and global keys. + (findlines): Clear keybeg and keylim if no keys are used. + (sort): Avoid overwriting tempfiles[] array bounds. + +Sun Mar 21 22:29:29 1993 Jim Meyering (meyering@comco.com) + + * pr.c (close_file): Reverse May 13, '92 change, but add the condition + that cols_ready_to_print not be decremented when printing across. + The command `echo |pr -2ta' didn't terminate. + (print_page): Rewrite conditional (that had side effects in second + conjunct) using nested if statements to make it clear that we do + indeed want those semantics. + +Tue Jan 19 13:35:24 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * Version 1.4. + + * system.h: Try BBSIZE if BSIZE isn't defined. + From Tony Robinson . + +Sat Dec 12 12:37:00 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * tail.c (tail_forever): Use an array of file descriptors + instead of forking processes. + (dump_remainder): Return number of bytes read. + (tail_file): Fill in the new array. + From Ian Lance Taylor. + +Fri Dec 11 17:18:16 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) + + * system.h: Only define index, bcmp, etc. if not already defined. + +Tue Dec 8 10:31:14 1992 Jim Meyering (meyering@idefix.comco.com) + + * tr.c (is_char_class_member): Remove unreached return after abort. + +Sun Dec 6 22:34:52 1992 Jim Meyering (meyering@idefix.comco.com) + + * csplit, cut.c, expand.c, fold.c, head.c, join.c, od.c, pr.c, + sort.c, split.c, tail.c, tr.c, unexpand.c, uniq.c: Remove inclusion + of and definitions of is* ctype macros to system.h. + Change a few more uses of is* ctype macros to (protected) upper + case versions. + + * system.h: Add isascii-protected ctype IS* macros. + +Wed Dec 2 12:28:10 1992 Jim Meyering (meyering@idefix.comco.com) + + * all files using getopt.h: Convert static declarations of + struct option to use new macros from getopt.h: no_argument, + required_argument, and optional_argument. + +Tue Dec 01 10:57:24 1992 Jim Meyering (meyering@idefix.comco.com) + + * od.c, pr.c, sort.c: Make uses of ctype.h macros consistent. + + * tr.c (main): Close stdin and stdout and check return status. + +Tue Nov 24 09:26:08 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * system.h, csplit.c: Use HAVE_FCNTL_H and HAVE_STRING_H + instead of USG. + +Tue Nov 24 08:42:30 1992 Jim Meyering (meyering@idefix.comco.com) + + * tr.c: Define new macros ISPRINT, ISALNUM, ISXDIGIT, ... that + use isascii if it is defined. + (is_char_class_member, make_printable_char, make_printable_str, + non_neg_strtol): Use new macros instead of lower case ones + from . + + * od.c (print_ascii, dump_strings): Use ISDIGIT and ISPRINT + macros like pr.c. Suggested by David J. MacKenzie. + + * od.c (print_ascii, dump_strings): Check for isascii before isprint. + (dump_strings): Free malloc'd buffer before returning. + (skip): Return non-zero if an error occurred, zero otherwise. + Exit only if asked to skip beyond end of combined input. + (check_and_close): New function. + (skip, read_block, read_char): Call check_and_close when done + processing the file associated with in_stream. + (skip, read_block, read_char): Set have_read_stdin. + (main): Close stdin (if it was ever read) and check for errors + just before exiting. + (write_block, dump_strings, dump): Don't test return value from + functions that operate on streams. Rely on later ferror tests. + +Sat Nov 21 12:41:49 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * sort.c (main, usage): Add -T option. + +Thu Nov 19 14:33:40 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * tail.c (tail_forever, sigusr1, kill_kids): New functions to + do -f on multiple files. + (main): Call tail_forever. + From Ian Lance Taylor. + +Tue Nov 10 14:29:11 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * cut.c (cut_fields): Add cast. + + * od.c (decode_one_format): Remove '#' from pre_fmt_string; + many systems don't support it. + Conditionalize long double support on __STDC__, not __GNUC__. + From Ian Lance Taylor. + +Mon Nov 9 00:24:41 1992 Jim Meyering (meyering@idefix.comco.com) + + * sort.c (numcompare, keycompare): Add parentheses suggested + by gcc -Wall. Put braces around individual monthtab initializers. + + * cksum.c: Declare error. Make checksum table `const.' + + * pr.c: Remove comment and dcl of unused variable, `print_a_number'. + + * split.c (main): Add `default: abort();' to enumeration switch. + + * All files: Make all functions and extern variables static. + Make all longopts arrays const as well as static. + Make a couple statically initialized aggregates `const.' + +Sun Nov 8 19:46:59 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * od.c (main): Make old-style format options accumulate. + From Jim Meyering. + +Sat Nov 7 00:26:14 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * tr.c (look_up_char_class): Add cast. + + * nl.c (build_type_arg), csplit.c (extract_regexp), tac.c (main): + Add `const' to variable receiving value from re_compile_pattern. + + * wc.c (wc): If doing only -c, use st_size for regular files. + + * fold.c (fold_file): Was folding 1 column too early. + From Eric Backus . + + * memset.c: New file. + +Fri Nov 6 20:14:51 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * cksum.c: New file. + +Tue Oct 13 16:24:06 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * tac.c (tac_stdin): Handle SIGPIPE. + * sort.c (main): Handle SIGTERM. + + * od.c: New file. + + * system.h [USG || STDC_HEADERS]: Define bcmp. + +Sat Oct 3 20:41:24 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * sort.c (main): Handle SIGPIPE. From trq@dionysos.thphys.ox.ac.uk. + +Tue Sep 29 01:10:05 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * paste.c (main): Don't write on a string constant. + +Mon Aug 24 00:02:45 1992 Jim Meyering (meyering@churchy.gnu.ai.mit.edu) + + * tr.c: Minor cleanup. Replaced some assert(0) with abort(). + +Tue Jul 7 02:14:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * cmp.c, cmp.1: Move to diff distribution. + +Fri Jul 3 16:37:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * system.h: Change FOO_MISSING to HAVE_FOO. + +Wed May 13 20:05:41 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * pr.c (COLUMN): Add structure member to remember filename. + (main, init_fps, open_file, close_file): Use it. + + (close_file): Don't decrement cols_ready_to_print when closing + a file. From cdl@mpl.UCSD.EDU (Carl Lowenstein). + +Mon May 11 19:17:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * cmp.c: --show-chars -> --print-chars. + + * pr.c: Rename some variables. + +Sat May 9 18:39:47 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * system.h: Define DEV_BSIZE if not defined. + +Wed Apr 22 02:15:09 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * system.h, tac.c: SIGTYPE -> RETSIGTYPE. + +Fri Apr 17 10:42:23 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * sort.c (main): Don't stop processing args when we hit "-"; + treat it like a regular filename. + From ian@airs.com (Ian Lance Taylor). + + * pr.c (print_page): Fix off by one line count when ^L is in input. + From Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de). + +Mon Apr 6 20:52:29 1992 Jim Meyering (meyering@churchy.gnu.ai.mit.edu) + + * tr.c (validate): Change error message so it doesn't mention + actual name of --truncate-set1 option. From David MacKenzie. + +Sun Apr 5 14:22:42 1992 Jim Meyering (meyering@hal.gnu.ai.mit.edu) + + * tr.c (string2_extend, validate): Give an error message when + translating without --truncate-set1, with empty string2, and + with non-empty string1. "tr 1 ''" produced a failed assertion. + +Mon Mar 30 02:20:56 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * system.h: Change how ST_BLKSIZE is calculated to allow for + non-POSIX systems that don't define BSIZE in sys/param.h. + +Sat Mar 28 11:18:01 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * sum.c (main, bsd_sum_file): Don't print filename if BSD + algorithm is used and only one file was given. + +Wed Mar 25 11:34:41 1992 Jim Meyering (meyering@wombat.gnu.ai.mit.edu) + + * tr.c (get_spec_stats): Fix assertion to allow ranges like a-a + with starting character equal to ending character. This is + contrary to the POSIX spec, but what is already implemented + in find_closing_delim. + +Mon Mar 16 00:15:11 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * Version 1.3. + + * sort.c (numcompare, checkfp): Add parens to placate gcc2. + + * sort.c (mergefps): For -u, output the first, not last, of + the lines that compare equal. From Mike Haertel. + +Tue Mar 10 10:51:38 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * tr.c: Remove initial capitals and periods from error messages. + +Sun Mar 8 22:03:45 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + + * sum.c (main): Add -r option for SYSV compat. + +Thu Feb 27 22:26:25 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) + + * sort.c (compare): If -s given, leave lines in their original order. + (main): Recognize -s. + (usage): Document -s. + From Mike Haertel. + +Tue Feb 18 20:29:45 1992 Randall Smith (randy at geech.gnu.ai.mit.edu) + + * sort.c (sort): Check for complete parsing of buffer into + lines before nixing temp files. + +Mon Feb 17 10:35:58 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * sum.c (sysv_sum_file): Use %lu instead of %u to print a + long. Not that it matters for GNU . . . + + * tr.c (unquote, make_printable_str): Use \007 instead of ANSI \a. + (append_normal_char, append_range, append_char_class, + append_repeated_char, append_equiv_class, spec_init): + Initialize `next' field of new `struct List_element'. + From rommel@informatik.tu-muenchen.de (Kai-Uwe Rommel). + +Sat Feb 8 17:16:49 1992 David J. MacKenzie (djm at apple-gunkies.gnu.ai.mit.edu) + + * join.c (get_line): Renamed from getline to avoid GNU libc conflict. + +Sun Feb 2 21:22:01 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * Version 1.2. + + * nl.c: Support multiple files and "-" for stdin. + (main): Check for read and write errors. + (nl_file): New function. + +Wed Jan 29 10:09:10 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * tr.c (main): -t option was called -b in getopt spec. + (validate): Don't warn that set1 is longer than set2. + + * tr.c: Rename --sysv-string2-truncate to --truncate-string1. + +Fri Jan 17 16:29:05 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * nl.c: New program from bin-src. + + * nl.c (main): Use a struct linebuffer for line_buf. + (process_file): Use readline instead of fgets, to preserve NULs. + (check_section): Use memcmp instead of strncmp. + (proc_text): Print line_buf with fwrite instead of printf. + + * nl.c (main): Usage message if too many args given. Check + for error in closing input file. Lengths of section delimiter + strings were 1 too large. Take separator_str into account in + length of print_no_line_fmt. + (build_print_fmt): Allocate space for print_fmt, in case + separator_str is long. + (proc_text): A blank line is one that contains nothing, not + even nonprinting characters. + +Fri Jan 17 01:04:22 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * All programs: Document `--' instead of `+' to introduce + long-named options, in usage messages. + + * sum.c (bsd_sum_file): Renamed from sum_file. + (sysv_sum_file): New function. + (main): Recognize an option to select between the algorithms. + +Sun Jan 5 17:41:18 1992 Jim Meyering (meyering at churchy.gnu.ai.mit.edu) + + * pr.c (close_file, print_page): Fixed bug that had the command + yes |head |pr -t printing "yyyyyyyyyy". + * (print_page): Fixed bug that had pr -3 -a printing two too few + trailer lines per page. + * (main): Added restriction that -a and -m are incompatible. + Although the POSIX spec doesn't explicitly say they shouldn't + be used together, it says -a modifies the -column option and + that -column shouldn't be used with -m. + +Thu Jan 2 15:23:59 1992 David J. MacKenzie (djm at albert.gnu.ai.mit.edu) + + * nl.c: Include regex.h after, not before, sys/types.h. + +Thu Jan 2 12:18:10 1992 Tom Lord (lord at geech.gnu.ai.mit.edu) + + * sort.c (fillbuf) return bytes buffered instead of bytes read. + +Fri Dec 27 22:53:36 1991 Jim Kingdon (kingdon at geech.gnu.ai.mit.edu) + + * sort.c (LINEALLOC): New #define. + (struct lines): New field ``limit''. + (initlines): Set it from new arg ``limit''. + (sort, mergefps, checkfp): Pass new arg to initlines(). + (findlines): Don't realloc past lines->limit. + +Tue Dec 24 01:24:03 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * tac.c, sort.c, csplit.c, system.h: Change POSIX ifdefs to + HAVE_UNISTD_H and _POSIX_VERSION. + + * xwrite.c: Change POSIX ifdef to HAVE_UNISTD_H. + +Sat 14 Dec 1991 11:46:42 Jim Meyering (meyering at wombat) + + * tr.c: Fixed an inaccurate comment on posix_pedantic. + +Thu 12 Dec 1991 21:15:20 Jim Meyering (meyering at hal) + + * tr.c: Changed underscores to hyphens in long option name + "sysv_string2_truncate". + +Wed Dec 11 13:33:34 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * tac.c (main): Set obscure_syntax to tell re_search to + allocate memory for the group registers. + +Fri Dec 6 18:26:27 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * tac.c, sort.c, csplit.c [POSIX]: Use sigaction instead of + signal, which POSIX doesn't have. + * sort.c: Replace inthandler and huphandler with sighandler. + * csplit.c (main): Only handle signals if they were not being + ignored. + + * tr.c: POSIX_ME_HARDER -> POSIXLY_CORRECT. + +Wed Dec 4 00:47:47 1991 Jim Meyering (meyering at wombat) + + * tr.c (unquote): Reformat code so it doesn't go beyond column 80. + * tr.c (squeeze_filter): Comment a little on why it's better + to step through the input by two. + * tr.c (set_initialize): Write a comment describing the function. + * tr.c: Eliminated the variable `portability_warnings' and replaced + references to it by references to `!posix_pedantic'. One of the + uses of portability_warnings had been wrong. + +Tue Dec 3 14:03:35 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * tr.c: New program. + +Sun Dec 1 15:07:35 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * linebuffer.[ch] (freebuffer): New function (used by cron). + +Thu Oct 17 22:30:22 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * system.h, configure, Makefile.in: Don't include memory.h if + STDC_HEADERS, removing need for MEMORY_H_MISSING. + +Thu 17 Oct 1991 16:53:07 Jim Meyering (meyering at wombat) + + * pr.c (print_page): REALLY fixed `extra newline at EOF' problem. + Somehow, part of my patch didn't make it last time. + +Sat Oct 12 12:04:47 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) + + * tail.c (pipe_lines, pipe_bytes): Initialize `first->next'. + + * cmp.c (cmp): Print EOF message to stderr, not stdout, for + POSIX 1003.2.11.2. + + * sort.c (xfwrite): fwrite never returns < 0, so check if + number written is number we asked to write. + (fillbuf, main): fread never returns < 0, so check ferror instead. + From Rainer Orth. + +Tue Oct 8 18:07:08 1991 Jim Meyering (meyering at churchy) + + * pr.c (print_page): Really fixed `extra newline at EOF' problem. + * (store_columns): Fixed bug that caused `pr -b -2' to coredump + on files of certain lengths. + +Fri Oct 4 22:30:25 1991 Jim Meyering (meyering at churchy) + + * pr.c (print_page): Fixed to not add single spurious newline + at EOF when using -t. + +Wed Oct 2 01:02:05 1991 David J. MacKenzie (djm at apple-gunkies) + + * pr.c (print_page): Don't pad the page if -t given. + + * csplit.c (load_buffer), sort.c (mergefps): Use bcopy, not memcpy. + +Thu Sep 26 12:35:00 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) + + * Version 1.1. + + * configure, system.h: Include memory.h if it works. + + * split.c: Allow `b' unit as well as `k' and `m'. + + * head.c, tail.c: Replace -b +blocks option with specifying + units (b, k, or m) after the number. + (parse_unit): New function. + + * fold.c (main): Check that -w arg is a number. + + * cut.c: +delimiter takes an arg. + +Mon Sep 16 14:52:38 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu) + + * pr.c (close_file): Don't close an already closed file. + +Thu Sep 12 00:14:43 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * memchr.c: New file. + * configure: Check if it's needed. + + * csplit.c, gcsplit.1: New program. + + * pr.c (cleanup): Only free buffers if they were allocated. + + * sort.c [!USG && !STDC_HEADERS]: Declare memchr. + +Wed Sep 11 20:54:16 1991 Jim Meyering (meyering at churchy) + + * pr.c: The following 3 bugs appeared (at least) when printing + a single file with the options `-3 -f'. + * (print_white_space): Single spaces were being replaced + with tabs. + * (print_page): Some lines were getting too much white space + at the beginning because spaces_not_printed wasn't being reset + to 0. + * (read_line): The single space between a truncated column + on its left and the column on its right was omitted. Fixed + so that previous value of input_position is restored before + returning FALSE. + +Sat Sep 7 03:22:18 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * configure: Only remove /etc from PATH when it's not part of + a larger name. + +Wed Sep 4 17:09:24 1991 David J. MacKenzie (djm at apple-gunkies) + + * linebuffer.c (readline): Fix incorrect recalculation of `end'. + + * head.c, tail.c: Replace `mode' variables and bitmasks with + separate variables for each option. + +Mon Sep 2 04:00:37 1991 David J. MacKenzie (djm at apple-gunkies) + + * wc.c: New program. + +Sun Sep 1 01:18:38 1991 David J. MacKenzie (djm at apple-gunkies) + + * fold.c (fold_file): Read in an int, not a char, for EOF + comparison. + + * configure: Check whether st_blksize is missing. + + * tac.c (save_stdin): Put copy of pipe input in TMPDIR if + defined, instead of /tmp. + +Thu Aug 29 14:48:15 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * xwrite.c [POSIX]: unistd.h might require sys/types.h. + +Wed Aug 28 11:57:39 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * paste.c (main): Consider -d "" to be like -d "\0", + for POSIX (if I read it right). + + * sort.c, join.c: New programs. + + * cut.c (set_field): Allow blanks as well as commas to + separate numbers in ranges. + +Sun Aug 25 19:57:40 1991 Jim Meyering (meyering at apple-gunkies) + + * pr.c: Failure to open an input file is no longer a fatal error. + A message is printed for each failed open. When printing + in parallel, each failed open results in one fewer output column. + Added POSIX -r option to suppress the message. + * pr.c: Added variables: failed_opens, ignore_failed_opens. + These changes were based in part on work by David MacKenzie. + +Sat Aug 24 15:27:39 1991 Jim Meyering (meyering at pogo) + + * pr.c: Complain if user gives both -m and -[0-9]+ options. + +Wed Aug 21 22:04:57 1991 David J. MacKenzie (djm at apple-gunkies) + + * Version 1.0. + +Mon Aug 19 00:16:51 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * expand.c: Rename some variables. + (expand): Don't access value off end of array. + * unexpand.c: Rename some variables. + (unexpand): Don't access value off end of array. + Instead of copying tabs verbatim and flushing pending spaces + when one is reached, count them as the proper number of + pending spaces. Instead of changing tabs to single spaces if + the tabstop list is exhausted, print the rest of the line + unchanged (for POSIX). + +Sat Aug 17 01:49:41 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * cut.c (cut_file), paste.c (paste_parallel, paste_serial): + Clear EOF and error conditions on stdin so it can be reused. + + * expand.c, unexpand.c (parse_tabstops): Allow blanks as well + as commas to separate tabstops, for POSIX. + * expand.c (expand), unexpand.c (unexpand): Don't line-buffer + the output; send it directly to stdout. + * unexpand.c (main): Make -t stupidly imply -a for POSIX. + (unexpand): If a tab stop list was given and we move past its end, + copy the rest of the line verbatim. + + * split.c (convint): New function to allow 'm' and 'k' after + byte counts. + (main): Use it. Change -c option to -b for POSIX. + +Fri Aug 9 02:47:02 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * pr.c: Protect isdigit with isascii, if required. + +Tue Aug 6 21:42:25 1991 David J. MacKenzie (djm at wheat-chex) + + Most of the following is from Paul Eggert: + * cat.c (main): If stdin is read, check close at end. + * cmp.c (main): Check for stdin being closed. + Check for close errors on stdin and stdout. + (cmp): Return a value instead of exiting. + * cut.c (cut_file): New function, from code in main. + Check for read errors. + (main): Check for close errors. + * expand.c, unexpand.c (main): Check for close errors. + (next_file): Go to next file if one can't be opened. + Check for close errors. + * head.c (main), tail.c (main): If stdin was read, check for + close errors. + * head.c (head_file), tail.c (tail_file): Check for close errors. + * paste.c (main, paste_parallel, paste_serial), tac.c (main): + Check for close errors. Close stdin if it was read. + * split.c (main): Check for close errors. + + * configure, Makefile.in's: Support +srcdir option. + Make config.status. Fix up clean targets. + +Wed Jul 31 01:32:59 1991 David J. MacKenzie (djm at hal) + + * linebuffer.h (struct linebuffer): Add a field to indicate + the number of valid chars in the line. + * linebuffer.c (initbuffer, readline): Fill it in. + * uniq.c, comm.c: Use it. + + * pr.c (main): Check stdin and stdout fclose for errors. + (init_parameters): If there's no room for header and footer, + omit them rather than dying (for POSIX). + (init_header): Take a file descriptor as additional arg. + (init_fps): Change callers. Note when stdin is read. + (open_file): For filename "-" use stdin. + (close_file): Don't close stdin. Check close for errors. + (print_char, char_to_clump): Use isprint instead of explicit + comparisons. + + * memcmp.c: New file (needed for comm). + * bcopy.c: New file (needed for fold). + * system.h: Don't define bcopy as memcpy. + * configure: Check for bcopy and memcmp. + + * uniq.c (main): Use "-" instead of NULL to mean stdin or + stdout. + (check_file): Use "-" instead of NULL to mean stdin or stdout. + Check readline return instead of for NUL character to + detect eof. + Check fclose for errors. + (find_field): Use linebuffer length, not NULs, to detect end + of line. + (different): New function, replaces compare. Uses memcmp + instead of strncmp. + (writeline): Use fwrite instead of fputs so NULs are preserved. + + * comm.c (compare_files): Return an error indication. + Don't take a filename of NULL to mean stdin. + Use memcmp instead of strcmp to allow for NULs. + Check fclose for errors. + (writeline): Use fwrite instead of fputs so NULs are preserved. + + * sum.c (sum_file): Take an arg indicating whether to print + the filename, and don't take NULL meaning stdin. Set a flag + when we read stdin. Check fclose return for errors. + (main): If stdin was read, check fclose return for errors. + Use filename of "-" if no args given. + +Thu Jul 25 15:17:10 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * fold.c: Rewritten from scratch for POSIX. + +Wed Jul 24 01:55:41 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * split.c (line_bytes_split): Use xmalloc instead of alloca. + * system.h: Don't declare alloca. + + * tac.c, tail.c: Use SEEK_ instead of L_ for lseek. + * system.h: Define SEEK_ macros if not defined. + + * pr.c: Rename variable `truncate' to avoid library function conflict. + +Tue Jul 23 13:21:48 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * linebuffer.c, linebuffer.h: New files. + * comm.c, uniq.c (initbuffer, readline): Functions + removed (use versions in linebuffer.c). + +Mon Jul 22 13:23:53 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * sum.c (sumfile): Always print 5 digits for second number, too. + Interpret "-" to mean stdin. + +Sat Jul 20 14:24:40 1991 David J. MacKenzie (djm at bleen) + + * uniq.c: Use isblank instead of isspace, to support POSIX.2. + * comm.c, pr.c, uniq.c (concat, fatal, error, + pfatal_with_name, xmalloc, xrealloc): Functions removed. + +Sat Jul 13 02:04:53 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * nl.c: Add long-named options. Doc fixes. + +Sat Jul 6 02:19:09 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * expand.c, unexpand.c [STDC_HEADERS]: Include stdlib.h. + + * xwrite.c [POSIX]: Include unistd.h. + [STDC_HEADERS]: Don't declare errno. + +Sun Jun 30 23:35:16 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * uniq.c: Add long-named options. Remove marginally useful -z + option (zero padded repeat counts). + +Thu Jun 27 16:31:45 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * tail.c (tail_file), tac.c (save_stdin, tac_file), split.c + (cwrite), head.c (head_file), cat.c (main): Check close return + value for delayed error report due to NFS. + +Tue Jun 11 00:12:15 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * cat.c: Replace "uchar" with "unsigned char", to avoid + problems with various systems' typedefs. + +Thu Jun 6 12:54:26 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * cat.c (cat): Interpret ENOTTY return from FIONREAD ioctl to mean + operation is unsupported, for HP-UX 7.0. + +Sun Apr 14 21:49:17 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) + + * sum.c: Always print five digits for first number. + +Fri Mar 15 16:16:54 1991 David J. MacKenzie (djm at geech.ai.mit.edu) + + * cat.c, cmp.c: Don't use fileno(); not needed. + +Thu Jan 10 02:16:55 1991 David J. MacKenzie (djm at albert.ai.mit.edu) + + * tac.c, tail.c: Change _POSIX_SOURCE to POSIX. + +Thu Dec 27 00:06:45 1990 David J. MacKenzie (djm at egypt) + + * cut.c (cut_file_bytes, cut_file_fields): Make inbufp and + outbufp global. + (enlarge_line): Adjust inbufp and outbufp. + +Sun Sep 9 16:54:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cat.c: Declare free returning void, not int, so it + doesn't bomb on Xenix. + +Mon Sep 3 22:23:57 1990 David J. MacKenzie (djm at coke) + + * tac.c: Print error messages before calling cleanup, not after. + +Tue Aug 28 18:05:24 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * tac.c (cleanup): Return SIGTYPE, not int. + +Tue Aug 7 12:51:18 1990 David J. MacKenzie (djm at apple-gunkies) + + * cut.c (main, usage): Add -b and -n options for POSIX. + (set_fields): Don't allow SPC or TAB as number separators. + + * paste.c (paste_parallel): If open of any file fails, quit + (for POSIX). + +Mon Aug 6 22:14:13 1990 David J. MacKenzie (djm at apple-gunkies) + + * pr.c: Add POSIX -F option (same as -f). + + * uniq.c (check_file): Allow '-' to mean stdin or stdout. + +Mon Aug 6 14:43:30 1990 David J. MacKenzie (djm at pogo.ai.mit.edu) + + * head.c, tail.c: Change `chars' to `bytes' globally. + (main, usage): Use POSIX.2 draft 10 option syntax. + +Sun Aug 5 11:51:12 1990 David J. MacKenzie (djm at pogo.ai.mit.edu) + + * cat.c (main): Don't delay error messages, so they appear + where expected. + (main, simple_cat, cat): Make errors in input files nonfatal. + +Sat Aug 4 10:11:30 1990 David J. MacKenzie (djm at pogo.ai.mit.edu) + + * cat.c: Remove -c option added for POSIX draft 9, since POSIX + draft 10 removed it. + + * tac.c (tac_stdin): Use fstat instead of lseek to determine + whether stdin is seekable, because lseek silently fails on + some special files, like tty's. + tail.c (tail_chars, tail_lines): Use fstat instead of lseek; + don't turn off -f for non-regular files (assume the user knows + what he's doing; it might work for fifo's and sockets). + + * paste.c (main): If no files given, use stdin. + Don't let collapse_escapes write on string constant (delim default). + (paste_parallel): Don't close stdin. + + * cut.c (main): Use standard input for filename of "-". + + * comm.c (compare_files): Allow '-' to mean stdin. + +Fri Aug 3 13:38:28 1990 David J. MacKenzie (djm at pogo.ai.mit.edu) + + * cut.c (enlarge_line): Take an arg giving the required amount + of space. Change callers. + (main): Don't allow -t'' without -f. + Make `delim' unsigned to fix sign extension problem in comparison. + +Tue Jul 17 12:36:11 EDT 1990 Jay Fenlason (hack@ai.mit.edu) + + * pr.c Deleted excess whitespace from ends of lines. + Modified to work with current version of getopt, which + returns 1 instead of 0 for non-options. + Reversed the meaning of the -f option, to be compatable + with real pr. + +Sun Jul 8 00:39:31 1990 David J. MacKenzie (djm at apple-gunkies) + + * cmp.c (main, usage): Rename -L option to -c and don't have + it imply -l. + (printc): Take an arg to specify number of chars to pad to, + for column alignment. + (cmp): Respect flag_print_chars in default output format. + Align columns for cmp -cl. + +Sat Jul 7 17:23:30 1990 David J. MacKenzie (djm at apple-gunkies) + + * cmp.c: For +show-chars, have getopt return 'L' so + `flag_print_chars' gets set. + +Fri Jun 29 01:04:19 1990 David J. MacKenzie (djm at apple-gunkies) + + * tac.c (main): Initialize fastmap and translate fields of + regex before compiling it. + +Fri Jun 22 00:38:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * tac.c: Change +regexp to +regex for consistency with GNU find. + +Wed Jun 20 01:46:09 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cat.c (cat): If FIONREAD is available, only use it if it is + supported by the filesystem that the file is on. + +Sun Jun 3 20:26:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cat.c (main): Add a variable to control whether the check + for input file == output file is made, because no values of + st_dev and st_ino should be assumed to be available for this + purpose. Only do the check for regular files. + + * tac.c: Use bcopy instead of memcpy. + +Thu May 31 00:55:36 1990 David J. MacKenzie (djm at apple-gunkies) + + * head.c: Use longs instead of ints for file offsets, for 16 + bit machines. + +Tue May 22 00:56:51 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cmp.c: Change some ints to longs for 16 bit machines. + (bcmp_cnt): Make char-pointer counting slightly simpler. + +Sat May 12 01:16:42 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cat.c (main): Allow input file to be output file for devices + (ttys, etc.). Check whether input file is output file when + reading standard input. Print any error messages for standard + input. + + * cmp.c (bcmp_cnt): Handle int comparisons correctly on 16 bit + machines as well as 32 bit ones. + * cmp.c, tail.c: Use longs instead of ints for file offsets. + +Fri May 11 02:11:03 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cmp.c: Fix some exit statuses for POSIX. + +Tue May 8 03:41:42 1990 David J. MacKenzie (djm at abyss) + + * tac.c: Use regular expressions as the record boundaries. + Give better error messages. + Reformat code and make it more readable. + (main): Use getopt_long to parse options. + (tac_stdin): Do not make a temporary file if standard input + is a file. + (tac_file): New function. + (tac): Take an open file desc as an arg. + (output): Rewrite to use its own efficient buffering. + (xmalloc, xrealloc, xwrite): New functions. + +Sun Apr 8 20:33:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * head.c, tail.c: Use `error' instead of `fatal_perror' and + `nonfatal_perror'. Remove some unnecessary info from messages. + +Wed Mar 21 09:30:18 1990 David J. MacKenzie (djm at pogo.ai.mit.edu) + + * comm.c (main): Pass the list of files to compare_files as a + char ** instead of a char *. + (compare_files): Make arg a char **. + + * uniq.c: Declare some functions as void. + Change global vars `countmode' and `mode' from ints to enums. + (main): Use getopt to parse options and support POSIX options. + Don't use integer_arg to parse numbers, since `-#' can't be + parsed that way using getopt. + (find_field): Use isspace for finding fields boundaries. + +Tue Mar 20 14:28:25 1990 David J. MacKenzie (djm at pogo.ai.mit.edu) + + * comm.c (main): Call usage if given bad option or wrong + number of args. Exit with 0 status normally. + (usage): New function. + Declare some other functions as void. + +Wed Mar 14 10:48:40 1990 David J. MacKenzie (djm at rice-chex) + + * cmp.c (main, cmp, usage): Replace -q +quick option with -L + +show-chars option to add ASCII representation of bytes to -l format. + +Tue Mar 13 00:50:14 1990 David J. MacKenzie (djm at rice-chex) + + * cmp.c (cmp): Change EOF message for POSIX compatibility. + For -l format, clear bits > FF. + +Mon Mar 5 17:21:00 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * tail.c: Move global `errors' into main instead of having + nonfatal_perror set it. + (tail, tail_chars, tail_file, tail_lines, pipe_chars, pipe_lines): + Return an error status. + (file_lines, start_chars, start_lines): Reverse the meaning of + the return value. + (tail_lines, tail_chars): Account for that reversal. + +Mon Mar 5 00:34:36 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * head.c: Move global `errors' into main and have the various + functions return an error status instead of setting it in + nonfatal_perror. + +Sat Mar 3 11:27:27 1990 Torbj|rn Granlund (tege at echnaton) + + * cmp.c (cmp): Call function bcmp_cnt for flag == 0 (i.e. no + options specified), to compare the two blocks and count + newlines simultaneously. + * cmp.c New function: bcmp_cnt. + + * cmp.c (main): Test if output is redirected to /dev/null, and + assume `-s' if this is so. + +Tue Feb 20 17:09:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cat.c: Change `argbad' from a char to a short, so it will + work on machines with unsigned chars. + +Sat Feb 10 02:16:40 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * cmp.c (cmp): Rename `r' to `first_diff', and `x' to `smaller'. + Remove unneccessary variable `c1'. If -l was given, increase + `char_number' by the number of bytes read, after producing output, + rather than by the offset of the first differing bytes, before + producing output. + Replace if-else-if constructions with case statements for clarity. + (bcmp2): Rename `n' to `nread'. + +Wed Dec 20 01:32:06 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * nl.c (proc_text): Use re_search instead of re_match. + +Tue Dec 19 01:26:34 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * nl.c: Indent. Un-nest statements. Use GNU regexp functions + instead of System V ones. Move function declarations together. + (quit): Remove useless function. + (program_name): New variable for error messages. + (main): Use perror in error message. + (xmalloc): New function to replace myalloc. + (myalloc): Function removed. + Global: use program_name and xmalloc. + +Sun Dec 17 00:36:36 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * uniq.c: Declare some functions. + (main): Initialize infile and outfile. Call usage if given + invalid args. Normally exit with 0 status instead of garbage. + (usage): New function to print usage message and exit. + (check_file): Remove unused variable. + (readline): Compare against EOF, not < 0. + (xmalloc, xrealloc): Return char *, not int. + Ok to return 0 if 0 bytes requested. + (lb1, lb2): Remove unused global vars. + (concat): Remove unused function. + +Sat Dec 16 15:15:50 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * comm.c: Remove unused global variables lb1, lb2. + (main): Remove unneeded variable. + (compare_files): Remove unused arg. + (readline): un-nest assignment. Test against EOF instead of < 0. + (error): Print to stderr, not stdout. + (xmalloc, xrealloc): Return char * instead of int. + Returning 0 is ok if 0 bytes requested (ANSI C). diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/NEWS b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/NEWS new file mode 100644 index 0000000..a172299 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/old/textutils/NEWS @@ -0,0 +1,457 @@ +Changes in release 2.1 +[2.0.22] +* `od -t f8' works once again [bug introduced in textutils-2.0.8] +* various portability fixes, and general clean-up +* various minor, corner-case bug fixes +[2.0.21] +* split accepts new option -a or --suffix-length. +* split no longer generates longer suffixes than requested; instead, it reports + an error when suffixes are exhausted. POSIX requires this behavior. +* The _POSIX2_VERSION environment variable lets you select which version + of POSIX the utilities should conform to. Its default value is system + dependent. Set _POSIX2_VERSION=199209 to cause the utilities to support + obsolete usage like "sort +1". +* The following obsolete usages are no longer supported when conforming + to POSIX 1003.1-2001, which prohibits most digit-string options: + expand -N (instead, use expand -t N) + head -N (instead, use head -c N or head -n N) + fold -N (instead, use fold -w N) + split -N (instead, use split -l N) + tail -N (instead, use tail -c N or tail -n N) + unexpand -N (instead, use unexpand --first-only -t N) + uniq -N (instead, use uniq -f N) + The following obsolete usages (options without arguments) are no + longer supported when conforming to POSIX 1003.1-2001, which + prohibits most options with optional arguments: + od -s (instead, use od --strings) + od -w (instead, use od --width) + pr -S (instead, use pr --sep-string) +[2.0.20] +* tr no longer gets failed a assertion for [==] or [::] +* The following obsolete usages are no longer supported when conforming + to POSIX 1003.1-2001, which prohibits most options with leading "+": + sort +POS1 -POS2 (instead, use sort -k) + tail +N (instead, use tail -c +N or tail -n +N) + uniq +N (instead, use uniq -s N) +* Warnings are issued for obsolete usages on older hosts, + unless POSIXLY_CORRECT is set in the environment. +* sort -m no longer segfaults when given an empty file +* sort -S now accepts 'K' as a synonym for 'k'. +* wc recognizes all locale-defined white-space characters, not just those + in the "C" locale. +[2.0.19] +* portability tweak to make lib/regex.c compile +* split translatable strings only in the middle of sentences +[2.0.18] +* sort could segfault on systems without a working mkstemp function and + with a gettimeofday function that clobbers the static buffer that + localtime uses for it's return value -- introduced in 2.0.17 +[2.0.17] +* csplit no longer gets a failed assertion for this: + printf 'a\n\n'|csplit - '/^$/' 2 +* sort detects physical memory attributes more portably +* tail no longer gets a segfault on Linux's /proc/ksyms +* sum -s produces the proper 16-bit checksum for large files + (this fixes a bug that was introduced in 2.0f) +* uniq is now about 3 times faster than the version from 2.0 on Linux systems; + the code uses lock-avoiding variants of common I/O functions +[2.0.16] +* tail -F no longer segfaults +[2.0.15] +* `head -c N' and `od -N N' now read no more than N bytes of input +* tail accepts new option: -F, equivalent to `--follow=name --retry', + for compatibility with the FreeBSD and NetBSD versions of tail. +* fmt no longer segfaults when using a maximum line width larger than 32767 +* uniq's --all-repeated option has new modes to delimit groups + of duplicate lines: --all-repeated={precede,separate,none(default)} +[2.0.14] +* sort now accepts long options like "--reverse" and "--". +* sort now checks option syntax as POSIX requires, except that (as usual + for GNU) options can follow file names unless POSIXLY_CORRECT is set. + For example, invalid positional combinations like "sort +1 -r -2" are + now rejected as per POSIX. +* The next POSIX standard will require that obsolescent 'sort' + positional options like +1 be treated as file names, not options. + Please use 'sort -k' instead. +[2.0.13] +* pr accepts new -D or --date option, to specify date format. +* The following changes are required by POSIX: + - If POSIXLY_CORRECT is set, dates in pr headers now look something like + 'Dec 4 23:59 2001', with the exact appearance affected by LC_TIME. + - pr -h now affects only the center header string, not the entire header. + - pr no longer truncates headers. +* Spacing in pr headers has been adjusted slightly. +* `fmt --prefix=S' now works when S contains a byte with the high bit set +[2.0.12] +* sort has improved performance when using very little main memory +* sort has improved memory management +* sort is no longer susceptible to certain denial of service attacks +* sort no longer suffers from a race condition whereby an interrupt received + during cleanup could cause it to fail to remove temporary files. + This problem could arise only on hosts without sigaction. +[2.0.11] +* sort accepts new -S SIZE option, to specify main-memory usage. +[2.0.10] +* od is faster and more portable than it was in 2.0.9 +* tail avoids an uninitialized memory reference +[2.0.9] +* od now prints valid addresses for offsets of 2^32 and larger, and allows + the byte offset (-j) and byte count (-N) arguments to be 2^32 and larger. +* tail now works with line and byte counts of 2^32 and larger, on systems + with large file support +* join now works with an 8-bit delimiter +* fix a compilation failure on some Solaris systems with wc.c +[2.0.8] +* od now supports 8-byte integers, assuming they're printable with e.g., %lld +* new program: sha1sum +* wc accepts new -m option: count (potentially multi-byte) characters +* wc's `--chars' option is now equivalent to -m, not --bytes as it used to be +* `cat -n' works properly when processing 2^31 or more lines +[2.0g] +* sort's --help output now warns that it is locale-aware +* tail: fix a buffer underrun error that occurred on an empty pipe, + also thanks to bounded pointers +* pr: fix a bounds violation found by Greg McGary's bounded-pointers-enabled gcc + It could have caused (with low probability) the columns on the last page of + output *not* to be `balanced' when they should have been. +* sort: if the -T tmpdir option is given multiple times, all the given + directories are used; this can improve performance for huge sort/merges. +[2.0f] +* all programs fail when printing --help or --version output to a full device +* cut no longer gets a segfault under some circumstances +* unexpand accepts new option: --first-only +[2.0e] +* `tail -f directory' no longer gets a failed assertion +* sort: big performance improvement when sorting many small files; + from Charles Randall +* configure and portability changes in m4/ and lib/ +[2.0d] +* preliminary sort performance improvements +* tsort now works more like the traditional UNIX tsort. Before it would + exit when it found a loop. Now it continues and outputs all items. +* unexpand no longer infloops on certain sequences of white space +* unified lib/: now that directory and most of the configuration framework + is common between fileutils, textutils, and sh-utils +[2.0c] +* include lib/nanosleep.h. +[2.0b] +* portability tweaks for error.c vs. systems with deficient strerror_r +[2.0a] +* `tail --follow=name' no longer gets a failed assertion for a + dev,inode-reusing race condition +* sort and comm no longer consider newlines to be part of the line, + as this requirement will likely be removed from POSIX.2. + This undoes some changes made for textutils 1.22m and 1.22n. +* tail's (short only) -f option no longer accepts an optional argument, + so e.g., `tail -fn 2 file' works again. +* tail no longer refuses to operate on certain types of files +* fixed bug in tsort's handling of cycles + +Changes in release 2.0 +[1.22q] +* HPUX portability fix: md5sum would dump core due to use of libc's getline +[1.22p] +* portability fixes from Paul Eggert based largely on tar-1.13 reports +* `tail --pid=PID' now works even when PID belongs to some other user +[1.22o] +* tail accepts new option: --pid=PID +[1.22n] +* tail accepts the following new options (some of which were added in 1.22g): + --retry + --follow[={name|descriptor}] + --max-unchanged-stats=N + --max-consecutive-size-changes=N + --sleep-interval=S +* wc uses the POSIX-mandated output format when POSIXLY_CORRECT is set +* To maintain compatibility with sort, comm and join now obey the LC_COLLATE + locale, and comm now considers newlines to be part of the lines. +* use lib/memchr.c only if it's not provided by the system -- this means + that on systems with a fast library memchr function you may notice an + improvement. If you use a system with a buggy or signifcantly slower + memchr, please report it. +[1.22m] +* sort now considers newlines to be part of the line, as required by POSIX.2. + E.g. a line starting with a tab now sorts before an empty line, + since tab precedes newline in the ASCII collating sequence. +* sort handles NUL bytes correctly when configured/compiled with --enable-nls +* fix typos in my version of AC_SEARCH_LIBS. +* fix dates on config files so builders don't need autoconf/automake +[1.22l] +* sort no longer autodetects the locale of numbers and months, + as that conflicts with POSIX.2 +* `join -tC' now works when input contains trailing spaces +* portability tweaks for Irix's cc +[1.22k] +* `sort -n' works with negative numbers when configured/compiled + with --enable-nls +* head accepts byte and line counts of type uintmax_t (so up to 2^64 - 1) +[1.22j] +* tail: fix bug introduced in 1.22i +[1.22i] +* tail now terminates in `yes > k & sleep 1; tail -2c k' +* `tail -f' now ensures that stdout is unbuffered +* fix a bug in cut to allow use of 8-bit delimiters +* pr accepts POSIX compliant options -s and -w, + the new capital letter options -J, -S and _W turn off the + unexpected interferences of the small letter options -s and -w + if used together with the column options. +* pr output has been adapted to other UNIXes in some cases. +[1.22h] +* portability tweaks +* Window/NT/DOS support +[1.22g] +* uniq accepts new option: --all-repeated (-D). +* Windows/DOS portability fixes +* new program: tsort +* tail has several new options +* md5sum can handle file names with embedded backslash characters +* pr accepts long option names (see `pr --help') +* new program: ptx (moved to this package from being its own distribution) +[1.22f] +* cut accepts new --output-delimiter=STR option +* `sort -o no-such-file no-such-file' now fails, as it should +* fix pr bug: pr -td didn't double space +* fix tac bug when using -b, -r, and -s SEPARATOR +* fix sort bug whereby using key-local `d' option would cause following + key specs to be ignored when any two keys (in the `d'-modified test) + compared equal. +[1.22e] +* remove maintainer mode +[1.22d] +* wc accepts new option: --max-line-length (-L) +* sort can sort according to your locale if your C library supports that +[1.22c] +[1.22b] +* od supports a new trailing `z' character in a type specification: + $ od -tx1z . + 0000000 be ef c6 0f fd f9 d7 e0 ec cb f3 c6 00 db e8 00 >................< + 0000020 00 00 d2 00 00 00 00 00 00 00 00 00 00 00 00 00 >................< + 0000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >................< + * + 0000600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 cc >..............5.< + 0000620 05 63 76 74 2e 6f 00 00 29 ac 08 70 72 6f 6a 65 >.cvt.o..)..proje< + 0000640 63 74 73 00 00 00 18 9a 05 63 76 74 2e 63 00 00 >cts......cvt.c..< + 0000660 18 d9 03 52 43 53 00 00 18 c0 05 78 2e 64 61 74 >...RCS.....x.dat< + +[1.22a] +* sort -c reports both the number and the contents of the first out-of-order + line, in addition to the file name. +* `head -c 4096m' is no longer treated just like `head -c 0' + now it gets a diagnostic about 4096m being too large. +* pr: For compatibility (also more POSIX compliant): Include default + separator `TAB' when merging lines of full length. +* When POSIXLY_CORRECT is not set, tail -N now accepts more than one file + argument, to be consistent with the way head -N works. If POSIXLY_CORRECT + is set, using two or more file arguments with the obsolescent form (-N) + evokes an error. To avoid the warning or failure, use the POSIX -n N option + or the GNU --lines=N option. + +Changes in release 1.22 +[1.21a] +* Fix a bug in tail when invoked with an argument like `+NUMBERc' +* Add test suite for tail + +Changes in release 1.21 +* Using --program-prefix no longer applies the prefix twice + +Changes in release 1.20 +* fix pr: -l now uses total number of lines per page also with -f +* fix pr: use left-hand-side truncation of header string to avoid line + overflow +* fix pr: it now accepts `form feeds set in input files', also with -m + and multiple form feeds at different pages in each file +* pr now accepts: -h "", print a blank line header +* pr: when skipping pages (+FIRST_PAGE option) line counting (-n option) + starts with 1st line of input file (not of 1st page printed) by default +* pr accepts new option: -N, start printing with an optional line number +* pr -t retains `form feeds set in input files' (`don't destroy page layout') +* pr accepts new option: -T, equivalent to -t, but eliminate also form feeds + (`clear file') +* pr accepts the extension: +FIRST_PAGE[:LAST_PAGE] +* pr -w and -s option disentangled (`use a separator' no longer destroys + column alignment) +* pr accepts new option: -j, merge lines of full length +* pr accepts the extension: -s[STRING], use separator string instead of + character only +* pr -b is no longer an independent option, balancing is always used + with -COLUMN (a requirement of unrestricted use of form feeds) +* pr accepts new option: --test, to run the pr tests with a constant + header string +* join passes all of its tests on Alpha OSF 4.0. +* sort no longer improperly ignores blanks in determining starting and ending + positions for keys with explicit character offsets +* fix bug in csplit with regexp and negative offset that led to infinite loop + Changes in test release 1.19q +* fix bug in sort -c that sometimes resulted in a segfault + Changes in test release 1.19p +* md5sum's --string option is being deprecated and is no longer documented. + It is still accepted, but will be removed altogether in 1.22. +* tr '[:lower:]' '[:upper:]' no longer fails when LC_CTYPE is set to + iso_8859_1 on Solaris -- or any other character set with differing + numbers of uppercase and lowercase characters +* split and tail diagnose unrecognized multiplier suffixes, in e.g., + `split --bytes=1M' (should be `-b 1m' or `--bytes=1m') +* fix bug in md5sum's handling of partial reads +* fix bug in treatment by sort -f of bytes with high-bit set +* update configuration system to use automake's aclocal program +* configure performs sanity check on CC and CFLAGS to avoid a misleading + failure that suggested cross-compiling was the cause +* distribute test suites for cut, join, sort, and tr +* unexpand no longer gets in endless loop +* when verifying checksums, md5sum uses the binary mode flag from the + input stream rather than the one from the command line + +Changes in release 1.19 +* md5sum can verify digests of files with names containing newline characters +* update from gettext-0.10.20. + +Changes in release 1.18 +* when building sort, link with -lm on systems that use the replacement strtod +* update from gettext-0.10.17. + +Changes in release 1.17 +* include texinfo.tex in the distribution + +Changes in release 1.16 +* sort is compatible with Unix sort when a key-end spec refers to the N'th + character in a field that has fewer than N characters +* tail with old-style options like -20k and +31m operates on units of bytes, + as the --help usage message says. Before, it used units of lines. + +Changes in release 1.15 +* od gives better diagnostics for invalid format specs +* uses automake-generated Makefile templates +* configure takes a new option: --enable-maintainer-mode +* fix a bug in fmt when prefix has trailing white space +* internationalized diagnostic messages +* fix a couple bugs in tr involving use of -c and/or -d flags -- see ChangeLog +* diagnose some improper or questionable invocations of csplit +* properly handle `echo |csplit - 1 1', rather than aborting +* fix join: without -t it now ignores leading blanks +* sort accepts new option: -z for NUL terminated records +* join accepts new option: --ignore-case, -i +* uniq accepts new option: --ignore-case, -i + +User-visible changes in release 1.14 +* sort -i and sort -d properly order strings containing ignored characters +* nl: rename misleading --first-page=N option to --starting-line-number=N. +* sort diagnoses invalid arguments to -k, then fails +* sort -n properly orders invalid integers with respect to valid integers +* sorting works with character offsets larger than corresponding field width +* sort's -b option and `b' modifier work +* sort -k2,2 works. +* csplit detects integer overflow when converting command line arguments +* sort accepts new option/flag, -g, for sorting numbers in scientific notation +* join accepts POSIX `-o 0' field specifier. +* tr 'a[b*512]' '[a*]' < /dev/null terminates +* tr '[:*3][:digit:]' 'a-m' and tr 'a[=*2][=c=]' 'xyyz' no longer fail +* special characters in tr's string1 and string2 may be escaped with backslash + +User-visible changes in release 1.13 +* md5sum: with --check, distinguish between open/read failure and bad checksum +* md5sum: remove -h, -s, -v short options +* md5sum: rename --verbose to --warn, --quiet to --status +* md5sum --check fails if it finds no properly formatted checksum lines +* sort -c prints `disorder on...' message on standard error, not stdout +* sort -k works as described in the texinfo documentation +* tail works on NetBSD +* md5sum reads and writes (de facto) standard Plumb/Lankester format +* sort accepts -.1 +.2 options for compatibility +* od works properly when dump limit is specified and is a multiple of + bytes_per_block (set by --width, 16 by default). + +User-visible changes in release 1.12 +* sort no longer reports spurious errors on Ultrix systems +* new program: md5sum +* all --help messages have been improved +* join's -a1 and -a2 options work +* tr '[:upper:]' '[:lower:]' no longer reads uninitialized memory +* sort properly handles command line arguments like `+7.2n' +* fmt properly formats paragraphs not terminated by a newline +* tail -f flushes stdout before sleeping so that it will output partial + lines sooner +* sort properly orders fields where one field is a proper prefix of the other +* sort properly interprets field offsets specified via the -k option +* dd, od, and tail work on systems for which off_t is long long (e.g. BSD4.4) +* wc is faster when not counting words +* wc now works even when file pointer isn't at beginning of file +* expand no longer seg faults with very long tab lists + +User-visible changes in release 1.11 +* fmt is built + +User-visible changes in release 1.10 +* skeletal texinfo documentation (mainly just the `invoking' nodes) +* new program: fmt +* tail -f on multiple files reports file truncation +* tail -q has been fixed so it never prints headers +* wc -c is much faster when operating on non-regular files +* unexpand gives a diagnostic (rather than a segfault) when given a name of + a nonexistent file. +* cat, csplit, head, split, sum, tac, tail, tr, and wc no longer fail + gratuitously when continued after a suspended read or write system call. +* cut interprets -d '' to mean `use the NUL byte as the delimiter' rather + than reporting that no delimiter was specified and failing. +* `echo a:b:c: | cut -d: -f3,4' prints `c:'. Before it printed just `c'. +* cut has been rewritten, is markedly faster for large inputs, and passes a + fairly large test suite. +* sort properly handles the argument to the -T option. + +Major changes in release 1.9.1: +* cut no longer ignores the last line of input when that line lacks a + trailing newline character + +Major changes in release 1.9: +* `echo a:b:c: | cut -d: -f3-' prints `c:' and + `echo a:b | cut -d: -f1' prints `a'. +* the command `printf '\t\n' |fold -w n' now terminates. + Before, it wouldn't stop for n less than 8. +* sort accepts and ignores -y[string] options for compatibilty with Solaris. +* cat -v /dev/null works on more systems +* od's --compatible (-C) flag renamed to --traditional (no short option) +* --help and --version exit successfully +* --help gives a one-line description of each option and shows the + correspondence between short and long-named options. +* fix bug in cut. Now `echo 'a:b:c:' | cut -d: -f3-' works. + Before it printed `c' instead of `c:' +* csplit allows repeat counts to be specified via `{*}'. +* csplit accepts a new option, --suffix=format that supercedes the + --digits option. The --digits option will continue to work. +* csplit accepts a new option, --elide-empty-files. +* configure uses config.h, so DEFS won't exceed preprocessor limits of + some compilers on the number of symbols defined via -D. +* work around problem where $(srcdir)/config.h was used instead of + ../config.h -- this happened only when building in a subdirectory + and when config.h remained in $(srcdir) from a previous ./configure. + +Major changes in release 1.8: +* added non-ANSIfied version of memchr.c from GNU libc. + +Major changes in release 1.7: +* none +Major changes in release 1.6: +* with the --version option programs print the version and exit immediately +* pr -2a really terminates +* pr -n produces multi-column output + +Major changes in release 1.5: +* sort is 8-bit clean +* sort's -n and -M options no longer imply -b +* several bugs in sort have been fixed +* all programs accept --help and --version options +* od --compatible accepts pre-POSIX arguments +* pr -2a terminates + +Major changes in release 1.4: +* add od and cksum programs +* move cmp to GNU diff distribution +* tail -f works for multiple files +* pr prints the file name in error messages +* fix some off by 1 errors in pr and fold +* optimize wc -c on regular files +* sort handles `-' argument correctly +* sort supports -T option +* tr ranges like a-a work +* tr x '' fails gracefully +* default sum output format is BSD compatible +* paste -d '' works diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/po/ChangeLog b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/po/ChangeLog new file mode 100644 index 0000000..871d8e5 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/po/ChangeLog @@ -0,0 +1,104 @@ +2004-12-14 Jim Meyering + + * LINGUAS: Add Bulgarian (bg). + +2004-11-28 Jim Meyering + + * POTFILES.in: Add lib/openat.c. + +2004-10-11 Jim Meyering + + * fr.po: Fix two typos reported in http://bugs.debian.org/275924 + +2004-09-22 Jim Meyering + + * POTFILES.in: Remove lib/xmalloc.c. + Add lib/xalloc-die.c. + +2004-06-26 Jim Meyering + + * LINGUAS: Add Basque (eu). + +2004-04-16 Jim Meyering + + * fr.po: Correct typo in the french rendition of date's --help output: + s/%r/%R/. Patch by Nicolas Boulenguez. + +2004-03-02 Jim Meyering + + * LINGUAS: Add Afrikaans (af) + +2004-01-13 Jim Meyering + + * POTFILES.in: Replace src/sys2.h with src/system.h. + +2004-01-12 Jim Meyering + + * Makefile.in.in: Update from gettext-0.13.1. + +2003-11-09 Jim Meyering + + * POTFILES.in: Add lib/root-dev-ino.h. + +2003-10-17 Jim Meyering + + * POTFILES.in: Add lib/xfts.c. + +2003-09-22 Jim Meyering + + * Makevars (XGETTEXT_OPTIONS): Add --from-code=UTF-8 to accommodate the + non-ASCII comment to translators in ptx.c regarding the author's name. + +2003-08-27 Jim Meyering + + * Makefile.in.in: Update from gettext-0.12.2. + +2003-08-19 Jim Meyering + + * Makevars (MSGID_BUGS_ADDRESS): Define. + +2003-08-12 Jim Meyering + + * LINGUAS: Add Irish (ga). + +2003-07-11 Jim Meyering + + * POTFILES.in: Add src/nohup.c and src/setuidgid.c. + +2003-03-18 Jim Meyering + + * POTFILES.in: Remove lib/c-stack.c. + +2003-02-16 Jim Meyering + + * LINGUAS: Add Finnish (fi). + +2003-01-11 Jim Meyering + + * POTFILES.in: Add src/readlink.c. + +2002-11-21 Jim Meyering + + * LINGUAS: Add ms (Malay). + +2002-11-14 Jim Meyering + + * POTFILES.in: Remove lib/long-options.c and lib/same.c. + Although each defines `_', neither actually used it. + +2002-11-09 Jim Meyering + + * Makevars (EXTRA_LOCALE_CATEGORIES): Add LC_TIME. + Patch by Tim Waugh for Red Hat bug #73669. + +2002-09-25 gettextize + + * Makefile.in.in: Upgrade to gettext-0.11.5. + +2002-09-16 Jim Meyering + + * LINGUAS: Add be (Belarusian). + +2002-09-02 Jim Meyering + + * LINGUAS: Add lg (Luganda). diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/README b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/README new file mode 100644 index 0000000..58b11b4 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/README @@ -0,0 +1,3 @@ +A note about Makefile.am.in. +It is used (usually only by the maintainer) to generate some of the +Makefile.am files in these subdirectories. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/join/TODO b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/join/TODO new file mode 100644 index 0000000..265ea47 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/join/TODO @@ -0,0 +1,2 @@ +rename tr-tests +make sure all test_names are distinct! diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/tr/TODO b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/tr/TODO new file mode 100644 index 0000000..e1cffb7 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0-src/tests/tr/TODO @@ -0,0 +1 @@ +Integrate tests from the files `range-tests' and `failures'. diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0/check.log b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0/check.log new file mode 100644 index 0000000..d188898 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/coreutils-5.3.0/check.log @@ -0,0 +1,3311 @@ +Making check in lib +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/lib' +./t-fpending > /dev/null + +This application has requested the Runtime to terminate it in an unusual way. +Please contact the application's support team for more information. +make[1]: [unit-test] Fout 3 (genegeerd) +make check-am +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/lib' +make[2]: Niets te doen voor `check-am'. +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/lib' +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/lib' +Making check in src +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/src' +rm -rf progs-readme progs-makefile +echo [.exe chgrp.exe chown.exe chmod.exe cp.exe dd.exe dircolors.exe du.exe ginstall.exe link.exe ln.exe dir.exe vdir.exe ls.exe mkdir.exe mkfifo.exe mknod.exe mv.exe nohup.exe readlink.exe rm.exe rmdir.exe shred.exe stat.exe sync.exe touch.exe unlink.exe cat.exe cksum.exe comm.exe csplit.exe cut.exe expand.exe fmt.exe fold.exe head.exe join.exe md5sum.exe nl.exe od.exe paste.exe pr.exe ptx.exe sha1sum.exe sort.exe split.exe sum.exe tac.exe tail.exe tr.exe tsort.exe unexpand.exe uniq.exe wc.exe basename.exe date.exe dirname.exe echo.exe env.exe expr.exe factor.exe false.exe hostname.exe id.exe kill.exe logname.exe pathchk.exe printenv.exe printf.exe pwd.exe seq.exe sleep.exe tee.exe test.exe true.exe tty.exe whoami.exe yes.exe uname.exe chroot.exe hostid.exe nice.exe pinky.exe users.exe who.exe uptime.exe stty.exe df.exe groups chroot.exe df.exe hostid.exe nice.exe pinky.exe stty.exe su.exe uname.exe uptime.exe users.exe who.exe \ + | tr -s ' ' '\n' | LC_ALL=C sort -u > progs-makefile && \ +sed -n '/^The programs .* are:/,/^[a-zA-Z]/p' ../../coreutils-5.3.0-src/README \ + | sed -n '/^ */s///p' | tr -s ' ' '\n' > progs-readme +diff progs-makefile progs-readme && rm -rf progs-readme progs-makefile +1,28c1,28 +< [.exe +< basename.exe +< cat.exe +< chgrp.exe +< chmod.exe +< chown.exe +< chroot.exe +< cksum.exe +< comm.exe +< cp.exe +< csplit.exe +< cut.exe +< date.exe +< dd.exe +< df.exe +< dir.exe +< dircolors.exe +< dirname.exe +< du.exe +< echo.exe +< env.exe +< expand.exe +< expr.exe +< factor.exe +< false.exe +< fmt.exe +< fold.exe +< ginstall.exe +--- +> [ +> basename +> cat +> chgrp +> chmod +> chown +> chroot +> cksum +> comm +> cp +> csplit +> cut +> date +> dd +> df +> dir +> dircolors +> dirname +> du +> echo +> env +> expand +> expr +> factor +> false +> fmt +> fold +> ginstall +30,91c30,90 +< head.exe +< hostid.exe +< hostname.exe +< id.exe +< join.exe +< kill.exe +< link.exe +< ln.exe +< logname.exe +< ls.exe +< md5sum.exe +< mkdir.exe +< mkfifo.exe +< mknod.exe +< mv.exe +< nice.exe +< nl.exe +< nohup.exe +< od.exe +< paste.exe +< pathchk.exe +< pinky.exe +< pr.exe +< printenv.exe +< printf.exe +< ptx.exe +< pwd.exe +< readlink.exe +< rm.exe +< rmdir.exe +< seq.exe +< sha1sum.exe +< shred.exe +< sleep.exe +< sort.exe +< split.exe +< stat.exe +< stty.exe +< su.exe +< sum.exe +< sync.exe +< tac.exe +< tail.exe +< tee.exe +< test.exe +< touch.exe +< tr.exe +< true.exe +< tsort.exe +< tty.exe +< uname.exe +< unexpand.exe +< uniq.exe +< unlink.exe +< uptime.exe +< users.exe +< vdir.exe +< wc.exe +< who.exe +< who.exe +< whoami.exe +< yes.exe +--- +> head +> hostid +> hostname +> id +> join +> kill +> link +> ln +> logname +> ls +> md5sum +> mkdir +> mkfifo +> mknod +> mv +> nice +> nl +> nohup +> od +> paste +> pathchk +> pinky +> pr +> printenv +> printf +> ptx +> pwd +> readlink +> rm +> rmdir +> seq +> sha1sum +> shred +> sleep +> sort +> split +> stat +> stty +> su +> sum +> sync +> tac +> tail +> tee +> test +> touch +> tr +> true +> tsort +> tty +> uname +> unexpand +> uniq +> unlink +> uptime +> users +> vdir +> wc +> who +> whoami +> yes +make[1]: [check-README] Fout 1 (genegeerd) +cd ../../coreutils-5.3.0-src/src; grep '^# *define *S_IS' lbracket.c [.rc basename.c cat.c chgrp.rc chgrp.c chown-core.c chgrp-res.rc chmod.c chown.rc chown.c chown-core.c chown-res.rc chroot.c cksum.c comm.c cp.rc cp.c copy.c cp-hash.c cp-res.rc csplit.c cut.c date.c dd.c df.c dir.rc ls.c ls-dir.c dir-res.rc dircolors.c dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c fmt.c fold.c ginstall.rc install.c copy.c cp-hash.c ginstall-res.rc head.c hostid.c hostname.c id.c join.c kill.c link.c ln.c logname.c ls.rc ls.c ls-ls.c ls-res.rc md5sum.rc md5sum.c md5.c md5sum-res.rc mkdir.c mkfifo.c mknod.c mv.rc mv.c copy.c cp-hash.c remove.c mv-res.rc nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c printenv.c printf.c ptx.c pwd.c readlink.c rm.rc rm.c remove.c rm-res.rc rmdir.c seq.c setuidgid.c sha1sum.rc md5sum.c sha1sum.c sha1sum-res.rc shred.c sleep.c sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c unexpand.c uniq.c unlink.c uptime.c users.c vdir.rc ls.c ls-vdir.c vdir-res.rc wc.c who.c whoami.c yes.c && exit 1 || : +grep: [.rc: No such file or directory +grep: chgrp.rc: No such file or directory +grep: chgrp-res.rc: No such file or directory +grep: chown.rc: No such file or directory +grep: chown-res.rc: No such file or directory +grep: cp.rc: No such file or directory +grep: cp-res.rc: No such file or directory +grep: dir.rc: No such file or directory +grep: dir-res.rc: No such file or directory +grep: ginstall.rc: No such file or directory +grep: ginstall-res.rc: No such file or directory +grep: ls.rc: No such file or directory +grep: ls-res.rc: No such file or directory +grep: md5sum.rc: No such file or directory +grep: md5sum-res.rc: No such file or directory +grep: mv.rc: No such file or directory +grep: mv-res.rc: No such file or directory +grep: rm.rc: No such file or directory +grep: rm-res.rc: No such file or directory +grep: sha1sum.rc: No such file or directory +grep: sha1sum-res.rc: No such file or directory +grep: vdir.rc: No such file or directory +grep: vdir-res.rc: No such file or directory +cd ../../coreutils-5.3.0-src/src; grep st_blocks lbracket.c [.rc basename.c cat.c chgrp.rc chgrp.c chown-core.c chgrp-res.rc chmod.c chown.rc chown.c chown-core.c chown-res.rc chroot.c cksum.c comm.c cp.rc cp.c copy.c cp-hash.c cp-res.rc csplit.c cut.c date.c dd.c df.c dir.rc ls.c ls-dir.c dir-res.rc dircolors.c dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c fmt.c fold.c ginstall.rc install.c copy.c cp-hash.c ginstall-res.rc head.c hostid.c hostname.c id.c join.c kill.c link.c ln.c logname.c ls.rc ls.c ls-ls.c ls-res.rc md5sum.rc md5sum.c md5.c md5sum-res.rc mkdir.c mkfifo.c mknod.c mv.rc mv.c copy.c cp-hash.c remove.c mv-res.rc nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c printenv.c printf.c ptx.c pwd.c readlink.c rm.rc rm.c remove.c rm-res.rc rmdir.c seq.c setuidgid.c sha1sum.rc md5sum.c sha1sum.c sha1sum-res.rc shred.c sleep.c sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c unexpand.c uniq.c unlink.c uptime.c users.c vdir.rc ls.c ls-vdir.c vdir-res.rc wc.c who.c whoami.c yes.c && exit 1 || : +grep: [.rc: No such file or directory +grep: chgrp.rc: No such file or directory +grep: chgrp-res.rc: No such file or directory +grep: chown.rc: No such file or directory +grep: chown-res.rc: No such file or directory +grep: cp.rc: No such file or directory +grep: cp-res.rc: No such file or directory +grep: dir.rc: No such file or directory +grep: dir-res.rc: No such file or directory +grep: ginstall.rc: No such file or directory +grep: ginstall-res.rc: No such file or directory +grep: ls.rc: No such file or directory +grep: ls-res.rc: No such file or directory +grep: md5sum.rc: No such file or directory +grep: md5sum-res.rc: No such file or directory +grep: mv.rc: No such file or directory +grep: mv-res.rc: No such file or directory +grep: rm.rc: No such file or directory +grep: rm-res.rc: No such file or directory +grep: sha1sum.rc: No such file or directory +grep: sha1sum-res.rc: No such file or directory +grep: vdir.rc: No such file or directory +grep: vdir-res.rc: No such file or directory +cd ../../coreutils-5.3.0-src/src; grep '^# *define .*defined' lbracket.c [.rc basename.c cat.c chgrp.rc chgrp.c chown-core.c chgrp-res.rc chmod.c chown.rc chown.c chown-core.c chown-res.rc chroot.c cksum.c comm.c cp.rc cp.c copy.c cp-hash.c cp-res.rc csplit.c cut.c date.c dd.c df.c dir.rc ls.c ls-dir.c dir-res.rc dircolors.c dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c fmt.c fold.c ginstall.rc install.c copy.c cp-hash.c ginstall-res.rc head.c hostid.c hostname.c id.c join.c kill.c link.c ln.c logname.c ls.rc ls.c ls-ls.c ls-res.rc md5sum.rc md5sum.c md5.c md5sum-res.rc mkdir.c mkfifo.c mknod.c mv.rc mv.c copy.c cp-hash.c remove.c mv-res.rc nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c printenv.c printf.c ptx.c pwd.c readlink.c rm.rc rm.c remove.c rm-res.rc rmdir.c seq.c setuidgid.c sha1sum.rc md5sum.c sha1sum.c sha1sum-res.rc shred.c sleep.c sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c unexpand.c uniq.c unlink.c uptime.c users.c vdir.rc ls.c ls-vdir.c vdir-res.rc wc.c who.c whoami.c yes.c && exit 1 || : +grep: [.rc: No such file or directory +grep: chgrp.rc: No such file or directory +grep: chgrp-res.rc: No such file or directory +grep: chown.rc: No such file or directory +grep: chown-res.rc: No such file or directory +grep: cp.rc: No such file or directory +grep: cp-res.rc: No such file or directory +grep: dir.rc: No such file or directory +grep: dir-res.rc: No such file or directory +grep: ginstall.rc: No such file or directory +grep: ginstall-res.rc: No such file or directory +grep: ls.rc: No such file or directory +grep: ls-res.rc: No such file or directory +grep: md5sum.rc: No such file or directory +grep: md5sum-res.rc: No such file or directory +grep: mv.rc: No such file or directory +grep: mv-res.rc: No such file or directory +grep: rm.rc: No such file or directory +grep: rm-res.rc: No such file or directory +grep: sha1sum.rc: No such file or directory +grep: sha1sum-res.rc: No such file or directory +grep: vdir.rc: No such file or directory +grep: vdir-res.rc: No such file or directory +rm -f authors-actual authors-dotdot +for i in `ls [.exe chgrp.exe chown.exe chmod.exe cp.exe dd.exe dircolors.exe du.exe ginstall.exe link.exe ln.exe dir.exe vdir.exe ls.exe mkdir.exe mkfifo.exe mknod.exe mv.exe nohup.exe readlink.exe rm.exe rmdir.exe shred.exe stat.exe sync.exe touch.exe unlink.exe cat.exe cksum.exe comm.exe csplit.exe cut.exe expand.exe fmt.exe fold.exe head.exe join.exe md5sum.exe nl.exe od.exe paste.exe pr.exe ptx.exe sha1sum.exe sort.exe split.exe sum.exe tac.exe tail.exe tr.exe tsort.exe unexpand.exe uniq.exe wc.exe basename.exe date.exe dirname.exe echo.exe env.exe expr.exe factor.exe false.exe hostname.exe id.exe kill.exe logname.exe pathchk.exe printenv.exe printf.exe pwd.exe seq.exe sleep.exe tee.exe test.exe true.exe tty.exe whoami.exe yes.exe uname.exe chroot.exe hostid.exe nice.exe pinky.exe users.exe who.exe uptime.exe stty.exe df.exe groups chroot.exe df.exe hostid.exe nice.exe pinky.exe stty.exe su.exe uname.exe uptime.exe users.exe who.exe | LC_ALL=C sort -u`; do \ + test "$i" = '[' && continue; \ + exe=$i; \ + if test "$i" = install; then \ + exe=ginstall; \ + elif test "$i" = test; then \ + exe='['; \ + fi; \ + ./$exe --version \ + |sed -n '/Written by /{ s//'"$i"': /; s/,* and /, /; s/\.$//; p; }'; \ +done > authors-actual +sed -n '/:/p' ../../coreutils-5.3.0-src/AUTHORS > authors-dotdot +diff authors-actual authors-dotdot && rm -f authors-actual authors-dotdot +1,28c1,27 +< [.exe: Kevin Braunsdorf, Matthew Bradburn +< basename.exe: FIXME unknown +< cat.exe: Torbjorn Granlund, Richard M. Stallman +< chgrp.exe: David MacKenzie, Jim Meyering +< chmod.exe: David MacKenzie, Jim Meyering +< chown.exe: David MacKenzie, Jim Meyering +< chroot.exe: Roland McGrath +< cksum.exe: Q. Frank Xia +< comm.exe: Richard Stallman, David MacKenzie +< cp.exe: Torbjorn Granlund, David MacKenzie, Jim Meyering +< csplit.exe: Stuart Kemp, David MacKenzie +< cut.exe: David Ihnat, David MacKenzie, Jim Meyering +< date.exe: David MacKenzie +< dd.exe: Paul Rubin, David MacKenzie, Stuart Kemp +< df.exe: Torbjorn Granlund, David MacKenzie, Paul Eggert +< dir.exe: Richard Stallman, David MacKenzie +< dircolors.exe: H. Peter Anvin +< dirname.exe: David MacKenzie, Jim Meyering +< du.exe: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering +< echo.exe: FIXME unknown +< env.exe: Richard Mlynarik, David MacKenzie +< expand.exe: David MacKenzie +< expr.exe: Mike Parker +< factor.exe: Paul Rubin +< false.exe: Jim Meyering +< fmt.exe: Ross Paterson +< fold.exe: David MacKenzie +< ginstall.exe: David MacKenzie +--- +> basename: FIXME unknown +> cat: Torbjorn Granlund, Richard M. Stallman +> chgrp: David MacKenzie, Jim Meyering +> chmod: David MacKenzie, Jim Meyering +> chown: David MacKenzie, Jim Meyering +> chroot: Roland McGrath +> cksum: Q. Frank Xia +> comm: Richard Stallman, David MacKenzie +> cp: Torbjorn Granlund, David MacKenzie, Jim Meyering +> csplit: Stuart Kemp, David MacKenzie +> cut: David Ihnat, David MacKenzie, Jim Meyering +> date: David MacKenzie +> dd: Paul Rubin, David MacKenzie, Stuart Kemp +> df: Torbjorn Granlund, David MacKenzie, Paul Eggert +> dir: Richard Stallman, David MacKenzie +> dircolors: H. Peter Anvin +> dirname: David MacKenzie, Jim Meyering +> du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering +> echo: FIXME unknown +> env: Richard Mlynarik, David MacKenzie +> expand: David MacKenzie +> expr: Mike Parker +> factor: Paul Rubin +> false: Jim Meyering +> fmt: Ross Paterson +> fold: David MacKenzie +> ginstall: David MacKenzie +30,89c29,89 +< head.exe: David MacKenzie, Jim Meyering +< hostid.exe: Jim Meyering +< hostname.exe: Jim Meyering +< id.exe: Arnold Robbins, David MacKenzie +< join.exe: Mike Haertel +< kill.exe: Paul Eggert +< link.exe: Michael Stone +< ln.exe: Mike Parker, David MacKenzie +< logname.exe: FIXME: unknown +< ls.exe: Richard Stallman, David MacKenzie +< md5sum.exe: Ulrich Drepper, Scott Miller +< mkdir.exe: David MacKenzie +< mkfifo.exe: David MacKenzie +< mknod.exe: David MacKenzie +< mv.exe: Mike Parker, David MacKenzie, Jim Meyering +< nice.exe: David MacKenzie +< nl.exe: Scott Bartram, David MacKenzie +< nohup.exe: Jim Meyering +< od.exe: Jim Meyering +< paste.exe: David M. Ihnat, David MacKenzie +< pathchk.exe: Paul Eggert, David MacKenzie, Jim Meyering +< pinky.exe: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi +< pr.exe: Pete TerMaat, Roland Huebner +< printenv.exe: David MacKenzie, Richard Mlynarik +< printf.exe: David MacKenzie +< ptx.exe: F. Pinard +< pwd.exe: Jim Meyering +< readlink.exe: Dmitry V. Levin +< rm.exe: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering +< rmdir.exe: David MacKenzie +< seq.exe: Ulrich Drepper +< sha1sum.exe: Ulrich Drepper, Scott Miller +< shred.exe: Colin Plumb +< sleep.exe: Jim Meyering, Paul Eggert +< sort.exe: Mike Haertel, Paul Eggert +< split.exe: Torbjorn Granlund, Richard M. Stallman +< stat.exe: Michael Meskes +< stty.exe: David MacKenzie +< su.exe: David MacKenzie +< sum.exe: Kayvan Aghaiepour, David MacKenzie +< sync.exe: Jim Meyering +< tac.exe: Jay Lepreau, David MacKenzie +< tail.exe: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering +< tee.exe: Mike Parker, Richard M. Stallman, David MacKenzie +< touch.exe: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith +< tr.exe: Jim Meyering +< true.exe: Jim Meyering +< tsort.exe: Mark Kettenis +< tty.exe: David MacKenzie +< uname.exe: David MacKenzie +< unexpand.exe: David MacKenzie +< uniq.exe: Richard Stallman, David MacKenzie +< unlink.exe: Michael Stone +< uptime.exe: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi +< users.exe: Joseph Arceneaux, David MacKenzie +< vdir.exe: Richard Stallman, David MacKenzie +< wc.exe: Paul Rubin, David MacKenzie +< who.exe: Joseph Arceneaux, David MacKenzie, Michael Stone +< whoami.exe: Richard Mlynarik +< yes.exe: David MacKenzie +--- +> head: David MacKenzie, Jim Meyering +> hostid: Jim Meyering +> hostname: Jim Meyering +> id: Arnold Robbins, David MacKenzie +> join: Mike Haertel +> kill: Paul Eggert +> link: Michael Stone +> ln: Mike Parker, David MacKenzie +> logname: FIXME: unknown +> ls: Richard Stallman, David MacKenzie +> md5sum: Ulrich Drepper, Scott Miller +> mkdir: David MacKenzie +> mkfifo: David MacKenzie +> mknod: David MacKenzie +> mv: Mike Parker, David MacKenzie, Jim Meyering +> nice: David MacKenzie +> nl: Scott Bartram, David MacKenzie +> nohup: Jim Meyering +> od: Jim Meyering +> paste: David M. Ihnat, David MacKenzie +> pathchk: Paul Eggert, David MacKenzie, Jim Meyering +> pinky: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi +> pr: Pete TerMaat, Roland Huebner +> printenv: David MacKenzie, Richard Mlynarik +> printf: David MacKenzie +> ptx: F. Pinard +> pwd: Jim Meyering +> readlink: Dmitry V. Levin +> rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering +> rmdir: David MacKenzie +> seq: Ulrich Drepper +> sha1sum: Ulrich Drepper, Scott Miller +> shred: Colin Plumb +> sleep: Jim Meyering, Paul Eggert +> sort: Mike Haertel, Paul Eggert +> split: Torbjorn Granlund, Richard M. Stallman +> stat: Michael Meskes +> stty: David MacKenzie +> su: David MacKenzie +> sum: Kayvan Aghaiepour, David MacKenzie +> sync: Jim Meyering +> tac: Jay Lepreau, David MacKenzie +> tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering +> tee: Mike Parker, Richard M. Stallman, David MacKenzie +> test: Kevin Braunsdorf, Matthew Bradburn +> touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith +> tr: Jim Meyering +> true: Jim Meyering +> tsort: Mark Kettenis +> tty: David MacKenzie +> uname: David MacKenzie +> unexpand: David MacKenzie +> uniq: Richard Stallman, David MacKenzie +> unlink: Michael Stone +> uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi +> users: Joseph Arceneaux, David MacKenzie +> vdir: Richard Stallman, David MacKenzie +> wc: Paul Rubin, David MacKenzie +> who: Joseph Arceneaux, David MacKenzie, Michael Stone +> whoami: Richard Mlynarik +> yes: David MacKenzie +make[1]: [check-AUTHORS] Fout 1 (genegeerd) +make check-am +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/src' +make[2]: Niets te doen voor `check-am'. +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/src' +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/src' +Making check in doc +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/doc' +fail=0; \ +grep timezone ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep -E '(^|[^A-Za-z0-9_])IO([^A-Za-z0-9_]|$)' ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep non-zero ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep '@url{' ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep -E '(^|[^A-Za-z0-9_])NUL([^A-Za-z0-9_]|$)' ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep '\$@"' ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep -n '[^[:punct:]]@footnote' ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +grep -n filename ../../coreutils-5.3.0-src/doc/*.texi|grep -vE 'setfilename|{filename}' \ + && fail=1; \ +perl -e 1 2> /dev/null && { perl -ne \ + '/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \ + ../../coreutils-5.3.0-src/doc/*.texi 2> /dev/null || fail=1; }; \ +grep -iwE 'builtins?' ../../coreutils-5.3.0-src/doc/*.texi && fail=1; \ +exit $fail +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/doc' +Making check in man +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/man' +make check-local +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/man' +PATH=../src:$PATH; export PATH; \ +t=ls-files.$$; \ +(cd ../../coreutils-5.3.0-src/man && ls -1 *.x) | sed 's/\.x$//' | LC_ALL=C sort > $t;\ +echo basename.1 cat.1 chgrp.1 chmod.1 chown.1 chroot.1 cksum.1 comm.1 cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 head.1 hostid.1 hostname.1 id.1 install.1 join.1 kill.1 link.1 ln.1 logname.1 ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 who.1 whoami.1 yes.1 | tr -s ' ' '\n' | sed 's/\.1$//' \ + | LC_ALL=C sort | diff - $t || { rm $t; exit 1; }; \ +rm $t +1,89c1,89 +< basename +< cat +< chgrp +< chmod +< chown +< chroot +< cksum +< comm +< cp +< csplit +< cut +< date +< dd +< df +< dir +< dircolors +< dirname +< du +< echo +< env +< expand +< expr +< factor +< false +< fmt +< fold +< groups +< head +< hostid +< hostname +< id +< install +< join +< kill +< link +< ln +< logname +< ls +< md5sum +< mkdir +< mkfifo +< mknod +< mv +< nice +< nl +< nohup +< od +< paste +< pathchk +< pinky +< pr +< printenv +< printf +< ptx +< pwd +< readlink +< rm +< rmdir +< seq +< sha1sum +< shred +< sleep +< sort +< split +< stat +< stty +< su +< sum +< sync +< tac +< tail +< tee +< test +< touch +< tr +< true +< tsort +< tty +< uname +< unexpand +< uniq +< unlink +< uptime +< users +< vdir +< wc +< who +< whoami +< yes +--- +> basename +> cat +> chgrp +> chmod +> chown +> chroot +> cksum +> comm +> cp +> csplit +> cut +> date +> dd +> df +> dir +> dircolors +> dirname +> du +> echo +> env +> expand +> expr +> factor +> false +> fmt +> fold +> groups +> head +> hostid +> hostname +> id +> install +> join +> kill +> link +> ln +> logname +> ls +> md5sum +> mkdir +> mkfifo +> mknod +> mv +> nice +> nl +> nohup +> od +> paste +> pathchk +> pinky +> pr +> printenv +> printf +> ptx +> pwd +> readlink +> rm +> rmdir +> seq +> sha1sum +> shred +> sleep +> sort +> split +> stat +> stty +> su +> sum +> sync +> tac +> tail +> tee +> test +> touch +> tr +> true +> tsort +> tty +> uname +> unexpand +> uniq +> unlink +> uptime +> users +> vdir +> wc +> who +> whoami +> yes +make[2]: [check-x-vs-1] Fout 1 (genegeerd) +status=0; \ +for p in dummy `(cd ../src && MAKEFLAGS= make -s all_programs.list) | grep -v '\['`; do \ + test $p = dummy && continue; \ + test $p = ginstall && p=install || : ; \ + test -f ../../coreutils-5.3.0-src/man/$p.x \ + || { echo missing $p.x 1>&2; status=1; }; \ +done; \ +exit $status +missing basename.exe.x +missing cat.exe.x +missing chgrp.exe.x +missing chmod.exe.x +missing chown.exe.x +missing chroot.exe.x +missing chroot.exe.x +missing cksum.exe.x +missing comm.exe.x +missing cp.exe.x +missing csplit.exe.x +missing cut.exe.x +missing date.exe.x +missing dd.exe.x +missing df.exe.x +missing df.exe.x +missing dir.exe.x +missing dircolors.exe.x +missing dirname.exe.x +missing du.exe.x +missing echo.exe.x +missing env.exe.x +missing expand.exe.x +missing expr.exe.x +missing factor.exe.x +missing false.exe.x +missing fmt.exe.x +missing fold.exe.x +missing ginstall.exe.x +missing head.exe.x +missing hostid.exe.x +missing hostid.exe.x +missing hostname.exe.x +missing id.exe.x +missing join.exe.x +missing kill.exe.x +missing link.exe.x +missing ln.exe.x +missing logname.exe.x +missing ls.exe.x +missing md5sum.exe.x +missing mkdir.exe.x +missing mkfifo.exe.x +missing mknod.exe.x +missing mv.exe.x +missing nice.exe.x +missing nice.exe.x +missing nl.exe.x +missing nohup.exe.x +missing od.exe.x +missing paste.exe.x +missing pathchk.exe.x +missing pinky.exe.x +missing pinky.exe.x +missing pr.exe.x +missing printenv.exe.x +missing printf.exe.x +missing ptx.exe.x +missing pwd.exe.x +missing readlink.exe.x +missing rm.exe.x +missing rmdir.exe.x +missing seq.exe.x +missing sha1sum.exe.x +missing shred.exe.x +missing sleep.exe.x +missing sort.exe.x +missing split.exe.x +missing stat.exe.x +missing stty.exe.x +missing stty.exe.x +missing su.exe.x +missing sum.exe.x +missing sync.exe.x +missing tac.exe.x +missing tail.exe.x +missing tee.exe.x +missing test.exe.x +missing touch.exe.x +missing tr.exe.x +missing true.exe.x +missing tsort.exe.x +missing tty.exe.x +missing uname.exe.x +missing uname.exe.x +missing unexpand.exe.x +missing uniq.exe.x +missing unlink.exe.x +missing uptime.exe.x +missing uptime.exe.x +missing users.exe.x +missing users.exe.x +missing vdir.exe.x +missing wc.exe.x +missing who.exe.x +missing who.exe.x +missing whoami.exe.x +missing yes.exe.x +make[2]: [check-programs-vs-x] Fout 1 (genegeerd) +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/man' +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/man' +Making check in po +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/po' +make[1]: Niets te doen voor `check'. +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/po' +Making check in tests +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests' +../src/printenv POSIXLY_CORRECT >/dev/null \ + && sed s/%%/POSIXLY_CORRECT/ ../../coreutils-5.3.0-src/tests/.env-warn || : +test "${CDPATH+set}" = set \ + && sed s/%%/CDPATH/ ../../coreutils-5.3.0-src/tests/.env-warn || : +*********************************************************** +NOTICE: Some tests may be run only as root. + Do `make check-root' as `root' to run these tests. +*********************************************************** +Making check in basename +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/basename' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/basename' +-: test fail-1: stderr mismatch, comparing fail-1.E (actual) and fail-1.1 (expected) +*** fail-1.E Wed Apr 20 21:24:15 2005 +--- fail-1.1 Wed Apr 20 21:24:15 2005 +*************** +*** 1,2 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\basename.exe: missing operand +! Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\basename.exe --help' for more information. +--- 1,2 ---- +! basename: missing operand +! Try `basename --help' for more information. +-: test fail-2: stderr mismatch, comparing fail-2.E (actual) and fail-2.1 (expected) +*** fail-2.E Wed Apr 20 21:24:15 2005 +--- fail-2.1 Wed Apr 20 21:24:15 2005 +*************** +*** 1,2 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\basename.exe: extra operand `c' +! Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\basename.exe --help' for more information. +--- 1,2 ---- +! basename: extra operand `c' +! Try `basename --help' for more information. +-: test a: stdout mismatch, comparing a.O (actual) and a.1 (expected) +-: test b: stdout mismatch, comparing b.O (actual) and b.1 (expected) +-: test c: stdout mismatch, comparing c.O (actual) and c.1 (expected) +-: test d: stdout mismatch, comparing d.O (actual) and d.1 (expected) +-: test e: stdout mismatch, comparing e.O (actual) and e.1 (expected) +-: test f: stdout mismatch, comparing f.O (actual) and f.1 (expected) +-: test g: stdout mismatch, comparing g.O (actual) and g.1 (expected) +-: test h: stdout mismatch, comparing h.O (actual) and h.1 (expected) +-: test i: stdout mismatch, comparing i.O (actual) and i.1 (expected) +-: test 1: stdout mismatch, comparing 1.O (actual) and 1.1 (expected) +-: test 2: stdout mismatch, comparing 2.O (actual) and 2.1 (expected) +-: test 3: stdout mismatch, comparing 3.O (actual) and 3.1 (expected) +-: test 4: stdout mismatch, comparing 4.O (actual) and 4.1 (expected) +-: test 5: stdout mismatch, comparing 5.O (actual) and 5.1 (expected) +FAIL: basic +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/basename' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/basename' +Making check in chgrp +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chgrp' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chgrp' +../../../coreutils-5.3.0-src/tests/chgrp/no-x: this test requires that you be a member of more than one group, +but running `id -nG' either failed or found just one. If you really +are a member of at least two group, then rerun this test with FETISH_GROUPS +set in your environment to the space-separated list of names. E.g., + + env FETISH_GROUPS='users cdrom' make check + +SKIP: no-x +../../../coreutils-5.3.0-src/tests/chgrp/posix-H: this test requires that you be a member of more than one group, +but running `id -nG' either failed or found just one. If you really +are a member of at least two group, then rerun this test with FETISH_GROUPS +set in your environment to the space-separated list of names. E.g., + + env FETISH_GROUPS='users cdrom' make check + +SKIP: posix-H +../../../coreutils-5.3.0-src/tests/chgrp/basic: this test requires that you be a member of more than one group, +but running `id -nG' either failed or found just one. If you really +are a member of at least two group, then rerun this test with FETISH_GROUPS +set in your environment to the space-separated list of names. E.g., + + env FETISH_GROUPS='users cdrom' make check + +SKIP: basic +../../../coreutils-5.3.0-src/tests/chgrp/deref: this test requires that you be a member of more than one group, +but running `id -nG' either failed or found just one. If you really +are a member of at least two group, then rerun this test with FETISH_GROUPS +set in your environment to the space-separated list of names. E.g., + + env FETISH_GROUPS='users cdrom' make check + +SKIP: deref +../../../coreutils-5.3.0-src/tests/chgrp/recurse: this test requires that you be a member of more than one group, +but running `id -nG' either failed or found just one. If you really +are a member of at least two group, then rerun this test with FETISH_GROUPS +set in your environment to the space-separated list of names. E.g., + + env FETISH_GROUPS='users cdrom' make check + +SKIP: recurse +====================== +All 0 tests passed +(5 tests were not run) +====================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chgrp' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chgrp' +Making check in chmod +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chmod' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chmod' +../../../coreutils-5.3.0-src/tests/chmod/no-x: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/chmod/no-x: is invalid because its UID is 0. +FAIL: no-x +FAIL: equals +-r--r--r-- 1 KZLG 0 0 2005-04-20 21:24 f +FAIL: equal-x +../../../coreutils-5.3.0-src/tests/chmod/c-option: Since it looks like you're running this test in a directory with +the setgid bit set, we're skipping this test. +SKIP: c-option +../../../coreutils-5.3.0-src/tests/chmod/setgid: Since it looks like you're running this test in a directory with +the setgid bit set, we're skipping this test. +SKIP: setgid +PASS: usage +====================================== +3 of 4 tests failed +(2 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chmod' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chmod' +Making check in chown +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chown' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chown' +../../../coreutils-5.3.0-src/tests/chown/basic: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/chown/basic: is invalid because its UID is 0. +FAIL: basic +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: dangle: No such file or directory +out exp verschillen: byte 1, regel 1 +1,2c1 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\chown.exe +< Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\chown.exe --help' for more information. +--- +> chown: changing ownership of `dangle' +FAIL: deref +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\id.exe: cannot find name for group ID 0 +../../../coreutils-5.3.0-src/tests/chown/separator: failure in testing framework +FAIL: separator +====================================== +3 of 3 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chown' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/chown' +Making check in cp +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp' +PASS: preserve-2 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: bar: No such file or directory +FAIL: r-vs-symlink +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `b': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: c/b: No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: c/b: No such file or directory +FAIL: link-preserve +PASS: backup-1 +FAIL: no-deref-link1 +FAIL: no-deref-link2 +FAIL: no-deref-link3 +out2 exp differ: char 1, line 1 +FAIL: backup-is-src +*** expected-3044 Wed Apr 20 21:25:17 2005 +--- actual-3044 Wed Apr 20 21:25:17 2005 +*************** +*** 1,83 **** +! 1 [cp: `foo' and `symlink' are the same file] (foo symlink -> foo) +! 1 -d [cp: `foo' and `symlink' are the same file] (foo symlink -> foo) +! 1 -f [cp: `foo' and `symlink' are the same file] (foo symlink -> foo) +! 1 -df [cp: `foo' and `symlink' are the same file] (foo symlink -> foo) +! 0 --rem (foo symlink) +! 0 -b (foo symlink symlink.~1~ -> foo) +! 0 -bd (foo symlink symlink.~1~ -> foo) +! 0 -bf (foo symlink symlink.~1~ -> foo) +! 0 -bdf (foo symlink symlink.~1~ -> foo) +! 0 -l (foo symlink -> foo) +! 0 -dl (foo symlink -> foo) +! 0 -fl (foo symlink -> foo) +! 0 -dfl (foo symlink) +! 0 -bl (foo symlink -> foo) +! 0 -bdl (foo symlink symlink.~1~ -> foo) +! 0 -bfl (foo symlink -> foo) +! 0 -bdfl (foo symlink symlink.~1~ -> foo) + +! 1 [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 1 -d [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 1 -f [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 1 -df [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 1 --rem [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 1 -b [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 0 -bd (foo -> foo foo.~1~ symlink -> foo) symlink-loop symlink-loop +! 1 -bf [cp: `symlink' and `foo' are the same file] (foo symlink -> foo) +! 0 -bdf (foo -> foo foo.~1~ symlink -> foo) symlink-loop symlink-loop +! 0 -l (foo symlink -> foo) +! 0 -dl (foo symlink -> foo) +! 0 -fl (foo symlink -> foo) +! 0 -bl (foo symlink -> foo) +! 0 -bfl (foo symlink -> foo) + +! 1 [cp: `foo' and `foo' are the same file] (foo) +! 1 -d [cp: `foo' and `foo' are the same file] (foo) +! 1 -f [cp: `foo' and `foo' are the same file] (foo) +! 1 -df [cp: `foo' and `foo' are the same file] (foo) +! 1 --rem [cp: `foo' and `foo' are the same file] (foo) +! 1 -b [cp: `foo' and `foo' are the same file] (foo) +! 1 -bd [cp: `foo' and `foo' are the same file] (foo) +! 0 -bf (foo foo.~1~) +! 0 -bdf (foo foo.~1~) +! 0 -l (foo) +! 0 -dl (foo) +! 0 -fl (foo) +! 0 -dfl (foo) +! 0 -bl (foo) +! 0 -bdl (foo) +! 0 -bfl (foo foo.~1~) +! 0 -bdfl (foo foo.~1~) + +! 1 [cp: `sl1' and `sl2' are the same file] (foo sl1 -> foo sl2 -> foo) +! 0 -d (foo sl1 -> foo sl2 -> foo) +! 1 -f [cp: `sl1' and `sl2' are the same file] (foo sl1 -> foo sl2 -> foo) +! 0 -df (foo sl1 -> foo sl2 -> foo) +! 0 --rem (foo sl1 -> foo sl2) +! 0 -b (foo sl1 -> foo sl2 sl2.~1~ -> foo) +! 0 -bd (foo sl1 -> foo sl2 -> foo sl2.~1~ -> foo) +! 0 -bf (foo sl1 -> foo sl2 sl2.~1~ -> foo) +! 0 -bdf (foo sl1 -> foo sl2 -> foo sl2.~1~ -> foo) +! 0 -l (foo sl1 -> foo sl2 -> foo) +! 0 -fl (foo sl1 -> foo sl2 -> foo) +! 0 -bl (foo sl1 -> foo sl2 -> foo) +! 0 -bfl (foo sl1 -> foo sl2 -> foo) + +! 1 [cp: `foo' and `hardlink' are the same file] (foo hardlink) +! 1 -d [cp: `foo' and `hardlink' are the same file] (foo hardlink) +! 1 -f [cp: `foo' and `hardlink' are the same file] (foo hardlink) +! 1 -df [cp: `foo' and `hardlink' are the same file] (foo hardlink) +! 0 --rem (foo hardlink) +! 0 -b (foo hardlink hardlink.~1~) +! 0 -bd (foo hardlink hardlink.~1~) +! 0 -bf (foo hardlink hardlink.~1~) +! 0 -bdf (foo hardlink hardlink.~1~) +! 0 -l (foo hardlink) +! 0 -dl (foo hardlink) +! 0 -fl (foo hardlink) +! 0 -dfl (foo hardlink) +! 0 -bl (foo hardlink) +! 0 -bdl (foo hardlink) +! 0 -bfl (foo hardlink) +! 0 -bdfl (foo hardlink) + +--- 1,84 ---- +! 0 (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -d (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -f (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -df (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 --rem (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -b (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bd (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bf (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bdf (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -l (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -dl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -fl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -dfl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bdl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bfl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) +! 0 -bdfl (foo symlink -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) + +! 1 [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -d [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -f [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -df [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 --rem [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -b [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -bd [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -bf [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -bdf [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -l [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -dl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -fl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -bl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop +! 1 -bfl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop + +! 1 [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 1 -d [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 1 -f [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 1 -df [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 1 --rem [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 1 -b [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 1 -bd [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `foo' are the same file] (foo) +! 0 -bf (foo foo.~1~) +! 0 -bdf (foo foo.~1~) +! 0 -l (foo) +! 0 -dl (foo) +! 0 -fl (foo) +! 0 -dfl (foo) +! 0 -bl (foo) +! 0 -bdl (foo) +! 0 -bfl (foo foo.~1~) +! 0 -bdfl (foo foo.~1~) + +! 1 [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -d [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -f [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -df [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 --rem [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -b [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -bd [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -bf [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -bdf [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -l [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -fl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -bl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop +! 1 -bfl [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `sl1': No such file or directory] (foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo -> K:/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/same-file.tmp/3044/dir/foo) symlink-loop symlink-loop + +! 1 [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `hardlink' are the same file] (foo hardlink) +! 1 -d [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `hardlink' are the same file] (foo hardlink) +! 1 -f [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `hardlink' are the same file] (foo hardlink) +! 1 -df [cp:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: `foo' and `hardlink' are the same file] (foo hardlink) +! 0 --rem (foo hardlink) +! 0 -b (foo hardlink hardlink.~1~) +! 0 -bd (foo hardlink hardlink.~1~) +! 0 -bf (foo hardlink hardlink.~1~) +! 0 -bdf (foo hardlink hardlink.~1~) +! 0 -l (foo hardlink) +! 0 -dl (foo hardlink) +! 0 -fl (foo hardlink) +! 0 -dfl (foo hardlink) +! 0 -bl (foo hardlink) +! 0 -bdl (foo hardlink) +! 0 -bfl (foo hardlink) +! 0 -bdfl (foo hardlink) + ++ expected-3044 actual-3044 differ: char 1, line 1 +FAIL: same-file +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `y.~?~': Invalid argument +*** expected Wed Apr 20 21:25:29 2005 +--- actual Wed Apr 20 21:25:29 2005 +*************** +*** 78,80 **** +--- 78,81 ---- + x y y~ y.~1~ nil: y y.~1~ y.~2~ y~ + x y y~ y.~1~ simple: y y.~1~ y~ + x y y~ y.~1~ never: y y.~1~ y~ ++ expected actual differ: char 1002, line 41 +FAIL: cp-mv-backup +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `symlink/': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: s: No such file or directory +!::='::\' +!K:='K:\Sysutils\coreutils\5.3.0\coreutils-5.3.0' +ALLUSERSPROFILE='C:\Documents and Settings\All Users' +APPDATA='C:\Documents and Settings\KZLG\Application Data' +BASEDIR='E:\PROGRA~1\NTDDK' +BASH=/usr/bin/sh +BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i686-pc-cygwin") +BASH_VERSION='2.05b.0(1)-release' +CHARSET=UTF-8 +CLASSPATH='"E:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip"' +CLIENTNAME=Console +COMMONPROGRAMFILES='C:\Program Files\Common Files' +COMPUTERNAME=GAMMA +COMSPEC='C:\WINDOWS\system32\cmd.exe' +CONFIG_SITE=k:/config.site +CVS_RSH=ssh.exe +CYGWIN=codepage:oem +DDKDRIVE=E: +DIRSTACK=() +DISPLAY=localhost:0 +DVLDIR='k:\' +EDITOR=E:/PROGRA~1/oxedit/oxedit.EXE +EUID=400 +FP_NO_HOST_CHECK=NO +GCCVERSION=3.3.1 +GROUPS=() +HOME=/cygdrive/f/kzlg +HOMEDRIVE=f: +HOMEPATH='\kzlg' +HOSTNAME=gamma +HOSTTYPE=i686 +IFS=' +' +INTERIX_ROOT=/dev/fs/H/SFU/ +INTERIX_ROOT_WIN='H:\SFU\' +J2D_D3D=false +LANG= +LANGUAGE= +LC_ALL= +LC_COLLATE= +LC_CTYPE= +LC_MESSAGES= +LC_NUMERIC= +LC_TIME= +LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib +LESS=-isnMCd +LESSBINFMT='*n-' +LESSCHARDEF=8bcccbcc18b95.33b33b. +LESSCHARSET=latin1 +LN_S='ln -s' +LOGONSERVER='\\GAMMA' +MACHTYPE=i686-pc-cygwin +MAILCHECK=0 +MAKE=make +MAKEFLAGS=' --unix -wki' +MAKELEVEL=4 +MAKE_MODE=UNIX +MFLAGS='- --unix -wki' +MINGWDIR='h:\mingw\3.3.1' +NTRESKIT='E:\Program Files\NTrksupport' +NUMBER_OF_PROCESSORS=1 +OLDPWD=/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp +OPENNT_ROOT=/dev/fs/H/SFU/ +OPTERR=1 +OPTIND=1 +OS=Windows_NT +OSTYPE=cygwin +PATH='/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/../../src:/cygdrive/h/mingw/3.3.1/bin:/usr/bin:/usr/local/bin:/cygdrive/e/util:/cygdrive/e/program files/gnuwin32/bin:/cygdrive/h/mingw/3.3.1/bin:/cygdrive/h/tex/bin/win32:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/h/SFU/common/:.' +PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.tcl;.py;.pyc;.pyo;.pyw;.pys' +PIPESTATUS=([0]="0") +POPFILE_ROOT='e:\progra~1\popfile' +POPFILE_USER='e:\progra~1\popfile' +POSIXLY_CORRECT=y +PPID=2140 +PROCESSOR_ARCHITECTURE=x86 +PROCESSOR_IDENTIFIER='x86 Family 15 Model 2 Stepping 7, GenuineIntel' +PROCESSOR_LEVEL=15 +PROCESSOR_REVISION=0207 +PROGRAMFILES='C:\Program Files' +PROMPT='$P$G' +PS4='+ ' +PWD=/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp/symlink-slash.tmp/2104 +PWDIR=-is +QTJAVA='"E:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip"' +SESSIONNAME=Console +SFUDIR='H:\SFU\' +SFUDIR_INTERIX=/dev/fs/H/SFU/ +SHELL=/bin/sh +SHELLOPTS=braceexpand:hashall:interactive-comments:posix +SHLVL=7 +SYSTEMDRIVE=C: +SYSTEMROOT='C:\WINDOWS' +TEMP=/cygdrive/m/temp +TERM=ansi +TEXDIR='h:\tex' +TEXMFCNF='h:\tex\texmf-var\web2c' +TEXMFTEMP='E:\Program Files\TeXLive\temp' +TMAKEPATH='e:\program files\QT\tmake\lib\win32-msvc' +TMP=/cygdrive/m/temp +TMPDIR=/cygdrive/m/temp +TZ=CET-1CES,M3.5.0/2,M10.5.0/2 +UID=400 +USERDOMAIN=GAMMA +USERNAME=KZLG +USERPROFILE='C:\Documents and Settings\KZLG' +VCTOOLKITINSTALLDIR='E:\Program Files\Microsoft Visual C++ Toolkit 2003\' +WINDIR='C:\WINDOWS' +XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults +XCMSDB=/usr/X11R6/lib/X11/Xcms.txt +XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB +XNLSPATH=/usr/X11R6/lib/X11/locale +_= +as_unset=unset +envvar_check_failed=0 +fail=1 +framework_failure=0 +i=LC_TIME +pwd=/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp +srcdir=../../../coreutils-5.3.0-src/tests/cp +t0=symlink-slash.tmp +tmp=symlink-slash.tmp/2104 +var=VERSION_CONTROL +vars=' + BLOCKSIZE + BLOCK_SIZE + DF_BLOCK_SIZE + DU_BLOCK_SIZE + LS_BLOCK_SIZE + SIMPLE_BACKUP_SUFFIX + VERSION_CONTROL +' +FAIL: symlink-slash +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `a': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `c': No such file or directory +FAIL: slink-2-slink +../../../coreutils-5.3.0-src/tests/cp/fail-perm: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/cp/fail-perm: is invalid because its UID is 0. +FAIL: fail-perm +PASS: dir-slash +../../../coreutils-5.3.0-src/tests/cp/perm: This test is relatively expensive, so it is disabled by default. +To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS +environment variable set to yes. E.g., + + env RUN_EXPENSIVE_TESTS=yes make check + +SKIP: perm +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `slink': No such file or directory +FAIL: cp-HL +../../../coreutils-5.3.0-src/tests/cp/special-bits: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/cp/special-bits: is invalid because its UID is 0. +FAIL: special-bits +PASS: link +PASS: dir-rm-dest +../../../coreutils-5.3.0-src/tests/cp/cp-parents: Since it looks like you're running this test in a directory with +the setgid bit set, we're skipping this test. +SKIP: cp-parents +PASS: deref-slink +PASS: dir-vs-file +out exp differ: char 1, line 1 +1c1 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot copy a directory, `dir', into itself, `dir/dir' +--- +> cp: cannot copy a directory, `dir', into itself, `dir/dir' +FAIL: into-self +====================================== +14 of 21 tests failed +(2 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cp' +Making check in cut +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cut' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cut' +Files nul-odelim.O and ../../../coreutils-5.3.0-src/tests/cut/nul-odelim.X differ +Files nul-odelim.O and ../../../coreutils-5.3.0-src/tests/cut/nul-odelim.X differ +Files nul-odelim.O and ../../../coreutils-5.3.0-src/tests/cut/nul-odelim.X differ +*** 8bit-delim.O Wed Apr 20 21:25:57 2005 +--- ../../../coreutils-5.3.0-src/tests/cut/8bit-delim.X Wed Jun 2 13:41:10 2004 +*************** +*** 1 **** +! a­b­c +--- 1 ---- +! b_c +*** 8bit-delim.O Wed Apr 20 21:25:57 2005 +--- ../../../coreutils-5.3.0-src/tests/cut/8bit-delim.X Wed Jun 2 13:41:10 2004 +*************** +*** 1 **** +! a­b­c +--- 1 ---- +! b_c +*** 8bit-delim.O Wed Apr 20 21:25:58 2005 +--- ../../../coreutils-5.3.0-src/tests/cut/8bit-delim.X Wed Jun 2 13:41:10 2004 +*************** +*** 1 **** +! a­b­c +--- 1 ---- +! b_c +FAIL: cut-tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cut' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/cut' +Making check in date +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/date' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/date' +*** 1.O Wed Apr 20 21:26:06 2005 +--- ../../../coreutils-5.3.0-src/tests/date/1.X Mon May 31 20:04:52 2004 +*************** +*** 1 **** +! % zo zondag jan januari +--- 1 ---- +! % Sun Sunday Jan January +*** 3.O Wed Apr 20 21:26:06 2005 +--- ../../../coreutils-5.3.0-src/tests/date/3.X Mon May 31 20:04:52 2004 +*************** +*** 1 **** +! 19_01/19/97_19__08 +--- 1 ---- +! 19_01/19/97_19_Jan_08 +*** 5.O Wed Apr 20 21:26:06 2005 +--- ../../../coreutils-5.3.0-src/tests/date/5.X Mon May 31 20:04:52 2004 +*************** +*** 1,2 **** + 17_ +! _vm_ +--- 1,2 ---- + 17_ +! _AM_08:17:48 AM +*** 8.O Wed Apr 20 21:26:07 2005 +--- ../../../coreutils-5.3.0-src/tests/date/8.X Mon May 31 20:04:52 2004 +*************** +*** 1 **** +! 19-1-1997_8:17:48 vm_97_1997 +--- 1 ---- +! 01/19/97_08:17:48_97_1997 +FAIL: date-tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/date' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/date' +Making check in dd +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dd' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dd' +PASS: misc +PASS: not-rewound +-: test skip-seek-1: stderr mismatch, comparing skip-seek-1.E (actual) and skip-seek-1.4 (expected) +-: test skip-seek-2: stderr mismatch, comparing skip-seek-2.E (actual) and skip-seek-2.4 (expected) +-: test skip-seek-3: stderr mismatch, comparing skip-seek-3.E (actual) and skip-seek-3.4 (expected) +-: test skip-seek-3: mismatch, comparing skip-seek-3.2 (actual) and skip-seek-3.5 (expected) +Files skip-seek-3.2 and skip-seek-3.5 differ +-: test block-sync-1: stderr mismatch, comparing block-sync-1.E (actual) and block-sync-1.3 (expected) +FAIL: skip-seek +PASS: skip-seek2 +3+1 records in +0+1 records out +18 bytes (18 B) copied, 0 seconds, Infinity B/s +out exp verschillen: byte 5, regel 1 +FAIL: unblock-sync +====================================== +2 of 5 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dd' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dd' +Making check in dircolors +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dircolors' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dircolors' +-: test a: stderr mismatch, comparing a.E (actual) and a.1 (expected) +*** a.E Wed Apr 20 21:26:21 2005 +--- a.1 Wed Apr 20 21:26:21 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\dircolors.exe: k:1: invalid line; missing second token +--- 1 ---- +! dircolors: k:1: invalid line; missing second token +FAIL: simple +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dircolors' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/dircolors' +Making check in du +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/du' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/du' +-: test f-extra-arg: stderr mismatch, comparing f-extra-arg.E (actual) and f-extra-arg.2 (expected) +*** f-extra-arg.E Wed Apr 20 21:26:22 2005 +--- f-extra-arg.2 Wed Apr 20 21:26:22 2005 +*************** +*** 1,3 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: extra operand `no-such' + File operands cannot be combined with --files0-from. +! Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe --help' for more information. +--- 1,3 ---- +! du: extra operand `no-such' + File operands cannot be combined with --files0-from. +! Try `du --help' for more information. +-: test missing: stderr mismatch, comparing missing.E (actual) and missing.1 (expected) +*** missing.E Wed Apr 20 21:26:23 2005 +--- missing.1 Wed Apr 20 21:26:22 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot open `missing' for reading: No such file or directory +--- 1 ---- +! du: cannot open `missing' for reading: No such file or directory +-: test empty-nonreg failed: exit status mismatch: expected 0, got 1 +-: test nul-1: stderr mismatch, comparing nul-1.E (actual) and nul-1.2 (expected) +*** nul-1.E Wed Apr 20 21:26:23 2005 +--- nul-1.2 Wed Apr 20 21:26:23 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: -:1: invalid zero-length file name +--- 1 ---- +! du: -:1: invalid zero-length file name +-: test nul-2: stderr mismatch, comparing nul-2.E (actual) and nul-2.2 (expected) +*** nul-2.E Wed Apr 20 21:26:23 2005 +--- nul-2.2 Wed Apr 20 21:26:23 2005 +*************** +*** 1,2 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: -:1: invalid zero-length file name +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: -:2: invalid zero-length file name +--- 1,2 ---- +! du: -:1: invalid zero-length file name +! du: -:2: invalid zero-length file name +-: test 1: stdout mismatch, comparing 1.O (actual) and 1.1 (expected) +-: test 1a: stdout mismatch, comparing 1a.O (actual) and 1a.1 (expected) +-: test 2: stdout mismatch, comparing 2.O (actual) and 2.1 (expected) +-: test 2a: stdout mismatch, comparing 2a.O (actual) and 2a.1 (expected) +-: test zero-len: stdout mismatch, comparing zero-len.O (actual) and zero-len.1 (expected) +-: test zero-len: stderr mismatch, comparing zero-len.E (actual) and zero-len.2 (expected) +*** zero-len.E Wed Apr 20 21:26:24 2005 +--- zero-len.2 Wed Apr 20 21:26:24 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: -:1: invalid zero-length file name +--- 1 ---- +! du: -:1: invalid zero-length file name +FAIL: files0-from +../../../coreutils-5.3.0-src/tests/du/inaccessible-cwd: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/du/inaccessible-cwd: is invalid because its UID is 0. +FAIL: inaccessible-cwd +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\seq.exe: write error: Invalid argument +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `slink': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `slink/': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `slink-to-64k': No such file or directory +cmp: einde-bestand op out +0a1,5 +> slink/a +> slink +> slink/a +> slink/ +> 64 slink-to-64k +FAIL: deref-args +PASS: slash +../../../coreutils-5.3.0-src/tests/du/fd-leak: This test is relatively expensive, so it is disabled by default. +To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS +environment variable set to yes. E.g., + + env RUN_EXPENSIVE_TESTS=yes make check + +SKIP: fd-leak +PASS: hard-link +../../../coreutils-5.3.0-src/tests/du/8gb: skipping this test, since this file system doesn't support +../../../coreutils-5.3.0-src/tests/du/8gb: sparse files and this test requires a file with an apparent +../../../coreutils-5.3.0-src/tests/du/8gb: size of 8GB +SKIP: 8gb +../../../coreutils-5.3.0-src/tests/du/basic: different block count/size, so skipping this test +SKIP: basic +PASS: restore-wd +PASS: exclude +../../../coreutils-5.3.0-src/tests/du/no-x: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/du/no-x: is invalid because its UID is 0. +FAIL: no-x +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `slink': No such file or directory +cmp: einde-bestand op out +0a1 +> slink +FAIL: no-deref +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `slink/': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `slink': No such file or directory +out exp verschillen: byte 1, regel 1 +0a1,3 +> slink/1/2 +> slink/1 +> slink/ +1a5,7 +> slink/1/2 +> slink/1 +> slink +FAIL: trailing-slash +FAIL: deref +PASS: two-args +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `1': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `15': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `16': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `31': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `32': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `59': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `60': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `63': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `64': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `127': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\du.exe: cannot access `128': No such file or directory +FAIL: slink +====================================== +8 of 13 tests failed +(3 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/du' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/du' +Making check in expr +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/expr' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/expr' +-: test a: stdout mismatch, comparing a.O (actual) and a.1 (expected) +-: test b: stdout mismatch, comparing b.O (actual) and b.1 (expected) +-: test c failed: exit status mismatch: expected 0, got 2 +-: test d: stdout mismatch, comparing d.O (actual) and d.1 (expected) +-: test e: stdout mismatch, comparing e.O (actual) and e.1 (expected) +-: test paren1: stdout mismatch, comparing paren1.O (actual) and paren1.1 (expected) +-: test paren2: stdout mismatch, comparing paren2.O (actual) and paren2.1 (expected) +-: test paren3: stdout mismatch, comparing paren3.O (actual) and paren3.1 (expected) +-: test paren4: stdout mismatch, comparing paren4.O (actual) and paren4.1 (expected) +-: test paren5: stdout mismatch, comparing paren5.O (actual) and paren5.1 (expected) +-: test 0bang: stdout mismatch, comparing 0bang.O (actual) and 0bang.1 (expected) +-: test 00: stdout mismatch, comparing 00.O (actual) and 00.1 (expected) +-: test minus0: stdout mismatch, comparing minus0.O (actual) and minus0.1 (expected) +-: test andand: stdout mismatch, comparing andand.O (actual) and andand.1 (expected) +-: test oror: stdout mismatch, comparing oror.O (actual) and oror.1 (expected) +-: test orempty: stdout mismatch, comparing orempty.O (actual) and orempty.1 (expected) +-: test minus2: stdout mismatch, comparing minus2.O (actual) and minus2.1 (expected) +-: test fail-a: stderr mismatch, comparing fail-a.E (actual) and fail-a.1 (expected) +*** fail-a.E Wed Apr 20 21:26:45 2005 +--- fail-a.1 Wed Apr 20 21:26:45 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\expr.exe: non-numeric argument +--- 1 ---- +! expr: non-numeric argument +-: test fail-b: stderr mismatch, comparing fail-b.E (actual) and fail-b.1 (expected) +*** fail-b.E Wed Apr 20 21:26:45 2005 +--- fail-b.1 Wed Apr 20 21:26:45 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\expr.exe: syntax error +--- 1 ---- +! expr: syntax error +-: test fail-c: stderr mismatch, comparing fail-c.E (actual) and fail-c.1 (expected) +*** fail-c.E Wed Apr 20 21:26:45 2005 +--- fail-c.1 Wed Apr 20 21:26:45 2005 +*************** +*** 1,2 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\expr.exe: missing operand +! Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\expr.exe --help' for more information. +--- 1,2 ---- +! expr: missing operand +! Try `expr --help' for more information. +FAIL: basic +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/expr' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/expr' +Making check in factor +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/factor' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/factor' +-: test 1: stdout mismatch, comparing 1.O (actual) and 1.1 (expected) +-: test 1a: stdout mismatch, comparing 1a.O (actual) and 1a.1 (expected) +-: test 2: stdout mismatch, comparing 2.O (actual) and 2.1 (expected) +-: test 3: stdout mismatch, comparing 3.O (actual) and 3.1 (expected) +-: test 4: stdout mismatch, comparing 4.O (actual) and 4.1 (expected) +-: test a: stdout mismatch, comparing a.O (actual) and a.1 (expected) +-: test b: stdout mismatch, comparing b.O (actual) and b.1 (expected) +-: test c: stdout mismatch, comparing c.O (actual) and c.1 (expected) +-: test d: stdout mismatch, comparing d.O (actual) and d.1 (expected) +-: test e: stdout mismatch, comparing e.O (actual) and e.1 (expected) +-: test f: stdout mismatch, comparing f.O (actual) and f.1 (expected) +-: test g: stdout mismatch, comparing g.O (actual) and g.1 (expected) +-: test h: stdout mismatch, comparing h.O (actual) and h.1 (expected) +-: test i: stdout mismatch, comparing i.O (actual) and i.1 (expected) +-: test j: stdout mismatch, comparing j.O (actual) and j.1 (expected) +-: test k: stdout mismatch, comparing k.O (actual) and k.1 (expected) +-: test l: stdout mismatch, comparing l.O (actual) and l.1 (expected) +-: test m: stdout mismatch, comparing m.O (actual) and m.1 (expected) +-: test n: stdout mismatch, comparing n.O (actual) and n.1 (expected) +-: test o: stdout mismatch, comparing o.O (actual) and o.1 (expected) +-: test p: stdout mismatch, comparing p.O (actual) and p.1 (expected) +-: test q: stdout mismatch, comparing q.O (actual) and q.1 (expected) +-: test s: stdout mismatch, comparing s.O (actual) and s.1 (expected) +-: test t: stdout mismatch, comparing t.O (actual) and t.1 (expected) +-: test u: stdout mismatch, comparing u.O (actual) and u.1 (expected) +-: test v: stdout mismatch, comparing v.O (actual) and v.1 (expected) +-: test w: stdout mismatch, comparing w.O (actual) and w.1 (expected) +-: test x: stdout mismatch, comparing x.O (actual) and x.1 (expected) +-: test y: stdout mismatch, comparing y.O (actual) and y.1 (expected) +-: test z: stderr mismatch, comparing z.E (actual) and z.1 (expected) +*** z.E Wed Apr 20 21:26:51 2005 +--- z.1 Wed Apr 20 21:26:51 2005 +*************** +*** 1,2 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\factor.exe: invalid option -- 1 +! Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\factor.exe --help' for more information. +--- 1,2 ---- +! factor: invalid option -- 1 +! Try `factor --help' for more information. +FAIL: basic +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/factor' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/factor' +Making check in fmt +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/fmt' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/fmt' +-: test 8-bit-pfx: stdout mismatch, comparing 8-bit-pfx.O (actual) and 8-bit-pfx.2 (expected) +*** 8-bit-pfx.O Wed Apr 20 21:26:52 2005 +--- 8-bit-pfx.2 Wed Apr 20 21:26:52 2005 +*************** +*** 1,2 **** +! ça +! çb +--- 1 ---- +! ça b +-: test wide-1: stderr mismatch, comparing wide-1.E (actual) and wide-1.1 (expected) +*** wide-1.E Wed Apr 20 21:26:52 2005 +--- wide-1.1 Wed Apr 20 21:26:52 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\fmt.exe: invalid width: `32768' +--- 1 ---- +! fmt: invalid width: `32768' +-: test wide-2: stderr mismatch, comparing wide-2.E (actual) and wide-2.1 (expected) +*** wide-2.E Wed Apr 20 21:26:53 2005 +--- wide-2.1 Wed Apr 20 21:26:53 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\fmt.exe: invalid width: `2147483647' +--- 1 ---- +! fmt: invalid width: `2147483647' +-: test bad-suffix: stderr mismatch, comparing bad-suffix.E (actual) and bad-suffix.2 (expected) +*** bad-suffix.E Wed Apr 20 21:26:53 2005 +--- bad-suffix.2 Wed Apr 20 21:26:53 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\fmt.exe: invalid width: `72x' +--- 1 ---- +! fmt: invalid width: `72x' +-: test no-file: stderr mismatch, comparing no-file.E (actual) and no-file.1 (expected) +*** no-file.E Wed Apr 20 21:26:53 2005 +--- no-file.1 Wed Apr 20 21:26:53 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\fmt.exe: cannot open `no-such-file' for reading: No such file or directory +--- 1 ---- +! fmt: cannot open `no-such-file' for reading: No such file or directory +-: test obs-1: stderr mismatch, comparing obs-1.E (actual) and obs-1.1 (expected) +*** obs-1.E Wed Apr 20 21:26:53 2005 +--- obs-1.1 Wed Apr 20 21:26:53 2005 +*************** +*** 1,3 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\fmt.exe: invalid option -- 7; -WIDTH is recognized only when it is the first + option; use -w N instead +! Try `k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\fmt.exe --help' for more information. +--- 1,3 ---- +! fmt: invalid option -- 7; -WIDTH is recognized only when it is the first + option; use -w N instead +! Try `fmt --help' for more information. +FAIL: basic +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\yes.exe: standard output +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\yes.exe: write error +out exp verschillen: byte 2, regel 1 +1,43c1,30 +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y y y y y y y y y y y y y y y y y y y y +< y y y y +--- +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y +> y y +FAIL: long-line +====================================== +2 of 2 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/fmt' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/fmt' +Making check in head +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/head' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/head' +PASS: head-tests +================== +All 1 tests passed +================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/head' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/head' +Making check in install +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/install' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/install' +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ginstall.exe: cannot stat `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/install/../../src/ginstall': No such file or directory +PASS: trap +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `../../../src/dd': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\cp.exe: cannot stat `dd': No such file or directory +h:\mingw\3.3.1\bin\strip.exe: dd2: No such file or directory +../../../coreutils-5.3.0-src/tests/install/basic-1: WARNING!!! +Your strip command doesn't seem to work, so skipping +the test of install's --strip option. +SKIP: basic-1 +PASS: create-leading +====================== +All 2 tests passed +(1 tests were not run) +====================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/install' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/install' +Making check in join +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/join' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/join' +*** 8-bit-t.O Wed Apr 20 21:27:18 2005 +--- ../../../coreutils-5.3.0-src/tests/join/8-bit-t.X Mon May 31 20:05:08 2004 +*************** +*** 0 **** +--- 1,2 ---- ++ a§1§2§ ++ b§1§2§ +FAIL: join-tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/join' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/join' +Making check in ln +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ln' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ln' +PASS: target-1 +FAIL: sf-1 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `tln-symlink': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: hard-to-sym: No such file or directory +../../../coreutils-5.3.0-src/tests/ln/misc: line 113: test: =: unary operator expected +failure in testing framework +FAIL: misc +PASS: backup-1 +====================================== +2 of 4 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ln' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ln' +Making check in ls +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls' +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: slink: No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: slink: No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: slink: No such file or directory +FAIL: inode +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: dangle: No such file or directory +out exp verschillen: byte 1, regel 1 +1,3c1,4 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: slink-to-dir: No such file or directory +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: slink-to-dir: No such file or directory +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: slink-to-dir: No such file or directory +--- +> dangle +> sub +> sub +> sub +FAIL: dangle +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\mkfifo.exe: cannot create fifo `fifo' +out exp differ: char 17, line 2 +2c2,3 +< executable +--- +> executable* +> fifo| +4,6c5,7 +< slink-dangle.lnk@ +< slink-dir.lnk@ +< slink-reg.lnk@ +--- +> slink-dangle@ +> slink-dir@ +> slink-reg@ +out2 exp2 differ: char 19, line 3 +2a3 +> fifo| +4,6c5,7 +< slink-dangle.lnk@ +< slink-dir.lnk@ +< slink-reg.lnk@ +--- +> slink-dangle@ +> slink-dir@ +> slink-reg@ +FAIL: file-type +PASS: recursive +PASS: dired +PASS: infloop +PASS: rt-1 +A basic test of touch -a has just failed, so the subsequent +tests in this file will not be run. + +In the output below, the date of last access for `a' should +have been 1998-01-14 11:00. +-rw-rw-rw- 1 KZLG 0 0 2005-04-20 19:27:35.531250000 +0000 a +SKIP: time-1 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: symlink/: No such file or directory +!::='::\' +!K:='K:\Sysutils\coreutils\5.3.0\coreutils-5.3.0' +ALLUSERSPROFILE='C:\Documents and Settings\All Users' +APPDATA='C:\Documents and Settings\KZLG\Application Data' +BASEDIR='E:\PROGRA~1\NTDDK' +BASH=/usr/bin/sh +BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i686-pc-cygwin") +BASH_VERSION='2.05b.0(1)-release' +CHARSET=UTF-8 +CLASSPATH='"E:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip"' +CLIENTNAME=Console +COMMONPROGRAMFILES='C:\Program Files\Common Files' +COMPUTERNAME=GAMMA +COMSPEC='C:\WINDOWS\system32\cmd.exe' +CONFIG_SITE=k:/config.site +CVS_RSH=ssh.exe +CYGWIN=codepage:oem +DDKDRIVE=E: +DIRSTACK=() +DISPLAY=localhost:0 +DVLDIR='k:\' +EDITOR=E:/PROGRA~1/oxedit/oxedit.EXE +EUID=400 +FP_NO_HOST_CHECK=NO +GCCVERSION=3.3.1 +GROUPS=() +HOME=/cygdrive/f/kzlg +HOMEDRIVE=f: +HOMEPATH='\kzlg' +HOSTNAME=gamma +HOSTTYPE=i686 +IFS=' +' +INTERIX_ROOT=/dev/fs/H/SFU/ +INTERIX_ROOT_WIN='H:\SFU\' +J2D_D3D=false +LANG= +LANGUAGE= +LC_ALL= +LC_COLLATE= +LC_CTYPE= +LC_MESSAGES= +LC_NUMERIC= +LC_TIME= +LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib +LESS=-isnMCd +LESSBINFMT='*n-' +LESSCHARDEF=8bcccbcc18b95.33b33b. +LESSCHARSET=latin1 +LN_S='ln -s' +LOGONSERVER='\\GAMMA' +MACHTYPE=i686-pc-cygwin +MAILCHECK=0 +MAKEFLAGS=' --unix -wki' +MAKELEVEL=4 +MAKE_MODE=UNIX +MFLAGS='- --unix -wki' +MINGWDIR='h:\mingw\3.3.1' +NTRESKIT='E:\Program Files\NTrksupport' +NUMBER_OF_PROCESSORS=1 +OLDPWD=/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls +OPENNT_ROOT=/dev/fs/H/SFU/ +OPTERR=1 +OPTIND=1 +OS=Windows_NT +OSTYPE=cygwin +PATH='/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls/../../src:/cygdrive/h/mingw/3.3.1/bin:/usr/bin:/usr/local/bin:/cygdrive/e/util:/cygdrive/e/program files/gnuwin32/bin:/cygdrive/h/mingw/3.3.1/bin:/cygdrive/h/tex/bin/win32:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/h/SFU/common/:.' +PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.tcl;.py;.pyc;.pyo;.pyw;.pys' +PIPESTATUS=([0]="0") +POPFILE_ROOT='e:\progra~1\popfile' +POPFILE_USER='e:\progra~1\popfile' +POSIXLY_CORRECT=y +PPID=1844 +PROCESSOR_ARCHITECTURE=x86 +PROCESSOR_IDENTIFIER='x86 Family 15 Model 2 Stepping 7, GenuineIntel' +PROCESSOR_LEVEL=15 +PROCESSOR_REVISION=0207 +PROG=ls +PROGRAMFILES='C:\Program Files' +PROMPT='$P$G' +PS4='+ ' +PWD=/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls/t-ls.396 +PWDIR=-is +QTJAVA='"E:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip"' +SESSIONNAME=Console +SFUDIR='H:\SFU\' +SFUDIR_INTERIX=/dev/fs/H/SFU/ +SHELL=/bin/sh +SHELLOPTS=braceexpand:hashall:interactive-comments:posix +SHLVL=7 +SYSTEMDRIVE=C: +SYSTEMROOT='C:\WINDOWS' +TEMP=/cygdrive/m/temp +TERM=ansi +TEXDIR='h:\tex' +TEXMFCNF='h:\tex\texmf-var\web2c' +TEXMFTEMP='E:\Program Files\TeXLive\temp' +TMAKEPATH='e:\program files\QT\tmake\lib\win32-msvc' +TMP=/cygdrive/m/temp +TMPDIR=/cygdrive/m/temp +TZ=CET-1CES,M3.5.0/2,M10.5.0/2 +UID=400 +USERDOMAIN=GAMMA +USERNAME=KZLG +USERPROFILE='C:\Documents and Settings\KZLG' +VCTOOLKITINSTALLDIR='E:\Program Files\Microsoft Visual C++ Toolkit 2003\' +WINDIR='C:\WINDOWS' +XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults +XCMSDB=/usr/X11R6/lib/X11/Xcms.txt +XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB +XNLSPATH=/usr/X11R6/lib/X11/locale +_= +as_unset=unset +envvar_check_failed=0 +fail=0 +framework_failure=0 +i=LC_TIME +srcdir=../../../coreutils-5.3.0-src/tests/ls +tmp=t-ls.396 +top_srcdir=../../../coreutils-5.3.0-src +var=VERSION_CONTROL +vars=' + BLOCKSIZE + BLOCK_SIZE + DF_BLOCK_SIZE + DU_BLOCK_SIZE + LS_BLOCK_SIZE + SIMPLE_BACKUP_SUFFIX + VERSION_CONTROL +' +FAIL: symlink-slash +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\ls.exe: link: No such file or directory +failure in testing framework +FAIL: follow-slink +out exp verschillen: byte 23, regel 4 +4c4 +< symlink.lnk +--- +> symlink +out exp verschillen: byte 27, regel 5 +5c5 +< symlink.lnk +--- +> symlink +FAIL: no-arg +PASS: m-option +====================================== +6 of 11 tests failed +(1 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls' +Making check in ls-2 +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls-2' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls-2' +PATH=/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls-2/../../src:/cygdrive/h/mingw/3.3.1/bin:/usr/bin:/usr/local/bin:/cygdrive/e/util:/cygdrive/e/program files/gnuwin32/bin:/cygdrive/h/mingw/3.3.1/bin:/cygdrive/h/tex/bin/win32:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/h/SFU/common/:. +-: q: No such file or directory +FAIL: tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls-2' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/ls-2' +Making check in md5sum +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/md5sum' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/md5sum' +-: test 1: stdout mismatch, comparing 1.O (actual) and 1.1 (expected) +-: test 2: stdout mismatch, comparing 2.O (actual) and 2.1 (expected) +-: test 3: stdout mismatch, comparing 3.O (actual) and 3.1 (expected) +-: test 4: stdout mismatch, comparing 4.O (actual) and 4.1 (expected) +-: test 5: stdout mismatch, comparing 5.O (actual) and 5.1 (expected) +-: test 6: stdout mismatch, comparing 6.O (actual) and 6.1 (expected) +-: test 7: stdout mismatch, comparing 7.O (actual) and 7.1 (expected) +-: test backslash: stdout mismatch, comparing backslash.O (actual) and backslash.1 (expected) +-: test check-1: stdout mismatch, comparing check-1.O (actual) and check-1.1 (expected) +-: test check-bsd: stderr mismatch, comparing check-bsd.E (actual) and check-bsd.1 (expected) +*** check-bsd.E Wed Apr 20 21:27:42 2005 +--- check-bsd.1 Wed Apr 20 21:27:41 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\md5sum.exe: f.sha1: no properly formatted MD5 checksum lines found +--- 1 ---- +! md5sum: f.sha1: no properly formatted MD5 checksum lines found +-: test check-bsd2: stdout mismatch, comparing check-bsd2.O (actual) and check-bsd2.1 (expected) +FAIL: basic-1 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `a\nb': Invalid argument +../../../coreutils-5.3.0-src/tests/md5sum/newline-1: can't create newline-containing file name, so can't run this test +SKIP: newline-1 +====================================== +1 of 1 tests failed +(1 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/md5sum' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/md5sum' +Making check in misc +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/misc' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/misc' +../../../coreutils-5.3.0-src/tests/misc/tac-continue: FULL_PARTITION_TMPDIR not defined; skipping this test +SKIP: tac-continue +PASS: close-stdout +pwd: at depth 5: File name too long +../../../coreutils-5.3.0-src/tests/misc/pwd: line 1: cd: k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\tests\misc: No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\chmod.exe: cannot access `pwd.tmp': No such file or directory +FAIL: pwd +PASS: date-sec +-: test no-nl-1: stdout mismatch, comparing no-nl-1.O (actual) and no-nl-1.3 (expected) +-: test no-nl-2: stdout mismatch, comparing no-nl-2.O (actual) and no-nl-2.3 (expected) +-: test no-nl-3: stdout mismatch, comparing no-nl-3.O (actual) and no-nl-3.3 (expected) +-: test no-nl-4: stdout mismatch, comparing no-nl-4.O (actual) and no-nl-4.3 (expected) +-: test no-nla1: stdout mismatch, comparing no-nla1.O (actual) and no-nla1.3 (expected) +-: test no-nla2: stdout mismatch, comparing no-nla2.O (actual) and no-nla2.3 (expected) +-: test no-nla3: stdout mismatch, comparing no-nla3.O (actual) and no-nla3.3 (expected) +-: test no-nla4: stdout mismatch, comparing no-nla4.O (actual) and no-nla4.3 (expected) +FAIL: paste-no-nl +PASS: stat-fmt +PASS: expand +-: test s1: stdout mismatch, comparing s1.O (actual) and s1.2 (expected) +-: test s2: stdout mismatch, comparing s2.O (actual) and s2.2 (expected) +-: test s3: stdout mismatch, comparing s3.O (actual) and s3.2 (expected) +-: test s4: stdout mismatch, comparing s4.O (actual) and s4.2 (expected) +FAIL: fold + +cmp: EOF on err +1d0 +< stderr +FAIL: nohup +PASS: head-elide-tail +FAIL: split-fail +PASS: false +tty-eof: this script requires Perl's Expect package >=1.11 +SKIP: tty-eof +PASS: printf-hex +out exp verschillen: byte 66, regel 7 +7,8c7,8 +< 1^Ia^M$ +< ^M$ +--- +> 1^Ia$ +> $ +FAIL: nl +PASS: split-l +PASS: printf +cmp: einde-bestand op exp +28d27 +< creating file `xbb' +FAIL: split-a +PASS: head-pos +-: test m1: stdout mismatch, comparing m1.O (actual) and m1.1 (expected) +FAIL: sort +PASS: head-c +err experr differ: char 1, line 1 +1c1 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\csplit.exe: warning: line number `1' is the same as preceding line number +--- +> csplit: warning: line number `1' is the same as preceding line number +err experr differ: char 1, line 1 +1,4c1,4 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\csplit.exe: 0: line number must be greater than zero +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\csplit.exe: line number `1' is smaller than preceding line number, 2 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\csplit.exe: warning: line number `3' is the same as preceding line number +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\csplit.exe: `3': line number out of range +--- +> csplit: 0: line number must be greater than zero +> csplit: line number `1' is smaller than preceding line number, 2 +> csplit: warning: line number `3' is the same as preceding line number +> csplit: `3': line number out of range +FAIL: csplit +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\nice.exe: cannot get priority: Function not implemented +../../../coreutils-5.3.0-src/tests/misc/nice: this test must be run at nice level 0 +SKIP: nice +../../../coreutils-5.3.0-src/tests/misc/pathchk1: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/misc/pathchk1: is invalid because its UID is 0. +FAIL: pathchk1 +====================================== +10 of 21 tests failed +(3 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/misc' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/misc' +Making check in mkdir +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mkdir' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mkdir' +FAIL: p-1 +PASS: p-2 +FAIL: special-1 +../../../coreutils-5.3.0-src/tests/mkdir/perm: Since it looks like you're running this test in a directory with +the setgid bit set, we're skipping this test. +SKIP: perm +../../../coreutils-5.3.0-src/tests/mkdir/parents: Since it looks like you're running this test in a directory with +the setgid bit set, we're skipping this test. +SKIP: parents +PASS: t-slash +====================================== +2 of 4 tests failed +(2 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mkdir' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mkdir' +Making check in mv +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mv' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mv' +../../../coreutils-5.3.0-src/tests/mv/leak-fd: This test is relatively expensive, so it is disabled by default. +To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS +environment variable set to yes. E.g., + + env RUN_EXPENSIVE_TESTS=yes make check + +SKIP: leak-fd +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\chmod.exe: cannot access `part-hardlink.tmp': No such file or directory +SKIP: part-hardlink +PASS: hard-4 +../../../coreutils-5.3.0-src/tests/mv/hard-3: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/hard-3: is invalid because its UID is 0. +FAIL: hard-3 +../../../coreutils-5.3.0-src/tests/mv/hard-2: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/hard-2: is invalid because its UID is 0. +FAIL: hard-2 +../../../coreutils-5.3.0-src/tests/mv/perm-1: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/perm-1: is invalid because its UID is 0. +FAIL: perm-1 +PASS: i-link-no +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +../../../coreutils-5.3.0-src/tests/mv/part-fail: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/part-fail: is invalid because its UID is 0. +FAIL: part-fail +../../../coreutils-5.3.0-src/tests/mv/dup-source: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/dup-source: is invalid because its UID is 0. +FAIL: dup-source +../../../coreutils-5.3.0-src/tests/mv/childproof: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/childproof: is invalid because its UID is 0. +FAIL: childproof +PASS: i-4 +PASS: update +../../../coreutils-5.3.0-src/tests/mv/i-2: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/mv/i-2: is invalid because its UID is 0. +FAIL: i-2 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: mv-special-1 +out2 exp differ: char 1, line 1 +FAIL: into-self +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: into-self-2 +out2 exp differ: char 1, line 1 +FAIL: into-self-3 +FAIL: into-self-4 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: backup-is-src +-: test a: stderr mismatch, comparing a.E (actual) and a.2 (expected) +*** a.E Wed Apr 20 21:29:18 2005 +--- a.2 Wed Apr 20 21:29:18 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\mv.exe: overwrite `dst'? +\ No newline at end of file +--- 1 ---- +! mv: overwrite `dst'? +\ No newline at end of file +FAIL: i-1 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: hard-link-1 +out exp differ: char 1, line 1 +FAIL: force +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: partition-perm +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: to-symlink +PASS: dir-file +out exp differ: char 1, line 1 +FAIL: diag +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +SKIP: part-symlink +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/m/temp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/var/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/usr/tmp': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\df.exe: `/cygdrive/f/kzlg': No such file or directory +************************************** +This test requires a writable directory on a different +disk partition, and I couldn't find one. I tried these: + /cygdrive/m/temp /tmp /var/tmp /usr/tmp /cygdrive/f/kzlg +Set your environment variable CANDIDATE_TMP_DIRS to make +this test use a different list. +************************************** +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\chmod.exe: cannot access `part-rename.tmp': No such file or directory +SKIP: part-rename +PASS: trailing-slash +====================================== +13 of 19 tests failed +(10 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mv' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/mv' +Making check in od +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/od' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/od' +out exp verschillen: byte 18, regel 2 +2c2 +< e f g +--- +> d e f +FAIL: od-N +out exp verschillen: byte 1, regel 1 +1,10c1 +< +< 0 +< 00 +< 00 +< 00 +< 00 +< 00 +< 00 +< 00 +< d +--- +> 0d +FAIL: x8 +====================================== +2 of 2 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/od' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/od' +Making check in pr +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/pr' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/pr' +FAIL: pr-tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/pr' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/pr' +Making check in readlink +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/readlink' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/readlink' +FAIL: rl-1 +FAIL: can-e +FAIL: can-f +FAIL: can-m +====================================== +4 of 4 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/readlink' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/readlink' +Making check in rm +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rm' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rm' +PASS: dot-rel +../../../coreutils-5.3.0-src/tests/rm/inaccessible: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/inaccessible: is invalid because its UID is 0. +FAIL: inaccessible +../../../coreutils-5.3.0-src/tests/rm/unread3: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/unread3: is invalid because its UID is 0. +FAIL: unread3 +../../../coreutils-5.3.0-src/tests/rm/no-give-up: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/no-give-up: is invalid because its UID is 0. +FAIL: no-give-up +out exp differ: char 1, line 1 +1c1 +< k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `unwritable-dir': Is a directory +--- +> rm: cannot remove `unwritable-dir': Is a directory +FAIL: dir-no-w +../../../coreutils-5.3.0-src/tests/rm/fail-2eperm: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/fail-2eperm: is invalid because its UID is 0. +FAIL: fail-2eperm +../../../coreutils-5.3.0-src/tests/rm/cycle: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/cycle: is invalid because its UID is 0. +FAIL: cycle +PASS: i-no-r +../../../coreutils-5.3.0-src/tests/rm/fail-eperm: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/fail-eperm: is invalid because its UID is 0. +FAIL: fail-eperm +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `dangle': No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\rm.exe: cannot remove `symlink': No such file or directory +PASS: dangling-symlink +../../../coreutils-5.3.0-src/tests/rm/rm1: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/rm1: is invalid because its UID is 0. +FAIL: rm1 +../../../coreutils-5.3.0-src/tests/rm/rm2: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/rm2: is invalid because its UID is 0. +FAIL: rm2 +../../../coreutils-5.3.0-src/tests/rm/rm3: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/rm3: is invalid because its UID is 0. +FAIL: rm3 +../../../coreutils-5.3.0-src/tests/rm/rm4: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/rm4: is invalid because its UID is 0. +FAIL: rm4 +../../../coreutils-5.3.0-src/tests/rm/rm5: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/rm5: is invalid because its UID is 0. +FAIL: rm5 +../../../coreutils-5.3.0-src/tests/rm/unread2: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/unread2: is invalid because its UID is 0. +FAIL: unread2 +PASS: r-1 +PASS: r-2 +PASS: r-3 +PASS: i-1 +PASS: ir-1 +PASS: f-1 +PASS: sunos-1 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\mkdir.exe: cannot create directory `deep-1.tmp/2228/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k': No such file or directory +FAIL: deep-1 +../../../coreutils-5.3.0-src/tests/rm/hash: This test is relatively expensive, so it is disabled by default. +To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS +environment variable set to yes. E.g., + + env RUN_EXPENSIVE_TESTS=yes make check + +SKIP: hash +../../../coreutils-5.3.0-src/tests/rm/isatty: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rm/isatty: is invalid because its UID is 0. +FAIL: isatty +====================================== +15 of 25 tests failed +(1 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rm' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rm' +Making check in rmdir +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rmdir' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rmdir' +../../../coreutils-5.3.0-src/tests/rmdir/fail-perm: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/rmdir/fail-perm: is invalid because its UID is 0. +FAIL: fail-perm +PASS: ignore +PASS: t-slash +====================================== +1 of 3 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rmdir' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/rmdir' +Making check in seq +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/seq' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/seq' +-: test onearg-1: stdout mismatch, comparing onearg-1.O (actual) and onearg-1.1 (expected) +-: test neg-1: stdout mismatch, comparing neg-1.O (actual) and neg-1.1 (expected) +-: test neg-2 failed: exit status mismatch: expected 0, got 1 +-: test neg-3: stdout mismatch, comparing neg-3.O (actual) and neg-3.1 (expected) +-: test neg-4: stdout mismatch, comparing neg-4.O (actual) and neg-4.1 (expected) +-: test eq-wid-1: stdout mismatch, comparing eq-wid-1.O (actual) and eq-wid-1.1 (expected) +-: test eq-wid-2 failed: exit status mismatch: expected 0, got 1 +-: test fmt-1: stdout mismatch, comparing fmt-1.O (actual) and fmt-1.1 (expected) +*** fmt-1.O Wed Apr 20 21:31:03 2005 +--- fmt-1.1 Wed Apr 20 21:31:03 2005 +*************** +*** 1,2 **** +! 1,5 +! 2,0 +--- 1,2 ---- +! 1.5 +! 2.0 +-: test fmt-2: stdout mismatch, comparing fmt-2.O (actual) and fmt-2.1 (expected) +*** fmt-2.O Wed Apr 20 21:31:03 2005 +--- fmt-2.1 Wed Apr 20 21:31:03 2005 +*************** +*** 1,2 **** +! 1,5 +! 2,0 +--- 1,2 ---- +! 1.5 +! 2.0 +-: test fmt-3: stdout mismatch, comparing fmt-3.O (actual) and fmt-3.1 (expected) +*** fmt-3.O Wed Apr 20 21:31:03 2005 +--- fmt-3.1 Wed Apr 20 21:31:03 2005 +*************** +*** 1,2 **** +! 1,5 +! 2,0 +--- 1,2 ---- +! 1.5 +! 2.0 +-: test fmt-4: stdout mismatch, comparing fmt-4.O (actual) and fmt-4.1 (expected) +-: test fmt-5: stdout mismatch, comparing fmt-5.O (actual) and fmt-5.1 (expected) +-: test fmt-6: stdout mismatch, comparing fmt-6.O (actual) and fmt-6.1 (expected) +-: test fmt-7: stdout mismatch, comparing fmt-7.O (actual) and fmt-7.1 (expected) +-: test fmt-8: stdout mismatch, comparing fmt-8.O (actual) and fmt-8.1 (expected) +-: test fmt-9: stdout mismatch, comparing fmt-9.O (actual) and fmt-9.1 (expected) +-: test fmt-a: stdout mismatch, comparing fmt-a.O (actual) and fmt-a.1 (expected) +FAIL: basic +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/seq' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/seq' +Making check in sha1sum +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sha1sum' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sha1sum' +-: test s1: stdout mismatch, comparing s1.O (actual) and s1.1 (expected) +-: test s2: stdout mismatch, comparing s2.O (actual) and s2.1 (expected) +-: test s3: stdout mismatch, comparing s3.O (actual) and s3.1 (expected) +-: test s4: stdout mismatch, comparing s4.O (actual) and s4.1 (expected) +-: test s5: stdout mismatch, comparing s5.O (actual) and s5.1 (expected) +-: test s6: stdout mismatch, comparing s6.O (actual) and s6.1 (expected) +-: test s7: stdout mismatch, comparing s7.O (actual) and s7.1 (expected) +-: test bs-sha: stdout mismatch, comparing bs-sha.O (actual) and bs-sha.1 (expected) +-: test check-bsd: stderr mismatch, comparing check-bsd.E (actual) and check-bsd.1 (expected) +*** check-bsd.E Wed Apr 20 21:31:07 2005 +--- check-bsd.1 Wed Apr 20 21:31:07 2005 +*************** +*** 1 **** +! k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\sha1sum.exe: f.md5: no properly formatted SHA1 checksum lines found +--- 1 ---- +! sha1sum: f.md5: no properly formatted SHA1 checksum lines found +-: test check-bsd2: stdout mismatch, comparing check-bsd2.O (actual) and check-bsd2.1 (expected) +FAIL: basic-1 +-: test 1: stdout mismatch, comparing 1.O (actual) and 1.1 (expected) +-: test 2: stdout mismatch, comparing 2.O (actual) and 2.1 (expected) +-: test 3: stdout mismatch, comparing 3.O (actual) and 3.1 (expected) +-: test 4: stdout mismatch, comparing 4.O (actual) and 4.1 (expected) +-: test 5: stdout mismatch, comparing 5.O (actual) and 5.1 (expected) +-: test 6: stdout mismatch, comparing 6.O (actual) and 6.1 (expected) +-: test 7: stdout mismatch, comparing 7.O (actual) and 7.1 (expected) +-: test 8: stdout mismatch, comparing 8.O (actual) and 8.1 (expected) +-: test 9: stdout mismatch, comparing 9.O (actual) and 9.1 (expected) +-: test 10: stdout mismatch, comparing 10.O (actual) and 10.1 (expected) +-: test 11: stdout mismatch, comparing 11.O (actual) and 11.1 (expected) +-: test 12: stdout mismatch, comparing 12.O (actual) and 12.1 (expected) +-: test 13: stdout mismatch, comparing 13.O (actual) and 13.1 (expected) +-: test 14: stdout mismatch, comparing 14.O (actual) and 14.1 (expected) +-: test 15: stdout mismatch, comparing 15.O (actual) and 15.1 (expected) +-: test 16: stdout mismatch, comparing 16.O (actual) and 16.1 (expected) +-: test 17: stdout mismatch, comparing 17.O (actual) and 17.1 (expected) +-: test 18: stdout mismatch, comparing 18.O (actual) and 18.1 (expected) +-: test 19: stdout mismatch, comparing 19.O (actual) and 19.1 (expected) +-: test 20: stdout mismatch, comparing 20.O (actual) and 20.1 (expected) +-: test 21: stdout mismatch, comparing 21.O (actual) and 21.1 (expected) +-: test 22: stdout mismatch, comparing 22.O (actual) and 22.1 (expected) +-: test 23: stdout mismatch, comparing 23.O (actual) and 23.1 (expected) +-: test 24: stdout mismatch, comparing 24.O (actual) and 24.1 (expected) +-: test 25: stdout mismatch, comparing 25.O (actual) and 25.1 (expected) +-: test 26: stdout mismatch, comparing 26.O (actual) and 26.1 (expected) +-: test 27: stdout mismatch, comparing 27.O (actual) and 27.1 (expected) +-: test 28: stdout mismatch, comparing 28.O (actual) and 28.1 (expected) +-: test 29: stdout mismatch, comparing 29.O (actual) and 29.1 (expected) +-: test 30: stdout mismatch, comparing 30.O (actual) and 30.1 (expected) +-: test 31: stdout mismatch, comparing 31.O (actual) and 31.1 (expected) +-: test 32: stdout mismatch, comparing 32.O (actual) and 32.1 (expected) +-: test 33: stdout mismatch, comparing 33.O (actual) and 33.1 (expected) +-: test 34: stdout mismatch, comparing 34.O (actual) and 34.1 (expected) +-: test 35: stdout mismatch, comparing 35.O (actual) and 35.1 (expected) +-: test 36: stdout mismatch, comparing 36.O (actual) and 36.1 (expected) +-: test 37: stdout mismatch, comparing 37.O (actual) and 37.1 (expected) +-: test 38: stdout mismatch, comparing 38.O (actual) and 38.1 (expected) +-: test 39: stdout mismatch, comparing 39.O (actual) and 39.1 (expected) +-: test 40: stdout mismatch, comparing 40.O (actual) and 40.1 (expected) +-: test 41: stdout mismatch, comparing 41.O (actual) and 41.1 (expected) +-: test 42: stdout mismatch, comparing 42.O (actual) and 42.1 (expected) +-: test 43: stdout mismatch, comparing 43.O (actual) and 43.1 (expected) +-: test 44: stdout mismatch, comparing 44.O (actual) and 44.1 (expected) +-: test 45: stdout mismatch, comparing 45.O (actual) and 45.1 (expected) +-: test 46: stdout mismatch, comparing 46.O (actual) and 46.1 (expected) +-: test 47: stdout mismatch, comparing 47.O (actual) and 47.1 (expected) +-: test 48: stdout mismatch, comparing 48.O (actual) and 48.1 (expected) +-: test 49: stdout mismatch, comparing 49.O (actual) and 49.1 (expected) +-: test 50: stdout mismatch, comparing 50.O (actual) and 50.1 (expected) +-: test 51: stdout mismatch, comparing 51.O (actual) and 51.1 (expected) +-: test 52: stdout mismatch, comparing 52.O (actual) and 52.1 (expected) +-: test 53: stdout mismatch, comparing 53.O (actual) and 53.1 (expected) +-: test 54: stdout mismatch, comparing 54.O (actual) and 54.1 (expected) +-: test 55: stdout mismatch, comparing 55.O (actual) and 55.1 (expected) +-: test 56: stdout mismatch, comparing 56.O (actual) and 56.1 (expected) +-: test 57: stdout mismatch, comparing 57.O (actual) and 57.1 (expected) +-: test 58: stdout mismatch, comparing 58.O (actual) and 58.1 (expected) +-: test 59: stdout mismatch, comparing 59.O (actual) and 59.1 (expected) +-: test 60: stdout mismatch, comparing 60.O (actual) and 60.1 (expected) +-: test 61: stdout mismatch, comparing 61.O (actual) and 61.1 (expected) +-: test 62: stdout mismatch, comparing 62.O (actual) and 62.1 (expected) +-: test 63: stdout mismatch, comparing 63.O (actual) and 63.1 (expected) +-: test 64: stdout mismatch, comparing 64.O (actual) and 64.1 (expected) +-: test 65: stdout mismatch, comparing 65.O (actual) and 65.1 (expected) +-: test 66: stdout mismatch, comparing 66.O (actual) and 66.1 (expected) +-: test 67: stdout mismatch, comparing 67.O (actual) and 67.1 (expected) +-: test 68: stdout mismatch, comparing 68.O (actual) and 68.1 (expected) +-: test 69: stdout mismatch, comparing 69.O (actual) and 69.1 (expected) +-: test 70: stdout mismatch, comparing 70.O (actual) and 70.1 (expected) +-: test 71: stdout mismatch, comparing 71.O (actual) and 71.1 (expected) +-: test 72: stdout mismatch, comparing 72.O (actual) and 72.1 (expected) +-: test 73: stdout mismatch, comparing 73.O (actual) and 73.1 (expected) +-: test 74: stdout mismatch, comparing 74.O (actual) and 74.1 (expected) +-: test 75: stdout mismatch, comparing 75.O (actual) and 75.1 (expected) +-: test 76: stdout mismatch, comparing 76.O (actual) and 76.1 (expected) +-: test 77: stdout mismatch, comparing 77.O (actual) and 77.1 (expected) +-: test 78: stdout mismatch, comparing 78.O (actual) and 78.1 (expected) +-: test 79: stdout mismatch, comparing 79.O (actual) and 79.1 (expected) +-: test 80: stdout mismatch, comparing 80.O (actual) and 80.1 (expected) +-: test 81: stdout mismatch, comparing 81.O (actual) and 81.1 (expected) +-: test 82: stdout mismatch, comparing 82.O (actual) and 82.1 (expected) +-: test 83: stdout mismatch, comparing 83.O (actual) and 83.1 (expected) +-: test 84: stdout mismatch, comparing 84.O (actual) and 84.1 (expected) +-: test 85: stdout mismatch, comparing 85.O (actual) and 85.1 (expected) +-: test 86: stdout mismatch, comparing 86.O (actual) and 86.1 (expected) +-: test 87: stdout mismatch, comparing 87.O (actual) and 87.1 (expected) +-: test 88: stdout mismatch, comparing 88.O (actual) and 88.1 (expected) +-: test 89: stdout mismatch, comparing 89.O (actual) and 89.1 (expected) +-: test 90: stdout mismatch, comparing 90.O (actual) and 90.1 (expected) +-: test 91: stdout mismatch, comparing 91.O (actual) and 91.1 (expected) +-: test 92: stdout mismatch, comparing 92.O (actual) and 92.1 (expected) +-: test 93: stdout mismatch, comparing 93.O (actual) and 93.1 (expected) +-: test 94: stdout mismatch, comparing 94.O (actual) and 94.1 (expected) +-: test 95: stdout mismatch, comparing 95.O (actual) and 95.1 (expected) +-: test 96: stdout mismatch, comparing 96.O (actual) and 96.1 (expected) +-: test 97: stdout mismatch, comparing 97.O (actual) and 97.1 (expected) +-: test 98: stdout mismatch, comparing 98.O (actual) and 98.1 (expected) +-: test 99: stdout mismatch, comparing 99.O (actual) and 99.1 (expected) +-: test 100: stdout mismatch, comparing 100.O (actual) and 100.1 (expected) +-: test 101: stdout mismatch, comparing 101.O (actual) and 101.1 (expected) +-: test 102: stdout mismatch, comparing 102.O (actual) and 102.1 (expected) +-: test 103: stdout mismatch, comparing 103.O (actual) and 103.1 (expected) +-: test 104: stdout mismatch, comparing 104.O (actual) and 104.1 (expected) +-: test 105: stdout mismatch, comparing 105.O (actual) and 105.1 (expected) +-: test 106: stdout mismatch, comparing 106.O (actual) and 106.1 (expected) +-: test 107: stdout mismatch, comparing 107.O (actual) and 107.1 (expected) +-: test 108: stdout mismatch, comparing 108.O (actual) and 108.1 (expected) +-: test 109: stdout mismatch, comparing 109.O (actual) and 109.1 (expected) +-: test 110: stdout mismatch, comparing 110.O (actual) and 110.1 (expected) +-: test 111: stdout mismatch, comparing 111.O (actual) and 111.1 (expected) +-: test 112: stdout mismatch, comparing 112.O (actual) and 112.1 (expected) +-: test 113: stdout mismatch, comparing 113.O (actual) and 113.1 (expected) +-: test 114: stdout mismatch, comparing 114.O (actual) and 114.1 (expected) +-: test 115: stdout mismatch, comparing 115.O (actual) and 115.1 (expected) +-: test 116: stdout mismatch, comparing 116.O (actual) and 116.1 (expected) +-: test 117: stdout mismatch, comparing 117.O (actual) and 117.1 (expected) +-: test 118: stdout mismatch, comparing 118.O (actual) and 118.1 (expected) +-: test 119: stdout mismatch, comparing 119.O (actual) and 119.1 (expected) +-: test 120: stdout mismatch, comparing 120.O (actual) and 120.1 (expected) +-: test 121: stdout mismatch, comparing 121.O (actual) and 121.1 (expected) +-: test 122: stdout mismatch, comparing 122.O (actual) and 122.1 (expected) +-: test 123: stdout mismatch, comparing 123.O (actual) and 123.1 (expected) +-: test 124: stdout mismatch, comparing 124.O (actual) and 124.1 (expected) +-: test 125: stdout mismatch, comparing 125.O (actual) and 125.1 (expected) +-: test 126: stdout mismatch, comparing 126.O (actual) and 126.1 (expected) +-: test 127: stdout mismatch, comparing 127.O (actual) and 127.1 (expected) +-: test 128: stdout mismatch, comparing 128.O (actual) and 128.1 (expected) +-: test 129: stdout mismatch, comparing 129.O (actual) and 129.1 (expected) +-: test 130: stdout mismatch, comparing 130.O (actual) and 130.1 (expected) +-: test 131: stdout mismatch, comparing 131.O (actual) and 131.1 (expected) +-: test 132: stdout mismatch, comparing 132.O (actual) and 132.1 (expected) +-: test 133: stdout mismatch, comparing 133.O (actual) and 133.1 (expected) +-: test 134: stdout mismatch, comparing 134.O (actual) and 134.1 (expected) +-: test 135: stdout mismatch, comparing 135.O (actual) and 135.1 (expected) +-: test 136: stdout mismatch, comparing 136.O (actual) and 136.1 (expected) +-: test 137: stdout mismatch, comparing 137.O (actual) and 137.1 (expected) +-: test 138: stdout mismatch, comparing 138.O (actual) and 138.1 (expected) +-: test 139: stdout mismatch, comparing 139.O (actual) and 139.1 (expected) +-: test 140: stdout mismatch, comparing 140.O (actual) and 140.1 (expected) +-: test 141: stdout mismatch, comparing 141.O (actual) and 141.1 (expected) +-: test 142: stdout mismatch, comparing 142.O (actual) and 142.1 (expected) +-: test 143: stdout mismatch, comparing 143.O (actual) and 143.1 (expected) +-: test 144: stdout mismatch, comparing 144.O (actual) and 144.1 (expected) +-: test 145: stdout mismatch, comparing 145.O (actual) and 145.1 (expected) +-: test 146: stdout mismatch, comparing 146.O (actual) and 146.1 (expected) +-: test 147: stdout mismatch, comparing 147.O (actual) and 147.1 (expected) +-: test 148: stdout mismatch, comparing 148.O (actual) and 148.1 (expected) +-: test 149: stdout mismatch, comparing 149.O (actual) and 149.1 (expected) +-: test 150: stdout mismatch, comparing 150.O (actual) and 150.1 (expected) +-: test 151: stdout mismatch, comparing 151.O (actual) and 151.1 (expected) +-: test 152: stdout mismatch, comparing 152.O (actual) and 152.1 (expected) +-: test 153: stdout mismatch, comparing 153.O (actual) and 153.1 (expected) +-: test 154: stdout mismatch, comparing 154.O (actual) and 154.1 (expected) +-: test 155: stdout mismatch, comparing 155.O (actual) and 155.1 (expected) +-: test 156: stdout mismatch, comparing 156.O (actual) and 156.1 (expected) +-: test 157: stdout mismatch, comparing 157.O (actual) and 157.1 (expected) +-: test 158: stdout mismatch, comparing 158.O (actual) and 158.1 (expected) +-: test 159: stdout mismatch, comparing 159.O (actual) and 159.1 (expected) +-: test 160: stdout mismatch, comparing 160.O (actual) and 160.1 (expected) +-: test 161: stdout mismatch, comparing 161.O (actual) and 161.1 (expected) +-: test 162: stdout mismatch, comparing 162.O (actual) and 162.1 (expected) +-: test 163: stdout mismatch, comparing 163.O (actual) and 163.1 (expected) +-: test 164: stdout mismatch, comparing 164.O (actual) and 164.1 (expected) +-: test 165: stdout mismatch, comparing 165.O (actual) and 165.1 (expected) +-: test 166: stdout mismatch, comparing 166.O (actual) and 166.1 (expected) +-: test 167: stdout mismatch, comparing 167.O (actual) and 167.1 (expected) +-: test 168: stdout mismatch, comparing 168.O (actual) and 168.1 (expected) +-: test 169: stdout mismatch, comparing 169.O (actual) and 169.1 (expected) +-: test 170: stdout mismatch, comparing 170.O (actual) and 170.1 (expected) +-: test 171: stdout mismatch, comparing 171.O (actual) and 171.1 (expected) +-: test 172: stdout mismatch, comparing 172.O (actual) and 172.1 (expected) +-: test 173: stdout mismatch, comparing 173.O (actual) and 173.1 (expected) +-: test 174: stdout mismatch, comparing 174.O (actual) and 174.1 (expected) +-: test 175: stdout mismatch, comparing 175.O (actual) and 175.1 (expected) +-: test 176: stdout mismatch, comparing 176.O (actual) and 176.1 (expected) +-: test 177: stdout mismatch, comparing 177.O (actual) and 177.1 (expected) +-: test 178: stdout mismatch, comparing 178.O (actual) and 178.1 (expected) +-: test 179: stdout mismatch, comparing 179.O (actual) and 179.1 (expected) +-: test 180: stdout mismatch, comparing 180.O (actual) and 180.1 (expected) +-: test 181: stdout mismatch, comparing 181.O (actual) and 181.1 (expected) +-: test 182: stdout mismatch, comparing 182.O (actual) and 182.1 (expected) +-: test 183: stdout mismatch, comparing 183.O (actual) and 183.1 (expected) +-: test 184: stdout mismatch, comparing 184.O (actual) and 184.1 (expected) +-: test 185: stdout mismatch, comparing 185.O (actual) and 185.1 (expected) +-: test 186: stdout mismatch, comparing 186.O (actual) and 186.1 (expected) +-: test 187: stdout mismatch, comparing 187.O (actual) and 187.1 (expected) +-: test 188: stdout mismatch, comparing 188.O (actual) and 188.1 (expected) +-: test 189: stdout mismatch, comparing 189.O (actual) and 189.1 (expected) +-: test 190: stdout mismatch, comparing 190.O (actual) and 190.1 (expected) +-: test 191: stdout mismatch, comparing 191.O (actual) and 191.1 (expected) +-: test 192: stdout mismatch, comparing 192.O (actual) and 192.1 (expected) +-: test 193: stdout mismatch, comparing 193.O (actual) and 193.1 (expected) +-: test 194: stdout mismatch, comparing 194.O (actual) and 194.1 (expected) +-: test 195: stdout mismatch, comparing 195.O (actual) and 195.1 (expected) +-: test 196: stdout mismatch, comparing 196.O (actual) and 196.1 (expected) +-: test 197: stdout mismatch, comparing 197.O (actual) and 197.1 (expected) +-: test 198: stdout mismatch, comparing 198.O (actual) and 198.1 (expected) +-: test 199: stdout mismatch, comparing 199.O (actual) and 199.1 (expected) +-: test 200: stdout mismatch, comparing 200.O (actual) and 200.1 (expected) +-: test 201: stdout mismatch, comparing 201.O (actual) and 201.1 (expected) +-: test 202: stdout mismatch, comparing 202.O (actual) and 202.1 (expected) +-: test 203: stdout mismatch, comparing 203.O (actual) and 203.1 (expected) +-: test 204: stdout mismatch, comparing 204.O (actual) and 204.1 (expected) +-: test 205: stdout mismatch, comparing 205.O (actual) and 205.1 (expected) +-: test 206: stdout mismatch, comparing 206.O (actual) and 206.1 (expected) +-: test 207: stdout mismatch, comparing 207.O (actual) and 207.1 (expected) +-: test 208: stdout mismatch, comparing 208.O (actual) and 208.1 (expected) +-: test 209: stdout mismatch, comparing 209.O (actual) and 209.1 (expected) +-: test 210: stdout mismatch, comparing 210.O (actual) and 210.1 (expected) +-: test 211: stdout mismatch, comparing 211.O (actual) and 211.1 (expected) +-: test 212: stdout mismatch, comparing 212.O (actual) and 212.1 (expected) +-: test 213: stdout mismatch, comparing 213.O (actual) and 213.1 (expected) +-: test 214: stdout mismatch, comparing 214.O (actual) and 214.1 (expected) +-: test 215: stdout mismatch, comparing 215.O (actual) and 215.1 (expected) +-: test 216: stdout mismatch, comparing 216.O (actual) and 216.1 (expected) +-: test 217: stdout mismatch, comparing 217.O (actual) and 217.1 (expected) +-: test 218: stdout mismatch, comparing 218.O (actual) and 218.1 (expected) +-: test 219: stdout mismatch, comparing 219.O (actual) and 219.1 (expected) +-: test 220: stdout mismatch, comparing 220.O (actual) and 220.1 (expected) +-: test 221: stdout mismatch, comparing 221.O (actual) and 221.1 (expected) +-: test 222: stdout mismatch, comparing 222.O (actual) and 222.1 (expected) +-: test 223: stdout mismatch, comparing 223.O (actual) and 223.1 (expected) +-: test 224: stdout mismatch, comparing 224.O (actual) and 224.1 (expected) +-: test 225: stdout mismatch, comparing 225.O (actual) and 225.1 (expected) +-: test 226: stdout mismatch, comparing 226.O (actual) and 226.1 (expected) +-: test 227: stdout mismatch, comparing 227.O (actual) and 227.1 (expected) +-: test 228: stdout mismatch, comparing 228.O (actual) and 228.1 (expected) +-: test 229: stdout mismatch, comparing 229.O (actual) and 229.1 (expected) +FAIL: sample-vec +====================================== +2 of 2 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sha1sum' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sha1sum' +Making check in shred +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/shred' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/shred' +../../../coreutils-5.3.0-src/tests/shred/remove: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/shred/remove: is invalid because its UID is 0. +FAIL: remove +PASS: exact +====================================== +1 of 2 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/shred' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/shred' +Making check in sort +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sort' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sort' +*** n11b.O Wed Apr 20 21:31:53 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/n11b.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,2 **** +- .01a + .010 +--- 1,2 ---- + .010 ++ .01a +*** 11a.O Wed Apr 20 21:32:01 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/11a.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,2 **** +- a :b + a :a +--- 1,2 ---- + a :a ++ a :b +*** 11b.O Wed Apr 20 21:32:01 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/11b.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,2 **** +- a :b + a :a +--- 1,2 ---- + a :a ++ a :b +*** 16a.O Wed Apr 20 21:32:03 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/16a.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,6 **** + 's-Gravenhage +- éminence +- überhaupt +- aëroclub + Aag + aagtappels +--- 1,6 ---- + 's-Gravenhage + Aag + aagtappels ++ aëroclub ++ éminence ++ überhaupt +*** 21a.O Wed Apr 20 21:32:05 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21a.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,3 **** + _ + a +- A +--- 1,3 ---- ++ A + _ + a +*** 21b.O Wed Apr 20 21:32:05 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21b.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,3 **** +- _ +- a + A +--- 1,3 ---- + A ++ a ++ _ +*** 21c.O Wed Apr 20 21:32:05 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21c.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,3 **** +- _ +- a + A +--- 1,3 ---- + A ++ a ++ _ +*** 21d.O Wed Apr 20 21:32:05 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21d.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,3 **** +- _ +- a + A +--- 1,3 ---- + A ++ a ++ _ +*** 21e.O Wed Apr 20 21:32:05 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21e.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,3 **** +- _ +- a + A +--- 1,3 ---- + A ++ a ++ _ +*** 21f.O Wed Apr 20 21:32:06 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21f.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,3 **** +- _ + A + a +--- 1,3 ---- + A + a ++ _ +*** 21g.O Wed Apr 20 21:32:06 2005 +--- ../../../coreutils-5.3.0-src/tests/sort/21g.X Sun Sep 12 11:41:35 2004 +*************** +*** 1,2 **** +- _ + a +--- 1,2 ---- + a ++ _ +Files nul-nls.O and ../../../coreutils-5.3.0-src/tests/sort/nul-nls.X differ +Files nul-tab.O and ../../../coreutils-5.3.0-src/tests/sort/nul-tab.X differ +FAIL: sort-tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sort' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sort' +Making check in stty +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/stty' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/stty' +../../../coreutils-5.3.0-src/tests/stty/row-col-1: This test must have a controlling input `terminal', + so it may not be run via `batch', `at', or `rsh'. + On some systems, it may not even be run in the background. +SKIP: row-col-1 +../../../coreutils-5.3.0-src/tests/stty/basic-1: This test must have a controlling input `terminal', + so it may not be run via `batch', `at', or `rsh'. + On some systems, it may not even be run in the background. +SKIP: basic-1 +====================== +All 0 tests passed +(2 tests were not run) +====================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/stty' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/stty' +Making check in sum +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sum' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sum' +-: test 1: stdout mismatch, comparing 1.O (actual) and 1.1 (expected) +-: test 2: stdout mismatch, comparing 2.O (actual) and 2.1 (expected) +-: test 3: stdout mismatch, comparing 3.O (actual) and 3.1 (expected) +-: test 4: stdout mismatch, comparing 4.O (actual) and 4.1 (expected) +-: test 5: stdout mismatch, comparing 5.O (actual) and 5.1 (expected) +-: test 6: stdout mismatch, comparing 6.O (actual) and 6.1 (expected) +-: test 7: stdout mismatch, comparing 7.O (actual) and 7.1 (expected) +-: test a-r-1k: stdout mismatch, comparing a-r-1k.O (actual) and a-r-1k.1 (expected) +-: test a-s-1k: stdout mismatch, comparing a-s-1k.O (actual) and a-s-1k.1 (expected) +-: test b-r-2k: stdout mismatch, comparing b-r-2k.O (actual) and b-r-2k.1 (expected) +-: test b-s-2k: stdout mismatch, comparing b-s-2k.O (actual) and b-s-2k.1 (expected) +-: test 1s: stdout mismatch, comparing 1s.O (actual) and 1s.1 (expected) +-: test 2s: stdout mismatch, comparing 2s.O (actual) and 2s.1 (expected) +-: test 3s: stdout mismatch, comparing 3s.O (actual) and 3s.1 (expected) +-: test 4s: stdout mismatch, comparing 4s.O (actual) and 4s.1 (expected) +-: test 5s: stdout mismatch, comparing 5s.O (actual) and 5s.1 (expected) +-: test 6s: stdout mismatch, comparing 6s.O (actual) and 6s.1 (expected) +-: test 7s: stdout mismatch, comparing 7s.O (actual) and 7s.1 (expected) +FAIL: basic-1 +PASS: sysv +====================================== +1 of 2 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sum' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/sum' +Making check in tac +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tac' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tac' +PASS: tac-tests +================== +All 1 tests passed +================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tac' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tac' +Making check in tail +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail' +FAIL: tail-tests +====================================== +1 of 1 tests failed +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail' +Making check in tail-2 +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail-2' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail-2' +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\sleep.exe: cannot read realtime clock: Invalid argument +[1]+ Terminated sleep 2 +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: empty: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: no files remaining +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\sleep.exe: cannot read realtime clock: Invalid argument +sed: kan /proc/3588/status niet lezen: No such file or directory +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: process in unexpected state: +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: line 53: kill: (3588) - No such process +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: empty: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: no files remaining +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\sleep.exe: cannot read realtime clock: Invalid argument +sed: kan /proc/3316/status niet lezen: No such file or directory +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: process in unexpected state: +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: line 53: kill: (3316) - No such process +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: nonempty: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: no files remaining +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\sleep.exe: cannot read realtime clock: Invalid argument +sed: kan /proc/3428/status niet lezen: No such file or directory +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: process in unexpected state: +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: line 53: kill: (3428) - No such process +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: nonempty: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: no files remaining +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\sleep.exe: cannot read realtime clock: Invalid argument +sed: kan /proc/3632/status niet lezen: No such file or directory +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: process in unexpected state: +../../../coreutils-5.3.0-src/tests/tail-2/tail-n0f: line 53: kill: (3632) - No such process +FAIL: tail-n0f +../../../coreutils-5.3.0-src/tests/tail-2/big-4gb: This test is relatively expensive, so it is disabled by default. +To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS +environment variable set to yes. E.g., + + env RUN_EXPENSIVE_TESTS=yes make check + +SKIP: big-4gb +PASS: proc-ksyms +PASS: start-middle +sleeping for 7 seconds... +../../../coreutils-5.3.0-src/tests/tail-2/assert: line 32: kill: (3548) - No such process +==> a <== + +==> foo <== +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: a: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: foo: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: no files remaining +FAIL: assert +sleeping for 7 seconds... +../../../coreutils-5.3.0-src/tests/tail-2/assert-2: line 30: kill: (2836) - No such process +==> a <== +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: cannot open `foo' for reading: No such file or directory +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: a: Bad file descriptor +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\tail.exe: no files remaining +FAIL: assert-2 +====================================== +3 of 5 tests failed +(1 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail-2' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tail-2' +Making check in test +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/test' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/test' +PASS: test-tests +================== +All 1 tests passed +================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/test' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/test' +Making check in touch +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/touch' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/touch' +PASS: relative +../../../coreutils-5.3.0-src/tests/touch/not-owner: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/touch/not-owner: is invalid because its UID is 0. +FAIL: not-owner +PASS: no-create-missing +../../../coreutils-5.3.0-src/tests/touch/fail-diag: The specified NON_ROOT_USERNAME (nobody) +../../../coreutils-5.3.0-src/tests/touch/fail-diag: is invalid because its UID is 0. +FAIL: fail-diag +PASS: dir-1 +FAIL: dangling-symlink +sleeping for 2 seconds... +sleeping for 2 seconds... +PASS: empty-file +k:\Sysutils\coreutils\5.3.0\coreutils-5.3.0\src\mkfifo.exe: cannot create fifo `fifo-3588' +******************************************** +NOTICE: unable to create test prerequisites +******************************************** +SKIP: fifo +sleeping for 2 seconds... +PASS: no-rights +PASS: obsolescent +====================================== +3 of 9 tests failed +(1 tests were not run) +Please report to bug-coreutils@gnu.org +====================================== +make[3]: [check-TESTS] Fout 1 (genegeerd) +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/touch' +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/touch' +Making check in tr +make[2]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tr' +make check-TESTS +make[3]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tr' +PASS: tr-tests +================== +All 1 tests passed +================== +make[3]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tr' +make[2]: *** Geen regel voor aanmaken doel `repeat-Compl.I', nodig voor `check'. +make[2]: *** Geen regel voor aanmaken doel `repeat-Compl.X', nodig voor `check'. +make[2]: Doel `check' niet opnieuw gemaakt vanwege fouten. +make[2]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests/tr' +make[1]: [check-recursive] Fout 1 (genegeerd) +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0/tests' +make[1]: Entering directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0' +make[1]: Niets te doen voor `check-am'. +make[1]: Leaving directory `/cygdrive/k/Sysutils/coreutils/5.3.0/coreutils-5.3.0' diff --git a/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/depends-GnuWin32.lst b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/depends-GnuWin32.lst new file mode 100644 index 0000000..86cc8b3 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/coreutils/5.3.0/depends-GnuWin32.lst @@ -0,0 +1,14 @@ +advapi32.dll +gdi32.dll +kernel32.dll +libiconv2.dll +libintl3.dll +msvcp60.dll +msvcrt.dll +ntdll.dll +ole32.dll +rpcrt4.dll +user32.dll +ws2help.dll +ws2_32.dll +wsock32.dll diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-1-GnuWin32.README b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-1-GnuWin32.README new file mode 100644 index 0000000..1bab5b6 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-1-GnuWin32.README @@ -0,0 +1,49 @@ +* Gawk-3.1.6 for Windows * +========================== + +What is it? +----------- +Gawk: pattern scanning and processing language + +Description +----------- +Several kinds of tasks occur repeatedly when working with text files. You might want to extract certain lines and discard the rest. Or you may need to make changes wherever certain patterns appear, but leave the rest of the file alone. Writing single-use programs for these tasks in languages such as C, C++ or Pascal is time-consuming and inconvenient. Such jobs are often easier with awk. The awk utility interprets a special-purpose programming language that makes it easy to handle simple data-reformatting jobs. The GNU implementation of awk is called gawk; it is fully compatible with the System V Release 4 version of awk. gawk is also compatible with the POSIX specification of the awk language. This means that all properly written awk programs should work with gawk. Thus, we usually don’t distinguish between gawk and other awk implementations. Using awk allows you to: - Manage small, personal databases - Generate reports - Validate data - Produce indexes and perform other document preparation tasks - Experiment with algorithms that you can adapt later to other computer languages. In addition, gawk provides facilities that make it easy to: - Extract bits and pieces of data for processing - Sort data - Perform simple network communications. The Win32 port has some limitations, In particular the ‘|&’ operator and TCP/IP networking are not supported. + +Homepage +-------- +http://www.gnu.org/software/gawk/gawk.html +Sources: http://ftp.gnu.org/gnu/gawk/gawk-3.1.6.tar.gz + +System +------ +- Win32, i.e. MS-Windows 95 / 98 / ME / NT / 2000 / XP / 2003 / Vista with msvcrt.dll +- if msvcrt.dll is not in your Windows/System folder, get it from + Microsoft + or by installing Internet Explorer 4.0 or higher + + +Notes +----- +- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net + +Package Availability +-------------------- +- in: http://gnuwin32.sourceforge.net +Installation +------------ + +Sources +------- +- gawk-3.1.6-1-src.zip + +Compilation +----------- +The package has been compiled with GNU auto-tools, GNU make, and Mingw +(GCC for MS-Windows). Any differences from the original sources are given +in gawk-3.1.6-1-GnuWin32.diffs in gawk-3.1.6-1-src.zip. Libraries needed +for compilation can be found at the lines starting with 'LIBS = ' in the +Makefiles. Usually, these are standard libraries provided with Mingw, or +libraries from the package itself; 'gw32c' refers to the libgw32c package, +which provides MS-Windows substitutes or stubs for functions normally found in +Unix. For more information, see: http://gnuwin32.sourceforge.net/compile.html +and http://gnuwin32.sourceforge.net/packages/libgw32c.htm. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/ABOUT-NLS b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/ABOUT-NLS new file mode 100644 index 0000000..ec20977 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/ABOUT-NLS @@ -0,0 +1,1101 @@ +1 Notes on the Free Translation Project +*************************************** + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +1.1 Quick configuration advice +============================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +1.2 INSTALL Matters +=================== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will, respectively, bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +1.3 Using This Package +====================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +1.4 Translating Teams +===================== + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. + +1.5 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of October +2006. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo + +----------------------------------------------------+ + GNUnet | [] | + a2ps | [] [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | [] | + ap-utils | | + aspell | [] [] [] [] [] | + bash | [] [] [] | + batchelor | [] | + bfd | | + bibshelf | [] | + binutils | [] | + bison | [] [] | + bison-runtime | | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | [] [] | + coreutils | [] [] [] | + cpio | | + cpplib | [] [] [] | + cryptonit | [] | + darkstat | [] () [] | + dialog | [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] | + findutils | [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] | + gip | [] | + gliv | [] | + glunarclock | [] | + gmult | [] [] | + gnubiff | () | + gnucash | () () [] | + gnucash-glossary | [] () | + gnuedu | | + gnulib | [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | | + gpe-edit | [] | + gpe-filemanager | | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-package | | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] | + gretl | | + gsasl | | + gss | | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | () | + gtkam | [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] | + id-utils | [] [] | + impost | | + indent | [] [] [] | + iso_3166 | [] [] | + iso_3166_2 | | + iso_4217 | [] | + iso_639 | [] [] | + jpilot | [] | + jtag | | + jwhois | | + kbd | [] [] [] [] | + keytouch | | + keytouch-editor | | + keytouch-keyboa... | | + latrine | () | + ld | [] | + leafpad | [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] | + libgpg-error | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libgsasl | | + libiconv | [] [] | + libidn | [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] | + make | [] [] | + man-db | [] () [] [] | + minicom | [] [] [] | + mysecretdiary | [] [] | + nano | [] [] [] | + nano_1_0 | [] () [] [] | + opcodes | [] | + parted | | + pilot-qof | [] | + psmisc | [] | + pwdutils | | + python | | + qof | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] [] | + sharutils | [] [] [] [] [] [] | + shishi | | + silky | | + skencil | [] () | + sketch | [] () | + solfege | | + soundtracker | [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | () () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] | + xchat | [] [] [] [] [] [] | + xkeyboard-config | | + xpad | [] [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs cy da de el en en_GB eo + 10 0 1 2 9 22 1 42 41 2 60 95 16 1 17 16 + + es et eu fa fi fr ga gl gu he hi hr hu id is it + +--------------------------------------------------+ + GNUnet | | + a2ps | [] [] [] () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] [] | + aspell | [] [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cpplib | [] [] | + cryptonit | [] | + darkstat | [] () [] [] [] | + dialog | [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gip | [] [] [] | + gliv | () | + glunarclock | [] [] [] | + gmult | [] [] [] | + gnubiff | () () | + gnucash | () () () | + gnucash-glossary | [] [] | + gnuedu | [] | + gnulib | [] [] [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | | + gpe-clock | [] [] [] [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] [] [] | + gpe-filemanager | [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | () () [] () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] [] | + gsasl | [] [] | + gss | [] | + gst-plugins | [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] [] | + gstreamer | [] [] [] | + gtick | [] | + gtkam | [] [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] [] | + impost | [] [] | + indent | [] [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_2 | [] | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] [] | + jpilot | [] [] | + jtag | [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] [] | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] [] [] | + libgpg-error | | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] | + libgsasl | [] [] | + libiconv | [] [] | + libidn | [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] [] | + lynx | [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] | + man-db | () | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] [] [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] [] | + shishi | | + silky | [] | + skencil | [] [] | + sketch | [] [] | + solfege | [] | + soundtracker | [] [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + tp-robot | [] [] [] [] | + tuxpaint | [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + es et eu fa fi fr ga gl gu he hi hr hu id is it + 88 22 14 2 40 115 61 14 1 8 1 6 59 31 0 52 + + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + +-------------------------------------------------+ + GNUnet | | + a2ps | () [] [] () | + aegis | () | + ant-phone | [] | + anubis | [] [] [] | + ap-utils | [] | + aspell | [] [] | + bash | [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | | + bison | [] [] [] | + bison-runtime | [] [] [] | + bluez-pin | [] [] [] | + cflow | | + clisp | [] | + console-tools | | + coreutils | [] | + cpio | | + cpplib | [] | + cryptonit | [] | + darkstat | [] [] | + dialog | [] [] | + diffutils | [] [] [] | + doodle | | + e2fsprogs | [] | + enscript | [] | + error | [] | + fetchmail | [] [] | + fileutils | [] [] | + findutils | [] | + flex | [] [] | + fslint | [] [] | + gas | | + gawk | [] [] | + gbiff | [] | + gcal | | + gcc | | + gettext-examples | [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] | + gip | [] [] | + gliv | [] | + glunarclock | [] [] | + gmult | [] [] | + gnubiff | | + gnucash | () () | + gnucash-glossary | [] | + gnuedu | | + gnulib | [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] | + gpe-clock | [] [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] | + gpe-taskmanager | [] [] [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | [] | + gphoto2 | [] [] | + gprof | | + gpsdrive | () () () | + gramadoir | () | + grep | [] [] [] [] | + gretl | | + gsasl | [] | + gss | | + gst-plugins | [] | + gst-plugins-base | | + gst-plugins-good | [] | + gstreamer | [] | + gtick | | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] | + gutenprint | | + hello | [] [] [] [] [] [] | + id-utils | [] | + impost | | + indent | [] [] | + iso_3166 | [] | + iso_3166_2 | [] | + iso_4217 | [] [] [] | + iso_639 | [] [] | + jpilot | () () () | + jtag | | + jwhois | [] | + kbd | [] | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | | + latrine | [] | + ld | | + leafpad | [] [] | + libc | [] [] [] [] [] | + libexif | | + libextractor | | + libgpewidget | [] | + libgpg-error | | + libgphoto2 | [] | + libgphoto2_port | [] | + libgsasl | [] | + libiconv | | + libidn | [] [] | + lifelines | [] | + lilypond | | + lingoteach | [] | + lynx | [] [] | + m4 | [] [] | + mailutils | | + make | [] [] [] | + man-db | () | + minicom | [] | + mysecretdiary | [] | + nano | [] [] [] | + nano_1_0 | [] [] [] | + opcodes | [] | + parted | [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | | + radius | | + recode | [] | + rpm | [] [] | + screem | [] | + scrollkeeper | [] [] [] [] | + sed | [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] [] [] | + sharutils | [] [] | + shishi | | + silky | [] | + skencil | | + sketch | | + solfege | | + soundtracker | | + sp | () | + stardict | [] [] | + system-tools-ba... | [] [] [] [] | + tar | [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | | + tp-robot | [] | + tuxpaint | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] | + vorbis-tools | [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] | + xchat | [] [] [] [] | + xkeyboard-config | [] | + xpad | [] [] [] | + +-------------------------------------------------+ + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + 52 24 2 2 1 3 0 2 3 21 0 15 1 97 5 1 + + nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + +------------------------------------------------------+ + GNUnet | | + a2ps | () [] [] [] [] [] [] | + aegis | () () | + ant-phone | [] [] | + anubis | [] [] [] | + ap-utils | () | + aspell | [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | [] [] | + bison | [] [] [] [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] [] | + cflow | [] | + clisp | [] | + console-tools | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + cpplib | [] | + cryptonit | [] [] | + darkstat | [] [] [] [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] [] | + fileutils | [] [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] [] | + fslint | [] [] [] [] | + gas | | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] [] | + gimp-print | [] [] | + gip | [] [] [] [] | + gliv | [] [] [] [] | + glunarclock | [] [] [] [] [] [] | + gmult | [] [] [] [] | + gnubiff | () | + gnucash | () [] | + gnucash-glossary | [] [] [] | + gnuedu | | + gnulib | [] [] [] [] [] | + gnunet-gtk | [] | + gnutls | [] [] | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-calendar | [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] [] [] [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] [] [] [] | + gpe-login | [] [] [] [] [] [] [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] | + gretl | [] | + gsasl | [] [] [] | + gss | [] [] [] | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] | + gst-plugins-good | [] [] [] [] | + gstreamer | [] [] [] | + gtick | [] | + gtkam | [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + impost | [] | + indent | [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] | + iso_3166_2 | | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] | + jpilot | | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] | + ld | [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] [] | + libgpewidget | [] [] [] [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] | + libiconv | [] [] | + libidn | [] [] () | + lifelines | [] [] | + lilypond | | + lingoteach | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailutils | [] [] [] [] | + make | [] [] [] [] | + man-db | [] [] | + minicom | [] [] [] [] [] | + mysecretdiary | [] [] [] [] | + nano | [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] | + parted | [] | + pilot-qof | [] | + psmisc | [] [] | + pwdutils | [] [] | + python | | + qof | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + silky | [] | + skencil | [] [] [] | + sketch | [] [] [] | + solfege | [] | + soundtracker | [] [] | + sp | | + stardict | [] [] [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] | + tin | () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] | + xchat | [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + xpad | [] [] [] | + +------------------------------------------------------+ + nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + 0 2 3 58 30 54 5 73 72 4 40 46 11 50 128 2 + + tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + +---------------------------------------------------+ + GNUnet | [] | 2 + a2ps | [] [] [] | 19 + aegis | | 0 + ant-phone | [] [] | 6 + anubis | [] [] [] | 11 + ap-utils | () [] | 4 + aspell | [] [] [] | 15 + bash | [] | 11 + batchelor | [] [] | 9 + bfd | | 1 + bibshelf | [] | 7 + binutils | [] [] [] | 9 + bison | [] [] [] | 19 + bison-runtime | [] [] [] | 15 + bluez-pin | [] [] [] [] [] [] | 28 + cflow | [] [] | 5 + clisp | | 6 + console-tools | [] [] | 5 + coreutils | [] [] | 16 + cpio | [] [] [] | 9 + cpplib | [] [] [] [] | 11 + cryptonit | | 5 + darkstat | [] () () | 15 + dialog | [] [] [] [] [] | 30 + diffutils | [] [] [] [] | 28 + doodle | [] | 6 + e2fsprogs | [] [] | 10 + enscript | [] [] [] | 16 + error | [] [] [] [] | 18 + fetchmail | [] [] | 12 + fileutils | [] [] [] | 18 + findutils | [] [] [] | 17 + flex | [] [] | 15 + fslint | [] | 9 + gas | [] | 3 + gawk | [] [] | 15 + gbiff | [] | 5 + gcal | [] | 5 + gcc | [] [] [] | 6 + gettext-examples | [] [] [] [] [] [] | 27 + gettext-runtime | [] [] [] [] [] [] | 28 + gettext-tools | [] [] [] [] [] | 19 + gimp-print | [] [] | 12 + gip | [] [] | 12 + gliv | [] [] | 8 + glunarclock | [] [] [] | 15 + gmult | [] [] [] [] | 15 + gnubiff | [] | 1 + gnucash | () | 2 + gnucash-glossary | [] [] | 9 + gnuedu | [] | 2 + gnulib | [] [] [] [] [] | 28 + gnunet-gtk | | 1 + gnutls | | 2 + gpe-aerial | [] [] | 14 + gpe-beam | [] [] | 14 + gpe-calendar | [] | 3 + gpe-clock | [] [] [] [] | 21 + gpe-conf | [] [] | 14 + gpe-contacts | [] [] | 10 + gpe-edit | [] [] [] [] | 20 + gpe-filemanager | [] | 6 + gpe-go | [] [] | 15 + gpe-login | [] [] [] [] [] | 21 + gpe-ownerinfo | [] [] [] [] | 21 + gpe-package | [] | 6 + gpe-sketchbook | [] [] | 16 + gpe-su | [] [] [] | 20 + gpe-taskmanager | [] [] [] | 20 + gpe-timesheet | [] [] [] [] | 18 + gpe-today | [] [] [] [] [] | 21 + gpe-todo | [] | 7 + gphoto2 | [] [] [] [] | 20 + gprof | [] [] | 11 + gpsdrive | | 4 + gramadoir | [] | 7 + grep | [] [] [] [] | 34 + gretl | | 4 + gsasl | [] [] | 8 + gss | [] | 5 + gst-plugins | [] [] [] | 15 + gst-plugins-base | [] [] [] | 9 + gst-plugins-good | [] [] [] [] [] | 20 + gstreamer | [] [] [] | 17 + gtick | [] | 3 + gtkam | [] | 13 + gtkorphan | [] | 7 + gtkspell | [] [] [] [] [] [] | 26 + gutenprint | | 3 + hello | [] [] [] [] [] | 37 + id-utils | [] [] | 14 + impost | [] | 4 + indent | [] [] [] [] | 25 + iso_3166 | [] [] [] [] | 16 + iso_3166_2 | | 2 + iso_4217 | [] [] | 14 + iso_639 | [] | 14 + jpilot | [] [] [] [] | 7 + jtag | [] | 3 + jwhois | [] [] [] | 13 + kbd | [] [] | 12 + keytouch | [] | 4 + keytouch-editor | | 2 + keytouch-keyboa... | [] | 3 + latrine | [] [] | 8 + ld | [] [] [] [] | 8 + leafpad | [] [] [] [] | 23 + libc | [] [] [] | 23 + libexif | [] | 4 + libextractor | [] | 5 + libgpewidget | [] [] [] | 19 + libgpg-error | [] | 4 + libgphoto2 | [] | 8 + libgphoto2_port | [] [] [] | 11 + libgsasl | [] | 8 + libiconv | [] | 7 + libidn | [] [] | 10 + lifelines | | 4 + lilypond | | 2 + lingoteach | [] | 6 + lynx | [] [] [] | 15 + m4 | [] [] [] | 18 + mailutils | [] | 8 + make | [] [] [] | 20 + man-db | [] | 6 + minicom | [] | 14 + mysecretdiary | [] [] | 12 + nano | [] [] | 17 + nano_1_0 | [] [] [] | 18 + opcodes | [] [] | 10 + parted | [] [] [] | 10 + pilot-qof | [] | 3 + psmisc | [] | 10 + pwdutils | [] | 3 + python | | 0 + qof | [] | 4 + radius | [] | 6 + recode | [] [] [] | 25 + rpm | [] [] [] [] | 14 + screem | [] | 2 + scrollkeeper | [] [] [] [] | 26 + sed | [] [] [] | 22 + sh-utils | [] | 15 + shared-mime-info | [] [] [] [] | 24 + sharutils | [] [] [] | 23 + shishi | | 1 + silky | [] | 4 + skencil | [] | 7 + sketch | | 6 + solfege | | 2 + soundtracker | [] [] | 9 + sp | [] | 3 + stardict | [] [] [] [] | 11 + system-tools-ba... | [] [] [] [] [] [] [] | 37 + tar | [] [] [] [] | 20 + texinfo | [] [] [] | 15 + textutils | [] [] [] | 17 + tin | | 1 + tp-robot | [] [] [] | 10 + tuxpaint | [] [] [] | 16 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux | [] [] [] | 20 + vorbis-tools | [] [] | 11 + wastesedge | | 1 + wdiff | [] [] | 22 + wget | [] [] [] | 19 + xchat | [] [] [] [] | 29 + xkeyboard-config | [] [] [] [] | 11 + xpad | [] [] [] | 14 + +---------------------------------------------------+ + 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + 170 domains 0 1 1 77 39 0 136 10 1 48 5 54 0 2028 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If October 2006 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +1.6 Using `gettext' in new packages +=================================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/AUTHORS b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/AUTHORS new file mode 100644 index 0000000..fa9e7fe --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/AUTHORS @@ -0,0 +1,13 @@ + Copyright (C) 2006, 2007 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. + +Gawk was written by Paul Rubin, and finished by Paul Finlason and +Richard Stallman. + +David Trueman and Arnold Robbins took it over, with David doing most +of the work to make it compatible with new awk. + +Circa 1994, Arnold Robbins took over maintenance. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/COPYING b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/INSTALL b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/INSTALL new file mode 100644 index 0000000..5458714 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/INSTALL @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/NEWS b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/NEWS new file mode 100644 index 0000000..a0ba8db --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/NEWS @@ -0,0 +1,2486 @@ + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2006, 2007 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. + +Changes from 3.1.5 to 3.1.6 +--------------------------- + +1. `gawk 'program' /non/existant/file' no longer core dumps. + +2. Too many people the world over have complained about gawk's use of the + locale's decimal point for parsing input data instead of the traditional + period. So, even though gawk was being nicely standards-compliant, in + a Triumph For The Users, gawk now only uses the locale's decimal point + if --posix is supplied or if POSIXLY_CORRECT is set. It is the sincere + hope that this change will eliminate this FAQ from being asked. + +3. `gawk -v BINMODE=1 ...' works again. + +4. Internal file names like `/dev/user' now work again. (Note that these + file names are obsolete and will go away eventually.) + +5. Problems with wide strings in non "C" locales have been straightened + out everywhere. (At least, we think so.) + +6. Use of `ansi2knr' is no longer supported. Please use an ANSI C compiler. + +7. Updated to Autoconf 2.61, Automake 1.10, and Gettext 0.16.1. + +8. The getopt* and regex* files were synchronized with current GLIBC CVS. + See the ChangeLog for the versions and minor edits made. + +9. There are additional --lint-old warnings. + +10. Gawk now uses getaddrinfo(3) to look up names and IP addresses. This + allows the use of an IPv6 format address and paves the way for + eventual addition of `/inet6/...' and `/inet4/...' hostnames. + +11. We believe gawk to now be valgrind clean. At least when run against + the test suite. + +12. A number of issues dealing with the formatting and printing of very + large numbers in integer formats have been dealt with and fixed. + +13. Gawk now converts "+inf", "-inf", "+nan" and "-nan" into the corresponding + magic IEEE floating point values. Only those strings (case independent) + work. With --posix, gawk calls the system strtod directly. You asked + for it, you got it, you deal with it. + +14. Defining YYDEBUG enables the -D command line option. + +15. Gawk should now work out of the box on Tandem NSK/OSS systems. + +16. Lint messages rationalized: many more of the messages are now printed + only once, instead of every time they are encountered. + +17. The strftime() function now accepts an optional third argument, which + if non-zero or non-null, indicates that the time should be formatted + as UTC instead of as local time. + +18. The precedence of concatenation and `| getline' (in something like + "echo " "date" | getline stuff) has been reverted to the earlier + behavior and now once again matches Unix awk. + +19. New configure time flag --disable-directories-fatal which causes + gawk to silently skip directories on the command line. This behavior + is also enabled for --traditional, since it's what Unix awk does. + +20. A new option, --use-lc-numeric, forces use of the locale's decimal + point without the rest of the draconian restrictions imposed by + --posix. This softens somewhat the stance taken in item #2. + +21. Everything relevant has been updated to the GPL 3. + +22. Array growth should be faster now, at no cost in space. + +23. Lots more tests. + +24. One new translation. + +25. Various bugs fixed, see the ChangeLog for details. + +Changes from 3.1.4 to 3.1.5 +--------------------------- + +1. The random() suite has been updated to a current FreeBSD version, which + works on systems with > 32-bit ints. + +2. A new option, `--exec' has been added. It's like -f but ends option + processing. It also disables `x=y' variable assignments, but not -v. + It's needed mainly for CGI scripts, so that source code can't be + passed in as part of the URL. + +3. dfa.[ch] have been synced with GNU grep development. This also fixes + multiple regex matching problems in multibyte locales. + +4. Updated to Automake 1.9.5. + +5. Updated to Bison 2.0. + +6. The getopt* and regex* files were synchronized with current GLIBC CVS. + See the ChangeLog for the versions and minor edits made. + +7. `configure --disable-nls' now disables just gawk's own translations. + Gawk continues to work with the locale's numeric formatting. This + includes a bug fix in handling the printf ' flag (e.g., %'d). + +8. Gawk is now multibyte aware. This means that index(), length(), + substr() and match() all work in terms of characters, not bytes. + +9. Gawk is now smarter about parsing numeric constants in corner cases. + +11. Not closing open redirections no longer causes gawk to exit non-zero. + +10. The VMS port has been updated. + +11. Changes from Andrew Schorr at the xmlgawk project to provide for + open hooks from extensions are now included. This will let the + xmlgawk extension work in the standard gawk. + +12. Updated to gettext 0.14.4. Gawk no longer includes its own copy + of the gettext `intl' library, following current GNU practice to + rely on there being an external version thereof. + +13. A regexp of the form `//' will now generate a warning that it + is not a C++ comment from --lint (awk.y). + +14. The ^ and ^= operators with an integer exponent now use Exponentiation + by Squaring. This simultaneously fixes a problem with ^= and a negative + integer exponent. + +15. length(array) now returns the number of elements in the array. This is + is a non-standard extension that will fail in POSIX mode. + +16. Carriage return characters are now ignored in program source code. + +17. Four new translations added. + +18. Various minor bugs fixed. See the ChangeLog for the details. + +Changes from 3.1.3 to 3.1.4 +--------------------------- + +1. Gawk now supports the POSIX %F format, falling back to %f if the local + system printf doesn't handle it. + +2. Gawk now supports the ' flag in printf. E.g., %'d in a locale with thousands + separators includes the thousands separator in the value, e.g. 12,345. + + This has one problem; the ' flag is next to impossible to use on the + command line, without major quoting games. Oh well, TANSTAAFL. + +3. The dfa code has been reinstated; the performance degradation was + just too awful. Sigh. (For fun, use `export GAWK_NO_DFA=1' to + see the difference.) + +4. The special case `x = x y' is now recognized in the grammar, and gawk + now uses `realloc' to append the new value to the end of the existing + one. This can speed up the common case of appending onto a string. + +5. The dfa code was upgraded with most of the fixes from grep 2.5.1, and + the regex code was upgraded with GLIBC as mid-January 2004. The regex + code is faster than it was, but still not as fast as the dfa code, so + the dfa code stays in. The getopt code was also synced to current GLIBC. + +6. Support code upgraded to Automake 1.8.5, Autoconf 2.59, and gettext 0.14.1. + +7. When --posix is in effect, sub/gsub now follow the 2001 POSIX behavior. + Yippee. This is even documented in the manual. + +8. Gawk will now recover children that have died (input pipelines, two-way + pipes), upon detecting EOF from them, thus avoiding filling + up the process table. Open file descriptors are not recovered + (unfortunately), since that could break awk semantics. See the + ChangeLog and the source code for the details. + +9. Handling of numbers like `0,1' in non-American locales ought to + work correctly now. + +10. IGNORECASE is now locale-aware for characters with values above 128. + The dfa matcher is now used for IGNORECASE matches too. + +11. Dynamic function loading is better. The documentation has been improved + and some new APIs for use by dynamic functions have been added. + +12. Gawk now has a fighting chance of working on older systems, + a la SunOS 4.1.x. + +13. Issues with multibyte support on HP-UX are now resolved. `configure' now + disables such support there, since it's not up to what gawk needs. + +14. There are now even more tests in the test suite. + +15. Various bugs fixed; see ChangeLog for the details. + +Changes from 3.1.2 to 3.1.3 +--------------------------- + +1. Gawk now follows POSIX in handling of local numeric formats for + input, output and number/string conversions. + +2. Multibyte detection improved. See README_d/README.multibyte for more + info about multibyte locales. + +3. Handling of `close' made more POSIX-compliant for POSIXLY_CORRECT, + see the documentation. + +4. The record reading code was redone, again. This time it's much + better. Really! + +5. For RS = "\n" and RS = "", gawk now only sets RT when it has changed. + This provides considerable performance improvement. + +6. `match' now sets all the subscripts in the third argument array + correctly, even if not all subexpressions matched. + +7. Updated to Automake 1.7.5. configure.in renamed configure.ac. + +8. C-style switch statements are available, but must be enabled at + compile time via `configure --enable-switch'. For 3.2 they'll be + enabled by default. Thanks to Michael Benzinger for the initial + code. + +9. %c now always prints no more than one character, whatever + precision is provided. + +10. strtonum() now works again. + +11. Gawk is now much better about scalar/array typing of global + uninitiailzed variables passed as parameters. Once the parameter + is then used one way or the other, the global var's type is + adjusted accordingly. Thanks to Stepan Kasal for the original + (considerable) changes. + +12. Dynamic function loading under Windows32 should now be possible. See + README_d/README.pcdynamic. Thanks to Patrick T.J. McPhee for the changes. + +13. Updated to gettext 0.12.1. + +14. Gawk now follows historical practice and POSIX for the return + value of `rand': It's now 0 <= N < 1. + +Changes from 3.1.1 to 3.1.2 +--------------------------- + +1. Loops of the form: + + for (iggy in foo) + next + + no longer leak memory. + +2. gawk -v FIELDWIDTHS="..." now sets PROCINFO["FS"] correctly. + +3. All builtin operations and functions should now fully evaluate their + arguments so that side effects take place correctly. + +4. Fixed a logic bug in gsub/gensub for matches to null strings that occurred + later in the string after a nonnull match. + +5. getgroups code now works on Ultrix again. + +6. Completely new version of the full GNU regex engine now in place. + +7. Argument parsing and variable assignment has been cleaned up. + +8. An I/O bug on HP-UX has been documented and worked around. See + README_d/README.hpux. + +9. awklib/grcat should now compile correctly. + +10. Updated to automake 1.7.3, autoconf 2.57 and gettext 0.11.5 ; thanks to + Paul Eggert for the initial automake and autoconf work. + +11. As a result of #6, removed the use of the dfa code from GNU grep. + +12. It is now possible to use ptys for |& two-way pipes instead of + pipes. The basic plumbing for this was provided by Paolo Bonzini. + To make this happen: + + command = "unix command etc" + PROCINFO[command, "pty"] = 1 + + print ... |& command + command |& getline stuff + + In other words, set the element in PROCINFO *before* opening the + two-way pipe, and then gawk will use ptys instead of pipes. + + On systems without ptys or where all the ptys are in use, gawk + will fall back to using plain pipes. + +13. Fixed a regex matching across buffer boundaries bug, with a + heuristic. See io.c:rsre_get_a_record. + +14. Profiling no longer dumps core if there are extension functions in place. + +15. Grammar and scanner cleaned up, courtesy of Stepen Kasal, to hopefully + once and for all fix the `/=' operator vs. `/=.../' regex ambiguity. + Lots of other grammar simplifications applied, as well. + +16. BINMODE should work now on more Windows ports. + +17. Updated to bison 1.875. Includes fix to bisonfix.sed script. + +18. The NODE structure is now 20% (8 bytes) smaller (on x86, anyway), which + should help conserve memory. + +19. Builds not in the source directory should work again. + +20. Arrays now use 2 NODE's per element instead of three. Combined with + #18, (on the x86) this reduces the overhead from 120 bytes per element + to just 64 bytes: almost a 50% improvement. + +21. Programs that make heavy use of changing IGNORECASE should now be + much faster, particularly if using a regular expression for FS or RS. + IGNORECASE now correctly affects RS regex record splitting, as well. + +22. IGNORECASE no longer affects single-character field splitting (FS = "c"), + or single-character record splitting (RS = "c"). + + This cleans up some weird behavior, and makes gawk better match the + documentation, which says it only affects regex-based field splitting + and record splitting. + + The documentation on this was improved, too. + +23. The framework in test/ has been simplified, making it much easier to + add new tests while keeping the size of Makefile.am reasonable. Thanks + for this to Stepan Kasal. + +24. --lint=invalid causes lint warnings only about stuff that's actually + invalid. This needs additional work. + +25. More translations. + +26. The `get_a_record' routine has been revamped (currently by splitting it + into three variants). This should improve long-term maintainability. + +27. `match' now adds more entries to 3rd array arg: + match("the big dog", /([a-z]+) ([a-z]+) ([a-z]+)/, data) + fills in variables: + data[1, "start"], data[1, "length"], and so on. + +28. New `asorti' function with same interface as `asort', but sorts indices + instead of values. + +29. Documentation updated to FDL 1.2. + +30. New `configure' option --disable-lint at compile time disables lint + checking. With GCC dead-code-elimination, cuts almost 200K off the + executable size on GNU/Linux x86. Presumably speeds up runtime. + + Using this will cause some of the tests in the test suite to fail. + This option may be removed at a later date. + +31. Various minor cleanups, see the ChangeLog for details. + +Changes from 3.1.0 to 3.1.1 +--------------------------- + +1. Six new translations. + +2. Having more than 4 different values for OFMT and/or CONVFMT now works. + +3. The handling of dynamic regexes is now more more sane, esp. w.r.t. + the profiling code. The profiling code has been fixed in several + places. + +4. The return value of index("", "") is now 1. + +5. Gawk should no longer close fd 0 in child processes. + +6. Fixed test for strtod semantics and regenerated configure. + +7. Gawk can now be built with byacc; an accidental bison dependency was + removed. + +8. `yyerror' will no longer dump core on long source lines. + +9. Gawk now correctly queries getgroups(2) to figure out how many groups + the process has. + +10. New configure option to force use of included strftime, e.g. on + Solaris systems. See `./configure --help' for the details. Replaced + the included strftime.c with the one from textutils. + +11. OS/2 port has been updated. + +12. Multi-byte character support has been added, courtesy of IBM Japan. + +13. The `for (iggy in foo) delete foo[iggy]' -> `delete foo' optimisation + now works. + +14. Upgraded to gettext 0.11.2 and automake 1.5. + +15. Full gettext compatibility (new dcngettext function). + +16. The O'Reilly copyedits and indexing changes for the documentation have + been folded into the texinfo version of the manuals. + +17. A humongously long value for the AWKPATH environment variable will no + longer dump core. + +18. Configuration / Installation issues have been straightened out in + Makefile.am. + +Changes from 3.0.6 to 3.1.0 +--------------------------- + +1. A new PROCINFO array provides info about the process. The non-I/O /dev/xxx + files are now obsolete, and their use always generates a warning. + +2. A new `mktime' builtin function was added for creating time stamps. The + `mktime' function written in awk was removed from the user's guide. + +3. New `--gen-po' option creates GNU gettext .po files for strings marked + with a leading underscore. + +4. Gawk now completely interprets special file names internally, ignoring the + existence of real /dev/stdin, /dev/stdout files, etc. + +5. The mmap code was removed. It was a worthwhile experiment that just + didn't work out. + +6. The BINMODE variable is new; on non-UNIX systems it affects how gawk + opens files for text vs. binary. + +7. The atari port is now unsupported. + +8. Gawk no longer supports `next file' as two words. + +9. On systems that support it, gawk now sets the `close on exec' flag on all + files and pipes it opens. This makes sure that child processes run via + `system' or pipes have plenty of file descriptors available. + +10. New ports: Tandem and BeOS. The Tandem port is unsupported. + +11. If `--posix' is in effect, newlines are not allowed after ?:. + +12. Weird OFMT/CONVFMT formats no longer cause fatal errors. + +13. Diagnostics about array parameters now include the parameter's name, + not just its number. + +14. configure should now automatically add -D_SYSV3 for ISC Unix. + (This seems to have made it into the gawk 3.0.x line long ago.) + +15. It is now possible to open a two-way pipe via the `|&' operator. + See the discussion in the manual about putting `sort' into such a pipeline, + though. (NOTE! This is borrowed from ksh: it is not the same as + the same operator in csh!) + +16. The `close' function now takes an optional second string argument + that allows closing one or the other end of the two-way pipe to + a co-process. This is needed to use `sort' in a co-process, see + the doc. + +17. If TCP/IP is available, special file names beginning with `/inet' + can be used with `|&' for IPC. Thanks to Juergen Kahrs for the initial + code. + +18. With `--enable-portals' on the configure command line, gawk will also + treat file names that start with `/p/' as a 4.4 BSD type portal file, + i.e., a two-way pipe for `|&'. + +19. Unrecognized escapes, such as "\q" now always generate a warning. + +20. The LINT variable is new; it provides dynamic control over the --lint + option. + +21. Lint warnings can be made fatal by using --lint=fatal or `LINT = "fatal"'. + Use this if you're really serious about portable code. + +22. Due to an enhanced sed script, there is no longer any need to worry + about finding or using alloca. alloca.c is thus now gone. + +23. A number of lint warnings have been added. Most notably, gawk will + detect if a variable is used before assigned to. Warnings for + when a string that isn't a number gets converted to a number are + in the code but disabled; they seem to be too picky in practice. + + Also, gawk will now warn about function parameter names that shadow + global variable names. + +24. It is now possible to dynamically add builtin functions on systems + that support dlopen. This facility is not (yet) as portable or well + integrated as it might be. *** WARNING *** THIS FEATURE WILL EVOLVE! + +25. There are *many* new tests in the test suite. + +26. Profiling has been added! A separate version of gawk, named pgawk, is + built and generates a run-time execution profile. The --profile option + can be used to change the default output file. In regular gawk, this + option pretty-prints the parse tree. + +27. Gawk has been internationalized, using GNU gettext. Translations for + future distributions are most welcome. Simultaneously, gawk was switched + over to using automake. You need Automake 1.4a (from the CVS archive) + if you want to muck with the Makefile.am files. + +28. New `asort' function for sorting arrays. See the doc for details. + +29. The match function takes an optional array third argument to hold + the text matched by parenthesized sub-expressions. + +30. The bit op functions and octal and hex source code constants are on by + default, no longer a configure-time option. Recognition of non-decimal + data is now enabled at runtime with --non-decimal-data command line option. + +31. Internationalization features available at the awk level: new TEXTDOMAIN + variable and `bindtextdomain' and `dcgettext' functions. printf formats + may contain the "%2$3.5d" kind of notation for use in translations. See + the texinfo manual for details. + +32. The return value from `close' has been rationalized. Most notably, + closing something that wasn't open returns -1 but remains non-fatal. + +33. The array effeciency change from 3.0.5 was reverted; the semantics were + not right. Additionally, index values of previously stored elements + can no longer change dynamically. + +34. The new option --dump-variables dumps a list of all global variables and + their final types and values to a file you give, or to `awkvars.out'. + +35. Gawk now uses a recent version of random.c courtesy of the FreeBSD + project. + +36. The gawk source code now uses ANSI C function definitions (new style), + with ansi2knr to translate code for old compilers. + +37. `for (iggy in foo)' loops should be more robust now in the face of + adding/deleting elements in the middle; they loop over just the elements + that are present in the array when the loop starts. + +Changes from 3.0.5 to 3.0.6 +--------------------------- + +This is a bug fix release only, pending further development on 3.1.0. + +Bugs fixed and changes made: + +1. Subscripting an array with a variable that is just a number no + longer magically converts the variable into a string. + +2. Similarly, running a `for (iggy in foo)' loop where `foo' is a + function parameter now works correctly. + +3. Similarly, `i = ""; v[i] = a; if (i in v) ...' now works again. + +4. Gawk now special cases `for (iggy in foo) delete foo[iggy]' and + treats it as the moral equivalent of `delete foo'. This should be + a major efficiency win when portably deleting large arrays. + +5. VMS port brought up to date. + +Changes from 3.0.4 to 3.0.5 +--------------------------- + +This is a bug fix release only, pending further development on 3.1.0. + +Bugs Fixed: + + 1. `function foo(foo)' is now a fatal error. + + 2. Array indexing is now much more efficient: where possible, only one + copy of an index string is kept, even if used in multiple arrays. + + 3. Support was added for MacOS X and an `install-strip' target. + + 4. [s]printf formatting for `0' flag and floating point formats now + works correctly. + + 5. HP-UX large file support with GCC 2.95.1 now works. + + 6. Arguments that contain `=' but that aren't syntactically valid are + now treated as filenames, instead of as fatal errors. + + 7. `-v NF=foo' now works. + + 8. Non-ascii alphanumeric characters are now treated as such in the + right locales by regex.c. Similarly, a Latin-1 y-umlaut (decimal + value 255) in the program text no longer acts like EOF. + + 9. Array indexes are always compared as strings; fixes an obscure bug + when user input gets used for the `x in array' test. + +10. The usage message now points users to the documentation for how + to report bugs. + +11. `/=' now works after an array. + +12. `b += b += 1' now works correctly. + +13. IGNORECASE changing with calls `match' now works better. (Fix for + semi-obscure bug.) + +14. Multicharacter values for RS now generate a lint warning. + +15. The gawk open file caching is now much more efficient. + +16. Global arrays passed to functions are now managed better. In particular, + test/arynocls.awk won't crash referencing freed memory. + +17. In obscure cases, `getline var' can no longer clobber $0. + +Changes from 3.0.3 to 3.0.4 +--------------------------- + +This is a bug fix release only, pending further development on 3.1.0. + +Bugs Fixed: + + 1. A memory leak when turning a function parameter into an array was + fixed. + + 2. The non-decimal data option now works correctly. + + 3. Using an empty pair of brackets as an array subscript no longer causes + a core dump during parsing. In general, syntax errors should not + cause core dumps any more. + + 4. Standard input is no longer closed if it provides program source, + avoiding strange I/O problems. + + 5. Memory corruption during printing with `print' has been fixed. + + 6. The gsub function now correctly counts the number of matches. + + 7. A typo in doc/Makefile.in has been fixed, making installation work. + + 8. Calling `next' or `nextfile' from a BEGIN or END rule is now fatal. + + 9. Subtle problems in rebuilding $0 when fields were changed have been + fixed. + +10. `FS = FS' now correctly turns off the use of FIELDWIDTHS. + +11. Gawk now parses fields correctly when FS is a single character. + +12. It is now possible for RS to be the NUL character ("\0"). + +13. Weird problems with number conversions on MIPS and other systems + have been fixed. + +14. When parsing using FIELDWIDTHS is in effect, `split' with no third + argument will still use the value of FS. + +15. Large File Support for Solaris, HP-UX, AIX, and IRIX is now enabled at + compile time, thanks to Paul Eggert. + +16. Attempting to use the name of a function as a variable or array + from within the function is now caught as a fatal error, instead + of as a core dump. + +17. A bug in parsing hex escapes was fixed. + +18. A weird bug with concatenation where one expression has side effects + that changes another was fixed. + +19. printf/sprintf now behave much better for uses of the '0' and '#' flags + and with precisions and field widths. + +20. Further strangenesses with concatenation and multiple accesses of some + of the special variables was fixed. + +21. The Atari port is marked as no longer supported. + +22. Build problems on HP-UX have been fixed. + +23. Minor fixes and additional explanations added to the documentation. + +24. For RS = "", even a single leading newline is now correctly stripped. + +25. Obscure parsing problems for regex constants like /=.../ fixed, so + that a regex constant is recognized, and not the /= operator. + +26. Fixed a bug when closing a redirection that matched the current + or last FILENAME. + +27. Build problems on AIX fixed. + +Changes from 3.0.2 to 3.0.3 +--------------------------- + +The horrendous per-record memory leak introduced in 3.0.1 is gone, finally. + +The `amiga' directory is now gone; Amiga support is now entirely handled +by the POSIX support. + +Windows32 support has been added in the `pc' directory. See `README_d/README.pc' +for more info. + +The mmap changes are disabled in io.c, and will be removed entirely +in the next big release. They were an interesting experiment that just +really didn't work in practice. + +A minor memory leak that occurred when using `next' from within a +function has also been fixed. + +Problems with I/O from sub-processes via a pipe are now gone. + +Using "/dev/pid" and the other special /dev files no longer causes a core dump. + +The files regex.h, regex.c, getopt.h, getopt.c, and getopt1.c have been +merged with the versions in GNU libc. Thanks to Ulrich Drepper for his help. + +Some new undocumented features have been added. Use the source, Luke! +It is not clear yet whether these will ever be fully supported. + +Array performance should be much better for very very large arrays. "Virtual +memory required, real memory helpful." + +builtin.c:do_substr rationalized, again. + +The --re-interval option now works as advertised. + +The license text on some of the missing/* files is now generic. + +Lots more new test cases. + +Lots of other small bugs fixed, see the ChangeLog files for details. + +Changes from 3.0.1 to 3.0.2 +--------------------------- + +Gawk now uses autoconf 2.12. + +strftime now behaves correctly if passed an empty format string or if +the string formats to an empty result string. + +Several minor compilation and installation problems have been fixed. + +Minor page break issues in the user's guide have been fixed. + +Lexical errors no longer repeat ad infinitum. + +Changes from 3.0.0 to 3.0.1 +--------------------------- + +Troff source for a handy-dandy five color reference card is now provided. +Thanks to SSC for their macros. + +Gawk now behaves like Unix awk and mawk, in that newline acts as white +space for separating fields and for `split', by default. In posix mode, +only space and tab separate fields. The documentation has been updated to +reflect this. + +Tons and tons of small bugs fixed and new tests added, see the ChangeLogs. + +Lots fewer compile time warnings from gcc -Wall. Remaining ones aren't +worth fixing. + +Gawk now pays some attention to the locale settings. + +Fixes to gsub to catch several corner cases. + +The `print' statement now evaluates all expressions first, and then +prints them. This leads to less suprising behaviour if any expression has +output side effects. + +Miscellanious improvements in regex.h and regex.c. + +Gawk will now install itself as gawk-M.N.P in $(bindir), and link +`gawk' to it. This makes it easy to have multiple versions of gawk +simultaneously. It will also now install itself as `awk' in $(bindir) +if there is no `awk' there. This is in addition to installing itself as +`gawk'. This change benefits the Hurd, and possibly other systems. One +day, gawk will drop the `g', but not yet. + +`--posix' turns on interval expressions. Gawk now matches its documentation. + +`close(FILENAME)' now does something meaningful. + +Field management code in field.c majorly overhauled, several times. + +The gensub code has been fixed, several bugs are now gone. + +Gawk will use mmap for data file input if it is available. + +The printf/sprintf code has been improved. + +Minor issues in Makefile setup worked on and improved. + +builtin.c:do_substr rationalized. + +Regex matching fixed so that /+[0-9]/ now matches the leading +. + +For building on vms, the default compiler is now DEC C rather than VAX C. + +Changes from 2.15.6 to 3.0.0 +---------------------------- + +Fixed spelling of `Programming' in the copyright notice in all the files. + +New --re-interval option to turn on interval expressions. They're off +by default, except for --posix, to avoid breaking old programs. + +Passing regexp constants as parameters to user defined functions now +generates a lint warning. + +Several obscure regexp bugs fixed; alas, a small number remain. + +The manual has been thoroughly revised. It's now almost 50% bigger than +it used to be. + +The `+' modifier in printf is now reset correctly for each item. + +The do_unix variable is now named do_traditional. + +Handling of \ in sub and gsub rationalized (somewhat, see the manual for +the gory [and I do mean gory] details). + +IGNORECASE now uses ISO 8859-1 Latin-1 instead of straight ASCII. See the +source for how to revert to pure ASCII. + +--lint will now warn if an assignment occurs in a conditional context. +This may become obnoxious enough to need turning off in the future, but +"it seemed like a good idea at the time." + +%hf and %Lf are now diagnosed as invalid in printf, just like %lf. + +Gawk no longer incorrectly closes stdin in child processes used in +input pipelines. + +For integer formats, gawk now correctly treats the precision as the +number of digits to print, not the number of characters. + +gawk is now much better at catching the use of scalar values when +arrays are needed, both in function calls and the `x in y' constructs. + +New gensub function added. See the manual. + +If do_tradtional is true, octal and hex escapes in regexp constants are +treated literally. This matches historical behavior. + +yylex/nextc fixed so that even null characters can be included +in the source code. + +do_format now handles cases where a format specifier doesn't end in +a control letter. --lint reports an error. + +strftime() now uses a default time format equivalent to that of the +Unix date command, thus it can be called with no arguments. + +Gawk now catches functions that are used but not defined at parse time +instead of at run time. (This is a lint error, making it fatal could break +old code.) + +Arrays that max out are now handled correctly. + +Integer formats outside the range of an unsigned long are now detected +correctly using the SunOS 4.x cc compiler. + +--traditional option added as new preferred name for --compat, in keeping +with GCC. + +--lint-old option added, so that warnings about things not in old awk +are only given if explicitly asked for. + +`next file' has changed to one word, `nextfile'. `next file' is still +accepted but generates a lint warning. `next file' will go away eventually. + +Gawk with --lint will now notice empty source files and empty data files. + +Amiga support using the Unix emulation added. Thanks to fnf@ninemoons.com. + +test/Makefile is now "parallel-make safe". + +Gawk now uses POSIX regexps + GNU regex ops by default. --posix goes to +pure posix regexps, and --compat goes to traditional Unix regexps. However, +interval expressions, even though specified by POSIX, are turned off by +default, to avoid breaking old code. + +IGNORECASE now applies to string comparison as well as regexp operations. + +The AT&T Bell Labs Research awk fflush builtin function is now supported. +fflush is extended to flush stdout if no arg and everything if given +the null string as an argument. + +If RS is more than one character, it is treated as a regular expression +and records are delimited accordingly. The variable RT is set to the record +terminator string. This is disabled in compatibility mode. + +If FS is set to the null string (or the third arg. of split() is the null +string), splitting is done at every single character. This is disabled in +compatibility mode. + +Gawk now uses the Autoconf generated configure script, doing away with all +the config/* files and the machinery that went with them. The Makefile.in +has also changed accordingly, complete with all the standard GNU Makefile +targets. (Non-unix systems may still have their own config.h and Makefile; +see the appropriate README_d/README.* and/or subdirectory.) + +The source code has been cleaned up somewhat and the formatting improved. + +Changes from 2.15.5 to 2.15.6 +----------------------------- + +Copyrights updated on all changed files. + +test directory enhanced with four new tests. + +Gawk now generates a warning for \x without following hexadecimal digits. +In this case, it returns 'x', not \0. + +Several fixes in main.c related to variable initialization: + CONVFMT has a default value + resetup is called before initializing variables + the varinit table fixed up a bit (see the comments) + +gawk.1 updated with new BUG REPORTS section. + +A plain `print' inside a BEGIN or END now generates a lint warning (awk.y). + +Small fix in iop.c:get_a_record to avoid reading uninitialized memory. + +awk.y:yylex now does a better job of handling things if the source file +does not end in a newline. Probably there is more work to be done. + +Memory leaks fixed in awk.y, particularly in cases of duplicate function +parameters. Also, calling a function doesn't leak memory during parsing. + +Empty function bodies are now allowed (awk.y). + +Gawk now detects duplicate parameter names in functions (awk.y). + +New function `error' in msg.c added for use from awk.y. + +eval.c:r_get_lhs now checks if its argument is a parameter on the stack, +and pulls down the real variable. This catches more 'using an array as +a scalar' kinds of errors. + +main.c recovers C alloca space after parsing, this is important for +bison-based parsers. re.c recovers C alloca space after doing an research. +[Changes from Pat Rankin] + +builtin.c now declares the random() related functions based on +RANDOM_MISSING from config.h. [Suggested by Pat Rankin] + +awk.h now handles alloca correctly for HP-UX. [Kaveh Ghazi] + +regex.h and config/cray60 updated for Unicos 8.0. [Hal Peterson] + +Fixed re.c and dfa.c so that gawk no longer leaks memory when using +lots of dynamic regexps. + +Removed dependency on signed chars from `idx' variable in awk.h. Gawk +now passes its test suite if compiled with `gcc -fno-signed-char'. + +Fixed warning on close in io.c to go under lint control. Too many people +have complained about the spurious message, particularly when closing a +child pipeline early. + +Gawk now correctly handles RS = "" when input is from a terminal +(iop.c:get_a_record). + +Config file added for GNU. + +gawk 'BEGIN { exit 1 } ; END { exit }' now exits 1, as it should +(eval.c:interpret). + +sub and gsub now follow posix, \ escapes both & and \. Each \ must +be doubled initially in the program to get it into the string. +Thanks to Mike Brennan for pointing this out (builtin.c:sub_common). + +If FS is "", gawk behaves like mawk and nawk, making the whole record be $1. +Yet Another Dark Corner. Sigh (field.c:def_parse_field). + +Gawk now correctly recomputes string values for numbers if CONVFMT has +changed (awk.h:force_string, node.c:r_force_string). + +A regexp of the form `/* this looks like a comment but is not */' will +now generate a warning from --lint (awk.y). + +Gawk will no longer core dump if given an empty input file (awk.y:get_src_buf, +iop.c:optimal_bufsize). + +A printf format of the form %lf is handled correctly. The `l' generates +a lint warning (builtin.c:format_tree) [Thanks to Mark Moraes]. + +Lynxos config file added. + +`continue' outside a loop treated as `next' only in compatibility mode, +instead of by default; recent att nawk chokes on this now. `break' +outside a loop now treated as `next' in compatibility mode (eval.c). + +Bug fix in string concatenation, an arbitrary number of expressions +are allowed (eval.c). + +$1 += $2 now works correctly (eval.c). + +Changing IGNORECASE no longer resets field-splitting to FS if it was +using FIELDWIDTHS (eval.c, field.c). + +Major enhancement: $0 and NF for last record read are now preserved +into the END rule (io.c). + +Regexp fixes: + /./ now matches a newline (regex.h) + ^ and $ match beginning and end of string only, not any embedded + newlines (re.c) + regex.c should compile and work ok on 64-bit mips/sgi machines + +Changes from 2.15.4 to 2.15.5 +----------------------------- + +FUTURES file updated and re-arranged some with more rational schedule. + +Many prototypes handled better for ANSI C in protos.h. + +getopt.c updated somewhat. + +test/Makefile now removes junk directory, `bardargtest' renamed `badargs.' + +Bug fix in iop.c for RS = "". Eat trailing newlines off of record separator. + +Bug fix in Makefile.bsd44, use leading tab in actions. + +Fix in field.c:set_FS for FS == "\\" and IGNORECASE != 0. + +Config files updated or added: + cray60, DEC OSF/1 2.0, Utek, sgi405, next21, next30, atari/config.h, + sco. + +Fix in io.c for ENFILE as well as EMFILE, update decl of groupset to +include OSF/1. + +Rationalized printing as integers if numbers are outside the range of a long. +Changes to node.c:force_string and builtin.c. + +Made internal NF, NR, and FNR variables longs instead of ints. + +Add LIMITS_H_MISSING stuff to config.in and awk.h, and default defs for +INT_MAX and LONG_MAX, if no limits.h file. Add a standard decl of +the time() function for __STDC__. From ghazi@noc.rutgers.edu. + +Fix tree_eval in awk.h and r_tree_eval in eval.c to deal better with +function parameters, particularly ones that are arrays. + +Fix eval.c to print out array names of arrays used in scalar contexts. + +Fix eval.c in interpret to zero out source and sourceline initially. This +does a better job of providing source file and line number information. + +Fix to re_parse_field in field.c to not use isspace when RS = "", but rather +to explicitly look for blank and tab. + +Fix to sc_parse_field in field.c to catch the case of the FS character at the +end of a record. + +Lots of miscellanious bug fixes for memory leaks, courtesy Mark Moraes, +also fixes for arrays. + +io.c fixed to warn about lack of explicit closes if --lint. + +Updated missing/strftime.c to match posted strftime 6.2. + +Bug fix in builtin.c, in case of non-match in sub_common. + +Updated constant used for division in builtin.c:do_rand for DEC Alpha +and CRAY Y-MP. + +POSIXLY_CORRECT in the environment turns on --posix (fixed in main.c). + +Updated srandom prototype and calls in builtin.c. + +Fix awk.y to enforce posix semantics of unary +: result is numeric. + +Fix array.c to not rearrange the hash chain upon finding an index in +the array. This messed things up in cases like: + for (index1 in array) { + blah + if (index2 in array) # blew away the for + stuff + } + +Fixed spelling errors in the man page. + +Fixes in awk.y so that + gawk '' /path/to/file +will work without core dumping or finding parse errors. + +Fix main.c so that --lint will fuss about an empty program. +Yet another fix for argument parsing in the case of unrecognized options. + +Bug fix in dfa.c to not attempt to free null pointers. + +Bug fix in builtin.c to only use DEFAULT_G_PRECISION for %g or %G. + +Bug fix in field.c to achieve call by value semantics for split. + +Changes from 2.15.3 to 2.15.4 +----------------------------- + +Lots of lint fixes, and do_sprintf made mostly ANSI C compatible. + +Man page updated and edited. + +Copyrights updated. + +Arrays now grow dynamically, initially scaling up by an order of magnitude + and then doubling, up to ~ 64K. This should keep gawk's performance + graceful under heavy load. + +New `delete array' feature added. Only documented in the man page. + +Switched to dfa and regex suites from grep-2.0. These offer the ability to + move to POSIX regexps in the next release. + +Disabled GNU regex ops. + +Research awk -m option now recognized. It does nothing in gawk, since gawk + has no static limits. Only documented in the man page. + +New bionic (faster, better, stronger than before) hashing function. + +Bug fix in argument handling. `gawk -X' now notices there was no program. + Additional bug fixes to make --compat and --lint work again. + +Many changes for systems where sizeof(int) != sizeof(void *). + +Add explicit alloca(0) in io.c to recover space from C alloca. + +Fixed file descriptor leak in io.c. + +The --version option now follows the GNU coding standards and exits. + +Fixed several prototypes in protos.h. + +Several tests updated. On Solaris, warn that the out? tests will fail. + +Configuration files for SunOS with cc and Solaris 2.x added. + +Improved error messages in awk.y on gawk extensions if do_unix or do_compat. + +INSTALL file added. + +Fixed Atari Makefile and several VMS specific changes. + +Better conversion of numbers to strings on systems with broken sprintfs. + +Changes from 2.15.2 to 2.15.3 +----------------------------- + +Increased HASHSIZE to a decent number, 127 was way too small. + +FILENAME is now the null string in a BEGIN rule. + +Argument processing fixed for invalid options and missing arguments. + +This version will build on VMS. This included a fix to close all files + and pipes opened with redirections before closing stdout and stderr. + +More getpgrp() defines. + +Changes for BSD44: in io.c and Makefile.bsd44. + +All directories in the distribution are now writable. + +Separated LDFLAGS and CFLAGS in Makefile. CFLAGS can now be overridden by + user. + +Make dist now builds compressed archives ending in .gz and runs doschk. + +Amiga port. + +New getopt.c fixes Alpha OSF/1 problem. + +Make clean now removes possible test output. + +Improved algorithm for multiple adjacent string concatenations leads to + performance improvements. + +Fix nasty bug whereby command-line assignments, both with -v and at run time, + could create variables with syntactically illegal names. + +Fix obscure bug in printf with %0 flag and filling. + +Add a lint check for substr if provided length exceeds remaining characters + in string. + +Update atari support. + +PC support enhanced to include support for both DOS and OS/2. (Lots more + #ifdefs. Sigh.) + +Config files for Hitachi Unix and OSF/1, courtesy of Yoko Morishita + (morisita@sra.co.jp) + +Changes from 2.15.1 to 2.15.2 +----------------------------- + +Additions to the FUTURES file. + +Document undefined order of output when using both standard output + and /dev/stdout or any of the /dev output files that gawk emulates in + the absence of OS support. + +Clean up the distribution generation in Makefile.in: the info files are + now included, the distributed files are marked read-only and patched + distributions are now unpacked in a directory named with the patch level. + +Changes from 2.15 to 2.15.1 +--------------------------- + +Close stdout and stderr before all redirections on program exit. This allows + detection of write errors and also fixes the messages test on Solaris 2.x. + +Removed YYMAXDEPTH define in awk.y which was limiting the parser stack depth. + +Changes to config/bsd44, Makefile.bsd44 and configure to bring it into line + with the BSD4.4 release. + +Changed Makefile to use prefix, exec_prefix, bindir etc. + +make install now installs info files. + +make install now sets permissions on installed files. + +Make targets added: uninstall, distclean, mostlyclean and realclean. + +Added config.h to cleaner and clobber make targets. + +Changes to config/{hpux8x,sysv3,sysv4,ultrix41} to deal with alloca(). + +Change to getopt.h for portability. + +Added more special cases to the getpgrp() call. + +Added README.ibmrt-aos and config/ibmrt-aos. + +Changes from 2.14 to 2.15 +--------------------------- + +Command-line source can now be mixed with library functions. + +ARGIND variable tracks index in ARGV of FILENAME. + +GNU style long options in addition to short options. + +Plan 9 style special files interpreted by gawk: + /dev/pid + /dev/ppid + /dev/pgrpid + /dev/user + $1 = getuid + $2 = geteuid + $3 = getgid + $4 = getegid + $5 ... $NF = getgroups if supported + +ERRNO variable contains error string if getline or close fails. + +Very old options -a and -e have gone away. + +Inftest has been removed from the default target in test/Makefile -- the + results were too machine specific and resulted in too many false alarms. + +A README.amiga has been added. + +The "too many arguments supplied for format string" warning message is only + in effect under the lint option. + +Code improvements in dfa.c. + +Fixed all reported bugs: + + Writes are checked for failure (such as full filesystem). + + Stopped (at least some) runaway error messages. + + gsub(/^/, "x") does the right thing for $0 of 0, 1, or more length. + + close() on a command being piped to a getline now works properly. + + The input record will no longer be freed upon an explicit close() + of the input file. + + A NUL character in FS now works. + + In a substitute, \\& now means a literal backslash followed by what + was matched. + + Integer overflow of substring length in substr() is caught. + + An input record without a newline termination is handled properly. + + In io.c, check is against only EMFILE so that system file table + is not filled. + + Renamed all files with names longer than 14 characters. + + Escaped characters in regular expressions were being lost when + IGNORECASE was used. + + Long source lines were not being handled properly. + + Sourcefiles that ended in a tab but no newline were bombing. + + Patterns that could match zero characters in split() were not working + properly. + + The parsedebug option was not working. + + The grammar was being a bit too lenient, allowing some very dubious + programs to pass. + + Compilation with DEBUG defined now works. + + A variable read in with getline was not being treated as a potential + number. + + Array subscripts were not always of string type. + + +Changes from 2.13.2 to 2.14 +--------------------------- + +Updated manual! + +Added "next file" to skip efficiently to the next input file. + +Fixed potential of overflowing buffer in do_sprintf(). + +Plugged small memory leak in sub_common(). + +EOF on a redirect is now "sticky" -- it can only be cleared by close()ing + the pipe or file. + +Now works if used via a #! /bin/gawk line at the top of an executable file + when that line ends with whitespace. + +Added some checks to the grammar to catch redefinition of builtin functions. + This could eventually be the basis for an extension to allow redefining + functions, but in the mean time it's a good error catching facility. + +Negative integer exponents now work. + +Modified do_system() to make sure it had a non-null string to be passed + to system(3). Thus, system("") will flush any pending output but not go + through the overhead of forking an un-needed shell. + +A fix to floating point comparisons so that NaNs compare right on IEEE systems. + +Added code to make sure we're not opening directories for reading and such. + +Added code to do better diagnoses of weird or null file names. + +Allow continue outside of a loop, unless in strict posix mode. Lint option + will issue warning. + +New missing/strftime.c. There has been one change that affects gawk. Posix + now defines a %V conversion so the vms conversion has been changed to %v. + If this version is used with gawk -Wlint and they use %V in a call to + strftime, they'll get a warning. + +Error messages now conform to GNU standard (I hope). + +Changed comparisons to conform to the description found in the file POSIX. + This is inconsistent with the current POSIX draft, but that is broken. + Hopefully the final POSIX standard will conform to this version. + (Alas, this will have to wait for 1003.2b, which will be a revision to + the 1003.2 standard. That standard has been frozen with the broken + comparison rules.) + +The length of a string was a short and now is a size_t. + +Updated VMS help. + +Added quite a few new tests to the test suite and deleted many due to lack of + written releases. Test output is only removed if it is identical to the + "good" output. + +Fixed a couple of bugs for reference to $0 when $0 is "" -- particularly in + a BEGIN block. + +Fixed premature freeing in construct "$0 = $0". + +Removed the call to wait_any() in gawk_popen(), since on at least some systems, + if gawk's input was from a pipe, the predecessor process in the pipe was a + child of gawk and this caused a deadlock. + +Regexp can (once again) match a newline, if given explicitly. + +nextopen() makes sure file name is null terminated. + +Fixed VMS pipe simulation. Improved VMS I/O performance. + +Catch . used in variable names. + +Fixed bug in getline without redirect from a file -- it was quitting after the + first EOF, rather than trying the next file. + +Fixed bug in treatment of backslash at the end of a string -- it was bombing + rather than doing something sensible. It is not clear what this should mean, + but for now I issue a warning and take it as a literal backslash. + +Moved setting of regexp syntax to before the option parsing in main(), to + handle things like -v FS='[.,;]' + +Fixed bug when NF is set by user -- fields_arr must be expanded if necessary + and "new" fields must be initialized. + +Fixed several bugs in [g]sub() for no match found or the match is 0-length. + +Fixed bug where in gsub() a pattern anchored at the beginning would still + substitute throughout the string. + +make test does not assume that . is in PATH. + +Fixed bug when a field beyond the end of the record was requested after + $0 was altered (directly or indirectly). + +Fixed bug for assignment to field beyond end of record -- the assigned value + was not found on subsequent reference to that field. + +Fixed bug for FS a regexp and it matches at the end of a record. + +Fixed memory leak for an array local to a function. + +Fixed hanging of pipe redirection to getline + +Fixed coredump on access to $0 inside BEGIN block. + +Fixed treatment of RS = "". It now parses the fields correctly and strips + leading whitespace from a record if FS is a space. + +Fixed faking of /dev/stdin. + +Fixed problem with x += x + +Use of scalar as array and vice versa is now detected. + +IGNORECASE now obeyed for FS (even if FS is a single alphabetic character). + +Switch to GPL version 2. + +Renamed awk.tab.c to awktab.c for MSDOS and VMS tar programs. + +Renamed this file (CHANGES) to NEWS. + +Use fmod() instead of modf() and provide FMOD_MISSING #define to undo + this change. + +Correct the volatile declarations in eval.c. + +Avoid errant closing of the file descriptors for stdin, stdout and stderr. + +Be more flexible about where semi-colons can occur in programs. + +Check for write errors on all output, not just on close(). + +Eliminate the need for missing/{strtol.c,vprintf.c}. + +Use GNU getopt and eliminate missing/getopt.c. + +More "lint" checking. + + +Changes from 2.13.1 to 2.13.2 +----------------------------- + +Toward conformity with GNU standards, configure is a link to mkconf, the latter + to disappear in the next major release. + +Update to config/bsd43. + +Added config/apollo, config/msc60, config/cray2-50, config/interactive2.2 + +sgi33.cc added for compilation using cc rather than gcc. + +Ultrix41 now propagates to config.h properly -- as part of a general + mechanism in configure for kludges -- #define anything from a config file + just gets tacked onto the end of config.h -- to be used sparingly. + +Got rid of an unnecessary and troublesome declaration of vprintf(). + +Small improvement in locality of error messages. + +Try to diagnose use of array as scalar and vice versa -- to be improved in + the future. + +Fix for last bug fix for Cray division code--sigh. + +More changes to test suite to explicitly use sh. Also get rid of + a few generated files. + +Fixed off-by-one bug in string concatenation code. + +Fix for use of array that is passed in from a previous function parameter. + Addition to test suite for above. + +A number of changes associated with changing NF and access to fields + beyond the end of the current record. + +Change to missing/memcmp.c to avoid seg. fault on zero length input. + +Updates to test suite (including some inadvertently left out of the last patch) + to invoke sh explicitly (rather than rely on #!/bin/sh) and remove some + junk files. test/chem/good updated to correspond to bug fixes. + +Changes from 2.13.0 to 2.13.1 +----------------------------- + +More configs and PORTS. + +Fixed bug wherein a simple division produced an erroneous FPE, caused by + the Cray division workaround -- that code is now #ifdef'd only for + Cray *and* fixed. + +Fixed bug in modulus implementation -- it was very close to the above + code, so I noticed it. + +Fixed portability problem with limits.h in missing.c + +Fixed portability problem with tzname and daylight -- define TZNAME_MISSING + if strftime() is missing and tzname is also. + +Better support for Latin-1 character set. + +Fixed portability problem in test Makefile. + +Updated PROBLEMS file. + +=============================== gawk-2.13 released ========================= +Changes from 2.12.42 to 2.12.43 +------------------------------- + +Typo in awk.y + +Fixed up strftime.3 and added doc. for %V. + +Changes from 2.12.41 to 2.12.42 +------------------------------- + +Fixed bug in devopen() -- if you had write permission in /dev, + it would just create /dev/stdout etc.!! + +Final (?) VMS update. + +Make NeXT use GFMT_WORKAROUND + +Fixed bug in sub_common() for substitute on zero-length match. Improved the + code a bit while I was at it. + +Fixed grammar so that $i++ parses as ($i)++ + +Put support/* back in the distribution (didn't I already do this?!) + +Changes from 2.12.40 to 2.12.41 +------------------------------- + +VMS workaround for broken %g format. + +Changes from 2.12.39 to 2.12.40 +------------------------------- + +Minor man page update. + +Fixed latent bug in redirect(). + +Changes from 2.12.38 to 2.12.39 +------------------------------- + +Updates to test suite -- remove dependence on changing gawk.1 man page. + +Changes from 2.12.37 to 2.12.38 +------------------------------- + +Fixed bug in use of *= without whitespace following. + +VMS update. + +Updates to man page. + +Option handling updates in main.c + +test/manyfiles redone and added to bigtest. + +Fixed latent (on Sun) bug in handling of save_fs. + +Changes from 2.12.36 to 2.12.37 +------------------------------- + +Update REL in Makefile-dist. Incorporate test suite into main distribution. + +Minor fix in regtest. + +Changes from 2.12.35 to 2.12.36 +------------------------------- + +Release takes on dual personality -- 2.12.36 and 2.13.0 -- any further + patches before public release won't count for 2.13, although they will for + 2.12 -- be careful to avoid confusion! patchlevel.h will be the last thing + to change. + +Cray updates to deal with arithmetic problems. + +Minor test suite updates. + +Fixed latent bug in parser (freeing memory). + +Changes from 2.12.34 to 2.12.35 +------------------------------- + +VMS updates. + +Flush stdout at top of err() and stderr at bottom. + +Fixed bug in eval_condition() -- it wasn't testing for MAYBE_NUM and + doing the force_number(). + +Included the missing manyfiles.awk and a new test to catch the above bug which + I am amazed wasn't already caught by the test suite -- it's pretty basic. + +Changes from 2.12.33 to 2.12.34 +------------------------------- + +Atari updates -- including bug fix. + +More VMS updates -- also nuke vms/version.com. + +Fixed bug in handling of large numbers of redirections -- it was probably never + tested before (blush!). + +Minor rearrangement of code in r_force_number(). + +Made chem and regtest tests a bit more portable (Ultrix again). + +Added another test -- manyfiles -- not invoked under any other test -- very Unix + specific. + +Rough beginning of LIMITATIONS file -- need my AWK book to complete it. + +Changes from 2.12.32 to 2.12.33 +------------------------------- + +Expunge debug.? from various files. + +Remove vestiges of Floor and Ceil kludge. + +Special case integer division -- mainly for Cray, but maybe someone else + will benefit. + +Workaround for iop_close closing an output pipe descriptor on Cray -- + not conditional since I think it may fix a bug on SGI as well and I don't + think it can hurt elsewhere. + +Fixed memory leak in assoc_lookup(). + +Small cleanup in test suite. + +Changes from 2.12.31 to 2.12.32 +------------------------------- + +Nuked debug.c and debugging flag -- there are better ways. + +Nuked version.sh and version.c in subdirectories. + +Fixed bug in handling of IGNORECASE. + +Fixed bug when FIELDWIDTHS was set via -v option. + +Fixed (obscure) bug when $0 is assigned a numerical value. + +Fixed so that escape sequences in command-line assignments work (as it already + said in the comment). + +Added a few cases to test suite. + +Moved support/* back into distribution. + +VMS updates. + +Changes from 2.12.30 to 2.12.31 +------------------------------- + +Cosmetic manual page changes. + +Updated sunos3 config. + +Small changes in test suite including renaming files over 14 chars. in length. + +Changes from 2.12.29 to 2.12.30 +------------------------------- + +Bug fix for many string concatenations in a row. + +Changes from 2.12.28 to 2.12.29 +------------------------------- + +Minor cleanup in awk.y + +Minor VMS update. + +Minor atari update. + +Changes from 2.12.27 to 2.12.28 +------------------------------- + +Got rid of the debugging goop in eval.c -- there are better ways. + +Sequent port. + +VMS changes left out of the last patch -- sigh! config/vms.h renamed + to config/vms-conf.h. + +Fixed missing/tzset.c + +Removed use of gcvt() and GCVT_MISSING -- turns out it was no faster than + sprintf("%g") and caused all sorts of portability headaches. + +Tuned get_field() -- it was unnecessarily parsing the whole record on reference + to $0. + +Tuned interpret() a bit in the rule_node loop. + +In r_force_number(), worked around bug in Uglix strtod() and got rid of + ugly do{}while(0) at Michal's urging. + +Replaced do_deref() and deref with unref(node) -- much cleaner and a bit faster. + +Got rid of assign_number() -- contrary to comment, it was no faster than + just making a new node and freeing the old one. + +Replaced make_number() and tmp_number() with macros that call mk_number(). + +Changed freenode() and newnode() into macros -- the latter is getnode() + which calls more_nodes() as necessary. + +Changes from 2.12.26 to 2.12.27 +------------------------------- + +Completion of Cray 2 port (includes a kludge for floor() and ceil() + that may go or be changed -- I think that it may just be working around + a bug in chem that is being tweaked on the Cray). + +More VMS updates. + +Moved kludge over yacc's insertion of malloc and realloc declarations + from protos.h to the Makefile. + +Added a lisp interpreter in awk to the test suite. (Invoked under + bigtest.) + +Cleanup in r_force_number() -- I had never gotten around to a thorough + profile of the cache code and it turns out to be not worth it. + +Performance boost -- do lazy force_number()'ing for fields etc. i.e. + flag them (MAYBE_NUM) and call force_number only as necessary. + +Changes from 2.12.25 to 2.12.26 +------------------------------- + +Rework of regexp stuff so that dynamic regexps have reasonable + performance -- string used for compiled regexp is stored and + compared to new string -- if same, no recompilation is necessary. + Also, very dynamic regexps cause dfa-based searching to be turned + off. + +Code in dev_open() is back to returning fileno(std*) rather than + dup()ing it. This will be documented. Sorry for the run-around + on this. + +Minor atari updates. + +Minor vms update. + +Missing file from MSDOS port. + +Added warning (under lint) if third arg. of [g]sub is a constant and + handle it properly in the code (i.e. return how many matches). + +Changes from 2.12.24 to 2.12.25 +------------------------------- + +MSDOS port. + +Non-consequential changes to regexp variables in preparation for + a more serious change to fix a serious performance problem. + +Changes from 2.12.23 to 2.12.24 +------------------------------- + +Fixed bug in output flushing introduced a few patches back. This caused + serious performance losses. + +Changes from 2.12.22 to 2.12.23 +------------------------------- + +Accidentally left config/cray2-60 out of last patch. + +Added some missing dependencies to Makefile. + +Cleaned up mkconf a bit; made yacc the default parser (no alloca needed, + right?); added rs6000 hook for signed characters. + +Made regex.c with NO_ALLOCA undefined work. + +Fixed bug in dfa.c for systems where free(NULL) bombs. + +Deleted a few cant_happen()'s that *really* can't hapen. + +Changes from 2.12.21 to 2.12.22 +------------------------------- + +Added to config stuff the ability to choose YACC rather than bison. + +Fixed CHAR_UNSIGNED in config.h-dist. + +Second arg. of strtod() is char ** rather than const char **. + +stackb is now initially malloc()'ed since it may be realloc()'ed. + +VMS updates. + +Added SIZE_T_MISSING to config stuff and a default typedef to awk.h. + (Maybe it is not needed on any current systems??) + +re_compile_pattern()'s size is now size_t unconditionally. + +Changes from 2.12.20 to 2.12.21 +------------------------------- + +Corrected missing/gcvt.c. + +Got rid of use of dup2() and thus DUP_MISSING. + +Updated config/sgi33. + +Turned on (and fixed) in cmp_nodes() the behaviour that I *hope* will be in + POSIX 1003.2 for relational comparisons. + +Small updates to test suite. + +Changes from 2.12.19 to 2.12.20 +------------------------------- + +Sloppy, sloppy, sloppy!! I didn't even try to compile the last two + patches. This one fixes goofs in regex.c. + +Changes from 2.12.18 to 2.12.19 +------------------------------- + +Cleanup of last patch. + +Changes from 2.12.17 to 2.12.18 +------------------------------- + +Makefile renamed to Makefile-dist. + +Added alloca() configuration to mkconf. (A bit kludgey.) Just + add a single line containing ALLOCA_PW, ALLOCA_S or ALLOCA_C + to the appropriate config file to have Makefile-dist edited + accordingly. + +Reorganized output flushing to correspond with new semantics of + devopen() on "/dev/std*" etc. + +Fixed rest of last goof!! + +Save and restore errno in do_pathopen(). + +Miscellaneous atari updates. + +Get rid of the trailing comma in the NODETYPE definition (Cray + compiler won't take it). + +Try to make the use of `const' consistent since Cray compiler is + fussy about that. See the changes to `basename' and `myname'. + +It turns out that, according to section 3.8.3 (Macro Replacement) + of the ANSI Standard: ``If there are sequences of preprocessing + tokens within the list of arguments that would otherwise act as + preprocessing directives, the behavior is undefined.'' That means + that you cannot count on the behavior of the declaration of + re_compile_pattern in awk.h, and indeed the Cray compiler chokes on it. + +Replaced alloca with malloc/realloc/free in regex.c. It was much simpler + than expected. (Inside NO_ALLOCA for now -- by default no alloca.) + +Added a configuration file, config/cray60, for Unicos-6.0. + +Changes from 2.12.16 to 2.12.17 +------------------------------- + +Ooops. Goofed signal use in last patch. + +Changes from 2.12.15 to 2.12.16 +------------------------------- + +RENAMED *_dir to just * (e.g. missing_dir). + +Numerous VMS changes. + +Proper inclusion of atari and vms files. + +Added experimental (ifdef'd out) RELAXED_CONTINUATION and DEFAULT_FILETYPE + -- please comment on these! + +Moved pathopen() to io.c (sigh). + +Put local directory ahead in default AWKPATH. + +Added facility in mkconf to echo comments on stdout: lines beginning + with "#echo " will have the remainder of the line echoed when mkconf is run. + Any lines starting with "#" will otherwise be treated as comments. The + intent is to be able to say: + "#echo Make sure you uncomment alloca.c in the Makefile" + or the like. + +Prototype fix for V.4 + +Fixed version_string to not print leading @(#). + +Fixed FIELDWIDTHS to work with strict (turned out to be easy). + +Fixed conf for V.2. + +Changed semantics of /dev/fd/n to be like on real /dev/fd. + +Several configuration and updates in the makefile. + +Updated manpage. + +Include tzset.c and system.c from missing_dir that were accidently left out of + the last patch. + +Fixed bug in cmdline variable assignment -- arg was getting freed(!) in + call to variable. + +Backed out of parse-time constant folding for now, until I can figure out + how to do it right. + +Fixed devopen() so that getline <"-" works. + +Changes from 2.12.14 to 2.12.15 +------------------------------- + +Changed config/* to a condensed form that can be used with mkconf to generate + a config.h from config.h-dist -- much easier to maintain. Please check + carefully against what you had before for a particular system and report + any problems. vms.h remains separate since the stuff at the bottom + didn't quite fit the mkconf model -- hopefully cleared up later. + +Fixed bug in grammar -- didn't allow function definition to be separated from + other rules by a semi-colon. + +VMS fix to #includes in missing.c -- should we just be including awk.h? + +Updated README for texinfo.tex version. + +Updating of copyright in all .[chy] files. + +Added but commented out Michal's fix to strftime. + +Added tzset() emulation based on Rick Adams' code. Added TZSET_MISSING to + config.h-dist. + +Added strftime.3 man page for missing_dir + +More posix: func, **, **= don't work in -W posix + +More lint: ^, ^= not in old awk + +gawk.1: removed ref to -DNO_DEV_FD, other minor updating. + +Style change: pushbak becomes pushback() in yylex(). + +Changes from 2.12.13 to 2.12.14 +------------------------------- + +Better (?) organization of awk.h -- attempt to keep all system dependencies + near the top and move some of the non-general things out of the config.h + files. + +Change to handling of SYSTEM_MISSING. + +Small change to ultrix config. + +Do "/dev/fd/*" etc. checking at runtime. + +First pass at VMS port. + +Improvements to error handling (when lexeme spans buffers). + +Fixed backslash handling -- why didn't I notice this sooner? + +Added programs from book to test suite and new target "bigtest" to Makefile. + +Changes from 2.12.12 to 2.12.13 +------------------------------- + +Recognize OFS and ORS specially so that OFS = 9 works without efficiency hit. + Took advantage of opportunity to tune do_print*() for about 10% win on a + print with 5 args (i.e. small but significant). + +Somewhat pervasive changes to reconcile CONVFMT vs. OFMT. + +Better initialization of builtin vars. + +Make config/* consistent wrt STRTOL_MISSING. + +Small portability improvement to alloca.s + +Improvements to lint code in awk.y + +Replaced strtol() with a better one by Chris Torek. + +Changes from 2.12.11 to 2.12.12 +------------------------------- + +Added PORTS file to record successful ports. + +Added #define const to nothing if not STDC and added const to strtod() header. + +Added * to printf capabilities and partially implemented ' ' and '+' (has an + effect for %d only, silently ignored for other formats). I'm afraid that's + as far as I want to go before I look at a complete replacement for + do_sprintf(). + +Added warning for /regexp/ on LHS of MATCHOP. + +Changes from 2.12.10 to 2.12.11 +------------------------------- + +Small Makefile improvements. + +Some remaining nits from the NeXT port. + +Got rid of bcopy() define in awk.h -- not needed anymore (??) + +Changed private in builtin.c -- it is special on Sequent. + +Added subset implementation of strtol() and STRTOL_MISSING. + +A little bit of cleanup in debug.c, dfa.c. + +Changes from 2.12.9 to 2.12.10 +------------------------------ + +Redid compatability checking and checking for # of args. + +Removed all references to variables[] from outside awk.y, in preparation + for a more abstract interface to the symbol table. + +Got rid of a remaining use of bcopy() in regex.c. + +Changes from 2.12.8 to 2.12.9 +----------------------------- + +Portability improvements for atari, next and decstation. + +Bug fix in substr() -- wasn't handling 3rd arg. of -1 properly. + +Manpage updates. + +Moved support from src release to doc release. + +Updated FUTURES file. + +Added some "lint" warnings. + +Changes from 2.12.7 to 2.12.8 +----------------------------- + +Changed time() to systime(). + +Changed warning() in snode() to fatal(). + +strftime() now defaults second arg. to current time. + +Changes from 2.12.6 to 2.12.7 +----------------------------- + +Fixed bug in sub_common() involving inadequate allocation of a buffer. + +Added some missing files to the Makefile. + +Changes from 2.12.5 to 2.12.6 +----------------------------- + +Fixed bug wherein non-redirected getline could call iop_close() just + prior to a call from do_input(). + +Fixed bug in handling of /dev/stdout and /dev/stderr. + +Changes from 2.12.4 to 2.12.5 +----------------------------- + +Updated README and support directory. + +Changes from 2.12.3 to 2.12.4 +----------------------------- + +Updated CHANGES and TODO (should have been done in previous 2 patches). + +Changes from 2.12.2 to 2.12.3 +----------------------------- + +Brought regex.c and alloca.s into line with current FSF versions. + +Changes from 2.12.1 to 2.12.2 +----------------------------- + +Portability improvements; mostly moving system prototypes out of awk.h + +Introduction of strftime. + +Use of CONVFMT. + +Changes from 2.12 to 2.12.1 +----------------------------- + +Consolidated treatment of command-line assignments (thus correcting the +-v treatment). + +Rationalized builtin-variable handling into a table-driven process, thus +simplifying variable() and eliminating spc_var(). + +Fixed bug in handling of command-line source that ended in a newline. + +Simplified install() and lookup(). + +Did away with double-mallocing of identifiers and now free second and later +instances of a name, after the first gets installed into the symbol table. + +Treat IGNORECASE specially, simplifying a lot of code, and allowing +checking against strict conformance only on setting it, rather than on each +pattern match. + +Fixed regexp matching when IGNORECASE is non-zero (broken when dfa.c was +added). + +Fixed bug where $0 was not being marked as valid, even after it was rebuilt. +This caused mangling of $0. + + +Changes from 2.11.1 to 2.12 +----------------------------- + +Makefile: + +Portability improvements in Makefile. +Move configuration stuff into config.h + +FSF files: + +Synchronized alloca.[cs] and regex.[ch] with FSF. + +array.c: + +Rationalized hash routines into one with a different algorithm. +delete() now works if the array is a local variable. +Changed interface of assoc_next() and avoided dereferencing past the end of the + array. + +awk.h: + +Merged non-prototype and prototype declarations in awk.h. +Expanded tree_eval #define to short-circuit more calls of r_tree_eval(). + +awk.y: + +Delinted some of the code in the grammar. +Fixed and improved some of the error message printing. +Changed to accomodate unlimited length source lines. +Line continuation now works as advertised. +Source lines can be arbitrarily long. +Refined grammar hacks so that /= assignment works. Regular expressions + starting with /= are recognized at the beginning of a line, after && or || + and after ~ or !~. More contexts can be added if necessary. +Fixed IGNORECASE (multiple scans for backslash). +Condensed expression_lists in array references. +Detect and warn for correct # args in builtin functions -- call most of them + with a fixed number (i.e. fill in defaults at parse-time rather than at + run-time). +Load ENVIRON only if it is referenced (detected at parse-time). +Treat NF, FS, RS, NR, FNR specially at parse time, to improve run time. +Fold constant expressions at parse time. +Do make_regexp() on third arg. of split() at parse tiem if it is a constant. + +builtin.c: + +srand() returns 0 the first time called. +Replaced alloca() with malloc() in do_sprintf(). +Fixed setting of RSTART and RLENGTH in do_match(). +Got rid of get_{one,two,three} and allowance for variable # of args. at + run-time -- this is now done at parse-time. +Fixed latent bug in [g]sub whereby changes to $0 would never get made. +Rewrote much of sub_common() for simplicity and performance. +Added ctime() and time() builtin functions (unless -DSTRICT). ctime() returns + a time string like the C function, given the number of seconds since the epoch + and time() returns the current time in seconds. +do_sprintf() now checks for mismatch between format string and number of + arguments supplied. + +dfa.c + +This is borrowed (almost unmodified) from GNU grep to provide faster searches. + +eval.c + +Node_var, Node_var_array and Node_param_list handled from macro rather + than in r_tree_eval(). +Changed cmp_nodes() to not do a force_number() -- this, combined with a + force_number() on ARGV[] and ENVIRON[] brings it into line with other awks +Greatly simplified cmp_nodes(). +Separated out Node_NF, Node_FS, Node_RS, Node_NR and Node_FNR in get_lhs(). +All adjacent string concatenations now done at once. + +field.c + +Added support for FIELDWIDTHS. +Fixed bug in get_field() whereby changes to a field were not always + properly reflected in $0. +Reordered tests in parse_field() so that reference off the end of the buffer + doesn't happen. +set_FS() now sets *parse_field i.e. routine to call depending on type of FS. +It also does make_regexp() for FS if needed. get_field() passes FS_regexp + to re_parse_field(), as does do_split(). +Changes to set_field() and set_record() to avoid malloc'ing and free'ing the + field nodes repeatedly. The fields now just point into $0 unless they are + assigned to another variable or changed. force_number() on the field is + *only* done when the field is needed. + +gawk.1 + +Fixed troff formatting problem on .TP lines. + +io.c + +Moved some code out into iop.c. +Output from pipes and system() calls is properly synchronized. +Status from pipe close properly returned. +Bug in getline with no redirect fixed. + +iop.c + +This file contains a totally revamped get_a_record and associated code. + +main.c + +Command line programs no longer use a temporary file. +Therefore, tmpnam() no longer required. +Deprecated -a and -e options -- they will go away in the next release, + but for now they cause a warning. +Moved -C, -V, -c options to -W ala posix. +Added -W posix option: throw out \x +Added -W lint option. + + +node.c + +force_number() now allows pure numerics to have leading whitespace. +Added make_string facility to optimize case of adding an already malloc'd + string. +Cleaned up and simplified do_deref(). +Fixed bug in handling of stref==255 in do_deref(). + +re.c + +contains the interface to regexp code + +Changes from 2.11.1 to FSF version of same +------------------------------------------ +Thu Jan 4 14:19:30 1990 Jim Kingdon (kingdon at albert) + + * Makefile (YACC): Add -y to bison part. + + * missing.c: Add #include . + +Sun Dec 24 16:16:05 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu) + + * Makefile: Add (commented out) default defines for Sony News. + + * awk.h: Move declaration of vprintf so it will compile when + -DVPRINTF_MISSING is defined. + +Mon Nov 13 18:54:08 1989 Robert J. Chassell (bob at apple-gunkies.ai.mit.edu) + + * gawk.texinfo: changed @-commands that are not part of the + standard, currently released texinfmt.el to those that are. + Otherwise, only people with the as-yet unreleased makeinfo.c can + format this file. + +Changes from 2.11beta to 2.11.1 (production) +-------------------------------------------- + +Went from "beta" to production status!!! + +Now flushes stdout before closing pipes or redirected files to +synchronize output. + +MS-DOS changes added in. + +Signal handler return type parameterized in Makefile and awk.h and +some lint removed. debug.c cleaned up. + +Fixed FS splitting to never match null strings, per book. + +Correction to the manual's description of FS. + +Some compilers break on char *foo = "string" + 4 so fixed version.sh and +main.c. + +Changes from 2.10beta to 2.11beta +--------------------------------- + +This release fixes all reported bugs that we could reproduce. Probably +some of the changes are not documented here. + +The next release will probably not be a beta release! + +The most important change is the addition of the -nostalgia option. :-) + +The documentation has been improved and brought up-to-date. + +There has been a lot of general cleaning up of the code that is not otherwise +documented here. There has been a movement toward using standard-conforming +library routines and providing them (in missing.d) for systems lacking them. +Improved (hopefully) configuration through Makfile modifications and missing.c. +In particular, straightened out confusion over vprintf #defines, declarations +etc. + +Deleted RCS log comments from source, to reduce source size by about one third. +Most of them were horribly out-of-date, anyway. + +Renamed source files to reflect (for the most part) their contents. + +More and improved error messages. Cleanup and fixes to yyerror(). +String constants are not altered in input buffer, so error messages come out +better. Fixed usage message. Make use of ANSI C strerror() function +(provided). + +Plugged many more memory leaks. The memory consumption is now quite +reasonable over a wide range of programs. + +Uses volatile declaration if STDC > 0 to avoid problems due to longjmp. + +New -a and -e options to use awk or egrep style regexps, respectively, +since POSIX says awk should use egrep regexps. Default is -a. + +Added -v option for setting variables before the first file is encountered. +Version information now uses -V and copyleft uses -C. + +Added a patchlevel.h file and its use for -V and -C. + +Append_right() optimized for major improvement to programs with a *lot* +of statements. + +Operator precedence has been corrected to match draft Posix. + +Tightened up grammar for builtin functions so that only length +may be called without arguments or parentheses. + +/regex/ is now a normal expression that can appear in any expression +context. + +Allow /= to begin a regexp. Allow ..[../..].. in a regexp. + +Allow empty compound statements ({}). + +Made return and next illegal outside a function and in BEGIN/END respectively. + +Division by zero is now illegal and causes a fatal error. + +Fixed exponentiation so that x ^ 0 and x ^= 0 both return 1. + +Fixed do_sqrt, do_log, and do_exp to do argument/return checking and +print an error message, per the manual. + +Fixed main to catch SIGSEGV to get source and data file line numbers. + +Fixed yyerror to print the ^ at the beginning of the bad token, not the end. + +Fix to substr() builtin: it was failing if the arguments +weren't already strings. + +Added new node value flag NUMERIC to indicate that a variable is +purely a number as opposed to type NUM which indicates that +the node's numeric value is valid. This is set in make_number(), +tmp_number and r_force_number() when appropriate and used in +cmp_nodes(). This fixed a bug in comparison of variables that had +numeric prefixes. The new code uses strtod() and eliminates is_a_number(). +A simple strtod() is provided for systems lacking one. It does no +overflow checking, so could be improved. + +Simplification and efficiency improvement in force_string. + +Added performance tweak in r_force_number(). + +Fixed a bug with nested loops and break/continue in functions. + +Fixed inconsistency in handling of empty fields when $0 has to be rebuilt. +Happens to simplify rebuild_record(). + +Cleaned up the code associated with opening a pipe for reading. Gawk +now has its own popen routine (gawk_popen) that allocates an IOBUF +and keeps track of the pid of the child process. gawk_pclose +marks the appropriate child as defunct in the right struct redirect. + +Cleaned up and fixed close_redir(). + +Fixed an obscure bug to do with redirection. Intermingled ">" and ">>" +redirects did not output in a predictable order. + +Improved handling of output buffering: now all print[f]s redirected to a tty +or pipe are flushed immediately and non-redirected output to a tty is flushed +before the next input record is read. + +Fixed a bug in get_a_record() where bcopy() could have copied over +a random pointer. + +Fixed a bug when RS="" and records separated by multiple blank lines. + +Got rid of SLOWIO code which was out-of-date anyway. + +Fix in get_field() for case where $0 is changed and then $(n) are +changed and then $0 is used. + +Fixed infinite loop on failure to open file for reading from getline. +Now handles redirect file open failures properly. + +Filenames such as /dev/stdin now allowed on the command line as well as +in redirects. + +Fixed so that gawk '$1' where $1 is a zero tests false. + +Fixed parsing so that `RLENGTH -1' parses the same as `RLENGTH - 1', +for example. + +The return from a user-defined function now defaults to the Null node. +This fixes a core-dump-causing bug when the return value of a function +is used and that function returns no value. + +Now catches floating point exceptions to avoid core dumps. + +Bug fix for deleting elements of an array -- under some conditions, it was +deleting more than one element at a time. + +Fix in AWKPATH code for running off the end of the string. + +Fixed handling of precision in *printf calls. %0.2d now works properly, +as does %c. [s]printf now recognizes %i and %X. + +Fixed a bug in printing of very large (>240) strings. + +Cleaned up erroneous behaviour for RS == "". + +Added IGNORECASE support to index(). + +Simplified and fixed newnode/freenode. + +Fixed reference to $(anything) in a BEGIN block. + +Eliminated use of USG rand48(). + +Bug fix in force_string for machines with 16-bit ints. + +Replaced use of mktemp() with tmpnam() and provided a partial implementation of +the latter for systems that don't have it. + +Added a portability check for includes in io.c. + +Minor portability fix in alloc.c plus addition of xmalloc(). + +Portability fix: on UMAX4.2, st_blksize is zero for a pipe, thus breaking +iop_alloc() -- fixed. + +Workaround for compiler bug on Sun386i in do_sprintf. + +More and improved prototypes in awk.h. + +Consolidated C escape parsing code into one place. + +strict flag is now turned on only when invoked with compatability option. +It now applies to fewer things. + +Changed cast of f._ptr in vprintf.c from (unsigned char *) to (char *). +Hopefully this is right for the systems that use this code (I don't). + +Support for pipes under MSDOS added. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/PROBLEMS b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/PROBLEMS new file mode 100644 index 0000000..072d56e --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/PROBLEMS @@ -0,0 +1,15 @@ + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. + +This is a list of known problems in gawk 3.1. +I don't know when this will be fixed, if ever. See also FUTURES +and the gawk.texi doc for other things that need doing. + +1. The interactions with the lexer and yyerror need reworking. It is possible + to get line numbers that are one line off if --compat or --posix is + true and either `nextfile' or `delete array' are used. + + Really the whole lexical analysis stuff needs reworking. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README new file mode 100644 index 0000000..1206429 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README @@ -0,0 +1,113 @@ + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. + +README: + +This is GNU Awk 3.1.6. It is upwardly compatible with the Bell Labs +research version of awk. It is almost completely compliant with the +2004 POSIX 1003.1 standard for awk. (See the note below about POSIX.) + +This is a bug fix release. See NEWS and ChangeLog for details. + +Work to be done is described briefly in the FUTURES file. Changes in this +version are summarized in the NEWS file. Please read the LIMITATIONS file. + +Read the file POSIX.STD for a discussion of issues where the standard +says one thing but gawk does something different. + +To format the documentation with TeX, use at least version 2000-10-27.17 +of texinfo.tex. There is a usable copy of texinfo.tex in the doc directory. + +INSTALLATION: + +Check whether there is a system-specific README file for your system under +the `README_d' directory. If there's something there that you should +have read and didn't, and you bug me about it, I'm going to yell at you. + +See the file INSTALL for installation instructions. + +If you have neither bison nor yacc, use the awkgram.c file here. It was +generated with bison, and has no proprietary code in it. (Note that +modifying awkgram.y without bison or yacc will be difficult, at best. +You might want to get a copy of bison from the FSF too.) + +If you have a Windows32, MS-DOS or OS/2 system, use the stuff in the `pc' +directory. Similarly, there is a separate directory for VMS. + +Ports for the Atari and old Tandem systems are supplied, but they are +unsupported. Thus, their code appears in the `unsupported' directory. + +Appendix B of ``GAWK: Effective Awk Programming'' discusses configuration +in detail. The configuration process is based on GNU Autoconf and +Automake. + +After successful compilation, do `make check' to run the test suite. +There should be no output from the `cmp' invocations except in the +cases where there are small differences in floating point values, and +possibly in the case of strftime. Several of the tests ignore errors +on purpose; those are not a problem. If there are other differences, +please investigate and report the problem. + +PRINTING THE MANUAL + +The `doc' directory contains a recent version of texinfo.tex, which will +be necessary for printing the manual. Use `make dvi' to get a DVI file +from the manual. In the `doc' directory, use `make postscript' to get +PostScript versions of the manual, the man page, and the reference card. + +BUG REPORTS AND FIXES (Un*x systems): + +Please coordinate changes through Arnold Robbins. In particular, see +the section in the manual on reporting bugs. Note that comp.lang.awk +is about the worst place to post a gawk bug report. Please, use the +mechanisms outlined in the manual. + +Email should be sent to bug-gawk@gnu.org. This address sends mail to +Arnold Robbins and the general GNU utilities bug list. The advantage +to using this address is that bug reports are archived at GNU Central. + +Arnold Robbins + +BUG REPORTS AND FIXES, non-Unix systems: + +Amiga: + Fred Fish + fnf@ninemoons.com + +Alpha/Linux: + Michal Jaegermann + michal@gortel.phys.ualberta.ca + +BeOS: + Martin Brown + mc@whoever.com + +MS-DOS: + Scott Deifik + scottd.mail@sbcglobal.net + + Darrel Hankerson + hankedr@mail.auburn.edu + +MS-Windows: + Juan Grigera + juan@biophnet.unlp.edu.ar + +OS/2: + andreas.buening@@nexgo.de + +Tandem: + Stephen Davies + scldad@sdc.com.au + (Original Tandem port) + + Ralf Wildenhues + + POSIX-compliant Tandem systems + +VMS: + Pat Rankin + rankin@pactechdata.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.FIRST b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.FIRST new file mode 100644 index 0000000..4957cb3 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.FIRST @@ -0,0 +1,21 @@ +Sat Feb 18 23:07:55 EST 1995 + +Starting with 2.15.6, gawk will preserve the value of NF and $0 for +the last record read into the END rule(s). This is important to you +if your program uses + + print + +in an END rule to mean + + print "" + +(i.e., print nothing). Examine your awk programs carefully to make sure +that they use `print ""' instead of `print', otherwise you will get +strange results. + +If you send me email about this, without having read this +file, I will yell at you. + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.linux b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.linux new file mode 100644 index 0000000..9ba15c5 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.linux @@ -0,0 +1,21 @@ +Thu Apr 17 14:41:17 EDT 1997 + +Some Linux systems, notably RedHat systems through RedHat 4.1, have the +symbolic links for /dev/stdin and /dev/stdout messed up. Specifically, +/dev/stdin is linked to ../proc/self/fd/1 and /dev/stdout to +../proc/self/fd/0. This is backwards. This causes strange behavior +when using those files from within gawk. + +Removing and redoing the symlinks fixes the problem. It is fixed in +post-4.1 RedHat Linux. + +Arnold Robbins +arnold@skeeve.com + +Sun Aug 3 15:07:06 EDT 1997 + +As of version 3.1 of gawk, this is no longer a problem, since gawk now +completely interprets the special file names internally. + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sco b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sco new file mode 100644 index 0000000..71494b7 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sco @@ -0,0 +1,67 @@ +Tue Dec 24 22:41:39 EST 1996 + +SCO's awk has a -e option which is similar to gawk's --source option, +allowing you to specify the script anywhere on the awk command line. + +This can be a problem, since gawk will install itself as `awk' in +$(bindir). If this is ahead of /bin and /usr/bin in the search path, +several of SCO's scripts that use -e will break, since gawk does not +accept this option. + +The solution is simple. After doing a `make install', do: + + rm -f /usr/local/bin/awk # or wherever it is installed. + +This removes the `awk' symlink so that SCO's programs will continue +to work. + +If you complain to me about this, I will fuss at you for not having +done your homework. + +Arnold Robbins +arnold@skeeve.com + +--------------------------- +Date: 14 Oct 1997 12:17 +0000 +From: Leigh Hebblethwaite +To: bug-gnu-utils@prep.ai.mit.edu + +I've just built gawk 3.0.3 on my system and have experienced a problem +with the routine pipeio2.awk in the test suite. However the problem +appears to be in the tr command rather than gawk. + +I'm using SCO Open Server 5. On the version I have there appears to be +a problem with tr such that: + + tr [0-9]. ........... + +does NOT translate 9s. This means that the output from: + + echo " 5 6 7 8 9 10 11" | tr [0-9]. ........... + +is: + + . . . . 9 .. .. + +This problem causes the pipeio2 test to be reported as a failure. + +Note that the following variation on the tr command works fine: + + tr 0123456789. ........... + +For your info the details of my system are summarised by the out put +of the uname -X command, which is: + +System = SCO_SV +Node = sgscos5 +Release = 3.2v5.0.2 +KernelID = 96/01/23 +Machine = Pentium +BusType = EISA +Serial = 4EC023443 +Users = 5-user +OEM# = 0 +Origin# = 1 +NumCPU = 1 + + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sony b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sony new file mode 100644 index 0000000..29ba875 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.sony @@ -0,0 +1,12 @@ +Sun Jan 19 23:13:50 EST 1997 + +> Machine: SONY NWS-5000 (MIPS r4000) +> OS : NEWS-OS 4.2.1 (4.3BSD compatible) +> This OS doesn't have `uname' +> Tools : gcc-2.7.2.1, bison-1.25, cmp-2.7, bash-2.0 + +This system has the same problem with the test/tweakfld case that Ultrix MIPS +has. See the README.ultrix file for details. + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.ultrix b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.ultrix new file mode 100644 index 0000000..917f02f --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.ultrix @@ -0,0 +1,46 @@ +When compiling on DECstation running Ultrix 4.0 a command 'cc -c -O +regex.c' is causing an infinite loop in an optimizer. Other sources +compile fine with -O flag. If you are going to use this flag either +add a special rule to Makefile for a compilation of regex.c, or issue +'cc -c regex.c' before hitting 'make'. + +From: Steve Simmons +Subject: Non-bug report on gawk 2.13.2 +To: david@cs.dal.ca, arnold@skeeve.atl.ga.us +Date: Thu, 25 Jul 1991 13:45:38 -0300 + +Just fyi -- it passes tests with flying colors under Ultrix 4.2. The +README.ultrix file applies more than ever. You might want to add +these paragraphs to it: + + As of Ultrix 4.2 the optimise works for regex.c, but you must give an + additional switch to get everything optimised. Using '-Olimit 1500' + does the job. Without the switch gawk will compile and run correctly, + but you will get complaints about lost optimisations in builtin.c, + awk.tab.c and regex.c. + +From: Arnold Robbins +Date: Sun Sep 8 07:05:07 EDT 1996 + +On Decstations using Ultrix 4.3, the tweakfld test case will fail. It +appears that routines in the math library return very small but non-zero +numbers in cases where most other systems return zero. + +From: Juergen Kahrs +Date: Wed Jan 17 13:15:34 MET 2001 + +On Ultrix 4.3, configure like this: + + ./configure --disable-nls + +In custom.h, we defined HAVE_MKTIME in order to avoid a linker error. +If you compile with + + make check + +every test will pass, except for the badargs test: + + *** Error code 1 (ignored) + +This shouldnt cause problems. + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.yacc b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.yacc new file mode 100644 index 0000000..6332986 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/OBSOLETE/README.yacc @@ -0,0 +1,10 @@ +Sat Jan 28 22:07:17 EST 1995 + +Some older versions of yacc (notably Ultrix's) have limits on the depth +of the parse stack. This only shows up when gawk is dealing with deeply +nested control structures, such as those in `awf'. + +The problem goes away if you use either bison or Berkeley yacc. + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.VMS b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.VMS new file mode 100644 index 0000000..4d19398 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.VMS @@ -0,0 +1,81 @@ + +Compiling GAWK on VMS: + + There's a DCL command procedure that will issue all the necessary +CC and LINK commands, and there's also a Makefile for use with the MMS +utility. From the source directory, use either + |$ @[.VMS]VMSBUILD.COM +or + |$ MMS/DECRIPTION=[.VMS]DECSRIP.MMS GAWK + +DEC C -- use either vmsbuild.com or descrip.mms as is. +VAX C -- use `@vmsbuild VAXC' or `MMS/MACRO=("VAXC")'. On a system + with both VAX C and DEC C installed where DEC C is the default, + use `MMS/MACRO=("VAXC","CC=CC/VAXC")' for the MMS variant; for + the vmsbuild.com variant, any need for `/VAXC' will be detected + automatically. +GNU C -- use `@vmsbuild GNUC' or `MMS/MACRO=("GNUC")'. On a system + where the GCC command is not already defined, use either + `@vmsbuild GNUC DO_GNUC_SETUP' or + `MMS/MACRO=("GNUC","DO_GNUC_SETUP")'. + + Tested under Alpha/VMS V7.1 using DEC C V6.4. GAWK should work +without modifications for VMS V4.6 and up. + + +Installing GAWK on VMS: + + All that's needed is a 'foreign' command, which is a DCL symbol +whose value begins with a dollar sign. + |$ GAWK :== $device:[directory]GAWK +(Substitute the actual location of gawk.exe for 'device:[directory]'.) +That symbol should be placed in the user's login.com or in the system- +wide sylogin.com procedure so that it will be defined every time the +user logs on. + + Optionally, the help entry can be loaded into a VMS help library. + |$ LIBRARY/HELP SYS$HELP:HELPLIB [.VMS]GAWK.HLP +(You may want to substitute a site-specific help library rather than +the standard VMS library 'HELPLIB'.) After loading the help text, + |$ HELP GAWK +will provide information about both the gawk implementation and the +awk programming language. + + The logical name AWK_LIBRARY can designate a default location +for awk program files. For the '-f' option, if the specified filename +has no device or directory path information in it, Gawk will look in +the current directory first, then in the directory specified by the +translation of AWK_LIBRARY if it the file wasn't found. If the file +still isn't found, then ".awk" will be appended and the file access +will be re-tried. If AWK_LIBRARY is not defined, that portion of the +file search will fail benignly. + + +Running GAWK on VMS: + + Command line parsing and quoting conventions are significantly +different on VMS, so examples in _The_GAWK_Manual_ or the awk book +often need minor changes. They *are* minor though, and all the awk +programs should run correctly. + + Here are a couple of trivial tests: + |$ gawk -- "BEGIN {print ""Hello, World!""}" + |$ gawk -"W" version !could also be -"W version" or "-W version" +Note that upper- and mixed-case text must be quoted. + + The VMS port of Gawk includes a DCL-style interface in addition +to the original shell-style interface. See the help entry for details. +One side-effect of dual command line parsing is that if there's only a +single parameter (as in the quoted string program above), the command +becomes ambiguous. To work-around this, the normally optional "--" +flag is required to force shell rather than DCL parsing. If any other +dash-type options (or multiple parameters such as data files to be +processed) are present, there is no ambiguity and "--" can be omitted. + + The logical name AWKPATH can be used to override the default +search path of "SYS$DISK:[],AWK_LIBRARY:" when looking for awk program +files specified by the '-f' option. The format of AWKPATH is a comma- +separated list of directory specifications. When defining it, the +value should be quoted so that it retains a single translation, not a +multi-translation RMS searchlist. + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.aix b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.aix new file mode 100644 index 0000000..283d387 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.aix @@ -0,0 +1,6 @@ +Tue Mar 11 13:21:26 IST 2003 +============================ + +On AIX 4.2 systems, you need: + + ./configure --disable-nls && make all check install diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.atari b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.atari new file mode 100644 index 0000000..0c7fd74 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.atari @@ -0,0 +1,26 @@ +Sun May 2 18:40:46 IDT 1999 + +See the README.1st file in the atari directory. + +-------------------------------------------------------- +Gawk on the Atari has been compiled and tested using gcc, both +with and without -mshort flag. Other compilers can be used but if +sizeof(pointer) != sizeof(int) this code will not compile correctly +with a non-ANSI compiler (prototypes and library). + +Compiled executables were tested and passed successfully a test suite +similar to 'make test'. Required changes are minor and minor +modifications are due to differences in environment and/or shell. If +a need will arise a modified test suite with a driving Makefile (for +gulam) is available on a request from Michal Jaegermann, +michal@gortel.phys.ualberta.ca or michal@ellpspace.math.ualberta.ca, +via e-mail. + +Sample files atari/Makefile.st, atari/Makefile.awklib and +atari/config.h assume gcc compilation and execution under TOS; it is +likely that one would want to change it for another setup. If they +are ok then copy atari/Makefile.st to Makefile, atari/config.h to +config.h and atari/Makefile.awklib to awklib/Makefile.. Pay attention +to code fragments bracketed by '#ifdef atarist ... #endif'. These +modifications may not be required/desired with a different OS and/or +libraries. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.beos b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.beos new file mode 100644 index 0000000..e0a8189 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.beos @@ -0,0 +1,86 @@ +README for GNU awk under BeOS +Last updated MCB, Tue Feb 6 10:15:46 GMT 2001 + +BeOS port contact: Martin C Brown (mc@whoever.com) + +Building/Installing +-------------------------- + +Since BeOS DR9, all the tools that you should need to build gawk are now +included with BeOS. The process is basically identical to the Unix process +of running configure and then make. Full instructions are given below: + +You can compile gawk under BeOS by extracting the standard sources, +and running the configure script. You MUST specify the location prefix +for the installation directory. Under BeOS DR9 and beyond the best +directory to use is /boot/home/config, so the configure command +would be: + +$ configure --prefix=/boot/home/config + +This will install the compiled application into /boot/home/config/bin, +which is already specified in the standard PATH. + +Once the configuration process has been completed, you can run make and +then make install: + +$ make +.... +$ make install + +Socket Notes +---------------------- + +Due to the socket implementation under BeOS not all of the features under +gawk's socket implementation may work properly. In particular: + + BeOS does not support a BSD SO_LINGER option, so sockets cannot remain + open after a close if data is still present on the incoming buffer. + + BeOS does not allow data to be read from a socket without removing the data + from the buffer (peek). If you need to use this feature in gawk, create a + separate input buffer and peek into your own copy, rather than the OS version. + + BeOS does not support RAW socket connections, only UDP or TCP. + +Note that these are BeOS Unix-layer compatibility problems, and only affect certain +aspects of network communication. Most socket based gawk scripts, and any scripts +that do not rely on sockets should work fine (excepting any other notes in this section). + +File Handle Notes +--------------------------- + +Expect the multiple file test (when running make check) to fail. The reason for this is +explained in the email shown below: + +------------------------------------------------------- +From mc@whoever.com Sun Jul 23 17:06:38 2000 +Date: Sun, 23 Jul 2000 07:23:49 +0100 +Subject: Re: gawk-3.0.5 results on BeOS +From: Martin C Brown +To: Aharon Robbins , + +Arnold/Bruno, + +> This is a known BeOS problem. I am cc'ing the BeOS port person. +> Sorry I don't have a fix. + +This problem is directly related to the FOPEN_MAX/OPEN_MAX parameter used in +the stdio library by the BeOS. It seems that the BeOS strictly enforces this +number to the point that opening the 128th file causes all previously opened +files (except stdin/out/err) to be closed - hence the bad number. + +I've tried this outside of gawk and the same thing happens, so it's not a +gawk problem. + +I've spent the past few days trying to find a suitable workaround, but it's +obviously difficult trying to patch a kernel from the outside :)) + +I'll be reporting this as a bug to Be shortly. + +MC + +-- +Martin 'MC' Brown, mc@mcslp.com http://www.mcwords.com +Writer, Author, Consultant +'Life is pain, anyone who says differently is selling something' diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.cygwin-dynamic b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.cygwin-dynamic new file mode 100644 index 0000000..948538f --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.cygwin-dynamic @@ -0,0 +1,88 @@ +From: courierdavid@hotmail.com +Newsgroups: comp.lang.awk +Subject: Re: Compiling gawk extensions under Cygwin +Date: 14 Mar 2005 20:47:09 -0800 +Organization: http://groups.google.com +Lines: 67 +Message-ID: <1110862029.175727.109280@o13g2000cwo.googlegroups.com> +References: <1e4e8dbe.0501140813.18248833@posting.google.com> + +NNTP-Posting-Host: 194.237.142.24 +Mime-Version: 1.0 +Content-Type: text/plain; charset="iso-8859-1" +X-Trace: posting.google.com 1110862033 8921 127.0.0.1 (15 Mar 2005 04:47:13 GMT) +X-Complaints-To: groups-abuse@google.com +NNTP-Posting-Date: Tue, 15 Mar 2005 04:47:13 +0000 (UTC) +User-Agent: G2/0.2 +Complaints-To: groups-abuse@google.com +Injection-Info: o13g2000cwo.googlegroups.com; posting-host=194.237.142.24; + posting-account=Iz4C5wwAAABx1yG_ft8eEAI99Wu1Tku1 +Path: news.012.net.il!seanews2.seabone.net!newsfeed.albacom.net!news.mailgate.org!newsfeed.stueberl.de!proxad.net!64.233.160.134.MISMATCH!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail +Xref: news.012.net.il comp.lang.awk:21835 + +Thanks for your help there Michael. I wouldn't have thought of that one +myself without your help :-) + +Anyway - for those who must stick with Cygwin here's a method that +works using the mingw32 makefiles and some modifications: + +Basically you need to extract all exportable symbol names from the +gawk.exe file into a text file and then create a dummy library file +which we can link against on Cygwin. You then throw the library file +away because in reality we use the gawk.exe file as the provider of +those functions. + +1. First grab the gawk source, e.g. gawk-3.1.4.tar.bz2 and decompress +it. +2. Move to the gawk-3.1.4 directory you just created. +3. cp pc/* . (copy the pc directory into the main one) +4. edit makefile - uncomment lines "DYN_FLAGS", "DYN_EXP", "DYN_OBJ" +and "DYN_MAKEXP=$(DMEmingw32) +5. make mingw32 (make a gawk.exe) +6. run "gcc -o gawk.exe array.o builtin.o eval.o field.o gawkmisc.o +io.o main.o ext.o msg.o node.o profile.o re.o version.o dlfcn.o +gawk.exp awkgram.o getid.o popen.o getopt.o getopt1.o dfa.o regex.o +random.o" (i.e. remove the -s from the compile command from the +makefile so the symbols are left in gawk.exe) + +now export all symbols from gawk.exe into foo.def so that we can put +these in our library +7. echo EXPORTS > foo.def +8. nm gawk.exe | grep -E ' [TBD] _' | sed 's/.* [TBD] _//' >> foo.def +9. cp foo.def gawkw32.def + +build the new library with all symbols included +10. make mingw32 + +Now you will see a file "libgawk.a" which you can link against to +create extensions. For example to build an extension called "file" run: + +gcc -shared -dll -DHAVE_CONFIG_H -I . extension/file.c -o file.dll -L . +-lgawk + +Then you can load it in gawk using the expression: + +extension("./file.dll", "dlload"); + +You must use the gawk you compiled from source though. It won't work +with any other gawk unfortunately :-( But that's OK because the +stripped gawk is not too big in size. + +Cheers, +Dave. + +Michael Heiming wrote: +> In comp.lang.awk David Smith : +> > Has anyone managed to compile gawk extensions (such as "filefuncs") +> > under Cygwin? +> +> Solution is pretty simple, install a real OS, Linux/*BSD or any +> other unix and this and further problems won't happen. +> +> Good luck +> +> -- +> Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94) +> mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/' +> #bofh excuse 242: Software uses US measurements, but the OS +> is in metric... diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.hpux b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.hpux new file mode 100644 index 0000000..78e6f35 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.hpux @@ -0,0 +1,78 @@ +Wed Jul 28 16:28:42 IDT 2004 +============================ +As of gawk 3.1.4, configure should correctly handle HP-UX and +I18N issues. -- Arnold +-------------------------------------------------------------- +2003-12-10 15:19:38 EST +Michael Elizabeth Chastain + +I built and tested gawk on hppa-hp-hpux11.11 and ia64-hp-hpux11.23. +All the tests in the test suite passed. + +I built with these compilers: + + gcc 3.3.2 + hp ansi C from /opt/ansic/bin + hp aCC from /opt/aCC/bin + +I ran into these problems: + + NLS does not work; configure with --disable-nls. + -D_XOPEN_SOURCE=500 does not work. + Multibyte support is not available. + +To get multibyte support, the following ugly hack might work: +--- gawk-3.1.3.orig/custom.h 2003-06-09 17:45:53.000000000 +0200 ++++ gawk-3.1.3/custom.h 2003-12-17 15:55:04.000000000 +0100 +@@ -101,4 +101,7 @@ + #undef HAVE_TZSET + #define HAVE_TZSET 1 + #define _TZSET 1 ++/* an ugly hack: */ ++#include ++#define HAVE_MBRTOWC 1 + #endif + +------------------------------- +Mon, 27 May 2002 17:55:46 +0800 + +The network support "|&" may not work under HP-UX 11. +An error message appears similar to this: +gawk: test_script.awk:3: fatal: get_a_record: iop->buf: can't allocate -61246 +bytes of memory (not enough space) + +Solution: +This is a bug in the fstat() call of HP-UX 11.00, please apply +the cumulative ARPA Transport patch PHNE_26771 to fix it. + +The following is the related description in PHNE_26771: + + Customer's application gets the wrong value from fstat(). + Resolution: + The value returned via st_blksize is now retrieved + from the same info as in 10.20. + +In case you cannot apply the HP patch, the attached patch to gawk source +might work. + +Xiang Zhao +Stepan Kasal + +diff -ur gawk-3.1.3.a0/posix/gawkmisc.c gawk-3.1.3.a1/posix/gawkmisc.c +--- gawk-3.1.3.a0/posix/gawkmisc.c Sun May 25 15:26:19 2003 ++++ gawk-3.1.3.a1/posix/gawkmisc.c Fri Jul 11 08:56:03 2003 +@@ -126,7 +126,13 @@ + * meant for in the first place. + */ + #ifdef HAVE_ST_BLKSIZE +-#define DEFBLKSIZE (stb->st_blksize > 0 ? stb->st_blksize : BUFSIZ) ++ /* ++ * 100k must be enough for everybody, ++ * bigger number means probably a bug in fstat() ++ */ ++#define MAXBLKSIZE 102400 ++#define DEFBLKSIZE (stb->st_blksize > 0 && stb->st_blksize <= MAXBLKSIZE \ ++ ? stb->st_blksize : BUFSIZ) + #else + #define DEFBLKSIZE BUFSIZ + #endif diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.ia64 b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.ia64 new file mode 100644 index 0000000..844d6a6 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.ia64 @@ -0,0 +1,30 @@ +Tue Mar 11 13:19:45 IST 2003 +============================ + +On real Itanium systems, builds with GCC are fine. If you're using the +Intel compiler `ecc', you need: + + CC=ecc ./configure && make all check install CFLAGS='-g -Drestrict=' + +Tue Apr 16 13:55:15 IDT 2002 +============================ +The current version of the IA-64 environment builds gawk without any problems. + +Wed Apr 25 17:17:01 IDT 2001 +============================ + +The Intel IA-64 emulation environment that sits on top of 32-bit Linux +has problems. Gawk does not work on it. + +1. The `sgicc' compiler lies to `configure' and pretends it's gcc. But it +really isn't, and several things don't work. + +2. Even if used with gcc, the executable doesn't run; somehow quoted +strings don't stay as one argument to gawk, which is, of course, +disastrous. + +3. It's flaky; initially `configure' wouldn't even get past the getpgrp +test. Then later it would. + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.macos b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.macos new file mode 100644 index 0000000..684e028 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.macos @@ -0,0 +1,32 @@ +Mon Jun 11 05:37:03 IDT 2007 +============================ + +The notes below no longer seem to apply. + +Mon Jul 4 09:55:22 IDT 2005 +============================ + +If you use GCC 4.0 under Mac OS X to compile gawk with optimization, +AND multibyte support is *disabled*, the `ignrcas2' test fails. This is +a compiler bug. Either compile it without optimization, or use gcc-3.3. + +All the other tests pass. + +Happily, the default is for the multibyte support to be enabled, so all +the tests pass by defualt. + + +Sun Dec 3 18:11:09 IST 2000 +============================ + +The `posix' test will fail because of output format differences but this +is apparently otherwise benign. + +Gawk uses the system's mktime(3) routine, even though Autoconf thinks +it's broken, so Caveat Emptor. + +If you ask me about either of these I will fuss at you for not having +done your homework. + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.multibyte b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.multibyte new file mode 100644 index 0000000..135ba86 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.multibyte @@ -0,0 +1,29 @@ +Fri Jun 3 12:20:17 IDT 2005 +============================ + +As noted in the NEWS file, as of 3.1.5, gawk uses character values instead +of byte values for `index', `length', `substr' and `match'. This works +in multibyte and unicode locales. + +Wed Jun 18 16:47:31 IDT 2003 +============================ + +Multibyte locales can cause occasional weirdness, in particular with +ranges inside brackets: /[....]/. Something that works great for ASCII +will choke for, e.g., en_US.UTF-8. One such program is test/gsubtst5.awk. + +By default, the test suite runs with LC_ALL=C and LANG=C. You +can change this by doing (from a Bourne-style shell): + + $ GAWKLOCALE=some_locale make check + +Then the test suite will set LC_ALL and LANG to the given locale. + +As of this writing, this works for en_US.UTF-8, and all tests +pass except gsubtst5. + +For the normal case of RS = "\n", the locale is largely irrelevant. +For other single byte record separators, using LC_ALL=C will give you +much better performance when reading records. Otherwise, gawk has to +make several function calls, *per input character* to find the record +terminator. You have been warned. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pc b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pc new file mode 100644 index 0000000..9ee2f12 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pc @@ -0,0 +1,378 @@ +This is the README for GNU awk 3.1 under Windows32, OS/2, and DOS. + + Gawk has been compiled and tested under OS/2, DOS, and Windows32 using +the GNU development tools from DJ Delorie (DJGPP; DOS with special +support for long filenames under Win95), Eberhard Mattes (EMX; OS/2, +DOS, and Windows32 with rsxnt), and Jan-Jaap van der Heijden and Mumit Khan +(Mingw32; Windows32). Microsoft Visual C/C++ can be used to build a Windows32 +version for Windows 9x/NT, and MSC can be used to build 16-bit versions +for DOS and OS/2. (As of 3.1.2, the MSC version doesn't work, but the +maintainer for it is working on fixing it.) + + The cygwin environment (http://www.cygwin.com) may also be used +to compile and run gawk under Windows. For cygwin, building and +installation is the same as under Unix: + + tar -xvpzf gawk-3.1.x.tar.gz + cd gawk-3.1.x + ./configure && make + +The `configure' step takes a long time, but works otherwise. + +******************************** N O T E ********************************** +* The `|&' operator only works when gawk is compiled for cygwin. Neither * +* socket support nor two-way pipes work in any other Windows environment! * +*************************************************************************** + +Building gawk +------------- + +Building on DOS or Windows environments can be troublesome, in part due +to shell limitations, the long filename issue, and various Windows32 pipe +considerations. The situation is somewhat better on OS/2. The general +recommendation is to use tools (especially make) which are compatible +or built with the compiler to be used on gawk. + +Building versions which do not understand long filenames on systems +that offer long names is a special case. The maintainers unpack the +distribution and process using utilities (unzip, make, cmp) which do not +use long filenames. (For example, the djgpp tools will work if LFN=n is +set in the environment.) + +Copy the files in the `pc' directory (EXCEPT for `ChangeLog') to the +directory with the rest of the gawk sources. (The subdirectories of +`pc' need not be copied.) The makefile contains a configuration +section with comments, and may need to be edited in order to work +with your make utility. + +The "prefix" line in the Makefile is used during the install of gawk +(and in building igawk.bat and igawk.cmd). Since the libraries for +gawk will be installed under $(prefix)/lib/awk (e.g., /gnu/lib/awk), +it is convenient to have this directory in DEFPATH of config.h. + +The makefile contains a number of targets for building various DOS and +OS/2 versions. A list of targets will be printed if the make command is +given without a target. As an example, to build gawk using the djgpp +tools, enter "make djgpp". + + +Testing and installing gawk +--------------------------- + +The command "make test" (and possibly "make install") requires several +Unix-like tools, including an sh-like shell, sed, cp, and cmp. Only +dmake and GNU make are known to work on "make test". + +There are two methods for the install: Method 1 uses a typical Unix-like +approach and requires cat, cp, mkdir, sed, and sh; method 2 uses gawk +and batch files. See the configuration section of the makefile. + +The file test/Makefile will need some editing (especially for DOS). A +sample makefile with comments appears in pc/Makefile.tst, and can be +used to modify test/Makefile for your platform. In addition, some +files in the test directory may need to have their end-of-line markers +converted, as described in Makefile.tst. + +As with building gawk, the OS, shell, and long filename issues come into +play when testing, too. If you are testing gawk on a LFN aware system with +some LFN aware tools, you may have problems if the shell that you specify in +test/Makefile is not LFN aware. This problem will apply whether or not +you are building a LFN aware gawk. See the comments in pc/Makefile.tst +for more information on this. + +It is routine to install by hand, but note that the install target also +builds igawk.bat and igawk.cmd, which are used to add an include +facility to gawk (and which require sh). + + +Notes +----- + +1. Collections containing gawk and various utilities for OS/2 or DOS +include the GNUish Project, Rommel's OS/2 collection at LEO, and the +djgpp collection. + +The GNUish Project was designed to bring GNU-like programs to small +systems running OS/2 and DOS. Binary distributions of gawk are +maintained in GNUish, and include 16bit OS/2 and DOS, 32bit djgpp, +and Windows32 versions. Information on GNUish is available via + + http://www.simtel.net/simtel.net/ +or + ftp://ftp.simtel.net/simtelnet/gnu/gnuish + +Documentation appears in gnuish.htm (html) or gnuish.inf (info). + +Kai Uwe Rommel maintains a (mostly OS/2) collection at + + http://www.leo.org/archiv/os2 or ftp://ftp.leo.org + +It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Windows32, +along with many OS/2 utilities. + +The djgpp collection at + + ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/ + +contains a djgpp-compiled (32bit) version of gawk, along with many +djgpp-compiled utilities. + +The Mingw32 collection at http://www.mingw.org contains links to ported +software. The site by Jan-Jaap van der Heijden + + http://agnes.dida.physik.uni-essen.de/~janjaap/ + +is apparently no longer maintained, but it was accessible as of Jan 2001 +and may contain files of interest. + + +2. The following table illustrates some of the differences among the various +compiled versions of gawk. For example, the djgpp version runs on all the +systems, but with differing capabilities: it supports long filenames under +Win-9x but not under NT, and it runs as a DPMI application under OS/2 (which +translates into "works in the DOS-box under OS/2, but not as a true OS/2 +application"). + + DOS Win/WfW Win9x NT OS/2 + ------------------------------------------------------- + djgpp | DPMI DPMI DPMI DPMI,NoLFN DPMI + emx(1) | N N N N OS2 + emxbnd(2) | VCPI,DPMI DPMI DPMI,NoLFN DPMI,NoLFN DPMI,OS2 + emxnt(3) | N N Windows32 Windows32 N + msc(4) | 16 16 16,NoLFN 16,NoLFN 16,DOS + msc6bnd | 16 16 16,NoLFN 16,NoLFN 16,DOS,OS2 + msc6os2 | N N N N 16,OS2 + vcWin32 | N N Windows32 Windows32 N + mingw32 | N N Windows32 Windows32 N + + (1) Requires emxrt. + + (2) May run as a DPMI app in plain DOS and in a DOS-shell under OS/2 + or Windows, and as a true OS/2 application under OS/2. DPMI + requires rsxnt, and VCPI or use as an OS/2 app requires emxrt. + + (3) Requires rsxnt. + + (4) When compiling, MSC 8, when run in Windows 9x, will require that if + files are listed in #include statements with LFNs + (eg. ), that the file be named with the LFN. + + 16 16bit; limited capacity, especially under DOS. + + DOS Runs as a DOS application. + + DPMI Dos Protected Mode Interface; program runs as a DOS application. + Under plain DOS, a DPMI server (such as csdpmi from the djgpp + archives) is required. See also VCPI. + + emxrt The emx runtime, available from LEO. + + N Not supported. + + NoLFN No long filename support. + + OS2 Runs as an OS/2 application. + + rsxnt Runtimes for use with DPMI or Windows32. + + VCPI Virtual Control Program Interface; program runs as a DOS app. + Memory managers (such as emm386) may need adjustment. VCPI cannot + be used under OS/2, Win/WfW, Win-95, or NT. See also DPMI. + +Windows32 Uses/supports Windows32 features (such as long filenames). + +Reportedly, NTEmacs (another Windows32 program) can run programs such as +Windows32-gawk asynchronously. Similarly, as native OS/2 versions are a +plus under OS/2 even for command-line programs, native Windows32 versions +may be desired under NT and Win95. + +Users interested in Windows32 applications may also wish to examine the +Cygnus cygwin project at http://sources.redhat.com/cygwin/ or the +Mingw32 work at http://www.mingw.org. Windows32 gawk will often require +that utilities run from within gawk be Windows32 (e.g., the tests place this +requirement on the cat utility). + + +3. An sh-like shell may be useful for awk programming (and is essential +for running "make test"). Stewartson's sh (OS/2 and DOS) is a good +choice, and may be found in GNUish. + +Stewartson's shell uses a configuration file (see "Command Line Building" +in the sh manual page), and it may be necessary to edit the entry for +gawk. The following entries are suggested: + + -- $(EXTENDED_LINE) -- -- Comment only, not part of file -- + gawk = unix ignoretype # emxbnd + gawk = unix # djgpp; msc* with Stewartson's stdargv + # No entry for emx or for msc* without stdargv + gawk = ignoretype # if you want something which which always work + # --but without the use of @-include files. + +However, users of djgpp versions of gawk may prefer "dos" over "unix" +in the above, due to the way djgpp handles @-include files. Entries +for other other utilities (such as sed and wc) may need to be edited +in order to match your specific collection of programs. + +Daisuke Aoyama has ported Bash 1.14.7 to djgpp. +This version worked flawlessly in tests with djgpp gawk and make. bash +is now part of the djgpp collection; the older port may be found on + + http://www.neongenesis.com/~jack/djgpp-work/beta/index.html + +Under OS/2, bash should be a good choice; however, there has been some +trouble getting a solid version. As of Feb-95, there are two bash ports, +available at LEO under shells/gnu/. + +LEO also contains a Korn shell (ksh), tcsh, zsh, and a demo of +Hamilton's C shell, but these have not been tested with gawk by the +maintainers. Reports are welcomed. + +Users of the emx versions of gawk may wish to set EMXSHELL, which +overrides COMSPEC when running shells from emx programs. Similarly, +the djgpp version of gawk respects SHELL. + +Compatibility among shells and various utilities (including gawk) +continues to be a problem. Stewartson's shell may be the best choice +for emx-compiled programs (although djgpp-bash almost works with +emx on DOS). GNU make is recommended if using djgpp-bash. + +Beginning with 3.0.4, the MSC (DOS/Windows32) and Mingw32 versions write +pipe and system() commands to a temporary file, and then execute +with SHELL or COMSPEC. The current mechanism defaults to dos-style +shell conventions unless the shell is one of sh, bash, csh, tcsh, sh32, +sh16, or ksh. + + +4. GNU make is available at LEO for OS/2, in the djgpp collection +for DOS, and in the Mingw32 collection for Windows32. + +dmake is by Dennis Vadura (dvadura@watdragon.uwaterloo.ca), CS +Dept., University of Waterloo. OS/2 and DOS versions can be found as +part of the GNUish project. Note that DOS users will need the DOS-only +version (due to the swap requirement). + +Ndmake is by D.G. Kneller. This ShareWare program was later released +as Opus Make (which is available for OS/2 and DOS). Ndmake 4.5 is +available at + + ftp://ftp.simtel.net/simtelnet/msdos/c/ndmake45.zip + + +5. Stewartson's shell contains sources for a setargv-replacement +for MSC, which can add enhanced command-line processing capabilities +to gawk. See the makefile. Note that there is a fatal bug in +stdargv.c, triggered in the case of no closing quote. The following +patch treats this case as if a quote was inserted as the last +character on the command-line. + +478,479c478,482 +< else +< spos = &spos[strlen (cpos)]; +--- +> else { +> /* No matching quote. Fake it. */ +> spos = cpos + strlen (cpos) + 1; +> break; +> } + + +Known bugs +---------- + +1. DJGPP version 1 has known problems with signals, and in the way it +handles command-lines. Older versions of this file contain notes on +other bugs, and on a few bugs uncovered in the v2 betas. Testing of +gawk with DJGPP v1 ended with gawk-3.0. djgpp-2.01 and djgpp ports of +GNU make 3.75 or later are strongly preferred, in part due to enhanced +support for sh-like shells. + +2. emx does not support DST. On 2-Jan-96, Mattes writes: + + Quotation from ISO 9899-1990: + + 7.12.3.5 The strftime function + [...] + %Z is replaced by the time zone name or abbreviation, or by no + characters if no time zone is determinable. + + As emx does not yet support DST, it does not know which one of the two + time zones (with DST vs. without DST) applies. In consequence, `no + time zone is determinable'. + +As a workaround, it may be possible to edit do_strftime() of builtin.c +according to Mattes' recommendation: + + If you happen to know whether DST applies or not for a given struct + tm, just set its tm_isdst to a positive value or to zero, respectively. + Then, strftime() will replace %Z with the name of the time zone. + +However, this probably won't yield a generic solution given that the rules +for when DST starts and stops vary depending upon your location and the +rules have changed over time. Most versions of UNIX maintain this +information in a database (of sorts). In Solaris, for instance, it can be +found in /usr/share/zoneinfo/*. The setting of the TZ environment variable +(eg. TZ=US/Pacific) is then used to lookup the specifics for that locale. + +3. The 16-bit DOS version can exhaust memory on scripts such as Henry +Spencer's "awf". Use GNU C versions if possible. + +4. builtin.c of gawk-3.0.[1-6] triggers a bug in MSC 6.00A. The makefile +works around the bug by compiling builtin.c without optimizations (-Od). +In limited testing, it appears that inserting some dummy code in +builtin.c can provide a better solution than disabling optimizations. + +5. There are problems with system() when using the rsx package with emx +programs (rsx is used in DPMI environments such as MS-Win). The djgpp +versions are preferred in this case. + +6. In contrast to getpid() on UNIX, the getpid() in Microsoft C/C++ 1.52 +(AKA 8.0) sometimes returns negative numbers. The DOS Gawk developers felt +that it was best to use Microsoft's built-in function; but at the same time, +we are placing this warning here, because this behavior will undoubtably be +surprising to many. + +7. MSC 6 fails the strftlng test. The funstack test exhausts memory +on the 16bit DOS versions. + +8. Eli Zaretskii writes: "Make can crash with SIGFPE after finishing all +the tests. This happens on Windows 95 only, and Gawk 3.0.3 does that as +well (as do older versions of Make). The cause for this is the log(-1) +call in the last test. Based on some limited testing, I'd say that the +problem is in sloppy Windows handling of the FPU: it doesn't clean up the +FPU after a program exits, so if Make has SIGFPE unmasked, it crashes." + +9. gawk built from the mingw32 and vcWin32 targets continues to have +problems with pipes; in particular, the pipeio1 test fails. + +10. As mentioned above, `|&' only works with cygwin. + + +Gawk thanks +----------- + +The DOS maintainers wish to express their thanks to Eli Zaretskii + for his work and for the many conversations +concerning gawk, make, and djgpp. His FAQ for djgpp is essential +reading, and he was always willing to answer our questions (even when +we didn't read the relevant portions of the FAQ :). + +We are indebted to Juan Grigera for the +Visual C++ target, and for additional help on changes for Windows32. + + +---- +If you have any problems with the DOS or OS/2 versions of Gawk, +please send bug reports (along with the version and compiler used) to + + Scott Deifik, scottd.mail@sbcglobal.net (DOS versions) +or + gawk-maintainer@unixos2.org (OS/2 version) + Darrel Hankerson, hankedr@mail.auburn.edu + +Support for Windows32 started in gawk-3.0.3. Reports on +the Visual C++ version (vcWin32) may be sent to + + Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version) + +with a copy to Scott Deifik. Other Windows32 reports may go to Darrel +Hankerson. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pcdynamic b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pcdynamic new file mode 100644 index 0000000..678206e --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.pcdynamic @@ -0,0 +1,93 @@ +This is the README for dynamic extension support for GNU awk 3.1.2 under Windows32 +This part of the README is directed to the gawk maintainers. + +The implementation consists of + +pc/dlfcn.h +pc/dlfcn.c + An implementation of the POSIX dynamic loading functions for Windows32. + Bugs and limitations: + the RTLD_* flags are ignored + passing NULL as the module name is not really supported. + dlerror() doesn't always generate useful output. + +pc/w32dynamic.patch + A patch to pc/Makefile. This adds macros to allow dynamic loading + to be compiled in. The macros (DYN_EXP, DYN_OBJ, DYN_FLAGS, and + DYN_MAKEXP) are commented-out by default (which is the default on + Unix as well). I've added definitions only for MS VC and MinGW. + I also added support for pgawk under MS VC and MinGW. + +pc/gawkw32.def + A list of functions to export from gawk.exe. Every function used + in an extension DLL needs to be in this file. I've added the ones + required by the provided examples, but some thought should go into + determining a useful set of API functions. From a maintenance + perspective, it's important that the ordinals (the number following @) + never change. You can use an existing DLL with a gawk.exe which has + new exported functions, but if you change the ordinal of an existing + function, you have to recompile all the extensions that use it. + +extension/Makefile.pc + A make file which compiles a few of the extension examples. + Only readfile, ordchr, and arrayparm are built, since the + other functions didn't compile without sizeable modifications. + +extension/pcext.def + A module definition file which exports dlload. + +extension/w32dynamic.patch + A patch to readfile.c to have it open files in binary mode. Without + this, the bytes read doesn't always match the file size. + +w32dynamic.patch + A patch to awk.h. This makes the temporary variable _t static and + adds an attribute to some data declarations when WIN32_EXTENSION is + defined. The issue is that data imported from a separate module has + a different level of indirection from the same data in the + original module. The difference can be made transparent by adding + __declspec(dllimport)) to the declarations used in the importing module. + Since _t doesn't actually have to be shared, I've just made it + static to the extension module and avoided the problem. + +README_d/README.pcdynamic + This file. + +The remainder of the file is intended for people installing and using gawk +and probably ought to be added to README.pc +--- +To compile gawk with dynamic extension support, uncomment the +definitions of DYN_FLAGS, DYN_EXP, DYN_OBJ, and DYN_MAKEXP in the +configuration section of Makefile. There are two definitions for +DYN_MAKEXP -- pick the one that matches your target. + +To build some of the example extension libraries, cd to the extension +directory and copy Makefile.pc to Makefile. You can then build using the same +two targets. To run the example awk scripts, you'll need to either change the +call to the `extension' function to match the name of the library (for +instance, change "./ordchr.so" to "ordchr.dll" or simply "ordchr"), or rename +the library to match the call (for instance, rename ordchr.dll to ordchr.so). + +If you build gawk.exe with one compiler but want to build an extension library +with the other, you need to copy the import library. Visual C uses a library +called gawk.lib, while MinGW uses a library called libgawk.a. These files +are equivalent and will interoperate if you give them the correct name. +The resulting shared libraries are also interoperable. + +To create your own extension library, you can use the examples as models, but +you're essentially on your own. Post to comp.lang.awk or send e-mail to +ptjm@interlog.com if you have problems getting started. If you need to access +functions or variables which are not exported by gawk.exe, add them to +gawkw32.def and rebuild. You should also add ATTRIBUTE_EXPORTED to the +declaration in awk.h of any variables you add to gawkw32.def. + +Note that extension libraries have the name of the awk executable embedded in +them at link time, so they will work only with gawk.exe. In particular, they won't +work if you rename gawk.exe to awk.exe or if you try to use pgawk.exe. You can +perform profiling by temporarily renaming pgawk.exe to gawk.exe. You can resolve +this problem by changing the program name in the definition of DYN_MAKEXP for +your compiler. + +On Windows32, libraries are sought first in the current directory, then in the +directory containing gawk.exe, and finally through the PATH environment +variable. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sgi b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sgi new file mode 100644 index 0000000..5d754a8 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sgi @@ -0,0 +1,20 @@ +Tue Jan 30 10:51:39 IST 2001 + +There will be linker warnings on SGI Irix will be building gawk. +These are related to use of dlopen and the dynamic loading of +builtins. The warnings can be ignored. +====================================== +Tue May 2 11:40:54 IDT 2000 + +GCC and gawk often don't mix on SGI systems. Use the native C compiler to +compile gawk. `make test' should work ok, although the `tweakfld' test +may fail. That's ok; see README.ultrix for the details on that one. + +Note that the SGI compiler will complain about some constructs in +regex.c and dfa.c. It's ok to ignore those complaints. + +If you ask me about this, I will fuss at you for not having done +your homework! + +Arnold Robbins +arnold@skeeve.com diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.solaris b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.solaris new file mode 100644 index 0000000..4b5affd --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.solaris @@ -0,0 +1,138 @@ +Solaris Problem #1: +=================== +From: carson@lehman.com +Date: Fri, 7 Feb 1997 01:05:58 -0500 +To: arnold@gnu.ai.mit.edu +Subject: Solaris 2.5.1 x86 bug in gawk-3.0.2 + +awktab.c has the following bogus logic: + +#ifndef alloca +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) +#include +#else /* not sparc */ + +Solaris x86 obviously dosn't define sparc or __sparc. + +What you _meant_ to say was: + +if (defined(__sun) && defined(__SVR4)) + +(which identifies Solaris 2.x under both Sun's cc and gcc) + +-- +Carson Gaspar -- carson@cs.columbia.edu carson@lehman.com +http://www.cs.columbia.edu/~carson/home.html + + + * * * * * * * + +Solution to Problem #1: +======================= +Tue Oct 20 21:25:11 IST 1998 + +This has been fixed in 3.1.0 with the bisonfix.sed script. + +Arnold Robbins +arnold@skeeve.com + +Solaris Problem #2: +=================== +Tue Apr 13 16:57:45 IDT 1999 + +There is a known problem in that the `manyfiles' test will fail under +Solaris if you set your soft limit on the number of file descriptors to +above 256. This is due to a "feature" of fdopen that an fd must be +less than 256 (see fdopen(3)). + +IMHO this is Sun's problem, not mine. + +Arnold Robbins +arnold@skeeve.com + +Solution (a) to Problem #2: +=========================== +Now fixed in the code via Paul Eggert's 2001-09-0 patch. See the +ChangeLog. + +Solution (b) to Problem #2: +=========================== +From: Paul Nevai +Subject: Re: gawk-3.0.4 +To: arnold@skeeve.com (Aharon Robbins) +Date: Tue, 6 Jul 1999 09:09:05 -0400 (EDT) + +Dear Aharon: + +Toda raba. Why don't you add something like that to README_d/README.solaris +file: + +for the SunOS do in + +/bin/sh: ulimit -n 256; ulimit -a; make test +/bin/tcsh: limit descriptors 256; ulimit -a; make test + +otherwise "make test" will fail + +Shalom, Paul + +Aharon Robbins wrote to Paul Nevai: +# >From the README_d/README.solaris file: +# +# Tue Apr 13 16:57:45 IDT 1999 +# +# There is a known problem in that the `manyfiles' test will fail under +# Solaris if you set your soft limit on the number of file descriptors to +# above 256. This is due to a "feature" of fdopen that an fd must be +# less than 256 (see fdopen(3)). +# +# IMHO this is Sun's problem, not mine. +# +# Arnold Robbins +# arnold@skeeve.com +# +# Double check your settings with ulimit; I suspect that this is +# your problem. +# +# Thanks, +# +# Arnold +# -- +# Aharon (Arnold) Robbins arnold@skeeve.com [ <<=== NOTE: NEW ADDRESS!! ] +# P.O. Box 354 Home Phone: +972 8 979-0381 Fax: +1 603 761-6761 +# Nof Ayalon Cell Phone: +972 51 297-545 (See www.efax.com) +# D.N. Shimshon 99784 Laundry increases exponentially in the +# ISRAEL number of children. -- Miriam Robbins +# +# + + + +Paul Nevai pali+@osu.edu +Department of Mathematics nevai@math.ohio-state.edu +The Ohio State University http://www.math.ohio-state.edu/~nevai/ +231 West Eighteenth Avenue http://www.math.ohio-state.edu/~jat/ +Columbus, Ohio 43210-1174 1-614-292-5310 (Office/Answering Device) +The United States of America 1-614-292-1479 (Math Dept Fax) + +Solaris Problem #3: +=================== +Sun Feb 9 10:35:51 IST 2003 + +Certain versions of Sun C give compilation errors under Solaris 5.5, 5.6 and +possibly later. Here's what I was told: + +> We have this version of cc here: +> cc -V +> cc: Sun WorkShop 6 update 1 C 5.2 2000/09/11 +> +> Probably, the others use different combinations of OS and CC. +> A quick fix was this (we use csh-syntax here): +> +> setenv CC "/opt/SUNWspro/bin/cc -Xc" +> ./configure +> make check + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sunos4 b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sunos4 new file mode 100644 index 0000000..7cef068 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.sunos4 @@ -0,0 +1,24 @@ +Sun Jan 7 23:49:46 EST 1996 + +GCC and Autoconf disagree about the type of the array argument passed +to getgroups(2). You can thus ignore the warning that gcc will +generate under SunOS 4.1.x for io.c. + +If you send me email about this without having read this file, I will +fuss at you! + +Arnold Robbins +arnold@skeeve.com + +Tue Jan 30 07:01:39 EST 1996 + +The manyfiles test fails under SunOS 4.1.4. There appears to be some +bug in libc (shared and static) for SunOS 4.1.4. I got a working gawk +binary by linking in /usr/5lib/libc.a statically. + + +,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-, + Jim Farrell | phone 610-940-6020 | Platinum technology +Systems Administrator | vmail 800-526-9096 x7512 | 620 W. Germantown Pike + jwf@platinum.com | fax 610-940-6021 | Plymouth Meeting,Pa,19462 +'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~' diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tandem b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tandem new file mode 100644 index 0000000..3f7ba93 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tandem @@ -0,0 +1,33 @@ +The Tandem port was done on a Cyclone machine running D20. +The port is pretty clean and all facilities seem to work except for +some of the I/O piping stuff which is just too foreign a concept for +Tandem. + +Usage is as for UNIX except that D20 requires all "{" and "}" characters +to be escaped with "~" on the command line (not in script files) and the +standard Tandem syntax for "/in filename,out filename/" must be used +instead of the usual UNIX "<" and ">" for file redirection. (Redirection +options on getline, print etc are supported.) + +The -mr=val option has been "stolen" to enable Tandem users to +process fixed-length records with no "end-of-line" character. That +is, -mr=74 tells gawk to read the input file as fixed 74-byte +records. + +To build a Tandem executable from source, down-load all of the files +so that the file names on the Tandem box are, for example ARRAYC or +AWKH. That is, make all of the file names conform to the restrictions +of D20. The "totally Tandem-specific" files are in the tandem +"subvolume" and should be copied to the main src directory before +building gawk. + +The file compit can then be used to compile and bind an executable. +Sorry, no make and no autoconfig. + +This is my first UNIX port to Tandem so I may well have missed the best +way of doing things: I just desperately needed a working awk at a +Tandem shop. + +Cheers, +Stephen Davies +(scldad@sdc.com.au) diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tests b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tests new file mode 100644 index 0000000..4b3d74b --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/README_d/README.tests @@ -0,0 +1,45 @@ +Date: Sat, 22 Apr 2000 06:07:06 -0600 (MDT) +From: "Nelson H. F. Beebe" +Cc: beebe@math.utah.edu, sysstaff@math.utah.edu, othmer@math.utah.edu +Subject: gawk-3.0.4 and a GNU/Linux gotcha + +Yesterday, I was assisting a colleague install some software on his +GNU/Linux machine for which uname -r reports 2.2.14. + +A (mis)feature of this system, which I've never encountered before, +broke the build of one of my programs, and also of gawk-3.0.4. + +Namely, the kernel will not execute anything that resides in /tmp, +though it will if the same script is in /usr/tmp! + +% cat /tmp/foo.sh +#! /bin/sh +echo hello + +ls -l /tmp/foo.sh +-rwxr-xr-x 1 othmer math 22 Apr 21 10:34 /tmp/foo.sh* + +% /tmp/foo.sh +bash: /tmp/foo.sh: Permission denied + +% cp /tmp/foo.sh /usr/tmp + +% /usr/tmp/foo.sh +hello + +Thus, programs that do a temporary install in /tmp, as some of mine do +in order to run the validation suite, will fail. + +gawk-3.0.4, and likely other gawk versions, hits this problem too. It +fails because test/poundbang starts with + +#! /tmp/gawk -f + +I tracked down where it comes from: + +% grep /tmp /etc/fstab +/dev/hda3 /tmp ext2 rw,nosuid,noexec,nouser,auto,async,nodev 1 1 + !!!!!! + +Since this is done via a mount command, potentially ANY directory tree +could be mounted with noexec. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/README.card b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/README.card new file mode 100644 index 0000000..ef77cda --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/README.card @@ -0,0 +1,19 @@ +Mon Dec 9 12:45:48 EST 1996 + +The AWK reference card included here requires a modern version of troff +(ditroff). GNU Troff (groff) is known to work. + +If your troff is able to produce Postscript but does not know how to +properly use the macros from `colors' file then try to uncomment in +Makefile the defintion which sets AWKCARD to awkcard.nc (no colors). +This will definitely require changes to the TROFF macro and you have to +ensure that the tbl preprocessor is called. For example, the following +modifications on NeXT: + +TROFF = tbl +SEDME = ptroff -t | sed -e \ + "s/^level0 restore/level0 restore flashme 100 72 moveto\ + (Copyright `date`, FSF, Inc. (all)) show/" \ + -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/" + +will produce a correctly formatted, albeit monochromatic, reference card. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawk.info b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawk.info new file mode 100644 index 0000000..98e33fb --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawk.info @@ -0,0 +1,24684 @@ +INFO-DIR-SECTION Text creation and manipulation +START-INFO-DIR-ENTRY +This is gawk.info, produced by makeinfo version 4.11 from gawk.texi. + +* Gawk: (gawk). A text scanning and processing language. +END-INFO-DIR-ENTRY +INFO-DIR-SECTION Individual utilities +START-INFO-DIR-ENTRY +* awk: (gawk)Invoking gawk. Text scanning and processing. +END-INFO-DIR-ENTRY + + Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + + + This is Edition 3 of `GAWK: Effective AWK Programming: A User's +Guide for GNU Awk', for the 3.1.6 (or later) version of the GNU +implementation of AWK. + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "GNU General Public License", the Front-Cover +texts being (a) (see below), and with the Back-Cover Texts being (b) +(see below). A copy of the license is included in the section entitled +"GNU Free Documentation License". + + a. "A GNU Manual" + + b. "You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development." + + +File: gawk.info, Node: Top, Next: Foreword, Up: (dir) + +General Introduction +******************** + +This file documents `awk', a program that you can use to select +particular records in a file and perform operations upon them. + + Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + + + This is Edition 3 of `GAWK: Effective AWK Programming: A User's +Guide for GNU Awk', for the 3.1.6 (or later) version of the GNU +implementation of AWK. + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "GNU General Public License", the Front-Cover +texts being (a) (see below), and with the Back-Cover Texts being (b) +(see below). A copy of the license is included in the section entitled +"GNU Free Documentation License". + + a. "A GNU Manual" + + b. "You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development." + +* Menu: + +* Foreword:: Some nice words about this + Info file. +* Preface:: What this Info file is about; brief + history and acknowledgments. +* Getting Started:: A basic introduction to using + `awk'. How to run an `awk' + program. Command-line syntax. +* Regexp:: All about matching things using regular + expressions. +* Reading Files:: How to read files and manipulate fields. +* Printing:: How to print using `awk'. Describes + the `print' and `printf' + statements. Also describes redirection of + output. +* Expressions:: Expressions are the basic building blocks + of statements. +* Patterns and Actions:: Overviews of patterns and actions. +* Arrays:: The description and use of arrays. Also + includes array-oriented control statements. +* Functions:: Built-in and user-defined functions. +* Internationalization:: Getting `gawk' to speak your + language. +* Advanced Features:: Stuff for advanced users, specific to + `gawk'. +* Invoking Gawk:: How to run `gawk'. +* Library Functions:: A Library of `awk' Functions. +* Sample Programs:: Many `awk' programs with complete + explanations. +* Language History:: The evolution of the `awk' + language. +* Installation:: Installing `gawk' under various + operating systems. +* Notes:: Notes about `gawk' extensions and + possible future work. +* Basic Concepts:: A very quick introduction to programming + concepts. +* Glossary:: An explanation of some unfamiliar terms. +* Copying:: Your right to copy and distribute + `gawk'. +* GNU Free Documentation License:: The license for this Info file. +* Index:: Concept and Variable Index. + +* History:: The history of `gawk' and + `awk'. +* Names:: What name to use to find `awk'. +* This Manual:: Using this Info file. Includes + sample input files that you can use. +* Conventions:: Typographical Conventions. +* Manual History:: Brief history of the GNU project and this + Info file. +* How To Contribute:: Helping to save the world. +* Acknowledgments:: Acknowledgments. +* Running gawk:: How to run `gawk' programs; + includes command-line syntax. +* One-shot:: Running a short throwaway `awk' + program. +* Read Terminal:: Using no input files (input from terminal + instead). +* Long:: Putting permanent `awk' programs in + files. +* Executable Scripts:: Making self-contained `awk' + programs. +* Comments:: Adding documentation to `gawk' + programs. +* Quoting:: More discussion of shell quoting issues. +* Sample Data Files:: Sample data files for use in the + `awk' programs illustrated in this + Info file. +* Very Simple:: A very simple example. +* Two Rules:: A less simple one-line example using two + rules. +* More Complex:: A more complex example. +* Statements/Lines:: Subdividing or combining statements into + lines. +* Other Features:: Other Features of `awk'. +* When:: When to use `gawk' and when to use + other things. +* Regexp Usage:: How to Use Regular Expressions. +* Escape Sequences:: How to write nonprinting characters. +* Regexp Operators:: Regular Expression Operators. +* Character Lists:: What can go between `[...]'. +* GNU Regexp Operators:: Operators specific to GNU software. +* Case-sensitivity:: How to do case-insensitive matching. +* Leftmost Longest:: How much text matches. +* Computed Regexps:: Using Dynamic Regexps. +* Locales:: How the locale affects things. +* Records:: Controlling how data is split into records. +* Fields:: An introduction to fields. +* Nonconstant Fields:: Nonconstant Field Numbers. +* Changing Fields:: Changing the Contents of a Field. +* Field Separators:: The field separator and how to change it. +* Regexp Field Splitting:: Using regexps as the field separator. +* Single Character Fields:: Making each character a separate field. +* Command Line Field Separator:: Setting `FS' from the command-line. +* Field Splitting Summary:: Some final points and a summary table. +* Constant Size:: Reading constant width data. +* Multiple Line:: Reading multi-line records. +* Getline:: Reading files under explicit program + control using the `getline' function. +* Plain Getline:: Using `getline' with no arguments. +* Getline/Variable:: Using `getline' into a variable. +* Getline/File:: Using `getline' from a file. +* Getline/Variable/File:: Using `getline' into a variable from a + file. +* Getline/Pipe:: Using `getline' from a pipe. +* Getline/Variable/Pipe:: Using `getline' into a variable from a + pipe. +* Getline/Coprocess:: Using `getline' from a coprocess. +* Getline/Variable/Coprocess:: Using `getline' into a variable from a + coprocess. +* Getline Notes:: Important things to know about + `getline'. +* Getline Summary:: Summary of `getline' Variants. +* Print:: The `print' statement. +* Print Examples:: Simple examples of `print' statements. +* Output Separators:: The output separators and how to change + them. +* OFMT:: Controlling Numeric Output With + `print'. +* Printf:: The `printf' statement. +* Basic Printf:: Syntax of the `printf' statement. +* Control Letters:: Format-control letters. +* Format Modifiers:: Format-specification modifiers. +* Printf Examples:: Several examples. +* Redirection:: How to redirect output to multiple files + and pipes. +* Special Files:: File name interpretation in `gawk'. + `gawk' allows access to inherited + file descriptors. +* Special FD:: Special files for I/O. +* Special Process:: Special files for process information. +* Special Network:: Special files for network communications. +* Special Caveats:: Things to watch out for. +* Close Files And Pipes:: Closing Input and Output Files and Pipes. +* Constants:: String, numeric and regexp constants. +* Scalar Constants:: Numeric and string constants. +* Nondecimal-numbers:: What are octal and hex numbers. +* Regexp Constants:: Regular Expression constants. +* Using Constant Regexps:: When and how to use a regexp constant. +* Variables:: Variables give names to values for later + use. +* Using Variables:: Using variables in your programs. +* Assignment Options:: Setting variables on the command-line and a + summary of command-line syntax. This is an + advanced method of input. +* Conversion:: The conversion of strings to numbers and + vice versa. +* Arithmetic Ops:: Arithmetic operations (`+', `-', + etc.) +* Concatenation:: Concatenating strings. +* Assignment Ops:: Changing the value of a variable or a + field. +* Increment Ops:: Incrementing the numeric value of a + variable. +* Truth Values:: What is ``true'' and what is ``false''. +* Typing and Comparison:: How variables acquire types and how this + affects comparison of numbers and strings + with `<', etc. +* Variable Typing:: String type versus numeric type. +* Comparison Operators:: The comparison operators. +* Boolean Ops:: Combining comparison expressions using + boolean operators `||' (``or''), + `&&' (``and'') and `!' (``not''). +* Conditional Exp:: Conditional expressions select between two + subexpressions under control of a third + subexpression. +* Function Calls:: A function call is an expression. +* Precedence:: How various operators nest. +* Pattern Overview:: What goes into a pattern. +* Regexp Patterns:: Using regexps as patterns. +* Expression Patterns:: Any expression can be used as a pattern. +* Ranges:: Pairs of patterns specify record ranges. +* BEGIN/END:: Specifying initialization and cleanup + rules. +* Using BEGIN/END:: How and why to use BEGIN/END rules. +* I/O And BEGIN/END:: I/O issues in BEGIN/END rules. +* Empty:: The empty pattern, which matches every + record. +* Using Shell Variables:: How to use shell variables with + `awk'. +* Action Overview:: What goes into an action. +* Statements:: Describes the various control statements in + detail. +* If Statement:: Conditionally execute some `awk' + statements. +* While Statement:: Loop until some condition is satisfied. +* Do Statement:: Do specified action while looping until + some condition is satisfied. +* For Statement:: Another looping statement, that provides + initialization and increment clauses. +* Switch Statement:: Switch/case evaluation for conditional + execution of statements based on a value. +* Break Statement:: Immediately exit the innermost enclosing + loop. +* Continue Statement:: Skip to the end of the innermost enclosing + loop. +* Next Statement:: Stop processing the current input record. +* Nextfile Statement:: Stop processing the current file. +* Exit Statement:: Stop execution of `awk'. +* Built-in Variables:: Summarizes the built-in variables. +* User-modified:: Built-in variables that you change to + control `awk'. +* Auto-set:: Built-in variables where `awk' + gives you information. +* ARGC and ARGV:: Ways to use `ARGC' and `ARGV'. +* Array Intro:: Introduction to Arrays +* Reference to Elements:: How to examine one element of an array. +* Assigning Elements:: How to change an element of an array. +* Array Example:: Basic Example of an Array +* Scanning an Array:: A variation of the `for' statement. It + loops through the indices of an array's + existing elements. +* Delete:: The `delete' statement removes an + element from an array. +* Numeric Array Subscripts:: How to use numbers as subscripts in + `awk'. +* Uninitialized Subscripts:: Using Uninitialized variables as + subscripts. +* Multi-dimensional:: Emulating multidimensional arrays in + `awk'. +* Multi-scanning:: Scanning multidimensional arrays. +* Array Sorting:: Sorting array values and indices. +* Built-in:: Summarizes the built-in functions. +* Calling Built-in:: How to call built-in functions. +* Numeric Functions:: Functions that work with numbers, including + `int', `sin' and `rand'. +* String Functions:: Functions for string manipulation, such as + `split', `match' and + `sprintf'. +* Gory Details:: More than you want to know about `\' + and `&' with `sub', `gsub', + and `gensub'. +* I/O Functions:: Functions for files and shell commands. +* Time Functions:: Functions for dealing with timestamps. +* Bitwise Functions:: Functions for bitwise operations. +* I18N Functions:: Functions for string translation. +* User-defined:: Describes User-defined functions in detail. +* Definition Syntax:: How to write definitions and what they + mean. +* Function Example:: An example function definition and what it + does. +* Function Caveats:: Things to watch out for. +* Return Statement:: Specifying the value a function returns. +* Dynamic Typing:: How variable types can change at runtime. +* I18N and L10N:: Internationalization and Localization. +* Explaining gettext:: How GNU `gettext' works. +* Programmer i18n:: Features for the programmer. +* Translator i18n:: Features for the translator. +* String Extraction:: Extracting marked strings. +* Printf Ordering:: Rearranging `printf' arguments. +* I18N Portability:: `awk'-level portability issues. +* I18N Example:: A simple i18n example. +* Gawk I18N:: `gawk' is also internationalized. +* Nondecimal Data:: Allowing nondecimal input data. +* Two-way I/O:: Two-way communications with another + process. +* TCP/IP Networking:: Using `gawk' for network + programming. +* Portal Files:: Using `gawk' with BSD portals. +* Profiling:: Profiling your `awk' programs. +* Command Line:: How to run `awk'. +* Options:: Command-line options and their meanings. +* Other Arguments:: Input file names and variable assignments. +* AWKPATH Variable:: Searching directories for `awk' + programs. +* Obsolete:: Obsolete Options and/or features. +* Undocumented:: Undocumented Options and Features. +* Known Bugs:: Known Bugs in `gawk'. +* Library Names:: How to best name private global variables + in library functions. +* General Functions:: Functions that are of general use. +* Nextfile Function:: Two implementations of a `nextfile' + function. +* Assert Function:: A function for assertions in `awk' + programs. +* Round Function:: A function for rounding if `sprintf' + does not do it correctly. +* Cliff Random Function:: The Cliff Random Number Generator. +* Ordinal Functions:: Functions for using characters as numbers + and vice versa. +* Join Function:: A function to join an array into a string. +* Gettimeofday Function:: A function to get formatted times. +* Data File Management:: Functions for managing command-line data + files. +* Filetrans Function:: A function for handling data file + transitions. +* Rewind Function:: A function for rereading the current file. +* File Checking:: Checking that data files are readable. +* Empty Files:: Checking for zero-length files. +* Ignoring Assigns:: Treating assignments as file names. +* Getopt Function:: A function for processing command-line + arguments. +* Passwd Functions:: Functions for getting user information. +* Group Functions:: Functions for getting group information. +* Running Examples:: How to run these examples. +* Clones:: Clones of common utilities. +* Cut Program:: The `cut' utility. +* Egrep Program:: The `egrep' utility. +* Id Program:: The `id' utility. +* Split Program:: The `split' utility. +* Tee Program:: The `tee' utility. +* Uniq Program:: The `uniq' utility. +* Wc Program:: The `wc' utility. +* Miscellaneous Programs:: Some interesting `awk' programs. +* Dupword Program:: Finding duplicated words in a document. +* Alarm Program:: An alarm clock. +* Translate Program:: A program similar to the `tr' + utility. +* Labels Program:: Printing mailing labels. +* Word Sorting:: A program to produce a word usage count. +* History Sorting:: Eliminating duplicate entries from a + history file. +* Extract Program:: Pulling out programs from Texinfo source + files. +* Simple Sed:: A Simple Stream Editor. +* Igawk Program:: A wrapper for `awk' that includes + files. +* V7/SVR3.1:: The major changes between V7 and System V + Release 3.1. +* SVR4:: Minor changes between System V Releases 3.1 + and 4. +* POSIX:: New features from the POSIX standard. +* BTL:: New features from the Bell Laboratories + version of `awk'. +* POSIX/GNU:: The extensions in `gawk' not in + POSIX `awk'. +* Contributors:: The major contributors to `gawk'. +* Gawk Distribution:: What is in the `gawk' distribution. +* Getting:: How to get the distribution. +* Extracting:: How to extract the distribution. +* Distribution contents:: What is in the distribution. +* Unix Installation:: Installing `gawk' under various + versions of Unix. +* Quick Installation:: Compiling `gawk' under Unix. +* Additional Configuration Options:: Other compile-time options. +* Configuration Philosophy:: How it's all supposed to work. +* Non-Unix Installation:: Installation on Other Operating Systems. +* Amiga Installation:: Installing `gawk' on an Amiga. +* BeOS Installation:: Installing `gawk' on BeOS. +* PC Installation:: Installing and Compiling `gawk' on + MS-DOS and OS/2. +* PC Binary Installation:: Installing a prepared distribution. +* PC Compiling:: Compiling `gawk' for MS-DOS, Windows32, + and OS/2. +* PC Using:: Running `gawk' on MS-DOS, Windows32 and + OS/2. +* PC Dynamic:: Compiling `gawk' for dynamic + libraries. +* Cygwin:: Building and running `gawk' for + Cygwin. +* VMS Installation:: Installing `gawk' on VMS. +* VMS Compilation:: How to compile `gawk' under VMS. +* VMS Installation Details:: How to install `gawk' under VMS. +* VMS Running:: How to run `gawk' under VMS. +* VMS POSIX:: Alternate instructions for VMS POSIX. +* VMS Old Gawk:: An old version comes with some VMS systems. +* Unsupported:: Systems whose ports are no longer + supported. +* Atari Installation:: Installing `gawk' on the Atari ST. +* Atari Compiling:: Compiling `gawk' on Atari. +* Atari Using:: Running `gawk' on Atari. +* Tandem Installation:: Installing `gawk' on a Tandem. +* Bugs:: Reporting Problems and Bugs. +* Other Versions:: Other freely available `awk' + implementations. +* Compatibility Mode:: How to disable certain `gawk' + extensions. +* Additions:: Making Additions To `gawk'. +* Adding Code:: Adding code to the main body of + `gawk'. +* New Ports:: Porting `gawk' to a new operating + system. +* Dynamic Extensions:: Adding new built-in functions to + `gawk'. +* Internals:: A brief look at some `gawk' + internals. +* Sample Library:: A example of new functions. +* Internal File Description:: What the new functions will do. +* Internal File Ops:: The code for internal file operations. +* Using Internal File Ops:: How to use an external extension. +* Future Extensions:: New features that may be implemented one + day. +* Basic High Level:: The high level view. +* Basic Data Typing:: A very quick intro to data types. +* Floating Point Issues:: Stuff to know about floating-point numbers. +* String Conversion Precision:: The String Value Can Lie. +* Unexpected Results:: Floating Point Numbers Are Not + Abstract Numbers. +* POSIX Floating Point Problems:: Standards Versus Existing Practice. + + To Miriam, for making me complete. + + To Chana, for the joy you bring us. + + To Rivka, for the exponential increase. + + To Nachum, for the added dimension. + + To Malka, for the new beginning. + +File: gawk.info, Node: Foreword, Next: Preface, Prev: Top, Up: Top + +Foreword +******** + +Arnold Robbins and I are good friends. We were introduced 11 years ago +by circumstances--and our favorite programming language, AWK. The +circumstances started a couple of years earlier. I was working at a new +job and noticed an unplugged Unix computer sitting in the corner. No +one knew how to use it, and neither did I. However, a couple of days +later it was running, and I was `root' and the one-and-only user. That +day, I began the transition from statistician to Unix programmer. + + On one of many trips to the library or bookstore in search of books +on Unix, I found the gray AWK book, a.k.a. Aho, Kernighan and +Weinberger, `The AWK Programming Language', Addison-Wesley, 1988. +AWK's simple programming paradigm--find a pattern in the input and then +perform an action--often reduced complex or tedious data manipulations +to few lines of code. I was excited to try my hand at programming in +AWK. + + Alas, the `awk' on my computer was a limited version of the +language described in the AWK book. I discovered that my computer had +"old `awk'" and the AWK book described "new `awk'." I learned that +this was typical; the old version refused to step aside or relinquish +its name. If a system had a new `awk', it was invariably called +`nawk', and few systems had it. The best way to get a new `awk' was to +`ftp' the source code for `gawk' from `prep.ai.mit.edu'. `gawk' was a +version of new `awk' written by David Trueman and Arnold, and available +under the GNU General Public License. + + (Incidentally, it's no longer difficult to find a new `awk'. `gawk' +ships with Linux, and you can download binaries or source code for +almost any system; my wife uses `gawk' on her VMS box.) + + My Unix system started out unplugged from the wall; it certainly was +not plugged into a network. So, oblivious to the existence of `gawk' +and the Unix community in general, and desiring a new `awk', I wrote my +own, called `mawk'. Before I was finished I knew about `gawk', but it +was too late to stop, so I eventually posted to a `comp.sources' +newsgroup. + + A few days after my posting, I got a friendly email from Arnold +introducing himself. He suggested we share design and algorithms and +attached a draft of the POSIX standard so that I could update `mawk' to +support language extensions added after publication of the AWK book. + + Frankly, if our roles had been reversed, I would not have been so +open and we probably would have never met. I'm glad we did meet. He +is an AWK expert's AWK expert and a genuinely nice person. Arnold +contributes significant amounts of his expertise and time to the Free +Software Foundation. + + This book is the `gawk' reference manual, but at its core it is a +book about AWK programming that will appeal to a wide audience. It is +a definitive reference to the AWK language as defined by the 1987 Bell +Labs release and codified in the 1992 POSIX Utilities standard. + + On the other hand, the novice AWK programmer can study a wealth of +practical programs that emphasize the power of AWK's basic idioms: data +driven control-flow, pattern matching with regular expressions, and +associative arrays. Those looking for something new can try out +`gawk''s interface to network protocols via special `/inet' files. + + The programs in this book make clear that an AWK program is +typically much smaller and faster to develop than a counterpart written +in C. Consequently, there is often a payoff to prototype an algorithm +or design in AWK to get it running quickly and expose problems early. +Often, the interpreted performance is adequate and the AWK prototype +becomes the product. + + The new `pgawk' (profiling `gawk'), produces program execution +counts. I recently experimented with an algorithm that for n lines of +input, exhibited ~ C n^2 performance, while theory predicted ~ C n log n +behavior. A few minutes poring over the `awkprof.out' profile +pinpointed the problem to a single line of code. `pgawk' is a welcome +addition to my programmer's toolbox. + + Arnold has distilled over a decade of experience writing and using +AWK programs, and developing `gawk', into this book. If you use AWK or +want to learn how, then read this book. + + Michael Brennan + Author of `mawk' + + +File: gawk.info, Node: Preface, Next: Getting Started, Prev: Foreword, Up: Top + +Preface +******* + +Several kinds of tasks occur repeatedly when working with text files. +You might want to extract certain lines and discard the rest. Or you +may need to make changes wherever certain patterns appear, but leave +the rest of the file alone. Writing single-use programs for these +tasks in languages such as C, C++, or Pascal is time-consuming and +inconvenient. Such jobs are often easier with `awk'. The `awk' +utility interprets a special-purpose programming language that makes it +easy to handle simple data-reformatting jobs. + + The GNU implementation of `awk' is called `gawk'; it is fully +compatible with the System V Release 4 version of `awk'. `gawk' is +also compatible with the POSIX specification of the `awk' language. +This means that all properly written `awk' programs should work with +`gawk'. Thus, we usually don't distinguish between `gawk' and other +`awk' implementations. + + Using `awk' allows you to: + + * Manage small, personal databases + + * Generate reports + + * Validate data + + * Produce indexes and perform other document preparation tasks + + * Experiment with algorithms that you can adapt later to other + computer languages + + In addition, `gawk' provides facilities that make it easy to: + + * Extract bits and pieces of data for processing + + * Sort data + + * Perform simple network communications + + This Info file teaches you about the `awk' language and how you can +use it effectively. You should already be familiar with basic system +commands, such as `cat' and `ls',(1) as well as basic shell facilities, +such as input/output (I/O) redirection and pipes. + + Implementations of the `awk' language are available for many +different computing environments. This Info file, while describing the +`awk' language in general, also describes the particular implementation +of `awk' called `gawk' (which stands for "GNU awk"). `gawk' runs on a +broad range of Unix systems, ranging from 80386 PC-based computers up +through large-scale systems, such as Crays. `gawk' has also been ported +to Mac OS X, MS-DOS, Microsoft Windows (all versions) and OS/2 PCs, +Atari and Amiga microcomputers, BeOS, Tandem D20, and VMS. + +* Menu: + +* History:: The history of `gawk' and + `awk'. +* Names:: What name to use to find `awk'. +* This Manual:: Using this Info file. Includes sample + input files that you can use. +* Conventions:: Typographical Conventions. +* Manual History:: Brief history of the GNU project and this + Info file. +* How To Contribute:: Helping to save the world. +* Acknowledgments:: Acknowledgments. + + ---------- Footnotes ---------- + + (1) These commands are available on POSIX-compliant systems, as well +as on traditional Unix-based systems. If you are using some other +operating system, you still need to be familiar with the ideas of I/O +redirection and pipes. + + +File: gawk.info, Node: History, Next: Names, Up: Preface + +History of `awk' and `gawk' +=========================== + + Recipe For A Programming Language + + 1 part `egrep' 1 part `snobol' + 2 parts `ed' 3 parts C + + Blend all parts well using `lex' and `yacc'. Document minimally + and release. + + After eight years, add another part `egrep' and two more parts C. + Document very well and release. + + The name `awk' comes from the initials of its designers: Alfred V. +Aho, Peter J. Weinberger and Brian W. Kernighan. The original version +of `awk' was written in 1977 at AT&T Bell Laboratories. In 1985, a new +version made the programming language more powerful, introducing +user-defined functions, multiple input streams, and computed regular +expressions. This new version became widely available with Unix System +V Release 3.1 (SVR3.1). The version in SVR4 added some new features +and cleaned up the behavior in some of the "dark corners" of the +language. The specification for `awk' in the POSIX Command Language +and Utilities standard further clarified the language. Both the `gawk' +designers and the original Bell Laboratories `awk' designers provided +feedback for the POSIX specification. + + Paul Rubin wrote the GNU implementation, `gawk', in 1986. Jay +Fenlason completed it, with advice from Richard Stallman. John Woods +contributed parts of the code as well. In 1988 and 1989, David +Trueman, with help from me, thoroughly reworked `gawk' for compatibility +with the newer `awk'. Circa 1995, I became the primary maintainer. +Current development focuses on bug fixes, performance improvements, +standards compliance, and occasionally, new features. + + In May of 1997, Ju"rgen Kahrs felt the need for network access from +`awk', and with a little help from me, set about adding features to do +this for `gawk'. At that time, he also wrote the bulk of `TCP/IP +Internetworking with `gawk'' (a separate document, available as part of +the `gawk' distribution). His code finally became part of the main +`gawk' distribution with `gawk' version 3.1. + + *Note Contributors::, for a complete list of those who made +important contributions to `gawk'. + + +File: gawk.info, Node: Names, Next: This Manual, Prev: History, Up: Preface + +A Rose by Any Other Name +======================== + +The `awk' language has evolved over the years. Full details are +provided in *note Language History::. The language described in this +Info file is often referred to as "new `awk'" (`nawk'). + + Because of this, many systems have multiple versions of `awk'. Some +systems have an `awk' utility that implements the original version of +the `awk' language and a `nawk' utility for the new version. Others +have an `oawk' version for the "old `awk'" language and plain `awk' for +the new one. Still others only have one version, which is usually the +new one.(1) + + All in all, this makes it difficult for you to know which version of +`awk' you should run when writing your programs. The best advice I can +give here is to check your local documentation. Look for `awk', `oawk', +and `nawk', as well as for `gawk'. It is likely that you already have +some version of new `awk' on your system, which is what you should use +when running your programs. (Of course, if you're reading this Info +file, chances are good that you have `gawk'!) + + Throughout this Info file, whenever we refer to a language feature +that should be available in any complete implementation of POSIX `awk', +we simply use the term `awk'. When referring to a feature that is +specific to the GNU implementation, we use the term `gawk'. + + ---------- Footnotes ---------- + + (1) Often, these systems use `gawk' for their `awk' implementation! + + +File: gawk.info, Node: This Manual, Next: Conventions, Prev: Names, Up: Preface + +Using This Book +=============== + +The term `awk' refers to a particular program as well as to the +language you use to tell this program what to do. When we need to be +careful, we call the language "the `awk' language," and the program +"the `awk' utility." This Info file explains both the `awk' language +and how to run the `awk' utility. The term "`awk' program" refers to a +program written by you in the `awk' programming language. + + Primarily, this Info file explains the features of `awk', as defined +in the POSIX standard. It does so in the context of the `gawk' +implementation. While doing so, it also attempts to describe important +differences between `gawk' and other `awk' implementations.(1) Finally, +any `gawk' features that are not in the POSIX standard for `awk' are +noted. + + There are subsections labelled as *Advanced Notes* scattered +throughout the Info file. They add a more complete explanation of +points that are relevant, but not likely to be of interest on first +reading. All appear in the index, under the heading "advanced +features." + + Most of the time, the examples use complete `awk' programs. In some +of the more advanced sections, only the part of the `awk' program that +illustrates the concept currently being described is shown. + + While this Info file is aimed principally at people who have not been +exposed to `awk', there is a lot of information here that even the `awk' +expert should find useful. In particular, the description of POSIX +`awk' and the example programs in *note Library Functions::, and in +*note Sample Programs::, should be of interest. + + *note Getting Started::, provides the essentials you need to know to +begin using `awk'. + + *note Regexp::, introduces regular expressions in general, and in +particular the flavors supported by POSIX `awk' and `gawk'. + + *note Reading Files::, describes how `awk' reads your data. It +introduces the concepts of records and fields, as well as the `getline' +command. I/O redirection is first described here. + + *note Printing::, describes how `awk' programs can produce output +with `print' and `printf'. + + *note Expressions::, describes expressions, which are the basic +building blocks for getting most things done in a program. + + *note Patterns and Actions::, describes how to write patterns for +matching records, actions for doing something when a record is matched, +and the built-in variables `awk' and `gawk' use. + + *note Arrays::, covers `awk''s one-and-only data structure: +associative arrays. Deleting array elements and whole arrays is also +described, as well as sorting arrays in `gawk'. + + *note Functions::, describes the built-in functions `awk' and `gawk' +provide, as well as how to define your own functions. + + *note Internationalization::, describes special features in `gawk' +for translating program messages into different languages at runtime. + + *note Advanced Features::, describes a number of `gawk'-specific +advanced features. Of particular note are the abilities to have +two-way communications with another process, perform TCP/IP networking, +and profile your `awk' programs. + + *note Invoking Gawk::, describes how to run `gawk', the meaning of +its command-line options, and how it finds `awk' program source files. + + *note Library Functions::, and *note Sample Programs::, provide many +sample `awk' programs. Reading them allows you to see `awk' solving +real problems. + + *note Language History::, describes how the `awk' language has +evolved since first release to present. It also describes how `gawk' +has acquired features over time. + + *note Installation::, describes how to get `gawk', how to compile it +under Unix, and how to compile and use it on different non-Unix +systems. It also describes how to report bugs in `gawk' and where to +get three other freely available implementations of `awk'. + + *note Notes::, describes how to disable `gawk''s extensions, as well +as how to contribute new code to `gawk', how to write extension +libraries, and some possible future directions for `gawk' development. + + *note Basic Concepts::, provides some very cursory background +material for those who are completely unfamiliar with computer +programming. Also centralized there is a discussion of some of the +issues surrounding floating-point numbers. + + The *note Glossary::, defines most, if not all, the significant +terms used throughout the book. If you find terms that you aren't +familiar with, try looking them up here. + + *note Copying::, and *note GNU Free Documentation License::, present +the licenses that cover the `gawk' source code and this Info file, +respectively. + + ---------- Footnotes ---------- + + (1) All such differences appear in the index under the entry +"differences in `awk' and `gawk'." + + +File: gawk.info, Node: Conventions, Next: Manual History, Prev: This Manual, Up: Preface + +Typographical Conventions +========================= + +This Info file is written using Texinfo, the GNU documentation +formatting language. A single Texinfo source file is used to produce +both the printed and online versions of the documentation. This minor +node briefly documents the typographical conventions used in Texinfo. + + Examples you would type at the command-line are preceded by the +common shell primary and secondary prompts, `$' and `>'. Output from +the command is preceded by the glyph "-|". This typically represents +the command's standard output. Error messages, and other output on the +command's standard error, are preceded by the glyph "error-->". For +example: + + $ echo hi on stdout + -| hi on stdout + $ echo hello on stderr 1>&2 + error--> hello on stderr + + Characters that you type at the keyboard look `like this'. In +particular, there are special characters called "control characters." +These are characters that you type by holding down both the `CONTROL' +key and another key, at the same time. For example, a `Ctrl-d' is typed +by first pressing and holding the `CONTROL' key, next pressing the `d' +key and finally releasing both keys. + +Dark Corners +............ + + Dark corners are basically fractal -- no matter how much you + illuminate, there's always a smaller but darker one. + Brian Kernighan + + Until the POSIX standard (and `The Gawk Manual'), many features of +`awk' were either poorly documented or not documented at all. +Descriptions of such features (often called "dark corners") are noted +in this Info file with "(d.c.)". They also appear in the index under +the heading "dark corner." + + As noted by the opening quote, though, any coverage of dark corners +is, by definition, something that is incomplete. + + +File: gawk.info, Node: Manual History, Next: How To Contribute, Prev: Conventions, Up: Preface + +The GNU Project and This Book +============================= + +The Free Software Foundation (FSF) is a nonprofit organization dedicated +to the production and distribution of freely distributable software. +It was founded by Richard M. Stallman, the author of the original Emacs +editor. GNU Emacs is the most widely used version of Emacs today. + + The GNU(1) Project is an ongoing effort on the part of the Free +Software Foundation to create a complete, freely distributable, +POSIX-compliant computing environment. The FSF uses the "GNU General +Public License" (GPL) to ensure that their software's source code is +always available to the end user. A copy of the GPL is included for +your reference (*note Copying::). The GPL applies to the C language +source code for `gawk'. To find out more about the FSF and the GNU +Project online, see the GNU Project's home page (http://www.gnu.org). +This Info file may also be read from their web site +(http://www.gnu.org/software/gawk/manual/). + + A shell, an editor (Emacs), highly portable optimizing C, C++, and +Objective-C compilers, a symbolic debugger and dozens of large and +small utilities (such as `gawk'), have all been completed and are +freely available. The GNU operating system kernel (the HURD), has been +released but is still in an early stage of development. + + Until the GNU operating system is more fully developed, you should +consider using GNU/Linux, a freely distributable, Unix-like operating +system for Intel 80386, DEC Alpha, Sun SPARC, IBM S/390, and other +systems.(2) There are many books on GNU/Linux. One that is freely +available is `Linux Installation and Getting Started', by Matt Welsh. +Many GNU/Linux distributions are often available in computer stores or +bundled on CD-ROMs with books about Linux. (There are three other +freely available, Unix-like operating systems for 80386 and other +systems: NetBSD, FreeBSD, and OpenBSD. All are based on the 4.4-Lite +Berkeley Software Distribution, and they use recent versions of `gawk' +for their versions of `awk'.) + + The Info file itself has gone through a number of previous editions. +Paul Rubin wrote the very first draft of `The GAWK Manual'; it was +around 40 pages in size. Diane Close and Richard Stallman improved it, +yielding a version that was around 90 pages long and barely described +the original, "old" version of `awk'. + + I started working with that version in the fall of 1988. As work on +it progressed, the FSF published several preliminary versions (numbered +0.X). In 1996, Edition 1.0 was released with `gawk' 3.0.0. The FSF +published the first two editions under the title `The GNU Awk User's +Guide'. + + This edition maintains the basic structure of Edition 1.0, but with +significant additional material, reflecting the host of new features in +`gawk' version 3.1. Of particular note is *note Array Sorting::, as +well as *note Bitwise Functions::, *note Internationalization::, and +also *note Advanced Features::, and *note Dynamic Extensions::. + + `GAWK: Effective AWK Programming' will undoubtedly continue to +evolve. An electronic version comes with the `gawk' distribution from +the FSF. If you find an error in this Info file, please report it! +*Note Bugs::, for information on submitting problem reports +electronically, or write to me in care of the publisher. + + ---------- Footnotes ---------- + + (1) GNU stands for "GNU's not Unix." + + (2) The terminology "GNU/Linux" is explained in the *note Glossary::. + + +File: gawk.info, Node: How To Contribute, Next: Acknowledgments, Prev: Manual History, Up: Preface + +How to Contribute +================= + +As the maintainer of GNU `awk', I am starting a collection of publicly +available `awk' programs. For more information, see +`ftp://ftp.freefriends.org/arnold/Awkstuff'. If you have written an +interesting `awk' program, or have written a `gawk' extension that you +would like to share with the rest of the world, please contact me +(). Making things available on the Internet helps +keep the `gawk' distribution down to manageable size. + + +File: gawk.info, Node: Acknowledgments, Prev: How To Contribute, Up: Preface + +Acknowledgments +=============== + +The initial draft of `The GAWK Manual' had the following +acknowledgments: + + Many people need to be thanked for their assistance in producing + this manual. Jay Fenlason contributed many ideas and sample + programs. Richard Mlynarik and Robert Chassell gave helpful + comments on drafts of this manual. The paper `A Supplemental + Document for `awk'' by John W. Pierce of the Chemistry Department + at UC San Diego, pinpointed several issues relevant both to `awk' + implementation and to this manual, that would otherwise have + escaped us. + + I would like to acknowledge Richard M. Stallman, for his vision of a +better world and for his courage in founding the FSF and starting the +GNU Project. + + The following people (in alphabetical order) provided helpful +comments on various versions of this book, up to and including this +edition. Rick Adams, Nelson H.F. Beebe, Karl Berry, Dr. Michael +Brennan, Rich Burridge, Claire Cloutier, Diane Close, Scott Deifik, +Christopher ("Topher") Eliot, Jeffrey Friedl, Dr. Darrel Hankerson, +Michal Jaegermann, Dr. Richard J. LeBlanc, Michael Lijewski, Pat Rankin, +Miriam Robbins, Mary Sheehan, and Chuck Toporek. + + Robert J. Chassell provided much valuable advice on the use of +Texinfo. He also deserves special thanks for convincing me _not_ to +title this Info file `How To Gawk Politely'. Karl Berry helped +significantly with the TeX part of Texinfo. + + I would like to thank Marshall and Elaine Hartholz of Seattle and +Dr. Bert and Rita Schreiber of Detroit for large amounts of quiet +vacation time in their homes, which allowed me to make significant +progress on this Info file and on `gawk' itself. + + Phil Hughes of SSC contributed in a very important way by loaning me +his laptop GNU/Linux system, not once, but twice, which allowed me to +do a lot of work while away from home. + + David Trueman deserves special credit; he has done a yeoman job of +evolving `gawk' so that it performs well and without bugs. Although he +is no longer involved with `gawk', working with him on this project was +a significant pleasure. + + The intrepid members of the GNITS mailing list, and most notably +Ulrich Drepper, provided invaluable help and feedback for the design of +the internationalization features. + + Nelson Beebe, Martin Brown, Andreas Buening, Scott Deifik, Darrel +Hankerson, Isamu Hasegawa, Michal Jaegermann, Ju"rgen Kahrs, Pat Rankin, +Kai Uwe Rommel, and Eli Zaretskii (in alphabetical order) make up the +`gawk' "crack portability team." Without their hard work and help, +`gawk' would not be nearly the fine program it is today. It has been +and continues to be a pleasure working with this team of fine people. + + David and I would like to thank Brian Kernighan of Bell Laboratories +for invaluable assistance during the testing and debugging of `gawk', +and for help in clarifying numerous points about the language. We +could not have done nearly as good a job on either `gawk' or its +documentation without his help. + + Chuck Toporek, Mary Sheehan, and Claire Coutier of O'Reilly & +Associates contributed significant editorial help for this Info file +for the 3.1 release of `gawk'. + + I must thank my wonderful wife, Miriam, for her patience through the +many versions of this project, for her proofreading, and for sharing me +with the computer. I would like to thank my parents for their love, +and for the grace with which they raised and educated me. Finally, I +also must acknowledge my gratitude to G-d, for the many opportunities +He has sent my way, as well as for the gifts He has given me with which +to take advantage of those opportunities. + + +Arnold Robbins +Nof Ayalon +ISRAEL +March, 2001 + + +File: gawk.info, Node: Getting Started, Next: Regexp, Prev: Preface, Up: Top + +1 Getting Started with `awk' +**************************** + +The basic function of `awk' is to search files for lines (or other +units of text) that contain certain patterns. When a line matches one +of the patterns, `awk' performs specified actions on that line. `awk' +keeps processing input lines in this way until it reaches the end of +the input files. + + Programs in `awk' are different from programs in most other +languages, because `awk' programs are "data-driven"; that is, you +describe the data you want to work with and then what to do when you +find it. Most other languages are "procedural"; you have to describe, +in great detail, every step the program is to take. When working with +procedural languages, it is usually much harder to clearly describe the +data your program will process. For this reason, `awk' programs are +often refreshingly easy to read and write. + + When you run `awk', you specify an `awk' "program" that tells `awk' +what to do. The program consists of a series of "rules". (It may also +contain "function definitions", an advanced feature that we will ignore +for now. *Note User-defined::.) Each rule specifies one pattern to +search for and one action to perform upon finding the pattern. + + Syntactically, a rule consists of a pattern followed by an action. +The action is enclosed in curly braces to separate it from the pattern. +Newlines usually separate rules. Therefore, an `awk' program looks +like this: + + PATTERN { ACTION } + PATTERN { ACTION } + ... + +* Menu: + +* Running gawk:: How to run `gawk' programs; includes + command-line syntax. +* Sample Data Files:: Sample data files for use in the `awk' + programs illustrated in this Info file. +* Very Simple:: A very simple example. +* Two Rules:: A less simple one-line example using two + rules. +* More Complex:: A more complex example. +* Statements/Lines:: Subdividing or combining statements into + lines. +* Other Features:: Other Features of `awk'. +* When:: When to use `gawk' and when to use + other things. + + +File: gawk.info, Node: Running gawk, Next: Sample Data Files, Up: Getting Started + +1.1 How to Run `awk' Programs +============================= + +There are several ways to run an `awk' program. If the program is +short, it is easiest to include it in the command that runs `awk', like +this: + + awk 'PROGRAM' INPUT-FILE1 INPUT-FILE2 ... + + When the program is long, it is usually more convenient to put it in +a file and run it with a command like this: + + awk -f PROGRAM-FILE INPUT-FILE1 INPUT-FILE2 ... + + This minor node discusses both mechanisms, along with several +variations of each. + +* Menu: + +* One-shot:: Running a short throwaway `awk' + program. +* Read Terminal:: Using no input files (input from terminal + instead). +* Long:: Putting permanent `awk' programs in + files. +* Executable Scripts:: Making self-contained `awk' programs. +* Comments:: Adding documentation to `gawk' + programs. +* Quoting:: More discussion of shell quoting issues. + + +File: gawk.info, Node: One-shot, Next: Read Terminal, Up: Running gawk + +1.1.1 One-Shot Throwaway `awk' Programs +--------------------------------------- + +Once you are familiar with `awk', you will often type in simple +programs the moment you want to use them. Then you can write the +program as the first argument of the `awk' command, like this: + + awk 'PROGRAM' INPUT-FILE1 INPUT-FILE2 ... + +where PROGRAM consists of a series of PATTERNS and ACTIONS, as +described earlier. + + This command format instructs the "shell", or command interpreter, +to start `awk' and use the PROGRAM to process records in the input +file(s). There are single quotes around PROGRAM so the shell won't +interpret any `awk' characters as special shell characters. The quotes +also cause the shell to treat all of PROGRAM as a single argument for +`awk', and allow PROGRAM to be more than one line long. + + This format is also useful for running short or medium-sized `awk' +programs from shell scripts, because it avoids the need for a separate +file for the `awk' program. A self-contained shell script is more +reliable because there are no other files to misplace. + + *note Very Simple::, presents several short, self-contained programs. + + +File: gawk.info, Node: Read Terminal, Next: Long, Prev: One-shot, Up: Running gawk + +1.1.2 Running `awk' Without Input Files +--------------------------------------- + +You can also run `awk' without any input files. If you type the +following command line: + + awk 'PROGRAM' + +`awk' applies the PROGRAM to the "standard input", which usually means +whatever you type on the terminal. This continues until you indicate +end-of-file by typing `Ctrl-d'. (On other operating systems, the +end-of-file character may be different. For example, on OS/2 and +MS-DOS, it is `Ctrl-z'.) + + As an example, the following program prints a friendly piece of +advice (from Douglas Adams's `The Hitchhiker's Guide to the Galaxy'), +to keep you from worrying about the complexities of computer programming +(`BEGIN' is a feature we haven't discussed yet): + + $ awk "BEGIN { print \"Don't Panic!\" }" + -| Don't Panic! + + This program does not read any input. The `\' before each of the +inner double quotes is necessary because of the shell's quoting +rules--in particular because it mixes both single quotes and double +quotes.(1) + + This next simple `awk' program emulates the `cat' utility; it copies +whatever you type on the keyboard to its standard output (why this +works is explained shortly). + + $ awk '{ print }' + Now is the time for all good men + -| Now is the time for all good men + to come to the aid of their country. + -| to come to the aid of their country. + Four score and seven years ago, ... + -| Four score and seven years ago, ... + What, me worry? + -| What, me worry? + Ctrl-d + + ---------- Footnotes ---------- + + (1) Although we generally recommend the use of single quotes around +the program text, double quotes are needed here in order to put the +single quote into the message. + + +File: gawk.info, Node: Long, Next: Executable Scripts, Prev: Read Terminal, Up: Running gawk + +1.1.3 Running Long Programs +--------------------------- + +Sometimes your `awk' programs can be very long. In this case, it is +more convenient to put the program into a separate file. In order to +tell `awk' to use that file for its program, you type: + + awk -f SOURCE-FILE INPUT-FILE1 INPUT-FILE2 ... + + The `-f' instructs the `awk' utility to get the `awk' program from +the file SOURCE-FILE. Any file name can be used for SOURCE-FILE. For +example, you could put the program: + + BEGIN { print "Don't Panic!" } + +into the file `advice'. Then this command: + + awk -f advice + +does the same thing as this one: + + awk "BEGIN { print \"Don't Panic!\" }" + +This was explained earlier (*note Read Terminal::). Note that you +don't usually need single quotes around the file name that you specify +with `-f', because most file names don't contain any of the shell's +special characters. Notice that in `advice', the `awk' program did not +have single quotes around it. The quotes are only needed for programs +that are provided on the `awk' command line. + + If you want to identify your `awk' program files clearly as such, +you can add the extension `.awk' to the file name. This doesn't affect +the execution of the `awk' program but it does make "housekeeping" +easier. + + +File: gawk.info, Node: Executable Scripts, Next: Comments, Prev: Long, Up: Running gawk + +1.1.4 Executable `awk' Programs +------------------------------- + +Once you have learned `awk', you may want to write self-contained `awk' +scripts, using the `#!' script mechanism. You can do this on many Unix +systems(1) as well as on the GNU system. For example, you could update +the file `advice' to look like this: + + #! /bin/awk -f + + BEGIN { print "Don't Panic!" } + +After making this file executable (with the `chmod' utility), simply +type `advice' at the shell and the system arranges to run `awk'(2) as +if you had typed `awk -f advice': + + $ chmod +x advice + $ advice + -| Don't Panic! + +(We assume you have the current directory in your shell's search path +variable (typically `$PATH'). If not, you may need to type `./advice' +at the shell.) + + Self-contained `awk' scripts are useful when you want to write a +program that users can invoke without their having to know that the +program is written in `awk'. + +Advanced Notes: Portability Issues with `#!' +-------------------------------------------- + +Some systems limit the length of the interpreter name to 32 characters. +Often, this can be dealt with by using a symbolic link. + + You should not put more than one argument on the `#!' line after the +path to `awk'. It does not work. The operating system treats the rest +of the line as a single argument and passes it to `awk'. Doing this +leads to confusing behavior--most likely a usage diagnostic of some +sort from `awk'. + + Finally, the value of `ARGV[0]' (*note Built-in Variables::) varies +depending upon your operating system. Some systems put `awk' there, +some put the full pathname of `awk' (such as `/bin/awk'), and some put +the name of your script (`advice'). Don't rely on the value of +`ARGV[0]' to provide your script name. + + ---------- Footnotes ---------- + + (1) The `#!' mechanism works on Linux systems, systems derived from +the 4.4-Lite Berkeley Software Distribution, and most commercial Unix +systems. + + (2) The line beginning with `#!' lists the full file name of an +interpreter to run and an optional initial command-line argument to +pass to that interpreter. The operating system then runs the +interpreter with the given argument and the full argument list of the +executed program. The first argument in the list is the full file name +of the `awk' program. The rest of the argument list contains either +options to `awk', or data files, or both. + + +File: gawk.info, Node: Comments, Next: Quoting, Prev: Executable Scripts, Up: Running gawk + +1.1.5 Comments in `awk' Programs +-------------------------------- + +A "comment" is some text that is included in a program for the sake of +human readers; it is not really an executable part of the program. +Comments can explain what the program does and how it works. Nearly all +programming languages have provisions for comments, as programs are +typically hard to understand without them. + + In the `awk' language, a comment starts with the sharp sign +character (`#') and continues to the end of the line. The `#' does not +have to be the first character on the line. The `awk' language ignores +the rest of a line following a sharp sign. For example, we could have +put the following into `advice': + + # This program prints a nice friendly message. It helps + # keep novice users from being afraid of the computer. + BEGIN { print "Don't Panic!" } + + You can put comment lines into keyboard-composed throwaway `awk' +programs, but this usually isn't very useful; the purpose of a comment +is to help you or another person understand the program when reading it +at a later time. + + *Caution:* As mentioned in *note One-shot::, you can enclose small +to medium programs in single quotes, in order to keep your shell +scripts self-contained. When doing so, _don't_ put an apostrophe +(i.e., a single quote) into a comment (or anywhere else in your +program). The shell interprets the quote as the closing quote for the +entire program. As a result, usually the shell prints a message about +mismatched quotes, and if `awk' actually runs, it will probably print +strange messages about syntax errors. For example, look at the +following: + + $ awk '{ print "hello" } # let's be cute' + > + + The shell sees that the first two quotes match, and that a new +quoted object begins at the end of the command line. It therefore +prompts with the secondary prompt, waiting for more input. With Unix +`awk', closing the quoted string produces this result: + + $ awk '{ print "hello" } # let's be cute' + > ' + error--> awk: can't open file be + error--> source line number 1 + + Putting a backslash before the single quote in `let's' wouldn't help, +since backslashes are not special inside single quotes. The next +node describes the shell's quoting rules. + + +File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk + +1.1.6 Shell-Quoting Issues +-------------------------- + +For short to medium length `awk' programs, it is most convenient to +enter the program on the `awk' command line. This is best done by +enclosing the entire program in single quotes. This is true whether +you are entering the program interactively at the shell prompt, or +writing it as part of a larger shell script: + + awk 'PROGRAM TEXT' INPUT-FILE1 INPUT-FILE2 ... + + Once you are working with the shell, it is helpful to have a basic +knowledge of shell quoting rules. The following rules apply only to +POSIX-compliant, Bourne-style shells (such as `bash', the GNU +Bourne-Again Shell). If you use `csh', you're on your own. + + * Quoted items can be concatenated with nonquoted items as well as + with other quoted items. The shell turns everything into one + argument for the command. + + * Preceding any single character with a backslash (`\') quotes that + character. The shell removes the backslash and passes the quoted + character on to the command. + + * Single quotes protect everything between the opening and closing + quotes. The shell does no interpretation of the quoted text, + passing it on verbatim to the command. It is _impossible_ to + embed a single quote inside single-quoted text. Refer back to + *note Comments::, for an example of what happens if you try. + + * Double quotes protect most things between the opening and closing + quotes. The shell does at least variable and command substitution + on the quoted text. Different shells may do additional kinds of + processing on double-quoted text. + + Since certain characters within double-quoted text are processed + by the shell, they must be "escaped" within the text. Of note are + the characters `$', ``', `\', and `"', all of which must be + preceded by a backslash within double-quoted text if they are to + be passed on literally to the program. (The leading backslash is + stripped first.) Thus, the example seen in *note Read Terminal::, + is applicable: + + $ awk "BEGIN { print \"Don't Panic!\" }" + -| Don't Panic! + + Note that the single quote is not special within double quotes. + + * Null strings are removed when they occur as part of a non-null + command-line argument, while explicit non-null objects are kept. + For example, to specify that the field separator `FS' should be + set to the null string, use: + + awk -F "" 'PROGRAM' FILES # correct + + Don't use this: + + awk -F"" 'PROGRAM' FILES # wrong! + + In the second case, `awk' will attempt to use the text of the + program as the value of `FS', and the first file name as the text + of the program! This results in syntax errors at best, and + confusing behavior at worst. + + Mixing single and double quotes is difficult. You have to resort to +shell quoting tricks, like this: + + $ awk 'BEGIN { print "Here is a single quote <'"'"'>" }' + -| Here is a single quote <'> + +This program consists of three concatenated quoted strings. The first +and the third are single-quoted, the second is double-quoted. + + This can be "simplified" to: + + $ awk 'BEGIN { print "Here is a single quote <'\''>" }' + -| Here is a single quote <'> + +Judge for yourself which of these two is the more readable. + + Another option is to use double quotes, escaping the embedded, +`awk'-level double quotes: + + $ awk "BEGIN { print \"Here is a single quote <'>\" }" + -| Here is a single quote <'> + +This option is also painful, because double quotes, backslashes, and +dollar signs are very common in `awk' programs. + + A third option is to use the octal escape sequence equivalents for +the single- and double-quote characters, like so: + + $ awk 'BEGIN { print "Here is a single quote <\47>" }' + -| Here is a single quote <'> + $ awk 'BEGIN { print "Here is a double quote <\42>" }' + -| Here is a double quote <"> + +This works nicely, except that you should comment clearly what the +escapes mean. + + A fourth option is to use command-line variable assignment, like +this: + + $ awk -v sq="'" 'BEGIN { print "Here is a single quote <" sq ">" }' + -| Here is a single quote <'> + + If you really need both single and double quotes in your `awk' +program, it is probably best to move it into a separate file, where the +shell won't be part of the picture, and you can say what you mean. + + +File: gawk.info, Node: Sample Data Files, Next: Very Simple, Prev: Running gawk, Up: Getting Started + +1.2 Data Files for the Examples +=============================== + +Many of the examples in this Info file take their input from two sample +data files. The first, `BBS-list', represents a list of computer +bulletin board systems together with information about those systems. +The second data file, called `inventory-shipped', contains information +about monthly shipments. In both files, each line is considered to be +one "record". + + In the data file `BBS-list', each record contains the name of a +computer bulletin board, its phone number, the board's baud rate(s), +and a code for the number of hours it is operational. An `A' in the +last column means the board operates 24 hours a day. A `B' in the last +column means the board only operates on evening and weekend hours. A +`C' means the board operates only on weekends: + + aardvark 555-5553 1200/300 B + alpo-net 555-3412 2400/1200/300 A + barfly 555-7685 1200/300 A + bites 555-1675 2400/1200/300 A + camelot 555-0542 300 C + core 555-2912 1200/300 C + fooey 555-1234 2400/1200/300 B + foot 555-6699 1200/300 B + macfoo 555-6480 1200/300 A + sdace 555-3430 2400/1200/300 A + sabafoo 555-2127 1200/300 C + + The data file `inventory-shipped' represents information about +shipments during the year. Each record contains the month, the number +of green crates shipped, the number of red boxes shipped, the number of +orange bags shipped, and the number of blue packages shipped, +respectively. There are 16 entries, covering the 12 months of last year +and the first four months of the current year. + + Jan 13 25 15 115 + Feb 15 32 24 226 + Mar 15 24 34 228 + Apr 31 52 63 420 + May 16 34 29 208 + Jun 31 42 75 492 + Jul 24 34 67 436 + Aug 15 34 47 316 + Sep 13 55 37 277 + Oct 29 54 68 525 + Nov 20 87 82 577 + Dec 17 35 61 401 + + Jan 21 36 64 620 + Feb 26 58 80 652 + Mar 24 75 70 495 + Apr 21 70 74 514 + + If you are reading this in GNU Emacs using Info, you can copy the +regions of text showing these sample files into your own test files. +This way you can try out the examples shown in the remainder of this +document. You do this by using the command `M-x write-region' to copy +text from the Info file into a file for use with `awk' (*Note +Miscellaneous File Operations: (emacs)Misc File Ops, for more +information). Using this information, create your own `BBS-list' and +`inventory-shipped' files and practice what you learn in this Info file. + + If you are using the stand-alone version of Info, see *note Extract +Program::, for an `awk' program that extracts these data files from +`gawk.texi', the Texinfo source file for this Info file. + + +File: gawk.info, Node: Very Simple, Next: Two Rules, Prev: Sample Data Files, Up: Getting Started + +1.3 Some Simple Examples +======================== + +The following command runs a simple `awk' program that searches the +input file `BBS-list' for the character string `foo' (a grouping of +characters is usually called a "string"; the term "string" is based on +similar usage in English, such as "a string of pearls," or "a string of +cars in a train"): + + awk '/foo/ { print $0 }' BBS-list + +When lines containing `foo' are found, they are printed because +`print $0' means print the current line. (Just `print' by itself means +the same thing, so we could have written that instead.) + + You will notice that slashes (`/') surround the string `foo' in the +`awk' program. The slashes indicate that `foo' is the pattern to +search for. This type of pattern is called a "regular expression", +which is covered in more detail later (*note Regexp::). The pattern is +allowed to match parts of words. There are single quotes around the +`awk' program so that the shell won't interpret any of it as special +shell characters. + + Here is what this program prints: + + $ awk '/foo/ { print $0 }' BBS-list + -| fooey 555-1234 2400/1200/300 B + -| foot 555-6699 1200/300 B + -| macfoo 555-6480 1200/300 A + -| sabafoo 555-2127 1200/300 C + + In an `awk' rule, either the pattern or the action can be omitted, +but not both. If the pattern is omitted, then the action is performed +for _every_ input line. If the action is omitted, the default action +is to print all lines that match the pattern. + + Thus, we could leave out the action (the `print' statement and the +curly braces) in the previous example and the result would be the same: +all lines matching the pattern `foo' are printed. By comparison, +omitting the `print' statement but retaining the curly braces makes an +empty action that does nothing (i.e., no lines are printed). + + Many practical `awk' programs are just a line or two. Following is a +collection of useful, short programs to get you started. Some of these +programs contain constructs that haven't been covered yet. (The +description of the program will give you a good idea of what is going +on, but please read the rest of the Info file to become an `awk' +expert!) Most of the examples use a data file named `data'. This is +just a placeholder; if you use these programs yourself, substitute your +own file names for `data'. For future reference, note that there is +often more than one way to do things in `awk'. At some point, you may +want to look back at these examples and see if you can come up with +different ways to do the same things shown here: + + * Print the length of the longest input line: + + awk '{ if (length($0) > max) max = length($0) } + END { print max }' data + + * Print every line that is longer than 80 characters: + + awk 'length($0) > 80' data + + The sole rule has a relational expression as its pattern and it + has no action--so the default action, printing the record, is used. + + * Print the length of the longest line in `data': + + expand data | awk '{ if (x < length()) x = length() } + END { print "maximum line length is " x }' + + The input is processed by the `expand' utility to change tabs into + spaces, so the widths compared are actually the right-margin + columns. + + * Print every line that has at least one field: + + awk 'NF > 0' data + + This is an easy way to delete blank lines from a file (or rather, + to create a new file similar to the old file but from which the + blank lines have been removed). + + * Print seven random numbers from 0 to 100, inclusive: + + awk 'BEGIN { for (i = 1; i <= 7; i++) + print int(101 * rand()) }' + + * Print the total number of bytes used by FILES: + + ls -l FILES | awk '{ x += $5 } + END { print "total bytes: " x }' + + * Print the total number of kilobytes used by FILES: + + ls -l FILES | awk '{ x += $5 } + END { print "total K-bytes: " (x + 1023)/1024 }' + + * Print a sorted list of the login names of all users: + + awk -F: '{ print $1 }' /etc/passwd | sort + + * Count the lines in a file: + + awk 'END { print NR }' data + + * Print the even-numbered lines in the data file: + + awk 'NR % 2 == 0' data + + If you use the expression `NR % 2 == 1' instead, the program would + print the odd-numbered lines. + + +File: gawk.info, Node: Two Rules, Next: More Complex, Prev: Very Simple, Up: Getting Started + +1.4 An Example with Two Rules +============================= + +The `awk' utility reads the input files one line at a time. For each +line, `awk' tries the patterns of each of the rules. If several +patterns match, then several actions are run in the order in which they +appear in the `awk' program. If no patterns match, then no actions are +run. + + After processing all the rules that match the line (and perhaps +there are none), `awk' reads the next line. (However, *note Next +Statement::, and also *note Nextfile Statement::). This continues +until the program reaches the end of the file. For example, the +following `awk' program contains two rules: + + /12/ { print $0 } + /21/ { print $0 } + +The first rule has the string `12' as the pattern and `print $0' as the +action. The second rule has the string `21' as the pattern and also +has `print $0' as the action. Each rule's action is enclosed in its +own pair of braces. + + This program prints every line that contains the string `12' _or_ +the string `21'. If a line contains both strings, it is printed twice, +once by each rule. + + This is what happens if we run this program on our two sample data +files, `BBS-list' and `inventory-shipped': + + $ awk '/12/ { print $0 } + > /21/ { print $0 }' BBS-list inventory-shipped + -| aardvark 555-5553 1200/300 B + -| alpo-net 555-3412 2400/1200/300 A + -| barfly 555-7685 1200/300 A + -| bites 555-1675 2400/1200/300 A + -| core 555-2912 1200/300 C + -| fooey 555-1234 2400/1200/300 B + -| foot 555-6699 1200/300 B + -| macfoo 555-6480 1200/300 A + -| sdace 555-3430 2400/1200/300 A + -| sabafoo 555-2127 1200/300 C + -| sabafoo 555-2127 1200/300 C + -| Jan 21 36 64 620 + -| Apr 21 70 74 514 + +Note how the line beginning with `sabafoo' in `BBS-list' was printed +twice, once for each rule. + + +File: gawk.info, Node: More Complex, Next: Statements/Lines, Prev: Two Rules, Up: Getting Started + +1.5 A More Complex Example +========================== + +Now that we've mastered some simple tasks, let's look at what typical +`awk' programs do. This example shows how `awk' can be used to +summarize, select, and rearrange the output of another utility. It uses +features that haven't been covered yet, so don't worry if you don't +understand all the details: + + ls -l | awk '$6 == "Nov" { sum += $5 } + END { print sum }' + + This command prints the total number of bytes in all the files in the +current directory that were last modified in November (of any year). +(1) The `ls -l' part of this example is a system command that gives you +a listing of the files in a directory, including each file's size and +the date the file was last modified. Its output looks like this: + + -rw-r--r-- 1 arnold user 1933 Nov 7 13:05 Makefile + -rw-r--r-- 1 arnold user 10809 Nov 7 13:03 awk.h + -rw-r--r-- 1 arnold user 983 Apr 13 12:14 awk.tab.h + -rw-r--r-- 1 arnold user 31869 Jun 15 12:20 awkgram.y + -rw-r--r-- 1 arnold user 22414 Nov 7 13:03 awk1.c + -rw-r--r-- 1 arnold user 37455 Nov 7 13:03 awk2.c + -rw-r--r-- 1 arnold user 27511 Dec 9 13:07 awk3.c + -rw-r--r-- 1 arnold user 7989 Nov 7 13:03 awk4.c + +The first field contains read-write permissions, the second field +contains the number of links to the file, and the third field +identifies the owner of the file. The fourth field identifies the group +of the file. The fifth field contains the size of the file in bytes. +The sixth, seventh, and eighth fields contain the month, day, and time, +respectively, that the file was last modified. Finally, the ninth field +contains the name of the file.(2) + + The `$6 == "Nov"' in our `awk' program is an expression that tests +whether the sixth field of the output from `ls -l' matches the string +`Nov'. Each time a line has the string `Nov' for its sixth field, the +action `sum += $5' is performed. This adds the fifth field (the file's +size) to the variable `sum'. As a result, when `awk' has finished +reading all the input lines, `sum' is the total of the sizes of the +files whose lines matched the pattern. (This works because `awk' +variables are automatically initialized to zero.) + + After the last line of output from `ls' has been processed, the +`END' rule executes and prints the value of `sum'. In this example, +the value of `sum' is 80600. + + These more advanced `awk' techniques are covered in later sections +(*note Action Overview::). Before you can move on to more advanced +`awk' programming, you have to know how `awk' interprets your input and +displays your output. By manipulating fields and using `print' +statements, you can produce some very useful and impressive-looking +reports. + + ---------- Footnotes ---------- + + (1) In the C shell (`csh'), you need to type a semicolon and then a +backslash at the end of the first line; see *note Statements/Lines::, +for an explanation. In a POSIX-compliant shell, such as the Bourne +shell or `bash', you can type the example as shown. If the command +`echo $path' produces an empty output line, you are most likely using a +POSIX-compliant shell. Otherwise, you are probably using the C shell +or a shell derived from it. + + (2) On some very old systems, you may need to use `ls -lg' to get +this output. + + +File: gawk.info, Node: Statements/Lines, Next: Other Features, Prev: More Complex, Up: Getting Started + +1.6 `awk' Statements Versus Lines +================================= + +Most often, each line in an `awk' program is a separate statement or +separate rule, like this: + + awk '/12/ { print $0 } + /21/ { print $0 }' BBS-list inventory-shipped + + However, `gawk' ignores newlines after any of the following symbols +and keywords: + + , { ? : || && do else + +A newline at any other point is considered the end of the statement.(1) + + If you would like to split a single statement into two lines at a +point where a newline would terminate it, you can "continue" it by +ending the first line with a backslash character (`\'). The backslash +must be the final character on the line in order to be recognized as a +continuation character. A backslash is allowed anywhere in the +statement, even in the middle of a string or regular expression. For +example: + + awk '/This regular expression is too long, so continue it\ + on the next line/ { print $1 }' + +We have generally not used backslash continuation in the sample programs +in this Info file. In `gawk', there is no limit on the length of a +line, so backslash continuation is never strictly necessary; it just +makes programs more readable. For this same reason, as well as for +clarity, we have kept most statements short in the sample programs +presented throughout the Info file. Backslash continuation is most +useful when your `awk' program is in a separate source file instead of +entered from the command line. You should also note that many `awk' +implementations are more particular about where you may use backslash +continuation. For example, they may not allow you to split a string +constant using backslash continuation. Thus, for maximum portability +of your `awk' programs, it is best not to split your lines in the +middle of a regular expression or a string. + + *Caution:* _Backslash continuation does not work as described with +the C shell._ It works for `awk' programs in files and for one-shot +programs, _provided_ you are using a POSIX-compliant shell, such as the +Unix Bourne shell or `bash'. But the C shell behaves differently! +There, you must use two backslashes in a row, followed by a newline. +Note also that when using the C shell, _every_ newline in your awk +program must be escaped with a backslash. To illustrate: + + % awk 'BEGIN { \ + ? print \\ + ? "hello, world" \ + ? }' + -| hello, world + +Here, the `%' and `?' are the C shell's primary and secondary prompts, +analogous to the standard shell's `$' and `>'. + + Compare the previous example to how it is done with a +POSIX-compliant shell: + + $ awk 'BEGIN { + > print \ + > "hello, world" + > }' + -| hello, world + + `awk' is a line-oriented language. Each rule's action has to begin +on the same line as the pattern. To have the pattern and action on +separate lines, you _must_ use backslash continuation; there is no +other option. + + Another thing to keep in mind is that backslash continuation and +comments do not mix. As soon as `awk' sees the `#' that starts a +comment, it ignores _everything_ on the rest of the line. For example: + + $ gawk 'BEGIN { print "dont panic" # a friendly \ + > BEGIN rule + > }' + error--> gawk: cmd. line:2: BEGIN rule + error--> gawk: cmd. line:2: ^ parse error + +In this case, it looks like the backslash would continue the comment +onto the next line. However, the backslash-newline combination is never +even noticed because it is "hidden" inside the comment. Thus, the +`BEGIN' is noted as a syntax error. + + When `awk' statements within one rule are short, you might want to +put more than one of them on a line. This is accomplished by +separating the statements with a semicolon (`;'). This also applies to +the rules themselves. Thus, the program shown at the start of this +minor node could also be written this way: + + /12/ { print $0 } ; /21/ { print $0 } + + NOTE: The requirement that states that rules on the same line must + be separated with a semicolon was not in the original `awk' + language; it was added for consistency with the treatment of + statements within an action. + + ---------- Footnotes ---------- + + (1) The `?' and `:' referred to here is the three-operand +conditional expression described in *note Conditional Exp::. Splitting +lines after `?' and `:' is a minor `gawk' extension; if `--posix' is +specified (*note Options::), then this extension is disabled. + + +File: gawk.info, Node: Other Features, Next: When, Prev: Statements/Lines, Up: Getting Started + +1.7 Other Features of `awk' +=========================== + +The `awk' language provides a number of predefined, or "built-in", +variables that your programs can use to get information from `awk'. +There are other variables your program can set as well to control how +`awk' processes your data. + + In addition, `awk' provides a number of built-in functions for doing +common computational and string-related operations. `gawk' provides +built-in functions for working with timestamps, performing bit +manipulation, and for runtime string translation. + + As we develop our presentation of the `awk' language, we introduce +most of the variables and many of the functions. They are defined +systematically in *note Built-in Variables::, and *note Built-in::. + + +File: gawk.info, Node: When, Prev: Other Features, Up: Getting Started + +1.8 When to Use `awk' +===================== + +Now that you've seen some of what `awk' can do, you might wonder how +`awk' could be useful for you. By using utility programs, advanced +patterns, field separators, arithmetic statements, and other selection +criteria, you can produce much more complex output. The `awk' language +is very useful for producing reports from large amounts of raw data, +such as summarizing information from the output of other utility +programs like `ls'. (*Note More Complex::.) + + Programs written with `awk' are usually much smaller than they would +be in other languages. This makes `awk' programs easy to compose and +use. Often, `awk' programs can be quickly composed at your terminal, +used once, and thrown away. Because `awk' programs are interpreted, you +can avoid the (usually lengthy) compilation part of the typical +edit-compile-test-debug cycle of software development. + + Complex programs have been written in `awk', including a complete +retargetable assembler for eight-bit microprocessors (*note Glossary::, +for more information), and a microcode assembler for a special-purpose +Prolog computer. More recently, `gawk' was used for writing a Wiki +clone.(1) While the original `awk''s capabilities were strained by tasks +of such complexity, modern versions are more capable. Even the Bell +Labs version of `awk' has fewer predefined limits, and those that it +has are much larger than they used to be. + + If you find yourself writing `awk' scripts of more than, say, a few +hundred lines, you might consider using a different programming +language. Emacs Lisp is a good choice if you need sophisticated string +or pattern matching capabilities. The shell is also good at string and +pattern matching; in addition, it allows powerful use of the system +utilities. More conventional languages, such as C, C++, and Java, offer +better facilities for system programming and for managing the complexity +of large programs. Programs in these languages may require more lines +of source code than the equivalent `awk' programs, but they are easier +to maintain and usually run more efficiently. + + ---------- Footnotes ---------- + + (1) Yet Another Wiki Clone +(http://www.awk-scripting.de/cgi-bin/wiki.cgi/yawk/). + + +File: gawk.info, Node: Regexp, Next: Reading Files, Prev: Getting Started, Up: Top + +2 Regular Expressions +********************* + +A "regular expression", or "regexp", is a way of describing a set of +strings. Because regular expressions are such a fundamental part of +`awk' programming, their format and use deserve a separate major node. + + A regular expression enclosed in slashes (`/') is an `awk' pattern +that matches every input record whose text belongs to that set. The +simplest regular expression is a sequence of letters, numbers, or both. +Such a regexp matches any string that contains that sequence. Thus, +the regexp `foo' matches any string containing `foo'. Therefore, the +pattern `/foo/' matches any input record containing the three +characters `foo' _anywhere_ in the record. Other kinds of regexps let +you specify more complicated classes of strings. + +* Menu: + +* Regexp Usage:: How to Use Regular Expressions. +* Escape Sequences:: How to write nonprinting characters. +* Regexp Operators:: Regular Expression Operators. +* Character Lists:: What can go between `[...]'. +* GNU Regexp Operators:: Operators specific to GNU software. +* Case-sensitivity:: How to do case-insensitive matching. +* Leftmost Longest:: How much text matches. +* Computed Regexps:: Using Dynamic Regexps. +* Locales:: How the locale affects things. + + +File: gawk.info, Node: Regexp Usage, Next: Escape Sequences, Up: Regexp + +2.1 How to Use Regular Expressions +================================== + +A regular expression can be used as a pattern by enclosing it in +slashes. Then the regular expression is tested against the entire text +of each record. (Normally, it only needs to match some part of the +text in order to succeed.) For example, the following prints the +second field of each record that contains the string `foo' anywhere in +it: + + $ awk '/foo/ { print $2 }' BBS-list + -| 555-1234 + -| 555-6699 + -| 555-6480 + -| 555-2127 + + `~' (tilde), `~' operator Regular expressions can also be used in +matching expressions. These expressions allow you to specify the +string to match against; it need not be the entire current input +record. The two operators `~' and `!~' perform regular expression +comparisons. Expressions using these operators can be used as +patterns, or in `if', `while', `for', and `do' statements. (*Note +Statements::.) For example: + + EXP ~ /REGEXP/ + +is true if the expression EXP (taken as a string) matches REGEXP. The +following example matches, or selects, all input records with the +uppercase letter `J' somewhere in the first field: + + $ awk '$1 ~ /J/' inventory-shipped + -| Jan 13 25 15 115 + -| Jun 31 42 75 492 + -| Jul 24 34 67 436 + -| Jan 21 36 64 620 + + So does this: + + awk '{ if ($1 ~ /J/) print }' inventory-shipped + + This next example is true if the expression EXP (taken as a +character string) does _not_ match REGEXP: + + EXP !~ /REGEXP/ + + The following example matches, or selects, all input records whose +first field _does not_ contain the uppercase letter `J': + + $ awk '$1 !~ /J/' inventory-shipped + -| Feb 15 32 24 226 + -| Mar 15 24 34 228 + -| Apr 31 52 63 420 + -| May 16 34 29 208 + ... + + When a regexp is enclosed in slashes, such as `/foo/', we call it a +"regexp constant", much like `5.27' is a numeric constant and `"foo"' +is a string constant. + + +File: gawk.info, Node: Escape Sequences, Next: Regexp Operators, Prev: Regexp Usage, Up: Regexp + +2.2 Escape Sequences +==================== + +Some characters cannot be included literally in string constants +(`"foo"') or regexp constants (`/foo/'). Instead, they should be +represented with "escape sequences", which are character sequences +beginning with a backslash (`\'). One use of an escape sequence is to +include a double-quote character in a string constant. Because a plain +double quote ends the string, you must use `\"' to represent an actual +double-quote character as a part of the string. For example: + + $ awk 'BEGIN { print "He said \"hi!\" to her." }' + -| He said "hi!" to her. + + The backslash character itself is another character that cannot be +included normally; you must write `\\' to put one backslash in the +string or regexp. Thus, the string whose contents are the two +characters `"' and `\' must be written `"\"\\"'. + + Backslash also represents unprintable characters such as TAB or +newline. While there is nothing to stop you from entering most +unprintable characters directly in a string constant or regexp constant, +they may look ugly. + + The following table lists all the escape sequences used in `awk' and +what they represent. Unless noted otherwise, all these escape sequences +apply to both string constants and regexp constants: + +`\\' + A literal backslash, `\'. + +`\a' + The "alert" character, `Ctrl-g', ASCII code 7 (BEL). (This + usually makes some sort of audible noise.) + +`\b' + Backspace, `Ctrl-h', ASCII code 8 (BS). + +`\f' + Formfeed, `Ctrl-l', ASCII code 12 (FF). + +`\n' + Newline, `Ctrl-j', ASCII code 10 (LF). + +`\r' + Carriage return, `Ctrl-m', ASCII code 13 (CR). + +`\t' + Horizontal TAB, `Ctrl-i', ASCII code 9 (HT). + +`\v' + Vertical tab, `Ctrl-k', ASCII code 11 (VT). + +`\NNN' + The octal value NNN, where NNN stands for 1 to 3 digits between + `0' and `7'. For example, the code for the ASCII ESC (escape) + character is `\033'. + +`\xHH...' + The hexadecimal value HH, where HH stands for a sequence of + hexadecimal digits (`0'-`9', and either `A'-`F' or `a'-`f'). Like + the same construct in ISO C, the escape sequence continues until + the first nonhexadecimal digit is seen. However, using more than + two hexadecimal digits produces undefined results. (The `\x' + escape sequence is not allowed in POSIX `awk'.) + +`\/' + A literal slash (necessary for regexp constants only). This + expression is used when you want to write a regexp constant that + contains a slash. Because the regexp is delimited by slashes, you + need to escape the slash that is part of the pattern, in order to + tell `awk' to keep processing the rest of the regexp. + +`\"' + A literal double quote (necessary for string constants only). + This expression is used when you want to write a string constant + that contains a double quote. Because the string is delimited by + double quotes, you need to escape the quote that is part of the + string, in order to tell `awk' to keep processing the rest of the + string. + + In `gawk', a number of additional two-character sequences that begin +with a backslash have special meaning in regexps. *Note GNU Regexp +Operators::. + + In a regexp, a backslash before any character that is not in the +previous list and not listed in *note GNU Regexp Operators::, means +that the next character should be taken literally, even if it would +normally be a regexp operator. For example, `/a\+b/' matches the three +characters `a+b'. + + For complete portability, do not use a backslash before any +character not shown in the previous list. + + To summarize: + + * The escape sequences in the table above are always processed first, + for both string constants and regexp constants. This happens very + early, as soon as `awk' reads your program. + + * `gawk' processes both regexp constants and dynamic regexps (*note + Computed Regexps::), for the special operators listed in *note GNU + Regexp Operators::. + + * A backslash before any other character means to treat that + character literally. + +Advanced Notes: Backslash Before Regular Characters +--------------------------------------------------- + +If you place a backslash in a string constant before something that is +not one of the characters previously listed, POSIX `awk' purposely +leaves what happens as undefined. There are two choices: + +Strip the backslash out + This is what Unix `awk' and `gawk' both do. For example, `"a\qc"' + is the same as `"aqc"'. (Because this is such an easy bug both to + introduce and to miss, `gawk' warns you about it.) Consider `FS = + "[ \t]+\|[ \t]+"' to use vertical bars surrounded by whitespace as + the field separator. There should be two backslashes in the string + `FS = "[ \t]+\\|[ \t]+"'.) + +Leave the backslash alone + Some other `awk' implementations do this. In such + implementations, typing `"a\qc"' is the same as typing `"a\\qc"'. + +Advanced Notes: Escape Sequences for Metacharacters +--------------------------------------------------- + +Suppose you use an octal or hexadecimal escape to represent a regexp +metacharacter. (See *note Regexp Operators::.) Does `awk' treat the +character as a literal character or as a regexp operator? + + Historically, such characters were taken literally. (d.c.) +However, the POSIX standard indicates that they should be treated as +real metacharacters, which is what `gawk' does. In compatibility mode +(*note Options::), `gawk' treats the characters represented by octal +and hexadecimal escape sequences literally when used in regexp +constants. Thus, `/a\52b/' is equivalent to `/a\*b/'. + + +File: gawk.info, Node: Regexp Operators, Next: Character Lists, Prev: Escape Sequences, Up: Regexp + +2.3 Regular Expression Operators +================================ + +You can combine regular expressions with special characters, called +"regular expression operators" or "metacharacters", to increase the +power and versatility of regular expressions. + + The escape sequences described in *note Escape Sequences::, are +valid inside a regexp. They are introduced by a `\' and are recognized +and converted into corresponding real characters as the very first step +in processing regexps. + + Here is a list of metacharacters. All characters that are not escape +sequences and that are not listed in the table stand for themselves: + +`\' + This is used to suppress the special meaning of a character when + matching. For example, `\$' matches the character `$'. + +`^' + This matches the beginning of a string. For example, `^@chapter' + matches `@chapter' at the beginning of a string and can be used to + identify chapter beginnings in Texinfo source files. The `^' is + known as an "anchor", because it anchors the pattern to match only + at the beginning of the string. + + It is important to realize that `^' does not match the beginning of + a line embedded in a string. The condition is not true in the + following example: + + if ("line1\nLINE 2" ~ /^L/) ... + +`$' + This is similar to `^', but it matches only at the end of a string. + For example, `p$' matches a record that ends with a `p'. The `$' + is an anchor and does not match the end of a line embedded in a + string. The condition in the following example is not true: + + if ("line1\nLINE 2" ~ /1$/) ... + +`.' + This matches any single character, _including_ the newline + character. For example, `.P' matches any single character + followed by a `P' in a string. Using concatenation, we can make a + regular expression such as `U.A', which matches any + three-character sequence that begins with `U' and ends with `A'. + + In strict POSIX mode (*note Options::), `.' does not match the NUL + character, which is a character with all bits equal to zero. + Otherwise, NUL is just another character. Other versions of `awk' + may not be able to match the NUL character. + +`[...]' + This is called a "character list".(1) It matches any _one_ of the + characters that are enclosed in the square brackets. For example, + `[MVX]' matches any one of the characters `M', `V', or `X' in a + string. A full discussion of what can be inside the square + brackets of a character list is given in *note Character Lists::. + +`[^ ...]' + This is a "complemented character list". The first character after + the `[' _must_ be a `^'. It matches any characters _except_ those + in the square brackets. For example, `[^awk]' matches any + character that is not an `a', `w', or `k'. + +`|' + This is the "alternation operator" and it is used to specify + alternatives. The `|' has the lowest precedence of all the regular + expression operators. For example, `^P|[[:digit:]]' matches any + string that matches either `^P' or `[[:digit:]]'. This means it + matches any string that starts with `P' or contains a digit. + + The alternation applies to the largest possible regexps on either + side. + +`(...)' + Parentheses are used for grouping in regular expressions, as in + arithmetic. They can be used to concatenate regular expressions + containing the alternation operator, `|'. For example, + `@(samp|code)\{[^}]+\}' matches both `@code{foo}' and `@samp{bar}'. + (These are Texinfo formatting control sequences. The `+' is + explained further on in this list.) + +`*' + This symbol means that the preceding regular expression should be + repeated as many times as necessary to find a match. For example, + `ph*' applies the `*' symbol to the preceding `h' and looks for + matches of one `p' followed by any number of `h's. This also + matches just `p' if no `h's are present. + + The `*' repeats the _smallest_ possible preceding expression. + (Use parentheses if you want to repeat a larger expression.) It + finds as many repetitions as possible. For example, `awk + '/\(c[ad][ad]*r x\)/ { print }' sample' prints every record in + `sample' containing a string of the form `(car x)', `(cdr x)', + `(cadr x)', and so on. Notice the escaping of the parentheses by + preceding them with backslashes. + +`+' + This symbol is similar to `*', except that the preceding + expression must be matched at least once. This means that `wh+y' + would match `why' and `whhy', but not `wy', whereas `wh*y' would + match all three of these strings. The following is a simpler way + of writing the last `*' example: + + awk '/\(c[ad]+r x\)/ { print }' sample + +`?' + This symbol is similar to `*', except that the preceding + expression can be matched either once or not at all. For example, + `fe?d' matches `fed' and `fd', but nothing else. + +`{N}' +`{N,}' +`{N,M}' + One or two numbers inside braces denote an "interval expression". + If there is one number in the braces, the preceding regexp is + repeated N times. If there are two numbers separated by a comma, + the preceding regexp is repeated N to M times. If there is one + number followed by a comma, then the preceding regexp is repeated + at least N times: + + `wh{3}y' + Matches `whhhy', but not `why' or `whhhhy'. + + `wh{3,5}y' + Matches `whhhy', `whhhhy', or `whhhhhy', only. + + `wh{2,}y' + Matches `whhy' or `whhhy', and so on. + + Interval expressions were not traditionally available in `awk'. + They were added as part of the POSIX standard to make `awk' and + `egrep' consistent with each other. + + However, because old programs may use `{' and `}' in regexp + constants, by default `gawk' does _not_ match interval expressions + in regexps. If either `--posix' or `--re-interval' are specified + (*note Options::), then interval expressions are allowed in + regexps. + + For new programs that use `{' and `}' in regexp constants, it is + good practice to always escape them with a backslash. Then the + regexp constants are valid and work the way you want them to, using + any version of `awk'.(2) + + In regular expressions, the `*', `+', and `?' operators, as well as +the braces `{' and `}', have the highest precedence, followed by +concatenation, and finally by `|'. As in arithmetic, parentheses can +change how operators are grouped. + + In POSIX `awk' and `gawk', the `*', `+', and `?' operators stand for +themselves when there is nothing in the regexp that precedes them. For +example, `/+/' matches a literal plus sign. However, many other +versions of `awk' treat such a usage as a syntax error. + + If `gawk' is in compatibility mode (*note Options::), POSIX +character classes and interval expressions are not available in regular +expressions. + + ---------- Footnotes ---------- + + (1) In other literature, you may see a character list referred to as +either a "character set", a "character class", or a "bracket +expression". + + (2) Use two backslashes if you're using a string constant with a +regexp operator or function. + + +File: gawk.info, Node: Character Lists, Next: GNU Regexp Operators, Prev: Regexp Operators, Up: Regexp + +2.4 Using Character Lists +========================= + +Within a character list, a "range expression" consists of two +characters separated by a hyphen. It matches any single character that +sorts between the two characters, using the locale's collating sequence +and character set. For example, in the default C locale, `[a-dx-z]' is +equivalent to `[abcdxyz]'. Many locales sort characters in dictionary +order, and in these locales, `[a-dx-z]' is typically not equivalent to +`[abcdxyz]'; instead it might be equivalent to `[aBbCcDdxXyYz]', for +example. To obtain the traditional interpretation of bracket +expressions, you can use the C locale by setting the `LC_ALL' +environment variable to the value `C'. + + To include one of the characters `\', `]', `-', or `^' in a +character list, put a `\' in front of it. For example: + + [d\]] + +matches either `d' or `]'. + + This treatment of `\' in character lists is compatible with other +`awk' implementations and is also mandated by POSIX. The regular +expressions in `awk' are a superset of the POSIX specification for +Extended Regular Expressions (EREs). POSIX EREs are based on the +regular expressions accepted by the traditional `egrep' utility. + + "Character classes" are a new feature introduced in the POSIX +standard. A character class is a special notation for describing lists +of characters that have a specific attribute, but the actual characters +can vary from country to country and/or from character set to character +set. For example, the notion of what is an alphabetic character +differs between the United States and France. + + A character class is only valid in a regexp _inside_ the brackets of +a character list. Character classes consist of `[:', a keyword +denoting the class, and `:]'. *note table-char-classes:: lists the +character classes defined by the POSIX standard. + +Class Meaning +-------------------------------------------------------------------------- +`[:alnum:]' Alphanumeric characters. +`[:alpha:]' Alphabetic characters. +`[:blank:]' Space and TAB characters. +`[:cntrl:]' Control characters. +`[:digit:]' Numeric characters. +`[:graph:]' Characters that are both printable and visible. (A space is + printable but not visible, whereas an `a' is both.) +`[:lower:]' Lowercase alphabetic characters. +`[:print:]' Printable characters (characters that are not control + characters). +`[:punct:]' Punctuation characters (characters that are not letters, + digits, control characters, or space characters). +`[:space:]' Space characters (such as space, TAB, and formfeed, to name + a few). +`[:upper:]' Uppercase alphabetic characters. +`[:xdigit:]'Characters that are hexadecimal digits. + +Table 2.1: POSIX Character Classes + + For example, before the POSIX standard, you had to write +`/[A-Za-z0-9]/' to match alphanumeric characters. If your character +set had other alphabetic characters in it, this would not match them, +and if your character set collated differently from ASCII, this might +not even match the ASCII alphanumeric characters. With the POSIX +character classes, you can write `/[[:alnum:]]/' to match the alphabetic +and numeric characters in your character set. + + Two additional special sequences can appear in character lists. +These apply to non-ASCII character sets, which can have single symbols +(called "collating elements") that are represented with more than one +character. They can also have several characters that are equivalent for +"collating", or sorting, purposes. (For example, in French, a plain "e" +and a grave-accented "e`" are equivalent.) These sequences are: + +Collating symbols + Multicharacter collating elements enclosed between `[.' and `.]'. + For example, if `ch' is a collating element, then `[[.ch.]]' is a + regexp that matches this collating element, whereas `[ch]' is a + regexp that matches either `c' or `h'. + +Equivalence classes + Locale-specific names for a list of characters that are equal. The + name is enclosed between `[=' and `=]'. For example, the name `e' + might be used to represent all of "e," "e`," and "e'." In this + case, `[[=e=]]' is a regexp that matches any of `e', `e'', or `e`'. + + These features are very valuable in non-English-speaking locales. + + *Caution:* The library functions that `gawk' uses for regular +expression matching currently recognize only POSIX character classes; +they do not recognize collating symbols or equivalence classes. + + +File: gawk.info, Node: GNU Regexp Operators, Next: Case-sensitivity, Prev: Character Lists, Up: Regexp + +2.5 `gawk'-Specific Regexp Operators +==================================== + +GNU software that deals with regular expressions provides a number of +additional regexp operators. These operators are described in this +minor node and are specific to `gawk'; they are not available in other +`awk' implementations. Most of the additional operators deal with word +matching. For our purposes, a "word" is a sequence of one or more +letters, digits, or underscores (`_'): + +`\w' + Matches any word-constituent character--that is, it matches any + letter, digit, or underscore. Think of it as shorthand for + `[[:alnum:]_]'. + +`\W' + Matches any character that is not word-constituent. Think of it + as shorthand for `[^[:alnum:]_]'. + +`\<' + Matches the empty string at the beginning of a word. For example, + `/\' + Matches the empty string at the end of a word. For example, + `/stow\>/' matches `stow' but not `stowaway'. + +`\y' + Matches the empty string at either the beginning or the end of a + word (i.e., the word boundar*y*). For example, `\yballs?\y' + matches either `ball' or `balls', as a separate word. + +`\B' + Matches the empty string that occurs between two word-constituent + characters. For example, `/\Brat\B/' matches `crate' but it does + not match `dirty rat'. `\B' is essentially the opposite of `\y'. + + There are two other operators that work on buffers. In Emacs, a +"buffer" is, naturally, an Emacs buffer. For other programs, `gawk''s +regexp library routines consider the entire string to match as the +buffer. The operators are: + +`\`' + Matches the empty string at the beginning of a buffer (string). + +`\'' + Matches the empty string at the end of a buffer (string). + + Because `^' and `$' always work in terms of the beginning and end of +strings, these operators don't add any new capabilities for `awk'. +They are provided for compatibility with other GNU software. + + In other GNU software, the word-boundary operator is `\b'. However, +that conflicts with the `awk' language's definition of `\b' as +backspace, so `gawk' uses a different letter. An alternative method +would have been to require two backslashes in the GNU operators, but +this was deemed too confusing. The current method of using `\y' for the +GNU `\b' appears to be the lesser of two evils. + + The various command-line options (*note Options::) control how +`gawk' interprets characters in regexps: + +No options + In the default case, `gawk' provides all the facilities of POSIX + regexps and the GNU regexp operators described in *note Regexp + Operators::. However, interval expressions are not supported. + +`--posix' + Only POSIX regexps are supported; the GNU operators are not special + (e.g., `\w' matches a literal `w'). Interval expressions are + allowed. + +`--traditional' + Traditional Unix `awk' regexps are matched. The GNU operators are + not special, interval expressions are not available, nor are the + POSIX character classes (`[[:alnum:]]', etc.). Characters + described by octal and hexadecimal escape sequences are treated + literally, even if they represent regexp metacharacters. Also, + `gawk' silently skips directories named on the command line. + +`--re-interval' + Allow interval expressions in regexps, even if `--traditional' has + been provided. (`--posix' automatically enables interval + expressions, so `--re-interval' is redundant when `--posix' is is + used.) + + +File: gawk.info, Node: Case-sensitivity, Next: Leftmost Longest, Prev: GNU Regexp Operators, Up: Regexp + +2.6 Case Sensitivity in Matching +================================ + +Case is normally significant in regular expressions, both when matching +ordinary characters (i.e., not metacharacters) and inside character +sets. Thus, a `w' in a regular expression matches only a lowercase `w' +and not an uppercase `W'. + + The simplest way to do a case-independent match is to use a character +list--for example, `[Ww]'. However, this can be cumbersome if you need +to use it often, and it can make the regular expressions harder to +read. There are two alternatives that you might prefer. + + One way to perform a case-insensitive match at a particular point in +the program is to convert the data to a single case, using the +`tolower' or `toupper' built-in string functions (which we haven't +discussed yet; *note String Functions::). For example: + + tolower($1) ~ /foo/ { ... } + +converts the first field to lowercase before matching against it. This +works in any POSIX-compliant `awk'. + + Another method, specific to `gawk', is to set the variable +`IGNORECASE' to a nonzero value (*note Built-in Variables::). When +`IGNORECASE' is not zero, _all_ regexp and string operations ignore +case. Changing the value of `IGNORECASE' dynamically controls the +case-sensitivity of the program as it runs. Case is significant by +default because `IGNORECASE' (like most variables) is initialized to +zero: + + x = "aB" + if (x ~ /ab/) ... # this test will fail + + IGNORECASE = 1 + if (x ~ /ab/) ... # now it will succeed + + In general, you cannot use `IGNORECASE' to make certain rules +case-insensitive and other rules case-sensitive, because there is no +straightforward way to set `IGNORECASE' just for the pattern of a +particular rule.(1) To do this, use either character lists or +`tolower'. However, one thing you can do with `IGNORECASE' only is +dynamically turn case-sensitivity on or off for all the rules at once. + + `IGNORECASE' can be set on the command line or in a `BEGIN' rule +(*note Other Arguments::; also *note Using BEGIN/END::). Setting +`IGNORECASE' from the command line is a way to make a program +case-insensitive without having to edit it. + + Prior to `gawk' 3.0, the value of `IGNORECASE' affected regexp +operations only. It did not affect string comparison with `==', `!=', +and so on. Beginning with version 3.0, both regexp and string +comparison operations are also affected by `IGNORECASE'. + + Beginning with `gawk' 3.0, the equivalences between upper- and +lowercase characters are based on the ISO-8859-1 (ISO Latin-1) +character set. This character set is a superset of the traditional 128 +ASCII characters, which also provides a number of characters suitable +for use with European languages. + + As of `gawk' 3.1.4, the case equivalences are fully locale-aware. +They are based on the C `' facilities, such as `isalpha()' and +`toupper()'. + + The value of `IGNORECASE' has no effect if `gawk' is in +compatibility mode (*note Options::). Case is always significant in +compatibility mode. + + ---------- Footnotes ---------- + + (1) Experienced C and C++ programmers will note that it is possible, +using something like `IGNORECASE = 1 && /foObAr/ { ... }' and +`IGNORECASE = 0 || /foobar/ { ... }'. However, this is somewhat +obscure and we don't recommend it. + + +File: gawk.info, Node: Leftmost Longest, Next: Computed Regexps, Prev: Case-sensitivity, Up: Regexp + +2.7 How Much Text Matches? +========================== + +Consider the following: + + echo aaaabcd | awk '{ sub(/a+/, ""); print }' + + This example uses the `sub' function (which we haven't discussed yet; +*note String Functions::) to make a change to the input record. Here, +the regexp `/a+/' indicates "one or more `a' characters," and the +replacement text is `'. + + The input contains four `a' characters. `awk' (and POSIX) regular +expressions always match the leftmost, _longest_ sequence of input +characters that can match. Thus, all four `a' characters are replaced +with `' in this example: + + $ echo aaaabcd | awk '{ sub(/a+/, ""); print }' + -| bcd + + For simple match/no-match tests, this is not so important. But when +doing text matching and substitutions with the `match', `sub', `gsub', +and `gensub' functions, it is very important. *Note String Functions::, +for more information on these functions. Understanding this principle +is also important for regexp-based record and field splitting (*note +Records::, and also *note Field Separators::). + + +File: gawk.info, Node: Computed Regexps, Next: Locales, Prev: Leftmost Longest, Up: Regexp + +2.8 Using Dynamic Regexps +========================= + +The righthand side of a `~' or `!~' operator need not be a regexp +constant (i.e., a string of characters between slashes). It may be any +expression. The expression is evaluated and converted to a string if +necessary; the contents of the string are used as the regexp. A regexp +that is computed in this way is called a "dynamic regexp": + + BEGIN { digits_regexp = "[[:digit:]]+" } + $0 ~ digits_regexp { print } + +This sets `digits_regexp' to a regexp that describes one or more digits, +and tests whether the input record matches this regexp. + + *Caution:* When using the `~' and `!~' operators, there is a +difference between a regexp constant enclosed in slashes and a string +constant enclosed in double quotes. If you are going to use a string +constant, you have to understand that the string is, in essence, +scanned _twice_: the first time when `awk' reads your program, and the +second time when it goes to match the string on the lefthand side of +the operator with the pattern on the right. This is true of any +string-valued expression (such as `digits_regexp', shown previously), +not just string constants. + + What difference does it make if the string is scanned twice? The +answer has to do with escape sequences, and particularly with +backslashes. To get a backslash into a regular expression inside a +string, you have to type two backslashes. + + For example, `/\*/' is a regexp constant for a literal `*'. Only +one backslash is needed. To do the same thing with a string, you have +to type `"\\*"'. The first backslash escapes the second one so that +the string actually contains the two characters `\' and `*'. + + Given that you can use both regexp and string constants to describe +regular expressions, which should you use? The answer is "regexp +constants," for several reasons: + + * String constants are more complicated to write and more difficult + to read. Using regexp constants makes your programs less + error-prone. Not understanding the difference between the two + kinds of constants is a common source of errors. + + * It is more efficient to use regexp constants. `awk' can note that + you have supplied a regexp and store it internally in a form that + makes pattern matching more efficient. When using a string + constant, `awk' must first convert the string into this internal + form and then perform the pattern matching. + + * Using regexp constants is better form; it shows clearly that you + intend a regexp match. + +Advanced Notes: Using `\n' in Character Lists of Dynamic Regexps +---------------------------------------------------------------- + +Some commercial versions of `awk' do not allow the newline character to +be used inside a character list for a dynamic regexp: + + $ awk '$0 ~ "[ \t\n]"' + error--> awk: newline in character class [ + error--> ]... + error--> source line number 1 + error--> context is + error--> >>> <<< + + But a newline in a regexp constant works with no problem: + + $ awk '$0 ~ /[ \t\n]/' + here is a sample line + -| here is a sample line + Ctrl-d + + `gawk' does not have this problem, and it isn't likely to occur +often in practice, but it's worth noting for future reference. + + +File: gawk.info, Node: Locales, Prev: Computed Regexps, Up: Regexp + +2.9 Where You Are Makes A Difference +==================================== + +Modern systems support the notion of "locales": a way to tell the +system about the local character set and language. The current locale +setting can affect the way regexp matching works, often in surprising +ways. In particular, many locales do case-insensitive matching, even +when you may have specified characters of only one particular case. + + The following example uses the `sub' function, which does text +replacement (*note String Functions::). Here, the intent is to remove +trailing uppercase characters: + + $ echo something1234abc | gawk '{ sub("[A-Z]*$", ""); print }' + -| something1234 + +This output is unexpected, since the `abc' at the end of +`something1234abc' should not normally match `[A-Z]*'. This result is +due to the locale setting (and thus you may not see it on your system). +There are two fixes. The first is to use the POSIX character class +`[[:upper:]]', instead of `[A-Z]'. (This is preferred, since then your +program will work everywhere.) The second is to change the locale +setting in the environment, before running `gawk', by using the shell +statements: + + LANG=C LC_ALL=C + export LANG LC_ALL + + The setting `C' forces `gawk' to behave in the traditional Unix +manner, where case distinctions do matter. You may wish to put these +statements into your shell startup file, e.g., `$HOME/.profile'. + + Similar considerations apply to other ranges. For example, `["-/]' +is perfectly valid in ASCII, but is not valid in many Unicode locales, +such as `en_US.UTF-8'. (In general, such ranges should be avoided; +either list the characters individually, or use a POSIX character class +such as `[[:punct:]]'.) + + For the normal case of `RS = "\n"', the locale is largely irrelevant. +For other single-character record separators, using `LC_ALL=C' will +give you much better performance when reading records. Otherwise, +`gawk' has to make several function calls, _per input character_ to +find the record terminator. + + Finally, the locale affects the value of the decimal point character +used when `gawk' parses input data. This is discussed in detail in +*note Conversion::. + + +File: gawk.info, Node: Reading Files, Next: Printing, Prev: Regexp, Up: Top + +3 Reading Input Files +********************* + +In the typical `awk' program, all input is read either from the +standard input (by default, this is the keyboard, but often it is a +pipe from another command) or from files whose names you specify on the +`awk' command line. If you specify input files, `awk' reads them in +order, processing all the data from one before going on to the next. +The name of the current input file can be found in the built-in variable +`FILENAME' (*note Built-in Variables::). + + The input is read in units called "records", and is processed by the +rules of your program one record at a time. By default, each record is +one line. Each record is automatically split into chunks called +"fields". This makes it more convenient for programs to work on the +parts of a record. + + On rare occasions, you may need to use the `getline' command. The +`getline' command is valuable, both because it can do explicit input +from any number of files, and because the files used with it do not +have to be named on the `awk' command line (*note Getline::). + +* Menu: + +* Records:: Controlling how data is split into records. +* Fields:: An introduction to fields. +* Nonconstant Fields:: Nonconstant Field Numbers. +* Changing Fields:: Changing the Contents of a Field. +* Field Separators:: The field separator and how to change it. +* Constant Size:: Reading constant width data. +* Multiple Line:: Reading multi-line records. +* Getline:: Reading files under explicit program control + using the `getline' function. + + +File: gawk.info, Node: Records, Next: Fields, Up: Reading Files + +3.1 How Input Is Split into Records +=================================== + +The `awk' utility divides the input for your `awk' program into records +and fields. `awk' keeps track of the number of records that have been +read so far from the current input file. This value is stored in a +built-in variable called `FNR'. It is reset to zero when a new file is +started. Another built-in variable, `NR', is the total number of input +records read so far from all data files. It starts at zero, but is +never automatically reset to zero. + + Records are separated by a character called the "record separator". +By default, the record separator is the newline character. This is why +records are, by default, single lines. A different character can be +used for the record separator by assigning the character to the +built-in variable `RS'. + + Like any other variable, the value of `RS' can be changed in the +`awk' program with the assignment operator, `=' (*note Assignment +Ops::). The new record-separator character should be enclosed in +quotation marks, which indicate a string constant. Often the right +time to do this is at the beginning of execution, before any input is +processed, so that the very first record is read with the proper +separator. To do this, use the special `BEGIN' pattern (*note +BEGIN/END::). For example: + + awk 'BEGIN { RS = "/" } + { print $0 }' BBS-list + +changes the value of `RS' to `"/"', before reading any input. This is +a string whose first character is a slash; as a result, records are +separated by slashes. Then the input file is read, and the second rule +in the `awk' program (the action with no pattern) prints each record. +Because each `print' statement adds a newline at the end of its output, +this `awk' program copies the input with each slash changed to a +newline. Here are the results of running the program on `BBS-list': + + $ awk 'BEGIN { RS = "/" } + > { print $0 }' BBS-list + -| aardvark 555-5553 1200 + -| 300 B + -| alpo-net 555-3412 2400 + -| 1200 + -| 300 A + -| barfly 555-7685 1200 + -| 300 A + -| bites 555-1675 2400 + -| 1200 + -| 300 A + -| camelot 555-0542 300 C + -| core 555-2912 1200 + -| 300 C + -| fooey 555-1234 2400 + -| 1200 + -| 300 B + -| foot 555-6699 1200 + -| 300 B + -| macfoo 555-6480 1200 + -| 300 A + -| sdace 555-3430 2400 + -| 1200 + -| 300 A + -| sabafoo 555-2127 1200 + -| 300 C + -| + +Note that the entry for the `camelot' BBS is not split. In the +original data file (*note Sample Data Files::), the line looks like +this: + + camelot 555-0542 300 C + +It has one baud rate only, so there are no slashes in the record, +unlike the others which have two or more baud rates. In fact, this +record is treated as part of the record for the `core' BBS; the newline +separating them in the output is the original newline in the data file, +not the one added by `awk' when it printed the record! + + Another way to change the record separator is on the command line, +using the variable-assignment feature (*note Other Arguments::): + + awk '{ print $0 }' RS="/" BBS-list + +This sets `RS' to `/' before processing `BBS-list'. + + Using an unusual character such as `/' for the record separator +produces correct behavior in the vast majority of cases. However, the +following (extreme) pipeline prints a surprising `1': + + $ echo | awk 'BEGIN { RS = "a" } ; { print NF }' + -| 1 + + There is one field, consisting of a newline. The value of the +built-in variable `NF' is the number of fields in the current record. + + Reaching the end of an input file terminates the current input +record, even if the last character in the file is not the character in +`RS'. (d.c.) + + The empty string `""' (a string without any characters) has a +special meaning as the value of `RS'. It means that records are +separated by one or more blank lines and nothing else. *Note Multiple +Line::, for more details. + + If you change the value of `RS' in the middle of an `awk' run, the +new value is used to delimit subsequent records, but the record +currently being processed, as well as records already processed, are not +affected. + + After the end of the record has been determined, `gawk' sets the +variable `RT' to the text in the input that matched `RS'. When using +`gawk', the value of `RS' is not limited to a one-character string. It +can be any regular expression (*note Regexp::). In general, each record +ends at the next string that matches the regular expression; the next +record starts at the end of the matching string. This general rule is +actually at work in the usual case, where `RS' contains just a newline: +a record ends at the beginning of the next matching string (the next +newline in the input), and the following record starts just after the +end of this string (at the first character of the following line). The +newline, because it matches `RS', is not part of either record. + + When `RS' is a single character, `RT' contains the same single +character. However, when `RS' is a regular expression, `RT' contains +the actual input text that matched the regular expression. + + The following example illustrates both of these features. It sets +`RS' equal to a regular expression that matches either a newline or a +series of one or more uppercase letters with optional leading and/or +trailing whitespace: + + $ echo record 1 AAAA record 2 BBBB record 3 | + > gawk 'BEGIN { RS = "\n|( *[[:upper:]]+ *)" } + > { print "Record =", $0, "and RT =", RT }' + -| Record = record 1 and RT = AAAA + -| Record = record 2 and RT = BBBB + -| Record = record 3 and RT = + -| + +The final line of output has an extra blank line. This is because the +value of `RT' is a newline, and the `print' statement supplies its own +terminating newline. *Note Simple Sed::, for a more useful example of +`RS' as a regexp and `RT'. + + If you set `RS' to a regular expression that allows optional +trailing text, such as `RS = "abc(XYZ)?"' it is possible, due to +implementation constraints, that `gawk' may match the leading part of +the regular expression, but not the trailing part, particularly if the +input text that could match the trailing part is fairly long. `gawk' +attempts to avoid this problem, but currently, there's no guarantee +that this will never happen. + + NOTE: Remember that in `awk', the `^' and `$' anchor + metacharacters match the beginning and end of a _string_, and not + the beginning and end of a _line_. As a result, something like + `RS = "^[[:upper:]]"' can only match at the beginning of a file. + This is because `gawk' views the input file as one long string + that happens to contain newline characters in it. It is thus best + to avoid anchor characters in the value of `RS'. + + The use of `RS' as a regular expression and the `RT' variable are +`gawk' extensions; they are not available in compatibility mode (*note +Options::). In compatibility mode, only the first character of the +value of `RS' is used to determine the end of the record. + +Advanced Notes: `RS = "\0"' Is Not Portable +------------------------------------------- + +There are times when you might want to treat an entire data file as a +single record. The only way to make this happen is to give `RS' a +value that you know doesn't occur in the input file. This is hard to +do in a general way, such that a program always works for arbitrary +input files. + + You might think that for text files, the NUL character, which +consists of a character with all bits equal to zero, is a good value to +use for `RS' in this case: + + BEGIN { RS = "\0" } # whole file becomes one record? + + `gawk' in fact accepts this, and uses the NUL character for the +record separator. However, this usage is _not_ portable to other `awk' +implementations. + + All other `awk' implementations(1) store strings internally as +C-style strings. C strings use the NUL character as the string +terminator. In effect, this means that `RS = "\0"' is the same as `RS += ""'. (d.c.) + + The best way to treat a whole file as a single record is to simply +read the file in, one record at a time, concatenating each record onto +the end of the previous ones. + + ---------- Footnotes ---------- + + (1) At least that we know about. + + +File: gawk.info, Node: Fields, Next: Nonconstant Fields, Prev: Records, Up: Reading Files + +3.2 Examining Fields +==================== + +When `awk' reads an input record, the record is automatically "parsed" +or separated by the interpreter into chunks called "fields". By +default, fields are separated by "whitespace", like words in a line. +Whitespace in `awk' means any string of one or more spaces, tabs, or +newlines;(1) other characters, such as formfeed, vertical tab, etc. +that are considered whitespace by other languages, are _not_ considered +whitespace by `awk'. + + The purpose of fields is to make it more convenient for you to refer +to these pieces of the record. You don't have to use them--you can +operate on the whole record if you want--but fields are what make +simple `awk' programs so powerful. + + A dollar-sign (`$') is used to refer to a field in an `awk' program, +followed by the number of the field you want. Thus, `$1' refers to the +first field, `$2' to the second, and so on. (Unlike the Unix shells, +the field numbers are not limited to single digits. `$127' is the one +hundred twenty-seventh field in the record.) For example, suppose the +following is a line of input: + + This seems like a pretty nice example. + +Here the first field, or `$1', is `This', the second field, or `$2', is +`seems', and so on. Note that the last field, `$7', is `example.'. +Because there is no space between the `e' and the `.', the period is +considered part of the seventh field. + + `NF' is a built-in variable whose value is the number of fields in +the current record. `awk' automatically updates the value of `NF' each +time it reads a record. No matter how many fields there are, the last +field in a record can be represented by `$NF'. So, `$NF' is the same +as `$7', which is `example.'. If you try to reference a field beyond +the last one (such as `$8' when the record has only seven fields), you +get the empty string. (If used in a numeric operation, you get zero.) + + The use of `$0', which looks like a reference to the "zero-th" +field, is a special case: it represents the whole input record when you +are not interested in specific fields. Here are some more examples: + + $ awk '$1 ~ /foo/ { print $0 }' BBS-list + -| fooey 555-1234 2400/1200/300 B + -| foot 555-6699 1200/300 B + -| macfoo 555-6480 1200/300 A + -| sabafoo 555-2127 1200/300 C + +This example prints each record in the file `BBS-list' whose first +field contains the string `foo'. The operator `~' is called a +"matching operator" (*note Regexp Usage::); it tests whether a string +(here, the field `$1') matches a given regular expression. + + By contrast, the following example looks for `foo' in _the entire +record_ and prints the first field and the last field for each matching +input record: + + $ awk '/foo/ { print $1, $NF }' BBS-list + -| fooey B + -| foot B + -| macfoo A + -| sabafoo C + + ---------- Footnotes ---------- + + (1) In POSIX `awk', newlines are not considered whitespace for +separating fields. + + +File: gawk.info, Node: Nonconstant Fields, Next: Changing Fields, Prev: Fields, Up: Reading Files + +3.3 Nonconstant Field Numbers +============================= + +The number of a field does not need to be a constant. Any expression in +the `awk' language can be used after a `$' to refer to a field. The +value of the expression specifies the field number. If the value is a +string, rather than a number, it is converted to a number. Consider +this example: + + awk '{ print $NR }' + +Recall that `NR' is the number of records read so far: one in the first +record, two in the second, etc. So this example prints the first field +of the first record, the second field of the second record, and so on. +For the twentieth record, field number 20 is printed; most likely, the +record has fewer than 20 fields, so this prints a blank line. Here is +another example of using expressions as field numbers: + + awk '{ print $(2*2) }' BBS-list + + `awk' evaluates the expression `(2*2)' and uses its value as the +number of the field to print. The `*' sign represents multiplication, +so the expression `2*2' evaluates to four. The parentheses are used so +that the multiplication is done before the `$' operation; they are +necessary whenever there is a binary operator in the field-number +expression. This example, then, prints the hours of operation (the +fourth field) for every line of the file `BBS-list'. (All of the `awk' +operators are listed, in order of decreasing precedence, in *note +Precedence::.) + + If the field number you compute is zero, you get the entire record. +Thus, `$(2-2)' has the same value as `$0'. Negative field numbers are +not allowed; trying to reference one usually terminates the program. +(The POSIX standard does not define what happens when you reference a +negative field number. `gawk' notices this and terminates your +program. Other `awk' implementations may behave differently.) + + As mentioned in *note Fields::, `awk' stores the current record's +number of fields in the built-in variable `NF' (also *note Built-in +Variables::). The expression `$NF' is not a special feature--it is the +direct consequence of evaluating `NF' and using its value as a field +number. + + +File: gawk.info, Node: Changing Fields, Next: Field Separators, Prev: Nonconstant Fields, Up: Reading Files + +3.4 Changing the Contents of a Field +==================================== + +The contents of a field, as seen by `awk', can be changed within an +`awk' program; this changes what `awk' perceives as the current input +record. (The actual input is untouched; `awk' _never_ modifies the +input file.) Consider the following example and its output: + + $ awk '{ nboxes = $3 ; $3 = $3 - 10 + > print nboxes, $3 }' inventory-shipped + -| 25 15 + -| 32 22 + -| 24 14 + ... + +The program first saves the original value of field three in the +variable `nboxes'. The `-' sign represents subtraction, so this +program reassigns field three, `$3', as the original value of field +three minus ten: `$3 - 10'. (*Note Arithmetic Ops::.) Then it prints +the original and new values for field three. (Someone in the warehouse +made a consistent mistake while inventorying the red boxes.) + + For this to work, the text in field `$3' must make sense as a +number; the string of characters must be converted to a number for the +computer to do arithmetic on it. The number resulting from the +subtraction is converted back to a string of characters that then +becomes field three. *Note Conversion::. + + When the value of a field is changed (as perceived by `awk'), the +text of the input record is recalculated to contain the new field where +the old one was. In other words, `$0' changes to reflect the altered +field. Thus, this program prints a copy of the input file, with 10 +subtracted from the second field of each line: + + $ awk '{ $2 = $2 - 10; print $0 }' inventory-shipped + -| Jan 3 25 15 115 + -| Feb 5 32 24 226 + -| Mar 5 24 34 228 + ... + + It is also possible to also assign contents to fields that are out +of range. For example: + + $ awk '{ $6 = ($5 + $4 + $3 + $2) + > print $6 }' inventory-shipped + -| 168 + -| 297 + -| 301 + ... + +We've just created `$6', whose value is the sum of fields `$2', `$3', +`$4', and `$5'. The `+' sign represents addition. For the file +`inventory-shipped', `$6' represents the total number of parcels +shipped for a particular month. + + Creating a new field changes `awk''s internal copy of the current +input record, which is the value of `$0'. Thus, if you do `print $0' +after adding a field, the record printed includes the new field, with +the appropriate number of field separators between it and the previously +existing fields. + + This recomputation affects and is affected by `NF' (the number of +fields; *note Fields::). For example, the value of `NF' is set to the +number of the highest field you create. The exact format of `$0' is +also affected by a feature that has not been discussed yet: the "output +field separator", `OFS', used to separate the fields (*note Output +Separators::). + + Note, however, that merely _referencing_ an out-of-range field does +_not_ change the value of either `$0' or `NF'. Referencing an +out-of-range field only produces an empty string. For example: + + if ($(NF+1) != "") + print "can't happen" + else + print "everything is normal" + +should print `everything is normal', because `NF+1' is certain to be +out of range. (*Note If Statement::, for more information about +`awk''s `if-else' statements. *Note Typing and Comparison::, for more +information about the `!=' operator.) + + It is important to note that making an assignment to an existing +field changes the value of `$0' but does not change the value of `NF', +even when you assign the empty string to a field. For example: + + $ echo a b c d | awk '{ OFS = ":"; $2 = "" + > print $0; print NF }' + -| a::c:d + -| 4 + +The field is still there; it just has an empty value, denoted by the +two colons between `a' and `c'. This example shows what happens if you +create a new field: + + $ echo a b c d | awk '{ OFS = ":"; $2 = ""; $6 = "new" + > print $0; print NF }' + -| a::c:d::new + -| 6 + +The intervening field, `$5', is created with an empty value (indicated +by the second pair of adjacent colons), and `NF' is updated with the +value six. + + Decrementing `NF' throws away the values of the fields after the new +value of `NF' and recomputes `$0'. (d.c.) Here is an example: + + $ echo a b c d e f | awk '{ print "NF =", NF; + > NF = 3; print $0 }' + -| NF = 6 + -| a b c + + *Caution:* Some versions of `awk' don't rebuild `$0' when `NF' is +decremented. Caveat emptor. + + Finally, there are times when it is convenient to force `awk' to +rebuild the entire record, using the current value of the fields and +`OFS'. To do this, use the seemingly innocuous assignment: + + $1 = $1 # force record to be reconstituted + print $0 # or whatever else with $0 + +This forces `awk' rebuild the record. It does help to add a comment, +as we've shown here. + + There is a flip side to the relationship between `$0' and the +fields. Any assignment to `$0' causes the record to be reparsed into +fields using the _current_ value of `FS'. This also applies to any +built-in function that updates `$0', such as `sub' and `gsub' (*note +String Functions::). + + +File: gawk.info, Node: Field Separators, Next: Constant Size, Prev: Changing Fields, Up: Reading Files + +3.5 Specifying How Fields Are Separated +======================================= + +* Menu: + +* Regexp Field Splitting:: Using regexps as the field separator. +* Single Character Fields:: Making each character a separate field. +* Command Line Field Separator:: Setting `FS' from the command-line. +* Field Splitting Summary:: Some final points and a summary table. + + The "field separator", which is either a single character or a +regular expression, controls the way `awk' splits an input record into +fields. `awk' scans the input record for character sequences that +match the separator; the fields themselves are the text between the +matches. + + In the examples that follow, we use the bullet symbol (*) to +represent spaces in the output. If the field separator is `oo', then +the following line: + + moo goo gai pan + +is split into three fields: `m', `*g', and `*gai*pan'. Note the +leading spaces in the values of the second and third fields. + + The field separator is represented by the built-in variable `FS'. +Shell programmers take note: `awk' does _not_ use the name `IFS' that +is used by the POSIX-compliant shells (such as the Unix Bourne shell, +`sh', or `bash'). + + The value of `FS' can be changed in the `awk' program with the +assignment operator, `=' (*note Assignment Ops::). Often the right +time to do this is at the beginning of execution before any input has +been processed, so that the very first record is read with the proper +separator. To do this, use the special `BEGIN' pattern (*note +BEGIN/END::). For example, here we set the value of `FS' to the string +`","': + + awk 'BEGIN { FS = "," } ; { print $2 }' + +Given the input line: + + John Q. Smith, 29 Oak St., Walamazoo, MI 42139 + +this `awk' program extracts and prints the string `*29*Oak*St.'. + + Sometimes the input data contains separator characters that don't +separate fields the way you thought they would. For instance, the +person's name in the example we just used might have a title or suffix +attached, such as: + + John Q. Smith, LXIX, 29 Oak St., Walamazoo, MI 42139 + +The same program would extract `*LXIX', instead of `*29*Oak*St.'. If +you were expecting the program to print the address, you would be +surprised. The moral is to choose your data layout and separator +characters carefully to prevent such problems. (If the data is not in +a form that is easy to process, perhaps you can massage it first with a +separate `awk' program.) + + Fields are normally separated by whitespace sequences (spaces, tabs, +and newlines), not by single spaces. Two spaces in a row do not +delimit an empty field. The default value of the field separator `FS' +is a string containing a single space, `" "'. If `awk' interpreted +this value in the usual way, each space character would separate +fields, so two spaces in a row would make an empty field between them. +The reason this does not happen is that a single space as the value of +`FS' is a special case--it is taken to specify the default manner of +delimiting fields. + + If `FS' is any other single character, such as `","', then each +occurrence of that character separates two fields. Two consecutive +occurrences delimit an empty field. If the character occurs at the +beginning or the end of the line, that too delimits an empty field. The +space character is the only single character that does not follow these +rules. + + +File: gawk.info, Node: Regexp Field Splitting, Next: Single Character Fields, Up: Field Separators + +3.5.1 Using Regular Expressions to Separate Fields +-------------------------------------------------- + +The previous node discussed the use of single characters or simple +strings as the value of `FS'. More generally, the value of `FS' may be +a string containing any regular expression. In this case, each match +in the record for the regular expression separates fields. For +example, the assignment: + + FS = ", \t" + +makes every area of an input line that consists of a comma followed by a +space and a TAB into a field separator. (`\t' is an "escape sequence" +that stands for a TAB; *note Escape Sequences::, for the complete list +of similar escape sequences.) + + For a less trivial example of a regular expression, try using single +spaces to separate fields the way single commas are used. `FS' can be +set to `"[ ]"' (left bracket, space, right bracket). This regular +expression matches a single space and nothing else (*note Regexp::). + + There is an important difference between the two cases of `FS = " "' +(a single space) and `FS = "[ \t\n]+"' (a regular expression matching +one or more spaces, tabs, or newlines). For both values of `FS', +fields are separated by "runs" (multiple adjacent occurrences) of +spaces, tabs, and/or newlines. However, when the value of `FS' is +`" "', `awk' first strips leading and trailing whitespace from the +record and then decides where the fields are. For example, the +following pipeline prints `b': + + $ echo ' a b c d ' | awk '{ print $2 }' + -| b + +However, this pipeline prints `a' (note the extra spaces around each +letter): + + $ echo ' a b c d ' | awk 'BEGIN { FS = "[ \t\n]+" } + > { print $2 }' + -| a + +In this case, the first field is "null" or empty. + + The stripping of leading and trailing whitespace also comes into +play whenever `$0' is recomputed. For instance, study this pipeline: + + $ echo ' a b c d' | awk '{ print; $2 = $2; print }' + -| a b c d + -| a b c d + +The first `print' statement prints the record as it was read, with +leading whitespace intact. The assignment to `$2' rebuilds `$0' by +concatenating `$1' through `$NF' together, separated by the value of +`OFS'. Because the leading whitespace was ignored when finding `$1', +it is not part of the new `$0'. Finally, the last `print' statement +prints the new `$0'. + + +File: gawk.info, Node: Single Character Fields, Next: Command Line Field Separator, Prev: Regexp Field Splitting, Up: Field Separators + +3.5.2 Making Each Character a Separate Field +-------------------------------------------- + +There are times when you may want to examine each character of a record +separately. This can be done in `gawk' by simply assigning the null +string (`""') to `FS'. In this case, each individual character in the +record becomes a separate field. For example: + + $ echo a b | gawk 'BEGIN { FS = "" } + > { + > for (i = 1; i <= NF; i = i + 1) + > print "Field", i, "is", $i + > }' + -| Field 1 is a + -| Field 2 is + -| Field 3 is b + + Traditionally, the behavior of `FS' equal to `""' was not defined. +In this case, most versions of Unix `awk' simply treat the entire record +as only having one field. (d.c.) In compatibility mode (*note +Options::), if `FS' is the null string, then `gawk' also behaves this +way. + + +File: gawk.info, Node: Command Line Field Separator, Next: Field Splitting Summary, Prev: Single Character Fields, Up: Field Separators + +3.5.3 Setting `FS' from the Command Line +---------------------------------------- + +`FS' can be set on the command line. Use the `-F' option to do so. +For example: + + awk -F, 'PROGRAM' INPUT-FILES + +sets `FS' to the `,' character. Notice that the option uses an +uppercase `F' instead of a lowercase `f'. The latter option (`-f') +specifies a file containing an `awk' program. Case is significant in +command-line options: the `-F' and `-f' options have nothing to do with +each other. You can use both options at the same time to set the `FS' +variable _and_ get an `awk' program from a file. + + The value used for the argument to `-F' is processed in exactly the +same way as assignments to the built-in variable `FS'. Any special +characters in the field separator must be escaped appropriately. For +example, to use a `\' as the field separator on the command line, you +would have to type: + + # same as FS = "\\" + awk -F\\\\ '...' files ... + +Because `\' is used for quoting in the shell, `awk' sees `-F\\'. Then +`awk' processes the `\\' for escape characters (*note Escape +Sequences::), finally yielding a single `\' to use for the field +separator. + + As a special case, in compatibility mode (*note Options::), if the +argument to `-F' is `t', then `FS' is set to the TAB character. If you +type `-F\t' at the shell, without any quotes, the `\' gets deleted, so +`awk' figures that you really want your fields to be separated with +tabs and not `t's. Use `-v FS="t"' or `-F"[t]"' on the command line if +you really do want to separate your fields with `t's. + + For example, let's use an `awk' program file called `baud.awk' that +contains the pattern `/300/' and the action `print $1': + + /300/ { print $1 } + + Let's also set `FS' to be the `-' character and run the program on +the file `BBS-list'. The following command prints a list of the names +of the bulletin boards that operate at 300 baud and the first three +digits of their phone numbers: + + $ awk -F- -f baud.awk BBS-list + -| aardvark 555 + -| alpo + -| barfly 555 + -| bites 555 + -| camelot 555 + -| core 555 + -| fooey 555 + -| foot 555 + -| macfoo 555 + -| sdace 555 + -| sabafoo 555 + +Note the second line of output. The second line in the original file +looked like this: + + alpo-net 555-3412 2400/1200/300 A + + The `-' as part of the system's name was used as the field +separator, instead of the `-' in the phone number that was originally +intended. This demonstrates why you have to be careful in choosing +your field and record separators. + + Perhaps the most common use of a single character as the field +separator occurs when processing the Unix system password file. On +many Unix systems, each user has a separate entry in the system password +file, one line per user. The information in these lines is separated +by colons. The first field is the user's login name and the second is +the user's (encrypted or shadow) password. A password file entry might +look like this: + + arnold:xyzzy:2076:10:Arnold Robbins:/home/arnold:/bin/bash + + The following program searches the system password file and prints +the entries for users who have no password: + + awk -F: '$2 == ""' /etc/passwd + + +File: gawk.info, Node: Field Splitting Summary, Prev: Command Line Field Separator, Up: Field Separators + +3.5.4 Field-Splitting Summary +----------------------------- + +It is important to remember that when you assign a string constant as +the value of `FS', it undergoes normal `awk' string processing. For +example, with Unix `awk' and `gawk', the assignment `FS = "\.."' +assigns the character string `".."' to `FS' (the backslash is +stripped). This creates a regexp meaning "fields are separated by +occurrences of any two characters." If instead you want fields to be +separated by a literal period followed by any single character, use `FS += "\\.."'. + + The following table summarizes how fields are split, based on the +value of `FS' (`==' means "is equal to"): + +`FS == " "' + Fields are separated by runs of whitespace. Leading and trailing + whitespace are ignored. This is the default. + +`FS == ANY OTHER SINGLE CHARACTER' + Fields are separated by each occurrence of the character. Multiple + successive occurrences delimit empty fields, as do leading and + trailing occurrences. The character can even be a regexp + metacharacter; it does not need to be escaped. + +`FS == REGEXP' + Fields are separated by occurrences of characters that match + REGEXP. Leading and trailing matches of REGEXP delimit empty + fields. + +`FS == ""' + Each individual character in the record becomes a separate field. + (This is a `gawk' extension; it is not specified by the POSIX + standard.) + +Advanced Notes: Changing `FS' Does Not Affect the Fields +-------------------------------------------------------- + +According to the POSIX standard, `awk' is supposed to behave as if each +record is split into fields at the time it is read. In particular, +this means that if you change the value of `FS' after a record is read, +the value of the fields (i.e., how they were split) should reflect the +old value of `FS', not the new one. + + However, many implementations of `awk' do not work this way. +Instead, they defer splitting the fields until a field is actually +referenced. The fields are split using the _current_ value of `FS'! +(d.c.) This behavior can be difficult to diagnose. The following +example illustrates the difference between the two methods. (The +`sed'(1) command prints just the first line of `/etc/passwd'.) + + sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }' + +which usually prints: + + root + +on an incorrect implementation of `awk', while `gawk' prints something +like: + + root:nSijPlPhZZwgE:0:0:Root:/: + +Advanced Notes: `FS' and `IGNORECASE' +------------------------------------- + +The `IGNORECASE' variable (*note User-modified::) affects field +splitting _only_ when the value of `FS' is a regexp. It has no effect +when `FS' is a single character, even if that character is a letter. +Thus, in the following code: + + FS = "c" + IGNORECASE = 1 + $0 = "aCa" + print $1 + +The output is `aCa'. If you really want to split fields on an +alphabetic character while ignoring case, use a regexp that will do it +for you. E.g., `FS = "[c]"'. In this case, `IGNORECASE' will take +effect. + + ---------- Footnotes ---------- + + (1) The `sed' utility is a "stream editor." Its behavior is also +defined by the POSIX standard. + + +File: gawk.info, Node: Constant Size, Next: Multiple Line, Prev: Field Separators, Up: Reading Files + +3.6 Reading Fixed-Width Data +============================ + +(This minor node discusses an advanced feature of `awk'. If you are a +novice `awk' user, you might want to skip it on the first reading.) + +`gawk' version 2.13 introduced a facility for dealing with fixed-width +fields with no distinctive field separator. For example, data of this +nature arises in the input for old Fortran programs where numbers are +run together, or in the output of programs that did not anticipate the +use of their output as input for other programs. + + An example of the latter is a table where all the columns are lined +up by the use of a variable number of spaces and _empty fields are just +spaces_. Clearly, `awk''s normal field splitting based on `FS' does +not work well in this case. Although a portable `awk' program can use +a series of `substr' calls on `$0' (*note String Functions::), this is +awkward and inefficient for a large number of fields. + + The splitting of an input record into fixed-width fields is +specified by assigning a string containing space-separated numbers to +the built-in variable `FIELDWIDTHS'. Each number specifies the width +of the field, _including_ columns between fields. If you want to +ignore the columns between fields, you can specify the width as a +separate field that is subsequently ignored. It is a fatal error to +supply a field width that is not a positive number. The following data +is the output of the Unix `w' utility. It is useful to illustrate the +use of `FIELDWIDTHS': + + 10:06pm up 21 days, 14:04, 23 users + User tty login idle JCPU PCPU what + hzuo ttyV0 8:58pm 9 5 vi p24.tex + hzang ttyV3 6:37pm 50 -csh + eklye ttyV5 9:53pm 7 1 em thes.tex + dportein ttyV6 8:17pm 1:47 -csh + gierd ttyD3 10:00pm 1 elm + dave ttyD4 9:47pm 4 4 w + brent ttyp0 26Jun91 4:46 26:46 4:41 bash + dave ttyq4 26Jun9115days 46 46 wnewmail + + The following program takes the above input, converts the idle time +to number of seconds, and prints out the first two fields and the +calculated idle time: + + NOTE: This program uses a number of `awk' features that haven't + been introduced yet. + + BEGIN { FIELDWIDTHS = "9 6 10 6 7 7 35" } + NR > 2 { + idle = $4 + sub(/^ */, "", idle) # strip leading spaces + if (idle == "") + idle = 0 + if (idle ~ /:/) { + split(idle, t, ":") + idle = t[1] * 60 + t[2] + } + if (idle ~ /days/) + idle *= 24 * 60 * 60 + + print $1, $2, idle + } + + Running the program on the data produces the following results: + + hzuo ttyV0 0 + hzang ttyV3 50 + eklye ttyV5 0 + dportein ttyV6 107 + gierd ttyD3 1 + dave ttyD4 0 + brent ttyp0 286 + dave ttyq4 1296000 + + Another (possibly more practical) example of fixed-width input data +is the input from a deck of balloting cards. In some parts of the +United States, voters mark their choices by punching holes in computer +cards. These cards are then processed to count the votes for any +particular candidate or on any particular issue. Because a voter may +choose not to vote on some issue, any column on the card may be empty. +An `awk' program for processing such data could use the `FIELDWIDTHS' +feature to simplify reading the data. (Of course, getting `gawk' to +run on a system with card readers is another story!) + + Assigning a value to `FS' causes `gawk' to use `FS' for field +splitting again. Use `FS = FS' to make this happen, without having to +know the current value of `FS'. In order to tell which kind of field +splitting is in effect, use `PROCINFO["FS"]' (*note Auto-set::). The +value is `"FS"' if regular field splitting is being used, or it is +`"FIELDWIDTHS"' if fixed-width field splitting is being used: + + if (PROCINFO["FS"] == "FS") + REGULAR FIELD SPLITTING ... + else + FIXED-WIDTH FIELD SPLITTING ... + + This information is useful when writing a function that needs to +temporarily change `FS' or `FIELDWIDTHS', read some records, and then +restore the original settings (*note Passwd Functions::, for an example +of such a function). + + +File: gawk.info, Node: Multiple Line, Next: Getline, Prev: Constant Size, Up: Reading Files + +3.7 Multiple-Line Records +========================= + +In some databases, a single line cannot conveniently hold all the +information in one entry. In such cases, you can use multiline +records. The first step in doing this is to choose your data format. + + One technique is to use an unusual character or string to separate +records. For example, you could use the formfeed character (written +`\f' in `awk', as in C) to separate them, making each record a page of +the file. To do this, just set the variable `RS' to `"\f"' (a string +containing the formfeed character). Any other character could equally +well be used, as long as it won't be part of the data in a record. + + Another technique is to have blank lines separate records. By a +special dispensation, an empty string as the value of `RS' indicates +that records are separated by one or more blank lines. When `RS' is set +to the empty string, each record always ends at the first blank line +encountered. The next record doesn't start until the first nonblank +line that follows. No matter how many blank lines appear in a row, they +all act as one record separator. (Blank lines must be completely +empty; lines that contain only whitespace do not count.) + + You can achieve the same effect as `RS = ""' by assigning the string +`"\n\n+"' to `RS'. This regexp matches the newline at the end of the +record and one or more blank lines after the record. In addition, a +regular expression always matches the longest possible sequence when +there is a choice (*note Leftmost Longest::). So the next record +doesn't start until the first nonblank line that follows--no matter how +many blank lines appear in a row, they are considered one record +separator. + + There is an important difference between `RS = ""' and `RS = +"\n\n+"'. In the first case, leading newlines in the input data file +are ignored, and if a file ends without extra blank lines after the +last record, the final newline is removed from the record. In the +second case, this special processing is not done. (d.c.) + + Now that the input is separated into records, the second step is to +separate the fields in the record. One way to do this is to divide each +of the lines into fields in the normal manner. This happens by default +as the result of a special feature. When `RS' is set to the empty +string, _and_ `FS' is set to a single character, the newline character +_always_ acts as a field separator. This is in addition to whatever +field separations result from `FS'.(1) + + The original motivation for this special exception was probably to +provide useful behavior in the default case (i.e., `FS' is equal to +`" "'). This feature can be a problem if you really don't want the +newline character to separate fields, because there is no way to +prevent it. However, you can work around this by using the `split' +function to break up the record manually (*note String Functions::). +If you have a single character field separator, you can work around the +special feature in a different way, by making `FS' into a regexp for +that single character. For example, if the field separator is a +percent character, instead of `FS = "%"', use `FS = "[%]"'. + + Another way to separate fields is to put each field on a separate +line: to do this, just set the variable `FS' to the string `"\n"'. +(This single character separator matches a single newline.) A +practical example of a data file organized this way might be a mailing +list, where each entry is separated by blank lines. Consider a mailing +list in a file named `addresses', which looks like this: + + Jane Doe + 123 Main Street + Anywhere, SE 12345-6789 + + John Smith + 456 Tree-lined Avenue + Smallville, MW 98765-4321 + ... + +A simple program to process this file is as follows: + + # addrs.awk --- simple mailing list program + + # Records are separated by blank lines. + # Each line is one field. + BEGIN { RS = "" ; FS = "\n" } + + { + print "Name is:", $1 + print "Address is:", $2 + print "City and State are:", $3 + print "" + } + + Running the program produces the following output: + + $ awk -f addrs.awk addresses + -| Name is: Jane Doe + -| Address is: 123 Main Street + -| City and State are: Anywhere, SE 12345-6789 + -| + -| Name is: John Smith + -| Address is: 456 Tree-lined Avenue + -| City and State are: Smallville, MW 98765-4321 + -| + ... + + *Note Labels Program::, for a more realistic program that deals with +address lists. The following table summarizes how records are split, +based on the value of `RS'. (`==' means "is equal to.") + +`RS == "\n"' + Records are separated by the newline character (`\n'). In effect, + every line in the data file is a separate record, including blank + lines. This is the default. + +`RS == ANY SINGLE CHARACTER' + Records are separated by each occurrence of the character. + Multiple successive occurrences delimit empty records. + +`RS == ""' + Records are separated by runs of blank lines. When `FS' is a + single character, then the newline character always serves as a + field separator, in addition to whatever value `FS' may have. + Leading and trailing newlines in a file are ignored. + +`RS == REGEXP' + Records are separated by occurrences of characters that match + REGEXP. Leading and trailing matches of REGEXP delimit empty + records. (This is a `gawk' extension; it is not specified by the + POSIX standard.) + + In all cases, `gawk' sets `RT' to the input text that matched the +value specified by `RS'. + + ---------- Footnotes ---------- + + (1) When `FS' is the null string (`""') or a regexp, this special +feature of `RS' does not apply. It does apply to the default field +separator of a single space: `FS = " "'. + + +File: gawk.info, Node: Getline, Prev: Multiple Line, Up: Reading Files + +3.8 Explicit Input with `getline' +================================= + +So far we have been getting our input data from `awk''s main input +stream--either the standard input (usually your terminal, sometimes the +output from another program) or from the files specified on the command +line. The `awk' language has a special built-in command called +`getline' that can be used to read input under your explicit control. + + The `getline' command is used in several different ways and should +_not_ be used by beginners. The examples that follow the explanation +of the `getline' command include material that has not been covered +yet. Therefore, come back and study the `getline' command _after_ you +have reviewed the rest of this Info file and have a good knowledge of +how `awk' works. + + The `getline' command returns one if it finds a record and zero if +it encounters the end of the file. If there is some error in getting a +record, such as a file that cannot be opened, then `getline' returns +-1. In this case, `gawk' sets the variable `ERRNO' to a string +describing the error that occurred. + + In the following examples, COMMAND stands for a string value that +represents a shell command. + +* Menu: + +* Plain Getline:: Using `getline' with no arguments. +* Getline/Variable:: Using `getline' into a variable. +* Getline/File:: Using `getline' from a file. +* Getline/Variable/File:: Using `getline' into a variable from a + file. +* Getline/Pipe:: Using `getline' from a pipe. +* Getline/Variable/Pipe:: Using `getline' into a variable from a + pipe. +* Getline/Coprocess:: Using `getline' from a coprocess. +* Getline/Variable/Coprocess:: Using `getline' into a variable from a + coprocess. +* Getline Notes:: Important things to know about `getline'. +* Getline Summary:: Summary of `getline' Variants. + + +File: gawk.info, Node: Plain Getline, Next: Getline/Variable, Up: Getline + +3.8.1 Using `getline' with No Arguments +--------------------------------------- + +The `getline' command can be used without arguments to read input from +the current input file. All it does in this case is read the next +input record and split it up into fields. This is useful if you've +finished processing the current record, but want to do some special +processing on the next record _right now_. For example: + + { + if ((t = index($0, "/*")) != 0) { + # value of `tmp' will be "" if t is 1 + tmp = substr($0, 1, t - 1) + u = index(substr($0, t + 2), "*/") + while (u == 0) { + if (getline <= 0) { + m = "unexpected EOF or error" + m = (m ": " ERRNO) + print m > "/dev/stderr" + exit + } + u = index($0, "*/") + } + # substr expression will be "" if */ + # occurred at end of line + $0 = tmp substr($0, u + 2) + } + print $0 + } + + This `awk' program deletes C-style comments (`/* ... */') from the +input. By replacing the `print $0' with other statements, you could +perform more complicated processing on the decommented input, such as +searching for matches of a regular expression. (This program has a +subtle problem--it does not work if one comment ends and another begins +on the same line.) + + This form of the `getline' command sets `NF', `NR', `FNR', and the +value of `$0'. + + NOTE: The new value of `$0' is used to test the patterns of any + subsequent rules. The original value of `$0' that triggered the + rule that executed `getline' is lost. By contrast, the `next' + statement reads a new record but immediately begins processing it + normally, starting with the first rule in the program. *Note Next + Statement::. + + +File: gawk.info, Node: Getline/Variable, Next: Getline/File, Prev: Plain Getline, Up: Getline + +3.8.2 Using `getline' into a Variable +------------------------------------- + +You can use `getline VAR' to read the next record from `awk''s input +into the variable VAR. No other processing is done. For example, +suppose the next line is a comment or a special string, and you want to +read it without triggering any rules. This form of `getline' allows +you to read that line and store it in a variable so that the main +read-a-line-and-check-each-rule loop of `awk' never sees it. The +following example swaps every two lines of input: + + { + if ((getline tmp) > 0) { + print tmp + print $0 + } else + print $0 + } + +It takes the following list: + + wan + tew + free + phore + +and produces these results: + + tew + wan + phore + free + + The `getline' command used in this way sets only the variables `NR' +and `FNR' (and of course, VAR). The record is not split into fields, +so the values of the fields (including `$0') and the value of `NF' do +not change. + + +File: gawk.info, Node: Getline/File, Next: Getline/Variable/File, Prev: Getline/Variable, Up: Getline + +3.8.3 Using `getline' from a File +--------------------------------- + +Use `getline < FILE' to read the next record from FILE. Here FILE is a +string-valued expression that specifies the file name. `< FILE' is +called a "redirection" because it directs input to come from a +different place. For example, the following program reads its input +record from the file `secondary.input' when it encounters a first field +with a value equal to 10 in the current input file: + + { + if ($1 == 10) { + getline < "secondary.input" + print + } else + print + } + + Because the main input stream is not used, the values of `NR' and +`FNR' are not changed. However, the record it reads is split into +fields in the normal manner, so the values of `$0' and the other fields +are changed, resulting in a new value of `NF'. + + According to POSIX, `getline < EXPRESSION' is ambiguous if +EXPRESSION contains unparenthesized operators other than `$'; for +example, `getline < dir "/" file' is ambiguous because the +concatenation operator is not parenthesized. You should write it as +`getline < (dir "/" file)' if you want your program to be portable to +other `awk' implementations. + + +File: gawk.info, Node: Getline/Variable/File, Next: Getline/Pipe, Prev: Getline/File, Up: Getline + +3.8.4 Using `getline' into a Variable from a File +------------------------------------------------- + +Use `getline VAR < FILE' to read input from the file FILE, and put it +in the variable VAR. As above, FILE is a string-valued expression that +specifies the file from which to read. + + In this version of `getline', none of the built-in variables are +changed and the record is not split into fields. The only variable +changed is VAR. For example, the following program copies all the +input files to the output, except for records that say +`@include FILENAME'. Such a record is replaced by the contents of the +file FILENAME: + + { + if (NF == 2 && $1 == "@include") { + while ((getline line < $2) > 0) + print line + close($2) + } else + print + } + + Note here how the name of the extra input file is not built into the +program; it is taken directly from the data, specifically from the +second field on the `@include' line. + + The `close' function is called to ensure that if two identical +`@include' lines appear in the input, the entire specified file is +included twice. *Note Close Files And Pipes::. + + One deficiency of this program is that it does not process nested +`@include' statements (i.e., `@include' statements in included files) +the way a true macro preprocessor would. *Note Igawk Program::, for a +program that does handle nested `@include' statements. + + +File: gawk.info, Node: Getline/Pipe, Next: Getline/Variable/Pipe, Prev: Getline/Variable/File, Up: Getline + +3.8.5 Using `getline' from a Pipe +--------------------------------- + +The output of a command can also be piped into `getline', using +`COMMAND | getline'. In this case, the string COMMAND is run as a +shell command and its output is piped into `awk' to be used as input. +This form of `getline' reads one record at a time from the pipe. For +example, the following program copies its input to its output, except +for lines that begin with `@execute', which are replaced by the output +produced by running the rest of the line as a shell command: + + { + if ($1 == "@execute") { + tmp = substr($0, 10) + while ((tmp | getline) > 0) + print + close(tmp) + } else + print + } + +The `close' function is called to ensure that if two identical +`@execute' lines appear in the input, the command is run for each one. +*Note Close Files And Pipes::. Given the input: + + foo + bar + baz + @execute who + bletch + +the program might produce: + + foo + bar + baz + arnold ttyv0 Jul 13 14:22 + miriam ttyp0 Jul 13 14:23 (murphy:0) + bill ttyp1 Jul 13 14:23 (murphy:0) + bletch + +Notice that this program ran the command `who' and printed the previous +result. (If you try this program yourself, you will of course get +different results, depending upon who is logged in on your system.) + + This variation of `getline' splits the record into fields, sets the +value of `NF', and recomputes the value of `$0'. The values of `NR' +and `FNR' are not changed. + + According to POSIX, `EXPRESSION | getline' is ambiguous if +EXPRESSION contains unparenthesized operators other than `$'--for +example, `"echo " "date" | getline' is ambiguous because the +concatenation operator is not parenthesized. You should write it as +`("echo " "date") | getline' if you want your program to be portable to +other `awk' implementations. + + NOTE: Unfortunately, `gawk' has not been consistent in its + treatment of a construct like `"echo " "date" | getline'. Up to + and including version 3.1.1 of `gawk', it was treated as `("echo " + "date") | getline'. (This how Unix `awk' behaves.) From 3.1.2 + through 3.1.5, it was treated as `"echo " ("date" | getline)'. + (This is how `mawk' behaves.) Starting with version 3.1.6, the + earlier behavior was reinstated. In short, _always_ use explicit + parentheses, and then you won't have to worry. + + +File: gawk.info, Node: Getline/Variable/Pipe, Next: Getline/Coprocess, Prev: Getline/Pipe, Up: Getline + +3.8.6 Using `getline' into a Variable from a Pipe +------------------------------------------------- + +When you use `COMMAND | getline VAR', the output of COMMAND is sent +through a pipe to `getline' and into the variable VAR. For example, the +following program reads the current date and time into the variable +`current_time', using the `date' utility, and then prints it: + + BEGIN { + "date" | getline current_time + close("date") + print "Report printed on " current_time + } + + In this version of `getline', none of the built-in variables are +changed and the record is not split into fields. + + According to POSIX, `EXPRESSION | getline VAR' is ambiguous if +EXPRESSION contains unparenthesized operators other than `$'; for +example, `"echo " "date" | getline VAR' is ambiguous because the +concatenation operator is not parenthesized. You should write it as +`("echo " "date") | getline VAR' if you want your program to be +portable to other `awk' implementations. + + +File: gawk.info, Node: Getline/Coprocess, Next: Getline/Variable/Coprocess, Prev: Getline/Variable/Pipe, Up: Getline + +3.8.7 Using `getline' from a Coprocess +-------------------------------------- + +Input into `getline' from a pipe is a one-way operation. The command +that is started with `COMMAND | getline' only sends data _to_ your +`awk' program. + + On occasion, you might want to send data to another program for +processing and then read the results back. `gawk' allows you to start +a "coprocess", with which two-way communications are possible. This is +done with the `|&' operator. Typically, you write data to the +coprocess first and then read results back, as shown in the following: + + print "SOME QUERY" |& "db_server" + "db_server" |& getline + +which sends a query to `db_server' and then reads the results. + + The values of `NR' and `FNR' are not changed, because the main input +stream is not used. However, the record is split into fields in the +normal manner, thus changing the values of `$0', of the other fields, +and of `NF'. + + Coprocesses are an advanced feature. They are discussed here only +because this is the minor node on `getline'. *Note Two-way I/O::, +where coprocesses are discussed in more detail. + + +File: gawk.info, Node: Getline/Variable/Coprocess, Next: Getline Notes, Prev: Getline/Coprocess, Up: Getline + +3.8.8 Using `getline' into a Variable from a Coprocess +------------------------------------------------------ + +When you use `COMMAND |& getline VAR', the output from the coprocess +COMMAND is sent through a two-way pipe to `getline' and into the +variable VAR. + + In this version of `getline', none of the built-in variables are +changed and the record is not split into fields. The only variable +changed is VAR. + + Coprocesses are an advanced feature. They are discussed here only +because this is the minor node on `getline'. *Note Two-way I/O::, +where coprocesses are discussed in more detail. + + +File: gawk.info, Node: Getline Notes, Next: Getline Summary, Prev: Getline/Variable/Coprocess, Up: Getline + +3.8.9 Points to Remember About `getline' +---------------------------------------- + +Here are some miscellaneous points about `getline' that you should bear +in mind: + + * When `getline' changes the value of `$0' and `NF', `awk' does + _not_ automatically jump to the start of the program and start + testing the new record against every pattern. However, the new + record is tested against any subsequent rules. + + * Many `awk' implementations limit the number of pipelines that an + `awk' program may have open to just one. In `gawk', there is no + such limit. You can open as many pipelines (and coprocesses) as + the underlying operating system permits. + + * An interesting side effect occurs if you use `getline' without a + redirection inside a `BEGIN' rule. Because an unredirected + `getline' reads from the command-line data files, the first + `getline' command causes `awk' to set the value of `FILENAME'. + Normally, `FILENAME' does not have a value inside `BEGIN' rules, + because you have not yet started to process the command-line data + files. (d.c.) (*Note BEGIN/END::, also *note Auto-set::.) + + * Using `FILENAME' with `getline' (`getline < FILENAME') is likely + to be a source for confusion. `awk' opens a separate input stream + from the current input file. However, by not using a variable, + `$0' and `NR' are still updated. If you're doing this, it's + probably by accident, and you should reconsider what it is you're + trying to accomplish. + + +File: gawk.info, Node: Getline Summary, Prev: Getline Notes, Up: Getline + +3.8.10 Summary of `getline' Variants +------------------------------------ + +*note table-getline-variants:: summarizes the eight variants of +`getline', listing which built-in variables are set by each one. + +Variant Effect +-------------------------------------------------------------------------- +`getline' Sets `$0', `NF', `FNR', and `NR' +`getline' VAR Sets VAR, `FNR', and `NR' +`getline <' FILE Sets `$0' and `NF' +`getline VAR < FILE' Sets VAR +COMMAND `| getline' Sets `$0' and `NF' +COMMAND `| getline' VAR Sets VAR +COMMAND `|& getline' Sets `$0' and `NF'. This is a `gawk' extension +COMMAND `|& getline' VAR Sets VAR. This is a `gawk' extension + +Table 3.1: getline Variants and What They Set + + +File: gawk.info, Node: Printing, Next: Expressions, Prev: Reading Files, Up: Top + +4 Printing Output +***************** + +One of the most common programming actions is to "print", or output, +some or all of the input. Use the `print' statement for simple output, +and the `printf' statement for fancier formatting. The `print' +statement is not limited when computing _which_ values to print. +However, with two exceptions, you cannot specify _how_ to print +them--how many columns, whether to use exponential notation or not, and +so on. (For the exceptions, *note Output Separators::, and *note +OFMT::.) For printing with specifications, you need the `printf' +statement (*note Printf::). + + Besides basic and formatted printing, this major node also covers +I/O redirections to files and pipes, introduces the special file names +that `gawk' processes internally, and discusses the `close' built-in +function. + +* Menu: + +* Print:: The `print' statement. +* Print Examples:: Simple examples of `print' statements. +* Output Separators:: The output separators and how to change them. +* OFMT:: Controlling Numeric Output With `print'. +* Printf:: The `printf' statement. +* Redirection:: How to redirect output to multiple files and + pipes. +* Special Files:: File name interpretation in `gawk'. + `gawk' allows access to inherited file + descriptors. +* Close Files And Pipes:: Closing Input and Output Files and Pipes. + + +File: gawk.info, Node: Print, Next: Print Examples, Up: Printing + +4.1 The `print' Statement +========================= + +The `print' statement is used to produce output with simple, +standardized formatting. Specify only the strings or numbers to print, +in a list separated by commas. They are output, separated by single +spaces, followed by a newline. The statement looks like this: + + print ITEM1, ITEM2, ... + +The entire list of items may be optionally enclosed in parentheses. The +parentheses are necessary if any of the item expressions uses the `>' +relational operator; otherwise it could be confused with a redirection +(*note Redirection::). + + The items to print can be constant strings or numbers, fields of the +current record (such as `$1'), variables, or any `awk' expression. +Numeric values are converted to strings and then printed. + + The simple statement `print' with no items is equivalent to `print +$0': it prints the entire current record. To print a blank line, use +`print ""', where `""' is the empty string. To print a fixed piece of +text, use a string constant, such as `"Don't Panic"', as one item. If +you forget to use the double-quote characters, your text is taken as an +`awk' expression, and you will probably get an error. Keep in mind +that a space is printed between any two items. + + +File: gawk.info, Node: Print Examples, Next: Output Separators, Prev: Print, Up: Printing + +4.2 Examples of `print' Statements +================================== + +Each `print' statement makes at least one line of output. However, it +isn't limited to only one line. If an item value is a string that +contains a newline, the newline is output along with the rest of the +string. A single `print' statement can make any number of lines this +way. + + The following is an example of printing a string that contains +embedded newlines (the `\n' is an escape sequence, used to represent +the newline character; *note Escape Sequences::): + + $ awk 'BEGIN { print "line one\nline two\nline three" }' + -| line one + -| line two + -| line three + + The next example, which is run on the `inventory-shipped' file, +prints the first two fields of each input record, with a space between +them: + + $ awk '{ print $1, $2 }' inventory-shipped + -| Jan 13 + -| Feb 15 + -| Mar 15 + ... + + A common mistake in using the `print' statement is to omit the comma +between two items. This often has the effect of making the items run +together in the output, with no space. The reason for this is that +juxtaposing two string expressions in `awk' means to concatenate them. +Here is the same program, without the comma: + + $ awk '{ print $1 $2 }' inventory-shipped + -| Jan13 + -| Feb15 + -| Mar15 + ... + + To someone unfamiliar with the `inventory-shipped' file, neither +example's output makes much sense. A heading line at the beginning +would make it clearer. Let's add some headings to our table of months +(`$1') and green crates shipped (`$2'). We do this using the `BEGIN' +pattern (*note BEGIN/END::) so that the headings are only printed once: + + awk 'BEGIN { print "Month Crates" + print "----- ------" } + { print $1, $2 }' inventory-shipped + +When run, the program prints the following: + + Month Crates + ----- ------ + Jan 13 + Feb 15 + Mar 15 + ... + +The only problem, however, is that the headings and the table data +don't line up! We can fix this by printing some spaces between the two +fields: + + awk 'BEGIN { print "Month Crates" + print "----- ------" } + { print $1, " ", $2 }' inventory-shipped + + Lining up columns this way can get pretty complicated when there are +many columns to fix. Counting spaces for two or three columns is +simple, but any more than this can take up a lot of time. This is why +the `printf' statement was created (*note Printf::); one of its +specialties is lining up columns of data. + + NOTE: You can continue either a `print' or `printf' statement + simply by putting a newline after any comma (*note + Statements/Lines::). + + +File: gawk.info, Node: Output Separators, Next: OFMT, Prev: Print Examples, Up: Printing + +4.3 Output Separators +===================== + +As mentioned previously, a `print' statement contains a list of items +separated by commas. In the output, the items are normally separated +by single spaces. However, this doesn't need to be the case; a single +space is only the default. Any string of characters may be used as the +"output field separator" by setting the built-in variable `OFS'. The +initial value of this variable is the string `" "'--that is, a single +space. + + The output from an entire `print' statement is called an "output +record". Each `print' statement outputs one output record, and then +outputs a string called the "output record separator" (or `ORS'). The +initial value of `ORS' is the string `"\n"'; i.e., a newline character. +Thus, each `print' statement normally makes a separate line. + + In order to change how output fields and records are separated, +assign new values to the variables `OFS' and `ORS'. The usual place to +do this is in the `BEGIN' rule (*note BEGIN/END::), so that it happens +before any input is processed. It can also be done with assignments on +the command line, before the names of the input files, or using the +`-v' command-line option (*note Options::). The following example +prints the first and second fields of each input record, separated by a +semicolon, with a blank line added after each newline: + + $ awk 'BEGIN { OFS = ";"; ORS = "\n\n" } + > { print $1, $2 }' BBS-list + -| aardvark;555-5553 + -| + -| alpo-net;555-3412 + -| + -| barfly;555-7685 + ... + + If the value of `ORS' does not contain a newline, the program's +output is run together on a single line. + + +File: gawk.info, Node: OFMT, Next: Printf, Prev: Output Separators, Up: Printing + +4.4 Controlling Numeric Output with `print' +=========================================== + +When the `print' statement is used to print numeric values, `awk' +internally converts the number to a string of characters and prints +that string. `awk' uses the `sprintf' function to do this conversion +(*note String Functions::). For now, it suffices to say that the +`sprintf' function accepts a "format specification" that tells it how +to format numbers (or strings), and that there are a number of +different ways in which numbers can be formatted. The different format +specifications are discussed more fully in *note Control Letters::. + + The built-in variable `OFMT' contains the default format +specification that `print' uses with `sprintf' when it wants to convert +a number to a string for printing. The default value of `OFMT' is +`"%.6g"'. The way `print' prints numbers can be changed by supplying +different format specifications as the value of `OFMT', as shown in the +following example: + + $ awk 'BEGIN { + > OFMT = "%.0f" # print numbers as integers (rounds) + > print 17.23, 17.54 }' + -| 17 18 + +According to the POSIX standard, `awk''s behavior is undefined if +`OFMT' contains anything but a floating-point conversion specification. +(d.c.) + + +File: gawk.info, Node: Printf, Next: Redirection, Prev: OFMT, Up: Printing + +4.5 Using `printf' Statements for Fancier Printing +================================================== + +For more precise control over the output format than what is normally +provided by `print', use `printf'. `printf' can be used to specify the +width to use for each item, as well as various formatting choices for +numbers (such as what output base to use, whether to print an exponent, +whether to print a sign, and how many digits to print after the decimal +point). This is done by supplying a string, called the "format +string", that controls how and where to print the other arguments. + +* Menu: + +* Basic Printf:: Syntax of the `printf' statement. +* Control Letters:: Format-control letters. +* Format Modifiers:: Format-specification modifiers. +* Printf Examples:: Several examples. + + +File: gawk.info, Node: Basic Printf, Next: Control Letters, Up: Printf + +4.5.1 Introduction to the `printf' Statement +-------------------------------------------- + +A simple `printf' statement looks like this: + + printf FORMAT, ITEM1, ITEM2, ... + +The entire list of arguments may optionally be enclosed in parentheses. +The parentheses are necessary if any of the item expressions use the `>' +relational operator; otherwise, it can be confused with a redirection +(*note Redirection::). + + The difference between `printf' and `print' is the FORMAT argument. +This is an expression whose value is taken as a string; it specifies +how to output each of the other arguments. It is called the "format +string". + + The format string is very similar to that in the ISO C library +function `printf'. Most of FORMAT is text to output verbatim. +Scattered among this text are "format specifiers"--one per item. Each +format specifier says to output the next item in the argument list at +that place in the format. + + The `printf' statement does not automatically append a newline to +its output. It outputs only what the format string specifies. So if a +newline is needed, you must include one in the format string. The +output separator variables `OFS' and `ORS' have no effect on `printf' +statements. For example: + + $ awk 'BEGIN { + > ORS = "\nOUCH!\n"; OFS = "+" + > msg = "Dont Panic!" + > printf "%s\n", msg + > }' + -| Dont Panic! + +Here, neither the `+' nor the `OUCH' appear when the message is printed. + + +File: gawk.info, Node: Control Letters, Next: Format Modifiers, Prev: Basic Printf, Up: Printf + +4.5.2 Format-Control Letters +---------------------------- + +A format specifier starts with the character `%' and ends with a +"format-control letter"--it tells the `printf' statement how to output +one item. The format-control letter specifies what _kind_ of value to +print. The rest of the format specifier is made up of optional +"modifiers" that control _how_ to print the value, such as the field +width. Here is a list of the format-control letters: + +`%c' + This prints a number as an ASCII character; thus, `printf "%c", + 65' outputs the letter `A'. (The output for a string value is the + first character of the string.) + +`%d, %i' + These are equivalent; they both print a decimal integer. (The + `%i' specification is for compatibility with ISO C.) + +`%e, %E' + These print a number in scientific (exponential) notation; for + example: + + printf "%4.3e\n", 1950 + + prints `1.950e+03', with a total of four significant figures, + three of which follow the decimal point. (The `4.3' represents + two modifiers, discussed in the next node.) `%E' uses `E' instead + of `e' in the output. + +`%f' + This prints a number in floating-point notation. For example: + + printf "%4.3f", 1950 + + prints `1950.000', with a total of four significant figures, three + of which follow the decimal point. (The `4.3' represents two + modifiers, discussed in the next node.) + + On systems supporting IEEE 754 floating point format, values + representing negative infinity are formatted as `-inf' or + `-infinity', and positive infinity as `inf' and `infinity'. The + special "not a number" value formats as `-nan' or `nan'. + +`%F' + Like `%f' but the infinity and "not a number" values are spelled + using uppercase letters. + + The `%F' format is a POSIX extension to ISO C; not all systems + support it. On those that don't, `gawk' uses `%f' instead. + +`%g, %G' + These print a number in either scientific notation or in + floating-point notation, whichever uses fewer characters; if the + result is printed in scientific notation, `%G' uses `E' instead of + `e'. + +`%o' + This prints an unsigned octal integer. + +`%s' + This prints a string. + +`%u' + This prints an unsigned decimal integer. (This format is of + marginal use, because all numbers in `awk' are floating-point; it + is provided primarily for compatibility with C.) + +`%x, %X' + These print an unsigned hexadecimal integer; `%X' uses the letters + `A' through `F' instead of `a' through `f'. + +`%%' + This isn't a format-control letter, but it does have meaning--the + sequence `%%' outputs one `%'; it does not consume an argument and + it ignores any modifiers. + + NOTE: When using the integer format-control letters for values + that are outside the range of the widest C integer type, `gawk' + switches to the `%g' format specifier. If `--lint' is provided on + the command line (*note Options::), `gawk' warns about this. + Other versions of `awk' may print invalid values or do something + else entirely. (d.c.) + + +File: gawk.info, Node: Format Modifiers, Next: Printf Examples, Prev: Control Letters, Up: Printf + +4.5.3 Modifiers for `printf' Formats +------------------------------------ + +A format specification can also include "modifiers" that can control +how much of the item's value is printed, as well as how much space it +gets. The modifiers come between the `%' and the format-control letter. +We will use the bullet symbol "*" in the following examples to represent +spaces in the output. Here are the possible modifiers, in the order in +which they may appear: + +`N$' + An integer constant followed by a `$' is a "positional specifier". + Normally, format specifications are applied to arguments in the + order given in the format string. With a positional specifier, + the format specification is applied to a specific argument, + instead of what would be the next argument in the list. + Positional specifiers begin counting with one. Thus: + + printf "%s %s\n", "don't", "panic" + printf "%2$s %1$s\n", "panic", "don't" + + prints the famous friendly message twice. + + At first glance, this feature doesn't seem to be of much use. It + is in fact a `gawk' extension, intended for use in translating + messages at runtime. *Note Printf Ordering::, which describes how + and why to use positional specifiers. For now, we will not use + them. + +`-' + The minus sign, used before the width modifier (see later on in + this table), says to left-justify the argument within its + specified width. Normally, the argument is printed + right-justified in the specified width. Thus: + + printf "%-4s", "foo" + + prints `foo*'. + +`SPACE' + For numeric conversions, prefix positive values with a space and + negative values with a minus sign. + +`+' + The plus sign, used before the width modifier (see later on in + this table), says to always supply a sign for numeric conversions, + even if the data to format is positive. The `+' overrides the + space modifier. + +`#' + Use an "alternate form" for certain control letters. For `%o', + supply a leading zero. For `%x' and `%X', supply a leading `0x' + or `0X' for a nonzero result. For `%e', `%E', and `%f', the + result always contains a decimal point. For `%g' and `%G', + trailing zeros are not removed from the result. + +`0' + A leading `0' (zero) acts as a flag that indicates that output + should be padded with zeros instead of spaces. This applies even + to non-numeric output formats. (d.c.) This flag only has an + effect when the field width is wider than the value to print. + +`'' + A single quote or apostrophe character is a POSIX extension to ISO + C. It indicates that the integer part of a floating point value, + or the entire part of an integer decimal value, should have a + thousands-separator character in it. This only works in locales + that support such characters. For example: + + $ cat thousands.awk Show source program + -| BEGIN { printf "%'d\n", 1234567 } + $ LC_ALL=C gawk -f thousands.awk + -| 1234567 Results in "C" locale + $ LC_ALL=en_US.UTF-8 gawk -f thousands.awk + -| 1,234,567 Results in US English UTF locale + + For more information about locales and internationalization issues, + see *note Locales::. + + NOTE: The `'' flag is a nice feature, but its use complicates + things: it becomes difficult to use it in command-line + programs. For information on appropriate quoting tricks, see + *note Quoting::. + +`WIDTH' + This is a number specifying the desired minimum width of a field. + Inserting any number between the `%' sign and the format-control + character forces the field to expand to this width. The default + way to do this is to pad with spaces on the left. For example: + + printf "%4s", "foo" + + prints `*foo'. + + The value of WIDTH is a minimum width, not a maximum. If the item + value requires more than WIDTH characters, it can be as wide as + necessary. Thus, the following: + + printf "%4s", "foobar" + + prints `foobar'. + + Preceding the WIDTH with a minus sign causes the output to be + padded with spaces on the right, instead of on the left. + +`.PREC' + A period followed by an integer constant specifies the precision + to use when printing. The meaning of the precision varies by + control letter: + + `%e', `%E', `%f' + Number of digits to the right of the decimal point. + + `%g', `%G' + Maximum number of significant digits. + + `%d', `%i', `%o', `%u', `%x', `%X' + Minimum number of digits to print. + + `%s' + Maximum number of characters from the string that should + print. + + Thus, the following: + + printf "%.4s", "foobar" + + prints `foob'. + + The C library `printf''s dynamic WIDTH and PREC capability (for +example, `"%*.*s"') is supported. Instead of supplying explicit WIDTH +and/or PREC values in the format string, they are passed in the +argument list. For example: + + w = 5 + p = 3 + s = "abcdefg" + printf "%*.*s\n", w, p, s + +is exactly equivalent to: + + s = "abcdefg" + printf "%5.3s\n", s + +Both programs output `**abc'. Earlier versions of `awk' did not +support this capability. If you must use such a version, you may +simulate this feature by using concatenation to build up the format +string, like so: + + w = 5 + p = 3 + s = "abcdefg" + printf "%" w "." p "s\n", s + +This is not particularly easy to read but it does work. + + C programmers may be used to supplying additional `l', `L', and `h' +modifiers in `printf' format strings. These are not valid in `awk'. +Most `awk' implementations silently ignore these modifiers. If +`--lint' is provided on the command line (*note Options::), `gawk' +warns about their use. If `--posix' is supplied, their use is a fatal +error. + + +File: gawk.info, Node: Printf Examples, Prev: Format Modifiers, Up: Printf + +4.5.4 Examples Using `printf' +----------------------------- + +The following is a simple example of how to use `printf' to make an +aligned table: + + awk '{ printf "%-10s %s\n", $1, $2 }' BBS-list + +This command prints the names of the bulletin boards (`$1') in the file +`BBS-list' as a string of 10 characters that are left-justified. It +also prints the phone numbers (`$2') next on the line. This produces +an aligned two-column table of names and phone numbers, as shown here: + + $ awk '{ printf "%-10s %s\n", $1, $2 }' BBS-list + -| aardvark 555-5553 + -| alpo-net 555-3412 + -| barfly 555-7685 + -| bites 555-1675 + -| camelot 555-0542 + -| core 555-2912 + -| fooey 555-1234 + -| foot 555-6699 + -| macfoo 555-6480 + -| sdace 555-3430 + -| sabafoo 555-2127 + + In this case, the phone numbers had to be printed as strings because +the numbers are separated by a dash. Printing the phone numbers as +numbers would have produced just the first three digits: `555'. This +would have been pretty confusing. + + It wasn't necessary to specify a width for the phone numbers because +they are last on their lines. They don't need to have spaces after +them. + + The table could be made to look even nicer by adding headings to the +tops of the columns. This is done using the `BEGIN' pattern (*note +BEGIN/END::) so that the headers are only printed once, at the +beginning of the `awk' program: + + awk 'BEGIN { print "Name Number" + print "---- ------" } + { printf "%-10s %s\n", $1, $2 }' BBS-list + + The above example mixed `print' and `printf' statements in the same +program. Using just `printf' statements can produce the same results: + + awk 'BEGIN { printf "%-10s %s\n", "Name", "Number" + printf "%-10s %s\n", "----", "------" } + { printf "%-10s %s\n", $1, $2 }' BBS-list + +Printing each column heading with the same format specification used +for the column elements ensures that the headings are aligned just like +the columns. + + The fact that the same format specification is used three times can +be emphasized by storing it in a variable, like this: + + awk 'BEGIN { format = "%-10s %s\n" + printf format, "Name", "Number" + printf format, "----", "------" } + { printf format, $1, $2 }' BBS-list + + At this point, it would be a worthwhile exercise to use the `printf' +statement to line up the headings and table data for the +`inventory-shipped' example that was covered earlier in the minor node +on the `print' statement (*note Print::). + + +File: gawk.info, Node: Redirection, Next: Special Files, Prev: Printf, Up: Printing + +4.6 Redirecting Output of `print' and `printf' +============================================== + +So far, the output from `print' and `printf' has gone to the standard +output, usually the terminal. Both `print' and `printf' can also send +their output to other places. This is called "redirection". + + A redirection appears after the `print' or `printf' statement. +Redirections in `awk' are written just like redirections in shell +commands, except that they are written inside the `awk' program. + + There are four forms of output redirection: output to a file, output +appended to a file, output through a pipe to another command, and output +to a coprocess. They are all shown for the `print' statement, but they +work identically for `printf': + +`print ITEMS > OUTPUT-FILE' + This type of redirection prints the items into the output file + named OUTPUT-FILE. The file name OUTPUT-FILE can be any + expression. Its value is changed to a string and then used as a + file name (*note Expressions::). + + When this type of redirection is used, the OUTPUT-FILE is erased + before the first output is written to it. Subsequent writes to + the same OUTPUT-FILE do not erase OUTPUT-FILE, but append to it. + (This is different from how you use redirections in shell scripts.) + If OUTPUT-FILE does not exist, it is created. For example, here + is how an `awk' program can write a list of BBS names to one file + named `name-list', and a list of phone numbers to another file + named `phone-list': + + $ awk '{ print $2 > "phone-list" + > print $1 > "name-list" }' BBS-list + $ cat phone-list + -| 555-5553 + -| 555-3412 + ... + $ cat name-list + -| aardvark + -| alpo-net + ... + + Each output file contains one name or number per line. + +`print ITEMS >> OUTPUT-FILE' + This type of redirection prints the items into the pre-existing + output file named OUTPUT-FILE. The difference between this and the + single-`>' redirection is that the old contents (if any) of + OUTPUT-FILE are not erased. Instead, the `awk' output is appended + to the file. If OUTPUT-FILE does not exist, then it is created. + +`print ITEMS | COMMAND' + It is also possible to send output to another program through a + pipe instead of into a file. This type of redirection opens a + pipe to COMMAND, and writes the values of ITEMS through this pipe + to another process created to execute COMMAND. + + The redirection argument COMMAND is actually an `awk' expression. + Its value is converted to a string whose contents give the shell + command to be run. For example, the following produces two files, + one unsorted list of BBS names, and one list sorted in reverse + alphabetical order: + + awk '{ print $1 > "names.unsorted" + command = "sort -r > names.sorted" + print $1 | command }' BBS-list + + The unsorted list is written with an ordinary redirection, while + the sorted list is written by piping through the `sort' utility. + + The next example uses redirection to mail a message to the mailing + list `bug-system'. This might be useful when trouble is + encountered in an `awk' script run periodically for system + maintenance: + + report = "mail bug-system" + print "Awk script failed:", $0 | report + m = ("at record number " FNR " of " FILENAME) + print m | report + close(report) + + The message is built using string concatenation and saved in the + variable `m'. It's then sent down the pipeline to the `mail' + program. (The parentheses group the items to concatenate--see + *note Concatenation::.) + + The `close' function is called here because it's a good idea to + close the pipe as soon as all the intended output has been sent to + it. *Note Close Files And Pipes::, for more information. + + This example also illustrates the use of a variable to represent a + FILE or COMMAND--it is not necessary to always use a string + constant. Using a variable is generally a good idea, because (if + you mean to refer to that same file or command) `awk' requires + that the string value be spelled identically every time. + +`print ITEMS |& COMMAND' + This type of redirection prints the items to the input of COMMAND. + The difference between this and the single-`|' redirection is that + the output from COMMAND can be read with `getline'. Thus COMMAND + is a "coprocess", which works together with, but subsidiary to, + the `awk' program. + + This feature is a `gawk' extension, and is not available in POSIX + `awk'. *Note Getline/Coprocess::, for a brief discussion. *Note + Two-way I/O::, for a more complete discussion. + + Redirecting output using `>', `>>', `|', or `|&' asks the system to +open a file, pipe, or coprocess only if the particular FILE or COMMAND +you specify has not already been written to by your program or if it +has been closed since it was last written to. + + It is a common error to use `>' redirection for the first `print' to +a file, and then to use `>>' for subsequent output: + + # clear the file + print "Don't panic" > "guide.txt" + ... + # append + print "Avoid improbability generators" >> "guide.txt" + +This is indeed how redirections must be used from the shell. But in +`awk', it isn't necessary. In this kind of case, a program should use +`>' for all the `print' statements, since the output file is only +opened once. (It happens that if you mix `>' and `>>' that output is +produced in the expected order. However, mixing the operators for the +same file is definitely poor style, and is confusing to readers of your +program.) + + Many `awk' implementations limit the number of pipelines that an +`awk' program may have open to just one! In `gawk', there is no such +limit. `gawk' allows a program to open as many pipelines as the +underlying operating system permits. + +Advanced Notes: Piping into `sh' +-------------------------------- + +A particularly powerful way to use redirection is to build command lines +and pipe them into the shell, `sh'. For example, suppose you have a +list of files brought over from a system where all the file names are +stored in uppercase, and you wish to rename them to have names in all +lowercase. The following program is both simple and efficient: + + { printf("mv %s %s\n", $0, tolower($0)) | "sh" } + + END { close("sh") } + + The `tolower' function returns its argument string with all +uppercase characters converted to lowercase (*note String Functions::). +The program builds up a list of command lines, using the `mv' utility +to rename the files. It then sends the list to the shell for execution. + + +File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Redirection, Up: Printing + +4.7 Special File Names in `gawk' +================================ + +`gawk' provides a number of special file names that it interprets +internally. These file names provide access to standard file +descriptors, process-related information, and TCP/IP networking. + +* Menu: + +* Special FD:: Special files for I/O. +* Special Process:: Special files for process information. +* Special Network:: Special files for network communications. +* Special Caveats:: Things to watch out for. + + +File: gawk.info, Node: Special FD, Next: Special Process, Up: Special Files + +4.7.1 Special Files for Standard Descriptors +-------------------------------------------- + +Running programs conventionally have three input and output streams +already available to them for reading and writing. These are known as +the "standard input", "standard output", and "standard error output". +These streams are, by default, connected to your terminal, but they are +often redirected with the shell, via the `<', `<<', `>', `>>', `>&', +and `|' operators. Standard error is typically used for writing error +messages; the reason there are two separate streams, standard output +and standard error, is so that they can be redirected separately. + + In other implementations of `awk', the only way to write an error +message to standard error in an `awk' program is as follows: + + print "Serious error detected!" | "cat 1>&2" + +This works by opening a pipeline to a shell command that can access the +standard error stream that it inherits from the `awk' process. This is +far from elegant, and it is also inefficient, because it requires a +separate process. So people writing `awk' programs often don't do +this. Instead, they send the error messages to the terminal, like this: + + print "Serious error detected!" > "/dev/tty" + +This usually has the same effect but not always: although the standard +error stream is usually the terminal, it can be redirected; when that +happens, writing to the terminal is not correct. In fact, if `awk' is +run from a background job, it may not have a terminal at all. Then +opening `/dev/tty' fails. + + `gawk' provides special file names for accessing the three standard +streams, as well as any other inherited open files. If the file name +matches one of these special names when `gawk' redirects input or +output, then it directly uses the stream that the file name stands for. +These special file names work for all operating systems that `gawk' has +been ported to, not just those that are POSIX-compliant: + +`/dev/stdin' + The standard input (file descriptor 0). + +`/dev/stdout' + The standard output (file descriptor 1). + +`/dev/stderr' + The standard error output (file descriptor 2). + +`/dev/fd/N' + The file associated with file descriptor N. Such a file must be + opened by the program initiating the `awk' execution (typically + the shell). Unless special pains are taken in the shell from which + `gawk' is invoked, only descriptors 0, 1, and 2 are available. + + The file names `/dev/stdin', `/dev/stdout', and `/dev/stderr' are +aliases for `/dev/fd/0', `/dev/fd/1', and `/dev/fd/2', respectively. +However, they are more self-explanatory. The proper way to write an +error message in a `gawk' program is to use `/dev/stderr', like this: + + print "Serious error detected!" > "/dev/stderr" + + Note the use of quotes around the file name. Like any other +redirection, the value must be a string. It is a common error to omit +the quotes, which leads to confusing results. + + +File: gawk.info, Node: Special Process, Next: Special Network, Prev: Special FD, Up: Special Files + +4.7.2 Special Files for Process-Related Information +--------------------------------------------------- + +`gawk' also provides special file names that give access to information +about the running `gawk' process. Each of these "files" provides a +single record of information. To read them more than once, they must +first be closed with the `close' function (*note Close Files And +Pipes::). The file names are: + +`/dev/pid' + Reading this file returns the process ID of the current process, + in decimal form, terminated with a newline. + +`/dev/ppid' + Reading this file returns the parent process ID of the current + process, in decimal form, terminated with a newline. + +`/dev/pgrpid' + Reading this file returns the process group ID of the current + process, in decimal form, terminated with a newline. + +`/dev/user' + Reading this file returns a single record terminated with a + newline. The fields are separated with spaces. The fields + represent the following information: + + `$1' + The return value of the `getuid' system call (the real user + ID number). + + `$2' + The return value of the `geteuid' system call (the effective + user ID number). + + `$3' + The return value of the `getgid' system call (the real group + ID number). + + `$4' + The return value of the `getegid' system call (the effective + group ID number). + + If there are any additional fields, they are the group IDs + returned by the `getgroups' system call. (Multiple groups may not + be supported on all systems.) + + These special file names may be used on the command line as data +files, as well as for I/O redirections within an `awk' program. They +may not be used as source files with the `-f' option. + + NOTE: The special files that provide process-related information + are now considered obsolete and will disappear entirely in the + next release of `gawk'. `gawk' prints a warning message every + time you use one of these files. To obtain process-related + information, use the `PROCINFO' array. *Note Auto-set::. + + +File: gawk.info, Node: Special Network, Next: Special Caveats, Prev: Special Process, Up: Special Files + +4.7.3 Special Files for Network Communications +---------------------------------------------- + +Starting with version 3.1 of `gawk', `awk' programs can open a two-way +TCP/IP connection, acting as either a client or a server. This is done +using a special file name of the form: + + `/inet/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT' + + The PROTOCOL is one of `tcp', `udp', or `raw', and the other fields +represent the other essential pieces of information for making a +networking connection. These file names are used with the `|&' +operator for communicating with a coprocess (*note Two-way I/O::). +This is an advanced feature, mentioned here only for completeness. +Full discussion is delayed until *note TCP/IP Networking::. + + +File: gawk.info, Node: Special Caveats, Prev: Special Network, Up: Special Files + +4.7.4 Special File Name Caveats +------------------------------- + +Here is a list of things to bear in mind when using the special file +names that `gawk' provides: + + * Recognition of these special file names is disabled if `gawk' is in + compatibility mode (*note Options::). + + * The special files that provide process-related information are now + considered obsolete and will disappear entirely in the next + release of `gawk'. `gawk' prints a warning message every time you + use one of these files. To obtain process-related information, + use the `PROCINFO' array. *Note Built-in Variables::. + + * Starting with version 3.1, `gawk' _always_ interprets these + special file names.(1) For example, using `/dev/fd/4' for output + actually writes on file descriptor 4, and not on a new file + descriptor that is `dup''ed from file descriptor 4. Most of the + time this does not matter; however, it is important to _not_ close + any of the files related to file descriptors 0, 1, and 2. Doing + so results in unpredictable behavior. + + ---------- Footnotes ---------- + + (1) Older versions of `gawk' would interpret these names internally +only if the system did not actually have a `/dev/fd' directory or any +of the other special files listed earlier. Usually this didn't make a +difference, but sometimes it did; thus, it was decided to make `gawk''s +behavior consistent on all systems and to have it always interpret the +special file names itself. + + +File: gawk.info, Node: Close Files And Pipes, Prev: Special Files, Up: Printing + +4.8 Closing Input and Output Redirections +========================================= + +If the same file name or the same shell command is used with `getline' +more than once during the execution of an `awk' program (*note +Getline::), the file is opened (or the command is executed) the first +time only. At that time, the first record of input is read from that +file or command. The next time the same file or command is used with +`getline', another record is read from it, and so on. + + Similarly, when a file or pipe is opened for output, the file name or +command associated with it is remembered by `awk', and subsequent +writes to the same file or command are appended to the previous writes. +The file or pipe stays open until `awk' exits. + + This implies that special steps are necessary in order to read the +same file again from the beginning, or to rerun a shell command (rather +than reading more output from the same command). The `close' function +makes these things possible: + + close(FILENAME) + +or: + + close(COMMAND) + + The argument FILENAME or COMMAND can be any expression. Its value +must _exactly_ match the string that was used to open the file or start +the command (spaces and other "irrelevant" characters included). For +example, if you open a pipe with this: + + "sort -r names" | getline foo + +then you must close it with this: + + close("sort -r names") + + Once this function call is executed, the next `getline' from that +file or command, or the next `print' or `printf' to that file or +command, reopens the file or reruns the command. Because the +expression that you use to close a file or pipeline must exactly match +the expression used to open the file or run the command, it is good +practice to use a variable to store the file name or command. The +previous example becomes the following: + + sortcom = "sort -r names" + sortcom | getline foo + ... + close(sortcom) + +This helps avoid hard-to-find typographical errors in your `awk' +programs. Here are some of the reasons for closing an output file: + + * To write a file and read it back later on in the same `awk' + program. Close the file after writing it, then begin reading it + with `getline'. + + * To write numerous files, successively, in the same `awk' program. + If the files aren't closed, eventually `awk' may exceed a system + limit on the number of open files in one process. It is best to + close each one when the program has finished writing it. + + * To make a command finish. When output is redirected through a + pipe, the command reading the pipe normally continues to try to + read input as long as the pipe is open. Often this means the + command cannot really do its work until the pipe is closed. For + example, if output is redirected to the `mail' program, the + message is not actually sent until the pipe is closed. + + * To run the same program a second time, with the same arguments. + This is not the same thing as giving more input to the first run! + + For example, suppose a program pipes output to the `mail' program. + If it outputs several lines redirected to this pipe without closing + it, they make a single message of several lines. By contrast, if + the program closes the pipe after each line of output, then each + line makes a separate message. + + If you use more files than the system allows you to have open, +`gawk' attempts to multiplex the available open files among your data +files. `gawk''s ability to do this depends upon the facilities of your +operating system, so it may not always work. It is therefore both good +practice and good portability advice to always use `close' on your +files when you are done with them. In fact, if you are using a lot of +pipes, it is essential that you close commands when done. For example, +consider something like this: + + { + ... + command = ("grep " $1 " /some/file | my_prog -q " $3) + while ((command | getline) > 0) { + PROCESS OUTPUT OF command + } + # need close(command) here + } + + This example creates a new pipeline based on data in _each_ record. +Without the call to `close' indicated in the comment, `awk' creates +child processes to run the commands, until it eventually runs out of +file descriptors for more pipelines. + + Even though each command has finished (as indicated by the +end-of-file return status from `getline'), the child process is not +terminated;(1) more importantly, the file descriptor for the pipe is +not closed and released until `close' is called or `awk' exits. + + `close' will silently do nothing if given an argument that does not +represent a file, pipe or coprocess that was opened with a redirection. + + Note also that `close(FILENAME)' has no "magic" effects on the +implicit loop that reads through the files named on the command line. +It is, more likely, a close of a file that was never opened, so `awk' +silently does nothing. + + When using the `|&' operator to communicate with a coprocess, it is +occasionally useful to be able to close one end of the two-way pipe +without closing the other. This is done by supplying a second argument +to `close'. As in any other call to `close', the first argument is the +name of the command or special file used to start the coprocess. The +second argument should be a string, with either of the values `"to"' or +`"from"'. Case does not matter. As this is an advanced feature, a +more complete discussion is delayed until *note Two-way I/O::, which +discusses it in more detail and gives an example. + +Advanced Notes: Using `close''s Return Value +-------------------------------------------- + +In many versions of Unix `awk', the `close' function is actually a +statement. It is a syntax error to try and use the return value from +`close': (d.c.) + + command = "..." + command | getline info + retval = close(command) # syntax error in most Unix awks + + `gawk' treats `close' as a function. The return value is -1 if the +argument names something that was never opened with a redirection, or +if there is a system problem closing the file or process. In these +cases, `gawk' sets the built-in variable `ERRNO' to a string describing +the problem. + + In `gawk', when closing a pipe or coprocess (input or output), the +return value is the exit status of the command.(2) Otherwise, it is the +return value from the system's `close' or `fclose' C functions when +closing input or output files, respectively. This value is zero if the +close succeeds, or -1 if it fails. + + The POSIX standard is very vague; it says that `close' returns zero +on success and non-zero otherwise. In general, different +implementations vary in what they report when closing pipes; thus the +return value cannot be used portably. (d.c.) + + ---------- Footnotes ---------- + + (1) The technical terminology is rather morbid. The finished child +is called a "zombie," and cleaning up after it is referred to as +"reaping." + + (2) This is a full 16-bit value as returned by the `wait' system +call. See the system manual pages for information on how to decode this +value. + + +File: gawk.info, Node: Expressions, Next: Patterns and Actions, Prev: Printing, Up: Top + +5 Expressions +************* + +Expressions are the basic building blocks of `awk' patterns and +actions. An expression evaluates to a value that you can print, test, +or pass to a function. Additionally, an expression can assign a new +value to a variable or a field by using an assignment operator. + + An expression can serve as a pattern or action statement on its own. +Most other kinds of statements contain one or more expressions that +specify the data on which to operate. As in other languages, +expressions in `awk' include variables, array references, constants, +and function calls, as well as combinations of these with various +operators. + +* Menu: + +* Constants:: String, numeric and regexp constants. +* Using Constant Regexps:: When and how to use a regexp constant. +* Variables:: Variables give names to values for later use. +* Conversion:: The conversion of strings to numbers and vice + versa. +* Arithmetic Ops:: Arithmetic operations (`+', `-', + etc.) +* Concatenation:: Concatenating strings. +* Assignment Ops:: Changing the value of a variable or a field. +* Increment Ops:: Incrementing the numeric value of a variable. +* Truth Values:: What is ``true'' and what is ``false''. +* Typing and Comparison:: How variables acquire types and how this + affects comparison of numbers and strings with + `<', etc. +* Boolean Ops:: Combining comparison expressions using boolean + operators `||' (``or''), `&&' + (``and'') and `!' (``not''). +* Conditional Exp:: Conditional expressions select between two + subexpressions under control of a third + subexpression. +* Function Calls:: A function call is an expression. +* Precedence:: How various operators nest. + + +File: gawk.info, Node: Constants, Next: Using Constant Regexps, Up: Expressions + +5.1 Constant Expressions +======================== + +The simplest type of expression is the "constant", which always has the +same value. There are three types of constants: numeric, string, and +regular expression. + + Each is used in the appropriate context when you need a data value +that isn't going to change. Numeric constants can have different +forms, but are stored identically internally. + +* Menu: + +* Scalar Constants:: Numeric and string constants. +* Nondecimal-numbers:: What are octal and hex numbers. +* Regexp Constants:: Regular Expression constants. + + +File: gawk.info, Node: Scalar Constants, Next: Nondecimal-numbers, Up: Constants + +5.1.1 Numeric and String Constants +---------------------------------- + +A "numeric constant" stands for a number. This number can be an +integer, a decimal fraction, or a number in scientific (exponential) +notation.(1) Here are some examples of numeric constants that all have +the same value: + + 105 + 1.05e+2 + 1050e-1 + + A string constant consists of a sequence of characters enclosed in +double-quotation marks. For example: + + "parrot" + +represents the string whose contents are `parrot'. Strings in `gawk' +can be of any length, and they can contain any of the possible +eight-bit ASCII characters including ASCII NUL (character code zero). +Other `awk' implementations may have difficulty with some character +codes. + + ---------- Footnotes ---------- + + (1) The internal representation of all numbers, including integers, +uses double-precision floating-point numbers. On most modern systems, +these are in IEEE 754 standard format. + + +File: gawk.info, Node: Nondecimal-numbers, Next: Regexp Constants, Prev: Scalar Constants, Up: Constants + +5.1.2 Octal and Hexadecimal Numbers +----------------------------------- + +In `awk', all numbers are in decimal; i.e., base 10. Many other +programming languages allow you to specify numbers in other bases, often +octal (base 8) and hexadecimal (base 16). In octal, the numbers go 0, +1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc. Just as `11', in decimal, is 1 +times 10 plus 1, so `11', in octal, is 1 times 8, plus 1. This equals 9 +in decimal. In hexadecimal, there are 16 digits. Since the everyday +decimal number system only has ten digits (`0'-`9'), the letters `a' +through `f' are used to represent the rest. (Case in the letters is +usually irrelevant; hexadecimal `a' and `A' have the same value.) +Thus, `11', in hexadecimal, is 1 times 16 plus 1, which equals 17 in +decimal. + + Just by looking at plain `11', you can't tell what base it's in. +So, in C, C++, and other languages derived from C, there is a special +notation to help signify the base. Octal numbers start with a leading +`0', and hexadecimal numbers start with a leading `0x' or `0X': + +`11' + Decimal value 11. + +`011' + Octal 11, decimal value 9. + +`0x11' + Hexadecimal 11, decimal value 17. + + This example shows the difference: + + $ gawk 'BEGIN { printf "%d, %d, %d\n", 011, 11, 0x11 }' + -| 9, 11, 17 + + Being able to use octal and hexadecimal constants in your programs +is most useful when working with data that cannot be represented +conveniently as characters or as regular numbers, such as binary data +of various sorts. + + `gawk' allows the use of octal and hexadecimal constants in your +program text. However, such numbers in the input data are not treated +differently; doing so by default would break old programs. (If you +really need to do this, use the `--non-decimal-data' command-line +option; *note Nondecimal Data::.) If you have octal or hexadecimal +data, you can use the `strtonum' function (*note String Functions::) to +convert the data into a number. Most of the time, you will want to use +octal or hexadecimal constants when working with the built-in bit +manipulation functions; see *note Bitwise Functions::, for more +information. + + Unlike some early C implementations, `8' and `9' are not valid in +octal constants; e.g., `gawk' treats `018' as decimal 18: + + $ gawk 'BEGIN { print "021 is", 021 ; print 018 }' + -| 021 is 17 + -| 18 + + Octal and hexadecimal source code constants are a `gawk' extension. +If `gawk' is in compatibility mode (*note Options::), they are not +available. + +Advanced Notes: A Constant's Base Does Not Affect Its Value +----------------------------------------------------------- + +Once a numeric constant has been converted internally into a number, +`gawk' no longer remembers what the original form of the constant was; +the internal value is always used. This has particular consequences +for conversion of numbers to strings: + + $ gawk 'BEGIN { printf "0x11 is <%s>\n", 0x11 }' + -| 0x11 is <17> + + +File: gawk.info, Node: Regexp Constants, Prev: Nondecimal-numbers, Up: Constants + +5.1.3 Regular Expression Constants +---------------------------------- + +A regexp constant is a regular expression description enclosed in +slashes, such as `/^beginning and end$/'. Most regexps used in `awk' +programs are constant, but the `~' and `!~' matching operators can also +match computed or "dynamic" regexps (which are just ordinary strings or +variables that contain a regexp). + + +File: gawk.info, Node: Using Constant Regexps, Next: Variables, Prev: Constants, Up: Expressions + +5.2 Using Regular Expression Constants +====================================== + +When used on the righthand side of the `~' or `!~' operators, a regexp +constant merely stands for the regexp that is to be matched. However, +regexp constants (such as `/foo/') may be used like simple expressions. +When a regexp constant appears by itself, it has the same meaning as if +it appeared in a pattern, i.e., `($0 ~ /foo/)' (d.c.) *Note Expression +Patterns::. This means that the following two code segments: + + if ($0 ~ /barfly/ || $0 ~ /camelot/) + print "found" + +and: + + if (/barfly/ || /camelot/) + print "found" + +are exactly equivalent. One rather bizarre consequence of this rule is +that the following Boolean expression is valid, but does not do what +the user probably intended: + + # note that /foo/ is on the left of the ~ + if (/foo/ ~ $1) print "found foo" + +This code is "obviously" testing `$1' for a match against the regexp +`/foo/'. But in fact, the expression `/foo/ ~ $1' actually means `($0 +~ /foo/) ~ $1'. In other words, first match the input record against +the regexp `/foo/'. The result is either zero or one, depending upon +the success or failure of the match. That result is then matched +against the first field in the record. Because it is unlikely that you +would ever really want to make this kind of test, `gawk' issues a +warning when it sees this construct in a program. Another consequence +of this rule is that the assignment statement: + + matches = /foo/ + +assigns either zero or one to the variable `matches', depending upon +the contents of the current input record. This feature of the language +has never been well documented until the POSIX specification. + + Constant regular expressions are also used as the first argument for +the `gensub', `sub', and `gsub' functions, and as the second argument +of the `match' function (*note String Functions::). Modern +implementations of `awk', including `gawk', allow the third argument of +`split' to be a regexp constant, but some older implementations do not. +(d.c.) This can lead to confusion when attempting to use regexp +constants as arguments to user-defined functions (*note User-defined::). +For example: + + function mysub(pat, repl, str, global) + { + if (global) + gsub(pat, repl, str) + else + sub(pat, repl, str) + return str + } + + { + ... + text = "hi! hi yourself!" + mysub(/hi/, "howdy", text, 1) + ... + } + + In this example, the programmer wants to pass a regexp constant to +the user-defined function `mysub', which in turn passes it on to either +`sub' or `gsub'. However, what really happens is that the `pat' +parameter is either one or zero, depending upon whether or not `$0' +matches `/hi/'. `gawk' issues a warning when it sees a regexp constant +used as a parameter to a user-defined function, since passing a truth +value in this way is probably not what was intended. + + +File: gawk.info, Node: Variables, Next: Conversion, Prev: Using Constant Regexps, Up: Expressions + +5.3 Variables +============= + +Variables are ways of storing values at one point in your program for +use later in another part of your program. They can be manipulated +entirely within the program text, and they can also be assigned values +on the `awk' command line. + +* Menu: + +* Using Variables:: Using variables in your programs. +* Assignment Options:: Setting variables on the command-line and a + summary of command-line syntax. This is an + advanced method of input. + + +File: gawk.info, Node: Using Variables, Next: Assignment Options, Up: Variables + +5.3.1 Using Variables in a Program +---------------------------------- + +Variables let you give names to values and refer to them later. +Variables have already been used in many of the examples. The name of +a variable must be a sequence of letters, digits, or underscores, and +it may not begin with a digit. Case is significant in variable names; +`a' and `A' are distinct variables. + + A variable name is a valid expression by itself; it represents the +variable's current value. Variables are given new values with +"assignment operators", "increment operators", and "decrement +operators". *Note Assignment Ops::. + + A few variables have special built-in meanings, such as `FS' (the +field separator), and `NF' (the number of fields in the current input +record). *Note Built-in Variables::, for a list of the built-in +variables. These built-in variables can be used and assigned just like +all other variables, but their values are also used or changed +automatically by `awk'. All built-in variables' names are entirely +uppercase. + + Variables in `awk' can be assigned either numeric or string values. +The kind of value a variable holds can change over the life of a +program. By default, variables are initialized to the empty string, +which is zero if converted to a number. There is no need to +"initialize" each variable explicitly in `awk', which is what you would +do in C and in most other traditional languages. + + +File: gawk.info, Node: Assignment Options, Prev: Using Variables, Up: Variables + +5.3.2 Assigning Variables on the Command Line +--------------------------------------------- + +Any `awk' variable can be set by including a "variable assignment" +among the arguments on the command line when `awk' is invoked (*note +Other Arguments::). Such an assignment has the following form: + + VARIABLE=TEXT + +With it, a variable is set either at the beginning of the `awk' run or +in between input files. When the assignment is preceded with the `-v' +option, as in the following: + + -v VARIABLE=TEXT + +the variable is set at the very beginning, even before the `BEGIN' +rules are run. The `-v' option and its assignment must precede all the +file name arguments, as well as the program text. (*Note Options::, +for more information about the `-v' option.) Otherwise, the variable +assignment is performed at a time determined by its position among the +input file arguments--after the processing of the preceding input file +argument. For example: + + awk '{ print $n }' n=4 inventory-shipped n=2 BBS-list + +prints the value of field number `n' for all input records. Before the +first file is read, the command line sets the variable `n' equal to +four. This causes the fourth field to be printed in lines from the +file `inventory-shipped'. After the first file has finished, but +before the second file is started, `n' is set to two, so that the +second field is printed in lines from `BBS-list': + + $ awk '{ print $n }' n=4 inventory-shipped n=2 BBS-list + -| 15 + -| 24 + ... + -| 555-5553 + -| 555-3412 + ... + + Command-line arguments are made available for explicit examination by +the `awk' program in the `ARGV' array (*note ARGC and ARGV::). `awk' +processes the values of command-line assignments for escape sequences +(*note Escape Sequences::). (d.c.) + + +File: gawk.info, Node: Conversion, Next: Arithmetic Ops, Prev: Variables, Up: Expressions + +5.4 Conversion of Strings and Numbers +===================================== + +Strings are converted to numbers and numbers are converted to strings, +if the context of the `awk' program demands it. For example, if the +value of either `foo' or `bar' in the expression `foo + bar' happens to +be a string, it is converted to a number before the addition is +performed. If numeric values appear in string concatenation, they are +converted to strings. Consider the following: + + two = 2; three = 3 + print (two three) + 4 + +This prints the (numeric) value 27. The numeric values of the +variables `two' and `three' are converted to strings and concatenated +together. The resulting string is converted back to the number 23, to +which 4 is then added. + + If, for some reason, you need to force a number to be converted to a +string, concatenate the empty string, `""', with that number. To force +a string to be converted to a number, add zero to that string. A +string is converted to a number by interpreting any numeric prefix of +the string as numerals: `"2.5"' converts to 2.5, `"1e3"' converts to +1000, and `"25fix"' has a numeric value of 25. Strings that can't be +interpreted as valid numbers convert to zero. + + The exact manner in which numbers are converted into strings is +controlled by the `awk' built-in variable `CONVFMT' (*note Built-in +Variables::). Numbers are converted using the `sprintf' function with +`CONVFMT' as the format specifier (*note String Functions::). + + `CONVFMT''s default value is `"%.6g"', which prints a value with at +least six significant digits. For some applications, you might want to +change it to specify more precision. On most modern machines, 17 +digits is enough to capture a floating-point number's value exactly, +most of the time.(1) + + Strange results can occur if you set `CONVFMT' to a string that +doesn't tell `sprintf' how to format floating-point numbers in a useful +way. For example, if you forget the `%' in the format, `awk' converts +all numbers to the same constant string. As a special case, if a +number is an integer, then the result of converting it to a string is +_always_ an integer, no matter what the value of `CONVFMT' may be. +Given the following code fragment: + + CONVFMT = "%2.2f" + a = 12 + b = a "" + +`b' has the value `"12"', not `"12.00"'. (d.c.) + + Prior to the POSIX standard, `awk' used the value of `OFMT' for +converting numbers to strings. `OFMT' specifies the output format to +use when printing numbers with `print'. `CONVFMT' was introduced in +order to separate the semantics of conversion from the semantics of +printing. Both `CONVFMT' and `OFMT' have the same default value: +`"%.6g"'. In the vast majority of cases, old `awk' programs do not +change their behavior. However, these semantics for `OFMT' are +something to keep in mind if you must port your new style program to +older implementations of `awk'. We recommend that instead of changing +your programs, just port `gawk' itself. *Note Print::, for more +information on the `print' statement. + + And, once again, where you are can matter when it comes to converting +between numbers and strings. In *note Locales::, we mentioned that the +local character set and language (the locale) can affect how `gawk' +matches characters. The locale also affects numeric formats. In +particular, for `awk' programs, it affects the decimal point character. +The `"C"' locale, and most English-language locales, use the period +character (`.') as the decimal point. However, many (if not most) +European and non-English locales use the comma (`,') as the decimal +point character. + + The POSIX standard says that `awk' always uses the period as the +decimal point when reading the `awk' program source code, and for +command-line variable assignments (*note Other Arguments::). However, +when interpreting input data, for `print' and `printf' output, and for +number to string conversion, the local decimal point character is used. +Here are some examples indicating the difference in behavior, on a +GNU/Linux system: + + $ gawk 'BEGIN { printf "%g\n", 3.1415927 }' + -| 3.14159 + $ LC_ALL=en_DK gawk 'BEGIN { printf "%g\n", 3.1415927 }' + -| 3,14159 + $ echo 4,321 | gawk '{ print $1 + 1 }' + -| 5 + $ echo 4,321 | LC_ALL=en_DK gawk '{ print $1 + 1 }' + -| 5,321 + +The `en_DK' locale is for English in Denmark, where the comma acts as +the decimal point separator. In the normal `"C"' locale, `gawk' treats +`4,321' as `4', while in the Danish locale, it's treated as the full +number, `4.321'. + + For version 3.1.3 through 3.1.5, `gawk' fully complied with this +aspect of the standard. However, many users in non-English locales +complained about this behavior, since their data used a period as the +decimal point. Beginning in version 3.1.6, the default behavior was +restored to use a period as the decimal point character. You can use +the `--use-lc-numeric' option (*note Options::) to force `gawk' to use +the locale's decimal point character. (`gawk' also uses the locale's +decimal point character when in POSIX mode, either via `--posix', or +the `POSIXLY_CORRECT' environment variable.) + + The following table describes the cases in which the locale's decimal +point character is used and when a period is used. Some of these +features have not been described yet. + +Feature Default `--posix' or `--use-lc-numeric' +------------------------------------------------------------ +`%'g' Use locale Use locale +`%g' Use period Use locale +Input Use period Use locale +`strtonum' Use period Use locale + +Table 5.1: Locale Decimal Point versus A Period + + Finally, modern day formal standards and IEEE standard floating point +representation can have an unusual but important effect on the way +`gawk' converts some special string values to numbers. The details are +presented in *note POSIX Floating Point Problems::. + + ---------- Footnotes ---------- + + (1) Pathological cases can require up to 752 digits (!), but we +doubt that you need to worry about this. + + +File: gawk.info, Node: Arithmetic Ops, Next: Concatenation, Prev: Conversion, Up: Expressions + +5.5 Arithmetic Operators +======================== + +The `awk' language uses the common arithmetic operators when evaluating +expressions. All of these arithmetic operators follow normal +precedence rules and work as you would expect them to. + + The following example uses a file named `grades', which contains a +list of student names as well as three test scores per student (it's a +small class): + + Pat 100 97 58 + Sandy 84 72 93 + Chris 72 92 89 + +This programs takes the file `grades' and prints the average of the +scores: + + $ awk '{ sum = $2 + $3 + $4 ; avg = sum / 3 + > print $1, avg }' grades + -| Pat 85 + -| Sandy 83 + -| Chris 84.3333 + + The following list provides the arithmetic operators in `awk', in +order from the highest precedence to the lowest: + +`- X' + Negation. + +`+ X' + Unary plus; the expression is converted to a number. + +`X ^ Y' +`X ** Y' + Exponentiation; X raised to the Y power. `2 ^ 3' has the value + eight; the character sequence `**' is equivalent to `^'. + +`X * Y' + Multiplication. + +`X / Y' + Division; because all numbers in `awk' are floating-point + numbers, the result is _not_ rounded to an integer--`3 / 4' has + the value 0.75. (It is a common mistake, especially for C + programmers, to forget that _all_ numbers in `awk' are + floating-point, and that division of integer-looking constants + produces a real number, not an integer.) + +`X % Y' + Remainder; further discussion is provided in the text, just after + this list. + +`X + Y' + Addition. + +`X - Y' + Subtraction. + + Unary plus and minus have the same precedence, the multiplication +operators all have the same precedence, and addition and subtraction +have the same precedence. + + When computing the remainder of `X % Y', the quotient is rounded +toward zero to an integer and multiplied by Y. This result is +subtracted from X; this operation is sometimes known as "trunc-mod." +The following relation always holds: + + b * int(a / b) + (a % b) == a + + One possibly undesirable effect of this definition of remainder is +that `X % Y' is negative if X is negative. Thus: + + -17 % 8 = -1 + + In other `awk' implementations, the signedness of the remainder may +be machine-dependent. + + NOTE: The POSIX standard only specifies the use of `^' for + exponentiation. For maximum portability, do not use the `**' + operator. + + +File: gawk.info, Node: Concatenation, Next: Assignment Ops, Prev: Arithmetic Ops, Up: Expressions + +5.6 String Concatenation +======================== + + It seemed like a good idea at the time. + Brian Kernighan + + There is only one string operation: concatenation. It does not have +a specific operator to represent it. Instead, concatenation is +performed by writing expressions next to one another, with no operator. +For example: + + $ awk '{ print "Field number one: " $1 }' BBS-list + -| Field number one: aardvark + -| Field number one: alpo-net + ... + + Without the space in the string constant after the `:', the line +runs together. For example: + + $ awk '{ print "Field number one:" $1 }' BBS-list + -| Field number one:aardvark + -| Field number one:alpo-net + ... + + Because string concatenation does not have an explicit operator, it +is often necessary to insure that it happens at the right time by using +parentheses to enclose the items to concatenate. For example, you +might expect that the following code fragment concatenates `file' and +`name': + + file = "file" + name = "name" + print "something meaningful" > file name + +This produces a syntax error with Unix `awk'.(1) It is necessary to use +the following: + + print "something meaningful" > (file name) + + Parentheses should be used around concatenation in all but the most +common contexts, such as on the righthand side of `='. Be careful +about the kinds of expressions used in string concatenation. In +particular, the order of evaluation of expressions used for +concatenation is undefined in the `awk' language. Consider this +example: + + BEGIN { + a = "don't" + print (a " " (a = "panic")) + } + +It is not defined whether the assignment to `a' happens before or after +the value of `a' is retrieved for producing the concatenated value. +The result could be either `don't panic', or `panic panic'. The +precedence of concatenation, when mixed with other operators, is often +counter-intuitive. Consider this example: + + $ awk 'BEGIN { print -12 " " -24 }' + -| -12-24 + + This "obviously" is concatenating -12, a space, and -24. But where +did the space disappear to? The answer lies in the combination of +operator precedences and `awk''s automatic conversion rules. To get +the desired result, write the program in the following manner: + + $ awk 'BEGIN { print -12 " " (-24) }' + -| -12 -24 + + This forces `awk' to treat the `-' on the `-24' as unary. +Otherwise, it's parsed as follows: + + -12 (`" "' - 24) + => -12 (0 - 24) + => -12 (-24) + => -12-24 + + As mentioned earlier, when doing concatenation, _parenthesize_. +Otherwise, you're never quite sure what you'll get. + + ---------- Footnotes ---------- + + (1) It happens that `gawk' and `mawk' "get it right," but you should +not rely on this. + + +File: gawk.info, Node: Assignment Ops, Next: Increment Ops, Prev: Concatenation, Up: Expressions + +5.7 Assignment Expressions +========================== + +An "assignment" is an expression that stores a (usually different) +value into a variable. For example, let's assign the value one to the +variable `z': + + z = 1 + + After this expression is executed, the variable `z' has the value +one. Whatever old value `z' had before the assignment is forgotten. + + Assignments can also store string values. For example, the +following stores the value `"this food is good"' in the variable +`message': + + thing = "food" + predicate = "good" + message = "this " thing " is " predicate + +This also illustrates string concatenation. The `=' sign is called an +"assignment operator". It is the simplest assignment operator because +the value of the righthand operand is stored unchanged. Most operators +(addition, concatenation, and so on) have no effect except to compute a +value. If the value isn't used, there's no reason to use the operator. +An assignment operator is different; it does produce a value, but even +if you ignore it, the assignment still makes itself felt through the +alteration of the variable. We call this a "side effect". + + The lefthand operand of an assignment need not be a variable (*note +Variables::); it can also be a field (*note Changing Fields::) or an +array element (*note Arrays::). These are all called "lvalues", which +means they can appear on the lefthand side of an assignment operator. +The righthand operand may be any expression; it produces the new value +that the assignment stores in the specified variable, field, or array +element. (Such values are called "rvalues".) + + It is important to note that variables do _not_ have permanent types. +A variable's type is simply the type of whatever value it happens to +hold at the moment. In the following program fragment, the variable +`foo' has a numeric value at first, and a string value later on: + + foo = 1 + print foo + foo = "bar" + print foo + +When the second assignment gives `foo' a string value, the fact that it +previously had a numeric value is forgotten. + + String values that do not begin with a digit have a numeric value of +zero. After executing the following code, the value of `foo' is five: + + foo = "a string" + foo = foo + 5 + + NOTE: Using a variable as a number and then later as a string can + be confusing and is poor programming style. The previous two + examples illustrate how `awk' works, _not_ how you should write + your programs! + + An assignment is an expression, so it has a value--the same value +that is assigned. Thus, `z = 1' is an expression with the value one. +One consequence of this is that you can write multiple assignments +together, such as: + + x = y = z = 5 + +This example stores the value five in all three variables (`x', `y', +and `z'). It does so because the value of `z = 5', which is five, is +stored into `y' and then the value of `y = z = 5', which is five, is +stored into `x'. + + Assignments may be used anywhere an expression is called for. For +example, it is valid to write `x != (y = 1)' to set `y' to one, and +then test whether `x' equals one. But this style tends to make +programs hard to read; such nesting of assignments should be avoided, +except perhaps in a one-shot program. + + Aside from `=', there are several other assignment operators that do +arithmetic with the old value of the variable. For example, the +operator `+=' computes a new value by adding the righthand value to the +old value of the variable. Thus, the following assignment adds five to +the value of `foo': + + foo += 5 + +This is equivalent to the following: + + foo = foo + 5 + +Use whichever makes the meaning of your program clearer. + + There are situations where using `+=' (or any assignment operator) +is _not_ the same as simply repeating the lefthand operand in the +righthand expression. For example: + + # Thanks to Pat Rankin for this example + BEGIN { + foo[rand()] += 5 + for (x in foo) + print x, foo[x] + + bar[rand()] = bar[rand()] + 5 + for (x in bar) + print x, bar[x] + } + +The indices of `bar' are practically guaranteed to be different, because +`rand' returns different values each time it is called. (Arrays and +the `rand' function haven't been covered yet. *Note Arrays::, and see +*note Numeric Functions::, for more information). This example +illustrates an important fact about assignment operators: the lefthand +expression is only evaluated _once_. It is up to the implementation as +to which expression is evaluated first, the lefthand or the righthand. +Consider this example: + + i = 1 + a[i += 2] = i + 1 + +The value of `a[3]' could be either two or four. + + *note table-assign-ops:: lists the arithmetic assignment operators. +In each case, the righthand operand is an expression whose value is +converted to a number. + +Operator Effect +-------------------------------------------------------------------------- +LVALUE `+=' INCREMENT Adds INCREMENT to the value of LVALUE. +LVALUE `-=' DECREMENT Subtracts DECREMENT from the value of LVALUE. +LVALUE `*=' Multiplies the value of LVALUE by COEFFICIENT. +COEFFICIENT +LVALUE `/=' DIVISOR Divides the value of LVALUE by DIVISOR. +LVALUE `%=' MODULUS Sets LVALUE to its remainder by MODULUS. +LVALUE `^=' POWER +LVALUE `**=' POWER Raises LVALUE to the power POWER. + +Table 5.2: Arithmetic Assignment Operators + + NOTE: Only the `^=' operator is specified by POSIX. For maximum + portability, do not use the `**=' operator. + +Advanced Notes: Syntactic Ambiguities Between `/=' and Regular Expressions +-------------------------------------------------------------------------- + +There is a syntactic ambiguity between the `/=' assignment operator and +regexp constants whose first character is an `='. (d.c.) This is most +notable in commercial `awk' versions. For example: + + $ awk /==/ /dev/null + error--> awk: syntax error at source line 1 + error--> context is + error--> >>> /= <<< + error--> awk: bailing out at source line 1 + +A workaround is: + + awk '/[=]=/' /dev/null + + `gawk' does not have this problem, nor do the other freely available +versions described in *note Other Versions::. + + +File: gawk.info, Node: Increment Ops, Next: Truth Values, Prev: Assignment Ops, Up: Expressions + +5.8 Increment and Decrement Operators +===================================== + +"Increment" and "decrement operators" increase or decrease the value of +a variable by one. An assignment operator can do the same thing, so +the increment operators add no power to the `awk' language; however, +they are convenient abbreviations for very common operations. + + The operator used for adding one is written `++'. It can be used to +increment a variable either before or after taking its value. To +pre-increment a variable `v', write `++v'. This adds one to the value +of `v'--that new value is also the value of the expression. (The +assignment expression `v += 1' is completely equivalent.) Writing the +`++' after the variable specifies post-increment. This increments the +variable value just the same; the difference is that the value of the +increment expression itself is the variable's _old_ value. Thus, if +`foo' has the value four, then the expression `foo++' has the value +four, but it changes the value of `foo' to five. In other words, the +operator returns the old value of the variable, but with the side +effect of incrementing it. + + The post-increment `foo++' is nearly the same as writing `(foo += 1) +- 1'. It is not perfectly equivalent because all numbers in `awk' are +floating-point--in floating-point, `foo + 1 - 1' does not necessarily +equal `foo'. But the difference is minute as long as you stick to +numbers that are fairly small (less than 10e12). + + Fields and array elements are incremented just like variables. (Use +`$(i++)' when you want to do a field reference and a variable increment +at the same time. The parentheses are necessary because of the +precedence of the field reference operator `$'.) + + The decrement operator `--' works just like `++', except that it +subtracts one instead of adding it. As with `++', it can be used before +the lvalue to pre-decrement or after it to post-decrement. Following +is a summary of increment and decrement expressions: + +`++LVALUE' + This expression increments LVALUE, and the new value becomes the + value of the expression. + +`LVALUE++' + This expression increments LVALUE, but the value of the expression + is the _old_ value of LVALUE. + +`--LVALUE' + This expression is like `++LVALUE', but instead of adding, it + subtracts. It decrements LVALUE and delivers the value that is + the result. + +`LVALUE--' + This expression is like `LVALUE++', but instead of adding, it + subtracts. It decrements LVALUE. The value of the expression is + the _old_ value of LVALUE. + +Advanced Notes: Operator Evaluation Order +----------------------------------------- + + Doctor, doctor! It hurts when I do this! + So don't do that! + Groucho Marx + +What happens for something like the following? + + b = 6 + print b += b++ + +Or something even stranger? + + b = 6 + b += ++b + b++ + print b + + In other words, when do the various side effects prescribed by the +postfix operators (`b++') take effect? When side effects happen is +"implementation defined". In other words, it is up to the particular +version of `awk'. The result for the first example may be 12 or 13, +and for the second, it may be 22 or 23. + + In short, doing things like this is not recommended and definitely +not anything that you can rely upon for portability. You should avoid +such things in your own programs. + + +File: gawk.info, Node: Truth Values, Next: Typing and Comparison, Prev: Increment Ops, Up: Expressions + +5.9 True and False in `awk' +=========================== + +Many programming languages have a special representation for the +concepts of "true" and "false." Such languages usually use the special +constants `true' and `false', or perhaps their uppercase equivalents. +However, `awk' is different. It borrows a very simple concept of true +and false from C. In `awk', any nonzero numeric value _or_ any +nonempty string value is true. Any other value (zero or the null +string `""') is false. The following program prints `A strange truth +value' three times: + + BEGIN { + if (3.1415927) + print "A strange truth value" + if ("Four Score And Seven Years Ago") + print "A strange truth value" + if (j = 57) + print "A strange truth value" + } + + There is a surprising consequence of the "nonzero or non-null" rule: +the string constant `"0"' is actually true, because it is non-null. +(d.c.) + + +File: gawk.info, Node: Typing and Comparison, Next: Boolean Ops, Prev: Truth Values, Up: Expressions + +5.10 Variable Typing and Comparison Expressions +=============================================== + + The Guide is definitive. Reality is frequently inaccurate. + The Hitchhiker's Guide to the Galaxy + + Unlike other programming languages, `awk' variables do not have a +fixed type. Instead, they can be either a number or a string, depending +upon the value that is assigned to them. We look now at how variables +are typed, and how `awk' compares variables. + +* Menu: + +* Variable Typing:: String type versus numeric type. +* Comparison Operators:: The comparison operators. + + +File: gawk.info, Node: Variable Typing, Next: Comparison Operators, Up: Typing and Comparison + +5.10.1 String Type Versus Numeric Type +-------------------------------------- + +The 1992 POSIX standard introduced the concept of a "numeric string", +which is simply a string that looks like a number--for example, +`" +2"'. This concept is used for determining the type of a variable. +The type of the variable is important because the types of two variables +determine how they are compared. In `gawk', variable typing follows +these rules: + + * A numeric constant or the result of a numeric operation has the + NUMERIC attribute. + + * A string constant or the result of a string operation has the + STRING attribute. + + * Fields, `getline' input, `FILENAME', `ARGV' elements, `ENVIRON' + elements, and the elements of an array created by `split' that are + numeric strings have the STRNUM attribute. Otherwise, they have + the STRING attribute. Uninitialized variables also have the + STRNUM attribute. + + * Attributes propagate across assignments but are not changed by any + use. + + The last rule is particularly important. In the following program, +`a' has numeric type, even though it is later used in a string +operation: + + BEGIN { + a = 12.345 + b = a " is a cute number" + print b + } + + When two operands are compared, either string comparison or numeric +comparison may be used. This depends upon the attributes of the +operands, according to the following symmetric matrix: + + +--------------------------------------------- + | STRING NUMERIC STRNUM + -------+--------------------------------------------- + | + STRING | string string string + | + NUMERIC | string numeric numeric + | + STRNUM | string numeric numeric + -------+--------------------------------------------- + + The basic idea is that user input that looks numeric--and _only_ +user input--should be treated as numeric, even though it is actually +made of characters and is therefore also a string. Thus, for example, +the string constant `" +3.14"', when it appears in program source code, +is a string--even though it looks numeric--and is _never_ treated as +number for comparison purposes. + + In short, when one operand is a "pure" string, such as a string +constant, then a string comparison is performed. Otherwise, a numeric +comparison is performed.(1) + + This point bears additional emphasis: All user input is made of +characters, and so is first and foremost of STRING type; input strings +that look numeric are additionally given the STRNUM attribute. Thus, +the six-character input string ` +3.14' receives the STRNUM attribute. +In contrast, the eight-character literal `" +3.14"' appearing in +program text is a string constant. The following examples print `1' +when the comparison between the two different constants is true, `0' +otherwise: + + $ echo ' +3.14' | gawk '{ print $0 == " +3.14" }' True + -| 1 + $ echo ' +3.14' | gawk '{ print $0 == "+3.14" }' False + -| 0 + $ echo ' +3.14' | gawk '{ print $0 == "3.14" }' False + -| 0 + $ echo ' +3.14' | gawk '{ print $0 == 3.14 }' True + -| 1 + $ echo ' +3.14' | gawk '{ print $1 == " +3.14" }' False + -| 0 + $ echo ' +3.14' | gawk '{ print $1 == "+3.14" }' True + -| 1 + $ echo ' +3.14' | gawk '{ print $1 == "3.14" }' False + -| 0 + $ echo ' +3.14' | gawk '{ print $1 == 3.14 }' True + -| 1 + + ---------- Footnotes ---------- + + (1) The POSIX standard has been revised. The revised standard's +rules for typing and comparison are the same as just described for +`gawk'. + + +File: gawk.info, Node: Comparison Operators, Prev: Variable Typing, Up: Typing and Comparison + +5.10.2 Comparison Operators +--------------------------- + +"Comparison expressions" compare strings or numbers for relationships +such as equality. They are written using "relational operators", which +are a superset of those in C. *note table-relational-ops:: describes +them. + +Expression Result +-------------------------------------------------------------------------- +X `<' Y True if X is less than Y. +X `<=' Y True if X is less than or equal to Y. +X `>' Y True if X is greater than Y. +X `>=' Y True if X is greater than or equal to Y. +X `==' Y True if X is equal to Y. +X `!=' Y True if X is not equal to Y. +X `~' Y True if the string X matches the regexp denoted by Y. +X `!~' Y True if the string X does not match the regexp + denoted by Y. +SUBSCRIPT `in' True if the array ARRAY has an element with the +ARRAY subscript SUBSCRIPT. + +Table 5.3: Relational Operators + + Comparison expressions have the value one if true and zero if false. +When comparing operands of mixed types, numeric operands are converted +to strings using the value of `CONVFMT' (*note Conversion::). + + Strings are compared by comparing the first character of each, then +the second character of each, and so on. Thus, `"10"' is less than +`"9"'. If there are two strings where one is a prefix of the other, +the shorter string is less than the longer one. Thus, `"abc"' is less +than `"abcd"'. + + It is very easy to accidentally mistype the `==' operator and leave +off one of the `=' characters. The result is still valid `awk' code, +but the program does not do what is intended: + + if (a = b) # oops! should be a == b + ... + else + ... + +Unless `b' happens to be zero or the null string, the `if' part of the +test always succeeds. Because the operators are so similar, this kind +of error is very difficult to spot when scanning the source code. + + The following table of expressions illustrates the kind of comparison +`gawk' performs, as well as what the result of the comparison is: + +`1.5 <= 2.0' + numeric comparison (true) + +`"abc" >= "xyz"' + string comparison (false) + +`1.5 != " +2"' + string comparison (true) + +`"1e2" < "3"' + string comparison (true) + +`a = 2; b = "2"' +`a == b' + string comparison (true) + +`a = 2; b = " +2"' + +`a == b' + string comparison (false) + + In the next example: + + $ echo 1e2 3 | awk '{ print ($1 < $2) ? "true" : "false" }' + -| false + +the result is `false' because both `$1' and `$2' are user input. They +are numeric strings--therefore both have the STRNUM attribute, +dictating a numeric comparison. The purpose of the comparison rules +and the use of numeric strings is to attempt to produce the behavior +that is "least surprising," while still "doing the right thing." +String comparisons and regular expression comparisons are very +different. For example: + + x == "foo" + +has the value one, or is true if the variable `x' is precisely `foo'. +By contrast: + + x ~ /foo/ + +has the value one if `x' contains `foo', such as `"Oh, what a fool am +I!"'. + + The righthand operand of the `~' and `!~' operators may be either a +regexp constant (`/.../') or an ordinary expression. In the latter +case, the value of the expression as a string is used as a dynamic +regexp (*note Regexp Usage::; also *note Computed Regexps::). + + In modern implementations of `awk', a constant regular expression in +slashes by itself is also an expression. The regexp `/REGEXP/' is an +abbreviation for the following comparison expression: + + $0 ~ /REGEXP/ + + One special place where `/foo/' is _not_ an abbreviation for `$0 ~ +/foo/' is when it is the righthand operand of `~' or `!~'. *Note Using +Constant Regexps::, where this is discussed in more detail. + + +File: gawk.info, Node: Boolean Ops, Next: Conditional Exp, Prev: Typing and Comparison, Up: Expressions + +5.11 Boolean Expressions +======================== + +A "Boolean expression" is a combination of comparison expressions or +matching expressions, using the Boolean operators "or" (`||'), "and" +(`&&'), and "not" (`!'), along with parentheses to control nesting. +The truth value of the Boolean expression is computed by combining the +truth values of the component expressions. Boolean expressions are +also referred to as "logical expressions". The terms are equivalent. + + Boolean expressions can be used wherever comparison and matching +expressions can be used. They can be used in `if', `while', `do', and +`for' statements (*note Statements::). They have numeric values (one +if true, zero if false) that come into play if the result of the +Boolean expression is stored in a variable or used in arithmetic. + + In addition, every Boolean expression is also a valid pattern, so +you can use one as a pattern to control the execution of rules. The +Boolean operators are: + +`BOOLEAN1 && BOOLEAN2' + True if both BOOLEAN1 and BOOLEAN2 are true. For example, the + following statement prints the current input record if it contains + both `2400' and `foo': + + if ($0 ~ /2400/ && $0 ~ /foo/) print + + The subexpression BOOLEAN2 is evaluated only if BOOLEAN1 is true. + This can make a difference when BOOLEAN2 contains expressions that + have side effects. In the case of `$0 ~ /foo/ && ($2 == bar++)', + the variable `bar' is not incremented if there is no substring + `foo' in the record. + +`BOOLEAN1 || BOOLEAN2' + True if at least one of BOOLEAN1 or BOOLEAN2 is true. For + example, the following statement prints all records in the input + that contain _either_ `2400' or `foo' or both: + + if ($0 ~ /2400/ || $0 ~ /foo/) print + + The subexpression BOOLEAN2 is evaluated only if BOOLEAN1 is false. + This can make a difference when BOOLEAN2 contains expressions that + have side effects. + +`! BOOLEAN' + True if BOOLEAN is false. For example, the following program + prints `no home!' in the unusual event that the `HOME' environment + variable is not defined: + + BEGIN { if (! ("HOME" in ENVIRON)) + print "no home!" } + + (The `in' operator is described in *note Reference to Elements::.) + + The `&&' and `||' operators are called "short-circuit" operators +because of the way they work. Evaluation of the full expression is +"short-circuited" if the result can be determined part way through its +evaluation. + + Statements that use `&&' or `||' can be continued simply by putting +a newline after them. But you cannot put a newline in front of either +of these operators without using backslash continuation (*note +Statements/Lines::). + + The actual value of an expression using the `!' operator is either +one or zero, depending upon the truth value of the expression it is +applied to. The `!' operator is often useful for changing the sense of +a flag variable from false to true and back again. For example, the +following program is one way to print lines in between special +bracketing lines: + + $1 == "START" { interested = ! interested; next } + interested == 1 { print } + $1 == "END" { interested = ! interested; next } + +The variable `interested', as with all `awk' variables, starts out +initialized to zero, which is also false. When a line is seen whose +first field is `START', the value of `interested' is toggled to true, +using `!'. The next rule prints lines as long as `interested' is true. +When a line is seen whose first field is `END', `interested' is toggled +back to false.(1) + + NOTE: The `next' statement is discussed in *note Next Statement::. + `next' tells `awk' to skip the rest of the rules, get the next + record, and start processing the rules over again at the top. The + reason it's there is to avoid printing the bracketing `START' and + `END' lines. + + ---------- Footnotes ---------- + + (1) This program has a bug; it prints lines starting with `END'. How +would you fix it? + + +File: gawk.info, Node: Conditional Exp, Next: Function Calls, Prev: Boolean Ops, Up: Expressions + +5.12 Conditional Expressions +============================ + +A "conditional expression" is a special kind of expression that has +three operands. It allows you to use one expression's value to select +one of two other expressions. The conditional expression is the same +as in the C language, as shown here: + + SELECTOR ? IF-TRUE-EXP : IF-FALSE-EXP + +There are three subexpressions. The first, SELECTOR, is always +computed first. If it is "true" (not zero or not null), then +IF-TRUE-EXP is computed next and its value becomes the value of the +whole expression. Otherwise, IF-FALSE-EXP is computed next and its +value becomes the value of the whole expression. For example, the +following expression produces the absolute value of `x': + + x >= 0 ? x : -x + + Each time the conditional expression is computed, only one of +IF-TRUE-EXP and IF-FALSE-EXP is used; the other is ignored. This is +important when the expressions have side effects. For example, this +conditional expression examines element `i' of either array `a' or +array `b', and increments `i': + + x == y ? a[i++] : b[i++] + +This is guaranteed to increment `i' exactly once, because each time +only one of the two increment expressions is executed and the other is +not. *Note Arrays::, for more information about arrays. + + As a minor `gawk' extension, a statement that uses `?:' can be +continued simply by putting a newline after either character. However, +putting a newline in front of either character does not work without +using backslash continuation (*note Statements/Lines::). If `--posix' +is specified (*note Options::), then this extension is disabled. + + +File: gawk.info, Node: Function Calls, Next: Precedence, Prev: Conditional Exp, Up: Expressions + +5.13 Function Calls +=================== + +A "function" is a name for a particular calculation. This enables you +to ask for it by name at any point in the program. For example, the +function `sqrt' computes the square root of a number. + + A fixed set of functions are "built-in", which means they are +available in every `awk' program. The `sqrt' function is one of these. +*Note Built-in::, for a list of built-in functions and their +descriptions. In addition, you can define functions for use in your +program. *Note User-defined::, for instructions on how to do this. + + The way to use a function is with a "function call" expression, +which consists of the function name followed immediately by a list of +"arguments" in parentheses. The arguments are expressions that provide +the raw materials for the function's calculations. When there is more +than one argument, they are separated by commas. If there are no +arguments, just write `()' after the function name. The following +examples show function calls with and without arguments: + + sqrt(x^2 + y^2) one argument + atan2(y, x) two arguments + rand() no arguments + + *Caution:* Do not put any space between the function name and the +open-parenthesis! A user-defined function name looks just like the +name of a variable--a space would make the expression look like +concatenation of a variable with an expression inside parentheses. + + With built-in functions, space before the parenthesis is harmless, +but it is best not to get into the habit of using space to avoid +mistakes with user-defined functions. Each function expects a +particular number of arguments. For example, the `sqrt' function must +be called with a single argument, the number of which to take the +square root: + + sqrt(ARGUMENT) + + Some of the built-in functions have one or more optional arguments. +If those arguments are not supplied, the functions use a reasonable +default value. *Note Built-in::, for full details. If arguments are +omitted in calls to user-defined functions, then those arguments are +treated as local variables and initialized to the empty string (*note +User-defined::). + + Like every other expression, the function call has a value, which is +computed by the function based on the arguments you give it. In this +example, the value of `sqrt(ARGUMENT)' is the square root of ARGUMENT. +The following program reads numbers, one number per line, and prints the +square root of each one: + + $ awk '{ print "The square root of", $1, "is", sqrt($1) }' + 1 + -| The square root of 1 is 1 + 3 + -| The square root of 3 is 1.73205 + 5 + -| The square root of 5 is 2.23607 + Ctrl-d + + A function can also have side effects, such as assigning values to +certain variables or doing I/O. This program shows how the `match' +function (*note String Functions::) changes the variables `RSTART' and +`RLENGTH': + + { + if (match($1, $2)) + print RSTART, RLENGTH + else + print "no match" + } + +Here is a sample run: + + $ awk -f matchit.awk + aaccdd c+ + -| 3 2 + foo bar + -| no match + abcdefg e + -| 5 1 + + +File: gawk.info, Node: Precedence, Prev: Function Calls, Up: Expressions + +5.14 Operator Precedence (How Operators Nest) +============================================= + +"Operator precedence" determines how operators are grouped when +different operators appear close by in one expression. For example, +`*' has higher precedence than `+'; thus, `a + b * c' means to multiply +`b' and `c', and then add `a' to the product (i.e., `a + (b * c)'). + + The normal precedence of the operators can be overruled by using +parentheses. Think of the precedence rules as saying where the +parentheses are assumed to be. In fact, it is wise to always use +parentheses whenever there is an unusual combination of operators, +because other people who read the program may not remember what the +precedence is in this case. Even experienced programmers occasionally +forget the exact rules, which leads to mistakes. Explicit parentheses +help prevent any such mistakes. + + When operators of equal precedence are used together, the leftmost +operator groups first, except for the assignment, conditional, and +exponentiation operators, which group in the opposite order. Thus, `a +- b + c' groups as `(a - b) + c' and `a = b = c' groups as `a = (b = +c)'. + + Normally the precedence of prefix unary operators does not matter, +because there is only one way to interpret them: innermost first. +Thus, `$++i' means `$(++i)' and `++$x' means `++($x)'. However, when +another operator follows the operand, then the precedence of the unary +operators can matter. `$x^2' means `($x)^2', but `-x^2' means +`-(x^2)', because `-' has lower precedence than `^', whereas `$' has +higher precedence. Also, operators cannot be combined in a way that +violates the precedence rules; for example, `$$0++--' is not a valid +expression because the first `$' has higher precedence than the `++'; +to avoid the problem the expression can be rewritten as `$($0++)--'. + + This table presents `awk''s operators, in order of highest to lowest +precedence: + +`(...)' + Grouping. + +`$' + Field. + +`++ --' + Increment, decrement. + +`^ **' + Exponentiation. These operators group right-to-left. + +`+ - !' + Unary plus, minus, logical "not." + +`* / %' + Multiplication, division, remainder. + +`+ -' + Addition, subtraction. + +`String Concatenation' + No special symbol is used to indicate concatenation. The operands + are simply written side by side (*note Concatenation::). + +`< <= == !=' +`> >= >> | |&' + Relational and redirection. The relational operators and the + redirections have the same precedence level. Characters such as + `>' serve both as relationals and as redirections; the context + distinguishes between the two meanings. + + Note that the I/O redirection operators in `print' and `printf' + statements belong to the statement level, not to expressions. The + redirection does not produce an expression that could be the + operand of another operator. As a result, it does not make sense + to use a redirection operator near another operator of lower + precedence without parentheses. Such combinations (for example, + `print foo > a ? b : c'), result in syntax errors. The correct + way to write this statement is `print foo > (a ? b : c)'. + +`~ !~' + Matching, nonmatching. + +`in' + Array membership. + +`&&' + Logical "and". + +`||' + Logical "or". + +`?:' + Conditional. This operator groups right-to-left. + +`= += -= *=' +`/= %= ^= **=' + Assignment. These operators group right to left. + + NOTE: The `|&', `**', and `**=' operators are not specified by + POSIX. For maximum portability, do not use them. + + +File: gawk.info, Node: Patterns and Actions, Next: Arrays, Prev: Expressions, Up: Top + +6 Patterns, Actions, and Variables +********************************** + +As you have already seen, each `awk' statement consists of a pattern +with an associated action. This major node describes how you build +patterns and actions, what kinds of things you can do within actions, +and `awk''s built-in variables. + + The pattern-action rules and the statements available for use within +actions form the core of `awk' programming. In a sense, everything +covered up to here has been the foundation that programs are built on +top of. Now it's time to start building something useful. + +* Menu: + +* Pattern Overview:: What goes into a pattern. +* Using Shell Variables:: How to use shell variables with `awk'. +* Action Overview:: What goes into an action. +* Statements:: Describes the various control statements in + detail. +* Built-in Variables:: Summarizes the built-in variables. + + +File: gawk.info, Node: Pattern Overview, Next: Using Shell Variables, Up: Patterns and Actions + +6.1 Pattern Elements +==================== + +* Menu: + +* Regexp Patterns:: Using regexps as patterns. +* Expression Patterns:: Any expression can be used as a pattern. +* Ranges:: Pairs of patterns specify record ranges. +* BEGIN/END:: Specifying initialization and cleanup rules. +* Empty:: The empty pattern, which matches every record. + + Patterns in `awk' control the execution of rules--a rule is executed +when its pattern matches the current input record. The following is a +summary of the types of `awk' patterns: + +`/REGULAR EXPRESSION/' + A regular expression. It matches when the text of the input record + fits the regular expression. (*Note Regexp::.) + +`EXPRESSION' + A single expression. It matches when its value is nonzero (if a + number) or non-null (if a string). (*Note Expression Patterns::.) + +`PAT1, PAT2' + A pair of patterns separated by a comma, specifying a range of + records. The range includes both the initial record that matches + PAT1 and the final record that matches PAT2. (*Note Ranges::.) + +`BEGIN' +`END' + Special patterns for you to supply startup or cleanup actions for + your `awk' program. (*Note BEGIN/END::.) + +`EMPTY' + The empty pattern matches every input record. (*Note Empty::.) + + +File: gawk.info, Node: Regexp Patterns, Next: Expression Patterns, Up: Pattern Overview + +6.1.1 Regular Expressions as Patterns +------------------------------------- + +Regular expressions are one of the first kinds of patterns presented in +this book. This kind of pattern is simply a regexp constant in the +pattern part of a rule. Its meaning is `$0 ~ /PATTERN/'. The pattern +matches when the input record matches the regexp. For example: + + /foo|bar|baz/ { buzzwords++ } + END { print buzzwords, "buzzwords seen" } + + +File: gawk.info, Node: Expression Patterns, Next: Ranges, Prev: Regexp Patterns, Up: Pattern Overview + +6.1.2 Expressions as Patterns +----------------------------- + +Any `awk' expression is valid as an `awk' pattern. The pattern matches +if the expression's value is nonzero (if a number) or non-null (if a +string). The expression is reevaluated each time the rule is tested +against a new input record. If the expression uses fields such as +`$1', the value depends directly on the new input record's text; +otherwise, it depends on only what has happened so far in the execution +of the `awk' program. + + Comparison expressions, using the comparison operators described in +*note Typing and Comparison::, are a very common kind of pattern. +Regexp matching and nonmatching are also very common expressions. The +left operand of the `~' and `!~' operators is a string. The right +operand is either a constant regular expression enclosed in slashes +(`/REGEXP/'), or any expression whose string value is used as a dynamic +regular expression (*note Computed Regexps::). The following example +prints the second field of each input record whose first field is +precisely `foo': + + $ awk '$1 == "foo" { print $2 }' BBS-list + +(There is no output, because there is no BBS site with the exact name +`foo'.) Contrast this with the following regular expression match, +which accepts any record with a first field that contains `foo': + + $ awk '$1 ~ /foo/ { print $2 }' BBS-list + -| 555-1234 + -| 555-6699 + -| 555-6480 + -| 555-2127 + + A regexp constant as a pattern is also a special case of an +expression pattern. The expression `/foo/' has the value one if `foo' +appears in the current input record. Thus, as a pattern, `/foo/' +matches any record containing `foo'. + + Boolean expressions are also commonly used as patterns. Whether the +pattern matches an input record depends on whether its subexpressions +match. For example, the following command prints all the records in +`BBS-list' that contain both `2400' and `foo': + + $ awk '/2400/ && /foo/' BBS-list + -| fooey 555-1234 2400/1200/300 B + + The following command prints all records in `BBS-list' that contain +_either_ `2400' or `foo' (or both, of course): + + $ awk '/2400/ || /foo/' BBS-list + -| alpo-net 555-3412 2400/1200/300 A + -| bites 555-1675 2400/1200/300 A + -| fooey 555-1234 2400/1200/300 B + -| foot 555-6699 1200/300 B + -| macfoo 555-6480 1200/300 A + -| sdace 555-3430 2400/1200/300 A + -| sabafoo 555-2127 1200/300 C + + The following command prints all records in `BBS-list' that do _not_ +contain the string `foo': + + $ awk '! /foo/' BBS-list + -| aardvark 555-5553 1200/300 B + -| alpo-net 555-3412 2400/1200/300 A + -| barfly 555-7685 1200/300 A + -| bites 555-1675 2400/1200/300 A + -| camelot 555-0542 300 C + -| core 555-2912 1200/300 C + -| sdace 555-3430 2400/1200/300 A + + The subexpressions of a Boolean operator in a pattern can be +constant regular expressions, comparisons, or any other `awk' +expressions. Range patterns are not expressions, so they cannot appear +inside Boolean patterns. Likewise, the special patterns `BEGIN' and +`END', which never match any input record, are not expressions and +cannot appear inside Boolean patterns. + + +File: gawk.info, Node: Ranges, Next: BEGIN/END, Prev: Expression Patterns, Up: Pattern Overview + +6.1.3 Specifying Record Ranges with Patterns +-------------------------------------------- + +A "range pattern" is made of two patterns separated by a comma, in the +form `BEGPAT, ENDPAT'. It is used to match ranges of consecutive input +records. The first pattern, BEGPAT, controls where the range begins, +while ENDPAT controls where the pattern ends. For example, the +following: + + awk '$1 == "on", $1 == "off"' myfile + +prints every record in `myfile' between `on'/`off' pairs, inclusive. + + A range pattern starts out by matching BEGPAT against every input +record. When a record matches BEGPAT, the range pattern is "turned on" +and the range pattern matches this record as well. As long as the +range pattern stays turned on, it automatically matches every input +record read. The range pattern also matches ENDPAT against every input +record; when this succeeds, the range pattern is turned off again for +the following record. Then the range pattern goes back to checking +BEGPAT against each record. + + The record that turns on the range pattern and the one that turns it +off both match the range pattern. If you don't want to operate on +these records, you can write `if' statements in the rule's action to +distinguish them from the records you are interested in. + + It is possible for a pattern to be turned on and off by the same +record. If the record satisfies both conditions, then the action is +executed for just that record. For example, suppose there is text +between two identical markers (e.g., the `%' symbol), each on its own +line, that should be ignored. A first attempt would be to combine a +range pattern that describes the delimited text with the `next' +statement (not discussed yet, *note Next Statement::). This causes +`awk' to skip any further processing of the current record and start +over again with the next input record. Such a program looks like this: + + /^%$/,/^%$/ { next } + { print } + +This program fails because the range pattern is both turned on and +turned off by the first line, which just has a `%' on it. To +accomplish this task, write the program in the following manner, using +a flag: + + /^%$/ { skip = ! skip; next } + skip == 1 { next } # skip lines with `skip' set + + In a range pattern, the comma (`,') has the lowest precedence of all +the operators (i.e., it is evaluated last). Thus, the following +program attempts to combine a range pattern with another, simpler test: + + echo Yes | awk '/1/,/2/ || /Yes/' + + The intent of this program is `(/1/,/2/) || /Yes/'. However, `awk' +interprets this as `/1/, (/2/ || /Yes/)'. This cannot be changed or +worked around; range patterns do not combine with other patterns: + + $ echo Yes | gawk '(/1/,/2/) || /Yes/' + error--> gawk: cmd. line:1: (/1/,/2/) || /Yes/ + error--> gawk: cmd. line:1: ^ parse error + error--> gawk: cmd. line:2: (/1/,/2/) || /Yes/ + error--> gawk: cmd. line:2: ^ unexpected newline + + +File: gawk.info, Node: BEGIN/END, Next: Empty, Prev: Ranges, Up: Pattern Overview + +6.1.4 The `BEGIN' and `END' Special Patterns +-------------------------------------------- + +All the patterns described so far are for matching input records. The +`BEGIN' and `END' special patterns are different. They supply startup +and cleanup actions for `awk' programs. `BEGIN' and `END' rules must +have actions; there is no default action for these rules because there +is no current record when they run. `BEGIN' and `END' rules are often +referred to as "`BEGIN' and `END' blocks" by long-time `awk' +programmers. + +* Menu: + +* Using BEGIN/END:: How and why to use BEGIN/END rules. +* I/O And BEGIN/END:: I/O issues in BEGIN/END rules. + + +File: gawk.info, Node: Using BEGIN/END, Next: I/O And BEGIN/END, Up: BEGIN/END + +6.1.4.1 Startup and Cleanup Actions +................................... + +A `BEGIN' rule is executed once only, before the first input record is +read. Likewise, an `END' rule is executed once only, after all the +input is read. For example: + + $ awk ' + > BEGIN { print "Analysis of \"foo\"" } + > /foo/ { ++n } + > END { print "\"foo\" appears", n, "times." }' BBS-list + -| Analysis of "foo" + -| "foo" appears 4 times. + + This program finds the number of records in the input file `BBS-list' +that contain the string `foo'. The `BEGIN' rule prints a title for the +report. There is no need to use the `BEGIN' rule to initialize the +counter `n' to zero, since `awk' does this automatically (*note +Variables::). The second rule increments the variable `n' every time a +record containing the pattern `foo' is read. The `END' rule prints the +value of `n' at the end of the run. + + The special patterns `BEGIN' and `END' cannot be used in ranges or +with Boolean operators (indeed, they cannot be used with any operators). +An `awk' program may have multiple `BEGIN' and/or `END' rules. They +are executed in the order in which they appear: all the `BEGIN' rules +at startup and all the `END' rules at termination. `BEGIN' and `END' +rules may be intermixed with other rules. This feature was added in +the 1987 version of `awk' and is included in the POSIX standard. The +original (1978) version of `awk' required the `BEGIN' rule to be placed +at the beginning of the program, the `END' rule to be placed at the +end, and only allowed one of each. This is no longer required, but it +is a good idea to follow this template in terms of program organization +and readability. + + Multiple `BEGIN' and `END' rules are useful for writing library +functions, because each library file can have its own `BEGIN' and/or +`END' rule to do its own initialization and/or cleanup. The order in +which library functions are named on the command line controls the +order in which their `BEGIN' and `END' rules are executed. Therefore, +you have to be careful when writing such rules in library files so that +the order in which they are executed doesn't matter. *Note Options::, +for more information on using library functions. *Note Library +Functions::, for a number of useful library functions. + + If an `awk' program has only a `BEGIN' rule and no other rules, then +the program exits after the `BEGIN' rule is run.(1) However, if an +`END' rule exists, then the input is read, even if there are no other +rules in the program. This is necessary in case the `END' rule checks +the `FNR' and `NR' variables. + + ---------- Footnotes ---------- + + (1) The original version of `awk' used to keep reading and ignoring +input until the end of the file was seen. + + +File: gawk.info, Node: I/O And BEGIN/END, Prev: Using BEGIN/END, Up: BEGIN/END + +6.1.4.2 Input/Output from `BEGIN' and `END' Rules +................................................. + +There are several (sometimes subtle) points to remember when doing I/O +from a `BEGIN' or `END' rule. The first has to do with the value of +`$0' in a `BEGIN' rule. Because `BEGIN' rules are executed before any +input is read, there simply is no input record, and therefore no +fields, when executing `BEGIN' rules. References to `$0' and the fields +yield a null string or zero, depending upon the context. One way to +give `$0' a real value is to execute a `getline' command without a +variable (*note Getline::). Another way is simply to assign a value to +`$0'. + + The second point is similar to the first but from the other +direction. Traditionally, due largely to implementation issues, `$0' +and `NF' were _undefined_ inside an `END' rule. The POSIX standard +specifies that `NF' is available in an `END' rule. It contains the +number of fields from the last input record. Most probably due to an +oversight, the standard does not say that `$0' is also preserved, +although logically one would think that it should be. In fact, `gawk' +does preserve the value of `$0' for use in `END' rules. Be aware, +however, that Unix `awk', and possibly other implementations, do not. + + The third point follows from the first two. The meaning of `print' +inside a `BEGIN' or `END' rule is the same as always: `print $0'. If +`$0' is the null string, then this prints an empty line. Many long +time `awk' programmers use an unadorned `print' in `BEGIN' and `END' +rules, to mean `print ""', relying on `$0' being null. Although one +might generally get away with this in `BEGIN' rules, it is a very bad +idea in `END' rules, at least in `gawk'. It is also poor style, since +if an empty line is needed in the output, the program should print one +explicitly. + + Finally, the `next' and `nextfile' statements are not allowed in a +`BEGIN' rule, because the implicit +read-a-record-and-match-against-the-rules loop has not started yet. +Similarly, those statements are not valid in an `END' rule, since all +the input has been read. (*Note Next Statement::, and see *note +Nextfile Statement::.) + + +File: gawk.info, Node: Empty, Prev: BEGIN/END, Up: Pattern Overview + +6.1.5 The Empty Pattern +----------------------- + +An empty (i.e., nonexistent) pattern is considered to match _every_ +input record. For example, the program: + + awk '{ print $1 }' BBS-list + +prints the first field of every record. + + +File: gawk.info, Node: Using Shell Variables, Next: Action Overview, Prev: Pattern Overview, Up: Patterns and Actions + +6.2 Using Shell Variables in Programs +===================================== + +`awk' programs are often used as components in larger programs written +in shell. For example, it is very common to use a shell variable to +hold a pattern that the `awk' program searches for. There are two ways +to get the value of the shell variable into the body of the `awk' +program. + + The most common method is to use shell quoting to substitute the +variable's value into the program inside the script. For example, in +the following program: + + echo -n "Enter search pattern: " + read pattern + awk "/$pattern/ "'{ nmatches++ } + END { print nmatches, "found" }' /path/to/data + +the `awk' program consists of two pieces of quoted text that are +concatenated together to form the program. The first part is +double-quoted, which allows substitution of the `pattern' variable +inside the quotes. The second part is single-quoted. + + Variable substitution via quoting works, but can be potentially +messy. It requires a good understanding of the shell's quoting rules +(*note Quoting::), and it's often difficult to correctly match up the +quotes when reading the program. + + A better method is to use `awk''s variable assignment feature (*note +Assignment Options::) to assign the shell variable's value to an `awk' +variable's value. Then use dynamic regexps to match the pattern (*note +Computed Regexps::). The following shows how to redo the previous +example using this technique: + + echo -n "Enter search pattern: " + read pattern + awk -v pat="$pattern" '$0 ~ pat { nmatches++ } + END { print nmatches, "found" }' /path/to/data + +Now, the `awk' program is just one single-quoted string. The +assignment `-v pat="$pattern"' still requires double quotes, in case +there is whitespace in the value of `$pattern'. The `awk' variable +`pat' could be named `pattern' too, but that would be more confusing. +Using a variable also provides more flexibility, since the variable can +be used anywhere inside the program--for printing, as an array +subscript, or for any other use--without requiring the quoting tricks +at every point in the program. + + +File: gawk.info, Node: Action Overview, Next: Statements, Prev: Using Shell Variables, Up: Patterns and Actions + +6.3 Actions +=========== + +An `awk' program or script consists of a series of rules and function +definitions interspersed. (Functions are described later. *Note +User-defined::.) A rule contains a pattern and an action, either of +which (but not both) may be omitted. The purpose of the "action" is to +tell `awk' what to do once a match for the pattern is found. Thus, in +outline, an `awk' program generally looks like this: + + [PATTERN] [{ ACTION }] + [PATTERN] [{ ACTION }] + ... + function NAME(ARGS) { ... } + ... + + An action consists of one or more `awk' "statements", enclosed in +curly braces (`{...}'). Each statement specifies one thing to do. The +statements are separated by newlines or semicolons. The curly braces +around an action must be used even if the action contains only one +statement, or if it contains no statements at all. However, if you +omit the action entirely, omit the curly braces as well. An omitted +action is equivalent to `{ print $0 }': + + /foo/ { } match `foo', do nothing -- empty action + /foo/ match `foo', print the record -- omitted action + + The following types of statements are supported in `awk': + +Expressions + Call functions or assign values to variables (*note + Expressions::). Executing this kind of statement simply computes + the value of the expression. This is useful when the expression + has side effects (*note Assignment Ops::). + +Control statements + Specify the control flow of `awk' programs. The `awk' language + gives you C-like constructs (`if', `for', `while', and `do') as + well as a few special ones (*note Statements::). + +Compound statements + Consist of one or more statements enclosed in curly braces. A + compound statement is used in order to put several statements + together in the body of an `if', `while', `do', or `for' statement. + +Input statements + Use the `getline' command (*note Getline::). Also supplied in + `awk' are the `next' statement (*note Next Statement::), and the + `nextfile' statement (*note Nextfile Statement::). + +Output statements + Such as `print' and `printf'. *Note Printing::. + +Deletion statements + For deleting array elements. *Note Delete::. + + +File: gawk.info, Node: Statements, Next: Built-in Variables, Prev: Action Overview, Up: Patterns and Actions + +6.4 Control Statements in Actions +================================= + +"Control statements", such as `if', `while', and so on, control the +flow of execution in `awk' programs. Most of the control statements in +`awk' are patterned on similar statements in C. + + All the control statements start with special keywords, such as `if' +and `while', to distinguish them from simple expressions. Many control +statements contain other statements. For example, the `if' statement +contains another statement that may or may not be executed. The +contained statement is called the "body". To include more than one +statement in the body, group them into a single "compound statement" +with curly braces, separating them with newlines or semicolons. + +* Menu: + +* If Statement:: Conditionally execute some `awk' + statements. +* While Statement:: Loop until some condition is satisfied. +* Do Statement:: Do specified action while looping until some + condition is satisfied. +* For Statement:: Another looping statement, that provides + initialization and increment clauses. +* Switch Statement:: Switch/case evaluation for conditional + execution of statements based on a value. +* Break Statement:: Immediately exit the innermost enclosing loop. +* Continue Statement:: Skip to the end of the innermost enclosing + loop. +* Next Statement:: Stop processing the current input record. +* Nextfile Statement:: Stop processing the current file. +* Exit Statement:: Stop execution of `awk'. + + +File: gawk.info, Node: If Statement, Next: While Statement, Up: Statements + +6.4.1 The `if'-`else' Statement +------------------------------- + +The `if'-`else' statement is `awk''s decision-making statement. It +looks like this: + + if (CONDITION) THEN-BODY [else ELSE-BODY] + +The CONDITION is an expression that controls what the rest of the +statement does. If the CONDITION is true, THEN-BODY is executed; +otherwise, ELSE-BODY is executed. The `else' part of the statement is +optional. The condition is considered false if its value is zero or +the null string; otherwise, the condition is true. Refer to the +following: + + if (x % 2 == 0) + print "x is even" + else + print "x is odd" + + In this example, if the expression `x % 2 == 0' is true (that is, if +the value of `x' is evenly divisible by two), then the first `print' +statement is executed; otherwise, the second `print' statement is +executed. If the `else' keyword appears on the same line as THEN-BODY +and THEN-BODY is not a compound statement (i.e., not surrounded by +curly braces), then a semicolon must separate THEN-BODY from the `else'. +To illustrate this, the previous example can be rewritten as: + + if (x % 2 == 0) print "x is even"; else + print "x is odd" + +If the `;' is left out, `awk' can't interpret the statement and it +produces a syntax error. Don't actually write programs this way, +because a human reader might fail to see the `else' if it is not the +first thing on its line. + + +File: gawk.info, Node: While Statement, Next: Do Statement, Prev: If Statement, Up: Statements + +6.4.2 The `while' Statement +--------------------------- + +In programming, a "loop" is a part of a program that can be executed +two or more times in succession. The `while' statement is the simplest +looping statement in `awk'. It repeatedly executes a statement as long +as a condition is true. For example: + + while (CONDITION) + BODY + +BODY is a statement called the "body" of the loop, and CONDITION is an +expression that controls how long the loop keeps running. The first +thing the `while' statement does is test the CONDITION. If the +CONDITION is true, it executes the statement BODY. (The CONDITION is +true when the value is not zero and not a null string.) After BODY has +been executed, CONDITION is tested again, and if it is still true, BODY +is executed again. This process repeats until the CONDITION is no +longer true. If the CONDITION is initially false, the body of the loop +is never executed and `awk' continues with the statement following the +loop. This example prints the first three fields of each record, one +per line: + + awk '{ i = 1 + while (i <= 3) { + print $i + i++ + } + }' inventory-shipped + +The body of this loop is a compound statement enclosed in braces, +containing two statements. The loop works in the following manner: +first, the value of `i' is set to one. Then, the `while' statement +tests whether `i' is less than or equal to three. This is true when +`i' equals one, so the `i'-th field is printed. Then the `i++' +increments the value of `i' and the loop repeats. The loop terminates +when `i' reaches four. + + A newline is not required between the condition and the body; +however using one makes the program clearer unless the body is a +compound statement or else is very simple. The newline after the +open-brace that begins the compound statement is not required either, +but the program is harder to read without it. + + +File: gawk.info, Node: Do Statement, Next: For Statement, Prev: While Statement, Up: Statements + +6.4.3 The `do'-`while' Statement +-------------------------------- + +The `do' loop is a variation of the `while' looping statement. The +`do' loop executes the BODY once and then repeats the BODY as long as +the CONDITION is true. It looks like this: + + do + BODY + while (CONDITION) + + Even if the CONDITION is false at the start, the BODY is executed at +least once (and only once, unless executing BODY makes CONDITION true). +Contrast this with the corresponding `while' statement: + + while (CONDITION) + BODY + +This statement does not execute BODY even once if the CONDITION is +false to begin with. The following is an example of a `do' statement: + + { i = 1 + do { + print $0 + i++ + } while (i <= 10) + } + +This program prints each input record 10 times. However, it isn't a +very realistic example, since in this case an ordinary `while' would do +just as well. This situation reflects actual experience; only +occasionally is there a real use for a `do' statement. + + +File: gawk.info, Node: For Statement, Next: Switch Statement, Prev: Do Statement, Up: Statements + +6.4.4 The `for' Statement +------------------------- + +The `for' statement makes it more convenient to count iterations of a +loop. The general form of the `for' statement looks like this: + + for (INITIALIZATION; CONDITION; INCREMENT) + BODY + +The INITIALIZATION, CONDITION, and INCREMENT parts are arbitrary `awk' +expressions, and BODY stands for any `awk' statement. + + The `for' statement starts by executing INITIALIZATION. Then, as +long as the CONDITION is true, it repeatedly executes BODY and then +INCREMENT. Typically, INITIALIZATION sets a variable to either zero or +one, INCREMENT adds one to it, and CONDITION compares it against the +desired number of iterations. For example: + + awk '{ for (i = 1; i <= 3; i++) + print $i + }' inventory-shipped + +This prints the first three fields of each input record, with one field +per line. + + It isn't possible to set more than one variable in the +INITIALIZATION part without using a multiple assignment statement such +as `x = y = 0'. This makes sense only if all the initial values are +equal. (But it is possible to initialize additional variables by +writing their assignments as separate statements preceding the `for' +loop.) + + The same is true of the INCREMENT part. Incrementing additional +variables requires separate statements at the end of the loop. The C +compound expression, using C's comma operator, is useful in this +context but it is not supported in `awk'. + + Most often, INCREMENT is an increment expression, as in the previous +example. But this is not required; it can be any expression +whatsoever. For example, the following statement prints all the powers +of two between 1 and 100: + + for (i = 1; i <= 100; i *= 2) + print i + + If there is nothing to be done, any of the three expressions in the +parentheses following the `for' keyword may be omitted. Thus, +`for (; x > 0;)' is equivalent to `while (x > 0)'. If the CONDITION is +omitted, it is treated as true, effectively yielding an "infinite loop" +(i.e., a loop that never terminates). + + In most cases, a `for' loop is an abbreviation for a `while' loop, +as shown here: + + INITIALIZATION + while (CONDITION) { + BODY + INCREMENT + } + +The only exception is when the `continue' statement (*note Continue +Statement::) is used inside the loop. Changing a `for' statement to a +`while' statement in this way can change the effect of the `continue' +statement inside the loop. + + The `awk' language has a `for' statement in addition to a `while' +statement because a `for' loop is often both less work to type and more +natural to think of. Counting the number of iterations is very common +in loops. It can be easier to think of this counting as part of +looping rather than as something to do inside the loop. + + There is an alternate version of the `for' loop, for iterating over +all the indices of an array: + + for (i in array) + DO SOMETHING WITH array[i] + +*Note Scanning an Array::, for more information on this version of the +`for' loop. + + +File: gawk.info, Node: Switch Statement, Next: Break Statement, Prev: For Statement, Up: Statements + +6.4.5 The `switch' Statement +---------------------------- + + NOTE: This node describes an experimental feature added in `gawk' + 3.1.3. It is _not_ enabled by default. To enable it, use the + `--enable-switch' option to `configure' when `gawk' is being + configured and built. *Note Additional Configuration Options::, + for more information. + + The `switch' statement allows the evaluation of an expression and +the execution of statements based on a `case' match. Case statements +are checked for a match in the order they are defined. If no suitable +`case' is found, the `default' section is executed, if supplied. + + Each `case' contains a single constant, be it numeric, string, or +regexp. The `switch' expression is evaluated, and then each `case''s +constant is compared against the result in turn. The type of constant +determines the comparison: numeric or string do the usual comparisons. +A regexp constant does a regular expression match against the string +value of the original expression. The general form of the `switch' +statement looks like this: + + switch (EXPRESSION) { + case VALUE OR REGULAR EXPRESSION: + CASE-BODY + default: + DEFAULT-BODY + } + + Control flow in the `switch' statement works as it does in C. Once a +match to a given case is made, case statement bodies are executed until +a `break', `continue', `next', `nextfile' or `exit' is encountered, or +the end of the `switch' statement itself. For example: + + switch (NR * 2 + 1) { + case 3: + case "11": + print NR - 1 + break + + case /2[[:digit:]]+/: + print NR + + default: + print NR + 1 + + case -1: + print NR * -1 + } + + Note that if none of the statements specified above halt execution +of a matched `case' statement, execution falls through to the next +`case' until execution halts. In the above example, for any case value +starting with `2' followed by one or more digits, the `print' statement +is executed and then falls through into the `default' section, +executing its `print' statement. In turn, the -1 case will also be +executed since the `default' does not halt execution. + + +File: gawk.info, Node: Break Statement, Next: Continue Statement, Prev: Switch Statement, Up: Statements + +6.4.6 The `break' Statement +--------------------------- + +The `break' statement jumps out of the innermost `for', `while', or +`do' loop that encloses it. The following example finds the smallest +divisor of any integer, and also identifies prime numbers: + + # find smallest divisor of num + { + num = $1 + for (div = 2; div*div <= num; div++) + if (num % div == 0) + break + if (num % div == 0) + printf "Smallest divisor of %d is %d\n", num, div + else + printf "%d is prime\n", num + } + + When the remainder is zero in the first `if' statement, `awk' +immediately "breaks out" of the containing `for' loop. This means that +`awk' proceeds immediately to the statement following the loop and +continues processing. (This is very different from the `exit' +statement, which stops the entire `awk' program. *Note Exit +Statement::.) + + Th following program illustrates how the CONDITION of a `for' or +`while' statement could be replaced with a `break' inside an `if': + + # find smallest divisor of num + { + num = $1 + for (div = 2; ; div++) { + if (num % div == 0) { + printf "Smallest divisor of %d is %d\n", num, div + break + } + if (div*div > num) { + printf "%d is prime\n", num + break + } + } + } + + The `break' statement has no meaning when used outside the body of a +loop. However, although it was never documented, historical +implementations of `awk' treated the `break' statement outside of a +loop as if it were a `next' statement (*note Next Statement::). Recent +versions of Unix `awk' no longer allow this usage. `gawk' supports +this use of `break' only if `--traditional' has been specified on the +command line (*note Options::). Otherwise, it is treated as an error, +since the POSIX standard specifies that `break' should only be used +inside the body of a loop. (d.c.) + + +File: gawk.info, Node: Continue Statement, Next: Next Statement, Prev: Break Statement, Up: Statements + +6.4.7 The `continue' Statement +------------------------------ + +As with `break', the `continue' statement is used only inside `for', +`while', and `do' loops. It skips over the rest of the loop body, +causing the next cycle around the loop to begin immediately. Contrast +this with `break', which jumps out of the loop altogether. + + The `continue' statement in a `for' loop directs `awk' to skip the +rest of the body of the loop and resume execution with the +increment-expression of the `for' statement. The following program +illustrates this fact: + + BEGIN { + for (x = 0; x <= 20; x++) { + if (x == 5) + continue + printf "%d ", x + } + print "" + } + +This program prints all the numbers from 0 to 20--except for 5, for +which the `printf' is skipped. Because the increment `x++' is not +skipped, `x' does not remain stuck at 5. Contrast the `for' loop from +the previous example with the following `while' loop: + + BEGIN { + x = 0 + while (x <= 20) { + if (x == 5) + continue + printf "%d ", x + x++ + } + print "" + } + +This program loops forever once `x' reaches 5. + + The `continue' statement has no meaning when used outside the body of +a loop. Historical versions of `awk' treated a `continue' statement +outside a loop the same way they treated a `break' statement outside a +loop: as if it were a `next' statement (*note Next Statement::). +Recent versions of Unix `awk' no longer work this way, and `gawk' +allows it only if `--traditional' is specified on the command line +(*note Options::). Just like the `break' statement, the POSIX standard +specifies that `continue' should only be used inside the body of a loop. +(d.c.) + + +File: gawk.info, Node: Next Statement, Next: Nextfile Statement, Prev: Continue Statement, Up: Statements + +6.4.8 The `next' Statement +-------------------------- + +The `next' statement forces `awk' to immediately stop processing the +current record and go on to the next record. This means that no +further rules are executed for the current record, and the rest of the +current rule's action isn't executed. + + Contrast this with the effect of the `getline' function (*note +Getline::). That also causes `awk' to read the next record +immediately, but it does not alter the flow of control in any way +(i.e., the rest of the current action executes with a new input record). + + At the highest level, `awk' program execution is a loop that reads +an input record and then tests each rule's pattern against it. If you +think of this loop as a `for' statement whose body contains the rules, +then the `next' statement is analogous to a `continue' statement. It +skips to the end of the body of this implicit loop and executes the +increment (which reads another record). + + For example, suppose an `awk' program works only on records with +four fields, and it shouldn't fail when given bad input. To avoid +complicating the rest of the program, write a "weed out" rule near the +beginning, in the following manner: + + NF != 4 { + err = sprintf("%s:%d: skipped: NF != 4\n", FILENAME, FNR) + print err > "/dev/stderr" + next + } + +Because of the `next' statement, the program's subsequent rules won't +see the bad record. The error message is redirected to the standard +error output stream, as error messages should be. For more detail see +*note Special Files::. + + According to the POSIX standard, the behavior is undefined if the +`next' statement is used in a `BEGIN' or `END' rule. `gawk' treats it +as a syntax error. Although POSIX permits it, some other `awk' +implementations don't allow the `next' statement inside function bodies +(*note User-defined::). Just as with any other `next' statement, a +`next' statement inside a function body reads the next record and +starts processing it with the first rule in the program. If the `next' +statement causes the end of the input to be reached, then the code in +any `END' rules is executed. *Note BEGIN/END::. + + +File: gawk.info, Node: Nextfile Statement, Next: Exit Statement, Prev: Next Statement, Up: Statements + +6.4.9 Using `gawk''s `nextfile' Statement +----------------------------------------- + +`gawk' provides the `nextfile' statement, which is similar to the +`next' statement. However, instead of abandoning processing of the +current record, the `nextfile' statement instructs `gawk' to stop +processing the current data file. + + The `nextfile' statement is a `gawk' extension. In most other `awk' +implementations, or if `gawk' is in compatibility mode (*note +Options::), `nextfile' is not special. + + Upon execution of the `nextfile' statement, `FILENAME' is updated to +the name of the next data file listed on the command line, `FNR' is +reset to one, `ARGIND' is incremented, and processing starts over with +the first rule in the program. (`ARGIND' hasn't been introduced yet. +*Note Built-in Variables::.) If the `nextfile' statement causes the +end of the input to be reached, then the code in any `END' rules is +executed. *Note BEGIN/END::. + + The `nextfile' statement is useful when there are many data files to +process but it isn't necessary to process every record in every file. +Normally, in order to move on to the next data file, a program has to +continue scanning the unwanted records. The `nextfile' statement +accomplishes this much more efficiently. + + While one might think that `close(FILENAME)' would accomplish the +same as `nextfile', this isn't true. `close' is reserved for closing +files, pipes, and coprocesses that are opened with redirections. It is +not related to the main processing that `awk' does with the files +listed in `ARGV'. + + If it's necessary to use an `awk' version that doesn't support +`nextfile', see *note Nextfile Function::, for a user-defined function +that simulates the `nextfile' statement. + + The current version of the Bell Laboratories `awk' (*note Other +Versions::) also supports `nextfile'. However, it doesn't allow the +`nextfile' statement inside function bodies (*note User-defined::). +`gawk' does; a `nextfile' inside a function body reads the next record +and starts processing it with the first rule in the program, just as +any other `nextfile' statement. + + *Caution:* Versions of `gawk' prior to 3.0 used two words (`next +file') for the `nextfile' statement. In version 3.0, this was changed +to one word, because the treatment of `file' was inconsistent. When it +appeared after `next', `file' was a keyword; otherwise, it was a +regular identifier. The old usage is no longer accepted; `next file' +generates a syntax error. + + +File: gawk.info, Node: Exit Statement, Prev: Nextfile Statement, Up: Statements + +6.4.10 The `exit' Statement +--------------------------- + +The `exit' statement causes `awk' to immediately stop executing the +current rule and to stop processing input; any remaining input is +ignored. The `exit' statement is written as follows: + + exit [RETURN CODE] + + When an `exit' statement is executed from a `BEGIN' rule, the +program stops processing everything immediately. No input records are +read. However, if an `END' rule is present, as part of executing the +`exit' statement, the `END' rule is executed (*note BEGIN/END::). If +`exit' is used as part of an `END' rule, it causes the program to stop +immediately. + + An `exit' statement that is not part of a `BEGIN' or `END' rule +stops the execution of any further automatic rules for the current +record, skips reading any remaining input records, and executes the +`END' rule if there is one. + + In such a case, if you don't want the `END' rule to do its job, set +a variable to nonzero before the `exit' statement and check that +variable in the `END' rule. *Note Assert Function::, for an example +that does this. + + If an argument is supplied to `exit', its value is used as the exit +status code for the `awk' process. If no argument is supplied, `exit' +returns status zero (success). In the case where an argument is +supplied to a first `exit' statement, and then `exit' is called a +second time from an `END' rule with no argument, `awk' uses the +previously supplied exit value. (d.c.) + + For example, suppose an error condition occurs that is difficult or +impossible to handle. Conventionally, programs report this by exiting +with a nonzero status. An `awk' program can do this using an `exit' +statement with a nonzero argument, as shown in the following example: + + BEGIN { + if (("date" | getline date_now) <= 0) { + print "Can't get system date" > "/dev/stderr" + exit 1 + } + print "current date is", date_now + close("date") + } + + +File: gawk.info, Node: Built-in Variables, Prev: Statements, Up: Patterns and Actions + +6.5 Built-in Variables +====================== + +Most `awk' variables are available to use for your own purposes; they +never change unless your program assigns values to them, and they never +affect anything unless your program examines them. However, a few +variables in `awk' have special built-in meanings. `awk' examines some +of these automatically, so that they enable you to tell `awk' how to do +certain things. Others are set automatically by `awk', so that they +carry information from the internal workings of `awk' to your program. + + This minor node documents all the built-in variables of `gawk', most +of which are also documented in the chapters describing their areas of +activity. + +* Menu: + +* User-modified:: Built-in variables that you change to control + `awk'. +* Auto-set:: Built-in variables where `awk' gives + you information. +* ARGC and ARGV:: Ways to use `ARGC' and `ARGV'. + + +File: gawk.info, Node: User-modified, Next: Auto-set, Up: Built-in Variables + +6.5.1 Built-in Variables That Control `awk' +------------------------------------------- + +The following is an alphabetical list of variables that you can change +to control how `awk' does certain things. The variables that are +specific to `gawk' are marked with a pound sign (`#'). + +`BINMODE #' + On non-POSIX systems, this variable specifies use of binary mode + for all I/O. Numeric values of one, two, or three specify that + input files, output files, or all files, respectively, should use + binary I/O. Alternatively, string values of `"r"' or `"w"' + specify that input files and output files, respectively, should + use binary I/O. A string value of `"rw"' or `"wr"' indicates that + all files should use binary I/O. Any other string value is + equivalent to `"rw"', but `gawk' generates a warning message. + `BINMODE' is described in more detail in *note PC Using::. + + This variable is a `gawk' extension. In other `awk' + implementations (except `mawk', *note Other Versions::), or if + `gawk' is in compatibility mode (*note Options::), it is not + special. + +`CONVFMT' + This string controls conversion of numbers to strings (*note + Conversion::). It works by being passed, in effect, as the first + argument to the `sprintf' function (*note String Functions::). + Its default value is `"%.6g"'. `CONVFMT' was introduced by the + POSIX standard. + +`FIELDWIDTHS #' + This is a space-separated list of columns that tells `gawk' how to + split input with fixed columnar boundaries. Assigning a value to + `FIELDWIDTHS' overrides the use of `FS' for field splitting. + *Note Constant Size::, for more information. + + If `gawk' is in compatibility mode (*note Options::), then + `FIELDWIDTHS' has no special meaning, and field-splitting + operations occur based exclusively on the value of `FS'. + +`FS' + This is the input field separator (*note Field Separators::). The + value is a single-character string or a multi-character regular + expression that matches the separations between fields in an input + record. If the value is the null string (`""'), then each + character in the record becomes a separate field. (This behavior + is a `gawk' extension. POSIX `awk' does not specify the behavior + when `FS' is the null string.) + + The default value is `" "', a string consisting of a single space. + As a special exception, this value means that any sequence of + spaces, tabs, and/or newlines is a single separator.(1) It also + causes spaces, tabs, and newlines at the beginning and end of a + record to be ignored. + + You can set the value of `FS' on the command line using the `-F' + option: + + awk -F, 'PROGRAM' INPUT-FILES + + If `gawk' is using `FIELDWIDTHS' for field splitting, assigning a + value to `FS' causes `gawk' to return to the normal, `FS'-based + field splitting. An easy way to do this is to simply say `FS = + FS', perhaps with an explanatory comment. + +`IGNORECASE #' + If `IGNORECASE' is nonzero or non-null, then all string comparisons + and all regular expression matching are case independent. Thus, + regexp matching with `~' and `!~', as well as the `gensub', + `gsub', `index', `match', `split', and `sub' functions, record + termination with `RS', and field splitting with `FS', all ignore + case when doing their particular regexp operations. However, the + value of `IGNORECASE' does _not_ affect array subscripting and it + does not affect field splitting when using a single-character + field separator. *Note Case-sensitivity::. + + If `gawk' is in compatibility mode (*note Options::), then + `IGNORECASE' has no special meaning. Thus, string and regexp + operations are always case-sensitive. + +`LINT #' + When this variable is true (nonzero or non-null), `gawk' behaves + as if the `--lint' command-line option is in effect. (*note + Options::). With a value of `"fatal"', lint warnings become fatal + errors. With a value of `"invalid"', only warnings about things + that are actually invalid are issued. (This is not fully + implemented yet.) Any other true value prints nonfatal warnings. + Assigning a false value to `LINT' turns off the lint warnings. + + This variable is a `gawk' extension. It is not special in other + `awk' implementations. Unlike the other special variables, + changing `LINT' does affect the production of lint warnings, even + if `gawk' is in compatibility mode. Much as the `--lint' and + `--traditional' options independently control different aspects of + `gawk''s behavior, the control of lint warnings during program + execution is independent of the flavor of `awk' being executed. + +`OFMT' + This string controls conversion of numbers to strings (*note + Conversion::) for printing with the `print' statement. It works + by being passed as the first argument to the `sprintf' function + (*note String Functions::). Its default value is `"%.6g"'. + Earlier versions of `awk' also used `OFMT' to specify the format + for converting numbers to strings in general expressions; this is + now done by `CONVFMT'. + +`OFS' + This is the output field separator (*note Output Separators::). + It is output between the fields printed by a `print' statement. + Its default value is `" "', a string consisting of a single space. + +`ORS' + This is the output record separator. It is output at the end of + every `print' statement. Its default value is `"\n"', the newline + character. (*Note Output Separators::.) + +`RS' + This is `awk''s input record separator. Its default value is a + string containing a single newline character, which means that an + input record consists of a single line of text. It can also be + the null string, in which case records are separated by runs of + blank lines. If it is a regexp, records are separated by matches + of the regexp in the input text. (*Note Records::.) + + The ability for `RS' to be a regular expression is a `gawk' + extension. In most other `awk' implementations, or if `gawk' is + in compatibility mode (*note Options::), just the first character + of `RS''s value is used. + +`SUBSEP' + This is the subscript separator. It has the default value of + `"\034"' and is used to separate the parts of the indices of a + multidimensional array. Thus, the expression `foo["A", "B"]' + really accesses `foo["A\034B"]' (*note Multi-dimensional::). + +`TEXTDOMAIN #' + This variable is used for internationalization of programs at the + `awk' level. It sets the default text domain for specially marked + string constants in the source text, as well as for the + `dcgettext', `dcngettext' and `bindtextdomain' functions (*note + Internationalization::). The default value of `TEXTDOMAIN' is + `"messages"'. + + This variable is a `gawk' extension. In other `awk' + implementations, or if `gawk' is in compatibility mode (*note + Options::), it is not special. + + ---------- Footnotes ---------- + + (1) In POSIX `awk', newline does not count as whitespace. + + +File: gawk.info, Node: Auto-set, Next: ARGC and ARGV, Prev: User-modified, Up: Built-in Variables + +6.5.2 Built-in Variables That Convey Information +------------------------------------------------ + +The following is an alphabetical list of variables that `awk' sets +automatically on certain occasions in order to provide information to +your program. The variables that are specific to `gawk' are marked +with a pound sign (`#'). + +`ARGC, ARGV' + The command-line arguments available to `awk' programs are stored + in an array called `ARGV'. `ARGC' is the number of command-line + arguments present. *Note Other Arguments::. Unlike most `awk' + arrays, `ARGV' is indexed from 0 to `ARGC' - 1. In the following + example: + + $ awk 'BEGIN { + > for (i = 0; i < ARGC; i++) + > print ARGV[i] + > }' inventory-shipped BBS-list + -| awk + -| inventory-shipped + -| BBS-list + + `ARGV[0]' contains `"awk"', `ARGV[1]' contains + `"inventory-shipped"', and `ARGV[2]' contains `"BBS-list"'. The + value of `ARGC' is three, one more than the index of the last + element in `ARGV', because the elements are numbered from zero. + + The names `ARGC' and `ARGV', as well as the convention of indexing + the array from 0 to `ARGC' - 1, are derived from the C language's + method of accessing command-line arguments. + + The value of `ARGV[0]' can vary from system to system. Also, you + should note that the program text is _not_ included in `ARGV', nor + are any of `awk''s command-line options. *Note ARGC and ARGV::, + for information about how `awk' uses these variables. + +`ARGIND #' + The index in `ARGV' of the current file being processed. Every + time `gawk' opens a new data file for processing, it sets `ARGIND' + to the index in `ARGV' of the file name. When `gawk' is + processing the input files, `FILENAME == ARGV[ARGIND]' is always + true. + + This variable is useful in file processing; it allows you to tell + how far along you are in the list of data files as well as to + distinguish between successive instances of the same file name on + the command line. + + While you can change the value of `ARGIND' within your `awk' + program, `gawk' automatically sets it to a new value when the next + file is opened. + + This variable is a `gawk' extension. In other `awk' + implementations, or if `gawk' is in compatibility mode (*note + Options::), it is not special. + +`ENVIRON' + An associative array that contains the values of the environment. + The array indices are the environment variable names; the elements + are the values of the particular environment variables. For + example, `ENVIRON["HOME"]' might be `/home/arnold'. Changing this + array does not affect the environment passed on to any programs + that `awk' may spawn via redirection or the `system' function. + + Some operating systems may not have environment variables. On + such systems, the `ENVIRON' array is empty (except for + `ENVIRON["AWKPATH"]', *note AWKPATH Variable::). + +`ERRNO #' + If a system error occurs during a redirection for `getline', + during a read for `getline', or during a `close' operation, then + `ERRNO' contains a string describing the error. + + `ERRNO' works similarly to the C variable `errno'. In particular + `gawk' _never_ clears it (sets it to zero or `""'). Thus, you + should only expect its value to be meaningful when an I/O + operation returns a failure value, such as `getline' returning -1. + You are, of course, free to clear it yourself before doing an I/O + operation. + + This variable is a `gawk' extension. In other `awk' + implementations, or if `gawk' is in compatibility mode (*note + Options::), it is not special. + +`FILENAME' + The name of the file that `awk' is currently reading. When no + data files are listed on the command line, `awk' reads from the + standard input and `FILENAME' is set to `"-"'. `FILENAME' is + changed each time a new file is read (*note Reading Files::). + Inside a `BEGIN' rule, the value of `FILENAME' is `""', since + there are no input files being processed yet.(1) (d.c.) Note, + though, that using `getline' (*note Getline::) inside a `BEGIN' + rule can give `FILENAME' a value. + +`FNR' + The current record number in the current file. `FNR' is + incremented each time a new record is read (*note Getline::). It + is reinitialized to zero each time a new input file is started. + +`NF' + The number of fields in the current input record. `NF' is set + each time a new record is read, when a new field is created or + when `$0' changes (*note Fields::). + + Unlike most of the variables described in this node, assigning a + value to `NF' has the potential to affect `awk''s internal + workings. In particular, assignments to `NF' can be used to + create or remove fields from the current record: *Note Changing + Fields::. + +`NR' + The number of input records `awk' has processed since the + beginning of the program's execution (*note Records::). `NR' is + incremented each time a new record is read. + +`PROCINFO #' + The elements of this array provide access to information about the + running `awk' program. The following elements (listed + alphabetically) are guaranteed to be available: + + `PROCINFO["egid"]' + The value of the `getegid' system call. + + `PROCINFO["euid"]' + The value of the `geteuid' system call. + + `PROCINFO["FS"]' + This is `"FS"' if field splitting with `FS' is in effect, or + it is `"FIELDWIDTHS"' if field splitting with `FIELDWIDTHS' + is in effect. + + `PROCINFO["gid"]' + The value of the `getgid' system call. + + `PROCINFO["pgrpid"]' + The process group ID of the current process. + + `PROCINFO["pid"]' + The process ID of the current process. + + `PROCINFO["ppid"]' + The parent process ID of the current process. + + `PROCINFO["uid"]' + The value of the `getuid' system call. + + `PROCINFO["version"]' + The version of `gawk'. This is available from version 3.1.4 + and later. + + On some systems, there may be elements in the array, `"group1"' + through `"groupN"' for some N. N is the number of supplementary + groups that the process has. Use the `in' operator to test for + these elements (*note Reference to Elements::). + + This array is a `gawk' extension. In other `awk' implementations, + or if `gawk' is in compatibility mode (*note Options::), it is not + special. + +`RLENGTH' + The length of the substring matched by the `match' function (*note + String Functions::). `RLENGTH' is set by invoking the `match' + function. Its value is the length of the matched string, or -1 if + no match is found. + +`RSTART' + The start-index in characters of the substring that is matched by + the `match' function (*note String Functions::). `RSTART' is set + by invoking the `match' function. Its value is the position of + the string where the matched substring starts, or zero if no match + was found. + +`RT #' + This is set each time a record is read. It contains the input text + that matched the text denoted by `RS', the record separator. + + This variable is a `gawk' extension. In other `awk' + implementations, or if `gawk' is in compatibility mode (*note + Options::), it is not special. + +Advanced Notes: Changing `NR' and `FNR' +--------------------------------------- + +`awk' increments `NR' and `FNR' each time it reads a record, instead of +setting them to the absolute value of the number of records read. This +means that a program can change these variables and their new values +are incremented for each record. (d.c.) This is demonstrated in the +following example: + + $ echo '1 + > 2 + > 3 + > 4' | awk 'NR == 2 { NR = 17 } + > { print NR }' + -| 1 + -| 17 + -| 18 + -| 19 + +Before `FNR' was added to the `awk' language (*note V7/SVR3.1::), many +`awk' programs used this feature to track the number of records in a +file by resetting `NR' to zero when `FILENAME' changed. + + ---------- Footnotes ---------- + + (1) Some early implementations of Unix `awk' initialized `FILENAME' +to `"-"', even if there were data files to be processed. This behavior +was incorrect and should not be relied upon in your programs. + + +File: gawk.info, Node: ARGC and ARGV, Prev: Auto-set, Up: Built-in Variables + +6.5.3 Using `ARGC' and `ARGV' +----------------------------- + +*note Auto-set::, presented the following program describing the +information contained in `ARGC' and `ARGV': + + $ awk 'BEGIN { + > for (i = 0; i < ARGC; i++) + > print ARGV[i] + > }' inventory-shipped BBS-list + -| awk + -| inventory-shipped + -| BBS-list + +In this example, `ARGV[0]' contains `awk', `ARGV[1]' contains +`inventory-shipped', and `ARGV[2]' contains `BBS-list'. Notice that +the `awk' program is not entered in `ARGV'. The other special +command-line options, with their arguments, are also not entered. This +includes variable assignments done with the `-v' option (*note +Options::). Normal variable assignments on the command line _are_ +treated as arguments and do show up in the `ARGV' array: + + $ cat showargs.awk + -| BEGIN { + -| printf "A=%d, B=%d\n", A, B + -| for (i = 0; i < ARGC; i++) + -| printf "\tARGV[%d] = %s\n", i, ARGV[i] + -| } + -| END { printf "A=%d, B=%d\n", A, B } + $ awk -v A=1 -f showargs.awk B=2 /dev/null + -| A=1, B=0 + -| ARGV[0] = awk + -| ARGV[1] = B=2 + -| ARGV[2] = /dev/null + -| A=1, B=2 + + A program can alter `ARGC' and the elements of `ARGV'. Each time +`awk' reaches the end of an input file, it uses the next element of +`ARGV' as the name of the next input file. By storing a different +string there, a program can change which files are read. Use `"-"' to +represent the standard input. Storing additional elements and +incrementing `ARGC' causes additional files to be read. + + If the value of `ARGC' is decreased, that eliminates input files +from the end of the list. By recording the old value of `ARGC' +elsewhere, a program can treat the eliminated arguments as something +other than file names. + + To eliminate a file from the middle of the list, store the null +string (`""') into `ARGV' in place of the file's name. As a special +feature, `awk' ignores file names that have been replaced with the null +string. Another option is to use the `delete' statement to remove +elements from `ARGV' (*note Delete::). + + All of these actions are typically done in the `BEGIN' rule, before +actual processing of the input begins. *Note Split Program::, and see +*note Tee Program::, for examples of each way of removing elements from +`ARGV'. The following fragment processes `ARGV' in order to examine, +and then remove, command-line options: + + BEGIN { + for (i = 1; i < ARGC; i++) { + if (ARGV[i] == "-v") + verbose = 1 + else if (ARGV[i] == "-d") + debug = 1 + else if (ARGV[i] ~ /^-./) { + e = sprintf("%s: unrecognized option -- %c", + ARGV[0], substr(ARGV[i], 2, 1)) + print e > "/dev/stderr" + } else + break + delete ARGV[i] + } + } + + To actually get the options into the `awk' program, end the `awk' +options with `--' and then supply the `awk' program's options, in the +following manner: + + awk -f myprog -- -v -d file1 file2 ... + + This is not necessary in `gawk'. Unless `--posix' has been +specified, `gawk' silently puts any unrecognized options into `ARGV' +for the `awk' program to deal with. As soon as it sees an unknown +option, `gawk' stops looking for other options that it might otherwise +recognize. The previous example with `gawk' would be: + + gawk -f myprog -d -v file1 file2 ... + +Because `-d' is not a valid `gawk' option, it and the following `-v' +are passed on to the `awk' program. + + +File: gawk.info, Node: Arrays, Next: Functions, Prev: Patterns and Actions, Up: Top + +7 Arrays in `awk' +***************** + +An "array" is a table of values called "elements". The elements of an +array are distinguished by their indices. "Indices" may be either +numbers or strings. + + This major node describes how arrays work in `awk', how to use array +elements, how to scan through every element in an array, and how to +remove array elements. It also describes how `awk' simulates +multidimensional arrays, as well as some of the less obvious points +about array usage. The major node finishes with a discussion of +`gawk''s facility for sorting an array based on its indices. + + `awk' maintains a single set of names that may be used for naming +variables, arrays, and functions (*note User-defined::). Thus, you +cannot have a variable and an array with the same name in the same +`awk' program. + +* Menu: + +* Array Intro:: Introduction to Arrays +* Reference to Elements:: How to examine one element of an array. +* Assigning Elements:: How to change an element of an array. +* Array Example:: Basic Example of an Array +* Scanning an Array:: A variation of the `for' statement. It + loops through the indices of an array's + existing elements. +* Delete:: The `delete' statement removes an element + from an array. +* Numeric Array Subscripts:: How to use numbers as subscripts in + `awk'. +* Uninitialized Subscripts:: Using Uninitialized variables as subscripts. +* Multi-dimensional:: Emulating multidimensional arrays in + `awk'. +* Multi-scanning:: Scanning multidimensional arrays. +* Array Sorting:: Sorting array values and indices. + + +File: gawk.info, Node: Array Intro, Next: Reference to Elements, Up: Arrays + +7.1 Introduction to Arrays +========================== + +The `awk' language provides one-dimensional arrays for storing groups +of related strings or numbers. Every `awk' array must have a name. +Array names have the same syntax as variable names; any valid variable +name would also be a valid array name. But one name cannot be used in +both ways (as an array and as a variable) in the same `awk' program. + + Arrays in `awk' superficially resemble arrays in other programming +languages, but there are fundamental differences. In `awk', it isn't +necessary to specify the size of an array before starting to use it. +Additionally, any number or string in `awk', not just consecutive +integers, may be used as an array index. + + In most other languages, arrays must be "declared" before use, +including a specification of how many elements or components they +contain. In such languages, the declaration causes a contiguous block +of memory to be allocated for that many elements. Usually, an index in +the array must be a positive integer. For example, the index zero +specifies the first element in the array, which is actually stored at +the beginning of the block of memory. Index one specifies the second +element, which is stored in memory right after the first element, and +so on. It is impossible to add more elements to the array, because it +has room only for as many elements as given in the declaration. (Some +languages allow arbitrary starting and ending indices--e.g., `15 .. +27'--but the size of the array is still fixed when the array is +declared.) + + A contiguous array of four elements might look like the following +example, conceptually, if the element values are 8, `"foo"', `""', and +30: + + +---------+---------+--------+---------+ + | 8 | "foo" | "" | 30 | Value + +---------+---------+--------+---------+ + 0 1 2 3 Index + +Only the values are stored; the indices are implicit from the order of +the values. Here, 8 is the value at index zero, because 8 appears in the +position with zero elements before it. + + Arrays in `awk' are different--they are "associative". This means +that each array is a collection of pairs: an index and its corresponding +array element value: + + Element 3 Value 30 + Element 1 Value "foo" + Element 0 Value 8 + Element 2 Value "" + +The pairs are shown in jumbled order because their order is irrelevant. + + One advantage of associative arrays is that new pairs can be added +at any time. For example, suppose a tenth element is added to the array +whose value is `"number ten"'. The result is: + + Element 10 Value "number ten" + Element 3 Value 30 + Element 1 Value "foo" + Element 0 Value 8 + Element 2 Value "" + +Now the array is "sparse", which just means some indices are missing. +It has elements 0-3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or +9. + + Another consequence of associative arrays is that the indices don't +have to be positive integers. Any number, or even a string, can be an +index. For example, the following is an array that translates words +from English to French: + + Element "dog" Value "chien" + Element "cat" Value "chat" + Element "one" Value "un" + Element 1 Value "un" + +Here we decided to translate the number one in both spelled-out and +numeric form--thus illustrating that a single array can have both +numbers and strings as indices. In fact, array subscripts are always +strings; this is discussed in more detail in *note Numeric Array +Subscripts::. Here, the number `1' isn't double-quoted, since `awk' +automatically converts it to a string. + + The value of `IGNORECASE' has no effect upon array subscripting. +The identical string value used to store an array element must be used +to retrieve it. When `awk' creates an array (e.g., with the `split' +built-in function), that array's indices are consecutive integers +starting at one. (*Note String Functions::.) + + `awk''s arrays are efficient--the time to access an element is +independent of the number of elements in the array. + + +File: gawk.info, Node: Reference to Elements, Next: Assigning Elements, Prev: Array Intro, Up: Arrays + +7.2 Referring to an Array Element +================================= + +The principal way to use an array is to refer to one of its elements. +An array reference is an expression as follows: + + ARRAY[INDEX] + +Here, ARRAY is the name of an array. The expression INDEX is the index +of the desired element of the array. + + The value of the array reference is the current value of that array +element. For example, `foo[4.3]' is an expression for the element of +array `foo' at index `4.3'. + + A reference to an array element that has no recorded value yields a +value of `""', the null string. This includes elements that have not +been assigned any value as well as elements that have been deleted +(*note Delete::). Such a reference automatically creates that array +element, with the null string as its value. (In some cases, this is +unfortunate, because it might waste memory inside `awk'.) + + To determine whether an element exists in an array at a certain +index, use the following expression: + + INDEX in ARRAY + +This expression tests whether the particular index exists, without the +side effect of creating that element if it is not present. The +expression has the value one (true) if `ARRAY[INDEX]' exists and zero +(false) if it does not exist. For example, this statement tests +whether the array `frequencies' contains the index `2': + + if (2 in frequencies) + print "Subscript 2 is present." + + Note that this is _not_ a test of whether the array `frequencies' +contains an element whose _value_ is two. There is no way to do that +except to scan all the elements. Also, this _does not_ create +`frequencies[2]', while the following (incorrect) alternative does: + + if (frequencies[2] != "") + print "Subscript 2 is present." + + +File: gawk.info, Node: Assigning Elements, Next: Array Example, Prev: Reference to Elements, Up: Arrays + +7.3 Assigning Array Elements +============================ + +Array elements can be assigned values just like `awk' variables: + + ARRAY[SUBSCRIPT] = VALUE + +ARRAY is the name of an array. The expression SUBSCRIPT is the index +of the element of the array that is assigned a value. The expression +VALUE is the value to assign to that element of the array. + + +File: gawk.info, Node: Array Example, Next: Scanning an Array, Prev: Assigning Elements, Up: Arrays + +7.4 Basic Array Example +======================= + +The following program takes a list of lines, each beginning with a line +number, and prints them out in order of line number. The line numbers +are not in order when they are first read--instead they are scrambled. +This program sorts the lines by making an array using the line numbers +as subscripts. The program then prints out the lines in sorted order +of their numbers. It is a very simple program and gets confused upon +encountering repeated numbers, gaps, or lines that don't begin with a +number: + + { + if ($1 > max) + max = $1 + arr[$1] = $0 + } + + END { + for (x = 1; x <= max; x++) + print arr[x] + } + + The first rule keeps track of the largest line number seen so far; +it also stores each line into the array `arr', at an index that is the +line's number. The second rule runs after all the input has been read, +to print out all the lines. When this program is run with the +following input: + + 5 I am the Five man + 2 Who are you? The new number two! + 4 . . . And four on the floor + 1 Who is number one? + 3 I three you. + +Its output is: + + 1 Who is number one? + 2 Who are you? The new number two! + 3 I three you. + 4 . . . And four on the floor + 5 I am the Five man + + If a line number is repeated, the last line with a given number +overrides the others. Gaps in the line numbers can be handled with an +easy improvement to the program's `END' rule, as follows: + + END { + for (x = 1; x <= max; x++) + if (x in arr) + print arr[x] + } + + +File: gawk.info, Node: Scanning an Array, Next: Delete, Prev: Array Example, Up: Arrays + +7.5 Scanning All Elements of an Array +===================================== + +In programs that use arrays, it is often necessary to use a loop that +executes once for each element of an array. In other languages, where +arrays are contiguous and indices are limited to positive integers, +this is easy: all the valid indices can be found by counting from the +lowest index up to the highest. This technique won't do the job in +`awk', because any number or string can be an array index. So `awk' +has a special kind of `for' statement for scanning an array: + + for (VAR in ARRAY) + BODY + +This loop executes BODY once for each index in ARRAY that the program +has previously used, with the variable VAR set to that index. + + The following program uses this form of the `for' statement. The +first rule scans the input records and notes which words appear (at +least once) in the input, by storing a one into the array `used' with +the word as index. The second rule scans the elements of `used' to +find all the distinct words that appear in the input. It prints each +word that is more than 10 characters long and also prints the number of +such words. *Note String Functions::, for more information on the +built-in function `length'. + + # Record a 1 for each word that is used at least once + { + for (i = 1; i <= NF; i++) + used[$i] = 1 + } + + # Find number of distinct words more than 10 characters long + END { + for (x in used) + if (length(x) > 10) { + ++num_long_words + print x + } + print num_long_words, "words longer than 10 characters" + } + +*Note Word Sorting::, for a more detailed example of this type. + + The order in which elements of the array are accessed by this +statement is determined by the internal arrangement of the array +elements within `awk' and cannot be controlled or changed. This can +lead to problems if new elements are added to ARRAY by statements in +the loop body; it is not predictable whether the `for' loop will reach +them. Similarly, changing VAR inside the loop may produce strange +results. It is best to avoid such things. + + +File: gawk.info, Node: Delete, Next: Numeric Array Subscripts, Prev: Scanning an Array, Up: Arrays + +7.6 The `delete' Statement +========================== + +To remove an individual element of an array, use the `delete' statement: + + delete ARRAY[INDEX] + + Once an array element has been deleted, any value the element once +had is no longer available. It is as if the element had never been +referred to or had been given a value. The following is an example of +deleting elements in an array: + + for (i in frequencies) + delete frequencies[i] + +This example removes all the elements from the array `frequencies'. +Once an element is deleted, a subsequent `for' statement to scan the +array does not report that element and the `in' operator to check for +the presence of that element returns zero (i.e., false): + + delete foo[4] + if (4 in foo) + print "This will never be printed" + + It is important to note that deleting an element is _not_ the same +as assigning it a null value (the empty string, `""'). For example: + + foo[4] = "" + if (4 in foo) + print "This is printed, even though foo[4] is empty" + + It is not an error to delete an element that does not exist. If +`--lint' is provided on the command line (*note Options::), `gawk' +issues a warning message when an element that is not in the array is +deleted. + + All the elements of an array may be deleted with a single statement +by leaving off the subscript in the `delete' statement, as follows: + + delete ARRAY + + This ability is a `gawk' extension; it is not available in +compatibility mode (*note Options::). + + Using this version of the `delete' statement is about three times +more efficient than the equivalent loop that deletes each element one +at a time. + + The following statement provides a portable but nonobvious way to +clear out an array:(1) + + split("", array) + + The `split' function (*note String Functions::) clears out the +target array first. This call asks it to split apart the null string. +Because there is no data to split out, the function simply clears the +array and then returns. + + *Caution:* Deleting an array does not change its type; you cannot +delete an array and then use the array's name as a scalar (i.e., a +regular variable). For example, the following does not work: + + a[1] = 3; delete a; a = 3 + + ---------- Footnotes ---------- + + (1) Thanks to Michael Brennan for pointing this out. + + +File: gawk.info, Node: Numeric Array Subscripts, Next: Uninitialized Subscripts, Prev: Delete, Up: Arrays + +7.7 Using Numbers to Subscript Arrays +===================================== + +An important aspect about arrays to remember is that _array subscripts +are always strings_. When a numeric value is used as a subscript, it +is converted to a string value before being used for subscripting +(*note Conversion::). This means that the value of the built-in +variable `CONVFMT' can affect how your program accesses elements of an +array. For example: + + xyz = 12.153 + data[xyz] = 1 + CONVFMT = "%2.2f" + if (xyz in data) + printf "%s is in data\n", xyz + else + printf "%s is not in data\n", xyz + +This prints `12.15 is not in data'. The first statement gives `xyz' a +numeric value. Assigning to `data[xyz]' subscripts `data' with the +string value `"12.153"' (using the default conversion value of +`CONVFMT', `"%.6g"'). Thus, the array element `data["12.153"]' is +assigned the value one. The program then changes the value of +`CONVFMT'. The test `(xyz in data)' generates a new string value from +`xyz'--this time `"12.15"'--because the value of `CONVFMT' only allows +two significant digits. This test fails, since `"12.15"' is a +different string from `"12.153"'. + + According to the rules for conversions (*note Conversion::), integer +values are always converted to strings as integers, no matter what the +value of `CONVFMT' may happen to be. So the usual case of the +following works: + + for (i = 1; i <= maxsub; i++) + do something with array[i] + + The "integer values always convert to strings as integers" rule has +an additional consequence for array indexing. Octal and hexadecimal +constants (*note Nondecimal-numbers::) are converted internally into +numbers, and their original form is forgotten. This means, for +example, that `array[17]', `array[021]', and `array[0x11]' all refer to +the same element! + + As with many things in `awk', the majority of the time things work +as one would expect them to. But it is useful to have a precise +knowledge of the actual rules which sometimes can have a subtle effect +on your programs. + + +File: gawk.info, Node: Uninitialized Subscripts, Next: Multi-dimensional, Prev: Numeric Array Subscripts, Up: Arrays + +7.8 Using Uninitialized Variables as Subscripts +=============================================== + +Suppose it's necessary to write a program to print the input data in +reverse order. A reasonable attempt to do so (with some test data) +might look like this: + + $ echo 'line 1 + > line 2 + > line 3' | awk '{ l[lines] = $0; ++lines } + > END { + > for (i = lines-1; i >= 0; --i) + > print l[i] + > }' + -| line 3 + -| line 2 + + Unfortunately, the very first line of input data did not come out in +the output! + + At first glance, this program should have worked. The variable +`lines' is uninitialized, and uninitialized variables have the numeric +value zero. So, `awk' should have printed the value of `l[0]'. + + The issue here is that subscripts for `awk' arrays are _always_ +strings. Uninitialized variables, when used as strings, have the value +`""', not zero. Thus, `line 1' ends up stored in `l[""]'. The +following version of the program works correctly: + + { l[lines++] = $0 } + END { + for (i = lines - 1; i >= 0; --i) + print l[i] + } + + Here, the `++' forces `lines' to be numeric, thus making the "old +value" numeric zero. This is then converted to `"0"' as the array +subscript. + + Even though it is somewhat unusual, the null string (`""') is a +valid array subscript. (d.c.) `gawk' warns about the use of the null +string as a subscript if `--lint' is provided on the command line +(*note Options::). + + +File: gawk.info, Node: Multi-dimensional, Next: Multi-scanning, Prev: Uninitialized Subscripts, Up: Arrays + +7.9 Multidimensional Arrays +=========================== + +A multidimensional array is an array in which an element is identified +by a sequence of indices instead of a single index. For example, a +two-dimensional array requires two indices. The usual way (in most +languages, including `awk') to refer to an element of a two-dimensional +array named `grid' is with `grid[X,Y]'. + + Multidimensional arrays are supported in `awk' through concatenation +of indices into one string. `awk' converts the indices into strings +(*note Conversion::) and concatenates them together, with a separator +between them. This creates a single string that describes the values +of the separate indices. The combined string is used as a single index +into an ordinary, one-dimensional array. The separator used is the +value of the built-in variable `SUBSEP'. + + For example, suppose we evaluate the expression `foo[5,12] = "value"' +when the value of `SUBSEP' is `"@"'. The numbers 5 and 12 are +converted to strings and concatenated with an `@' between them, +yielding `"5@12"'; thus, the array element `foo["5@12"]' is set to +`"value"'. + + Once the element's value is stored, `awk' has no record of whether +it was stored with a single index or a sequence of indices. The two +expressions `foo[5,12]' and `foo[5 SUBSEP 12]' are always equivalent. + + The default value of `SUBSEP' is the string `"\034"', which contains +a nonprinting character that is unlikely to appear in an `awk' program +or in most input data. The usefulness of choosing an unlikely +character comes from the fact that index values that contain a string +matching `SUBSEP' can lead to combined strings that are ambiguous. +Suppose that `SUBSEP' is `"@"'; then `foo["a@b", "c"]' and +`foo["a", "b@c"]' are indistinguishable because both are actually +stored as `foo["a@b@c"]'. + + To test whether a particular index sequence exists in a +multidimensional array, use the same operator (`in') that is used for +single dimensional arrays. Write the whole sequence of indices in +parentheses, separated by commas, as the left operand: + + (SUBSCRIPT1, SUBSCRIPT2, ...) in ARRAY + + The following example treats its input as a two-dimensional array of +fields; it rotates this array 90 degrees clockwise and prints the +result. It assumes that all lines have the same number of elements: + + { + if (max_nf < NF) + max_nf = NF + max_nr = NR + for (x = 1; x <= NF; x++) + vector[x, NR] = $x + } + + END { + for (x = 1; x <= max_nf; x++) { + for (y = max_nr; y >= 1; --y) + printf("%s ", vector[x, y]) + printf("\n") + } + } + +When given the input: + + 1 2 3 4 5 6 + 2 3 4 5 6 1 + 3 4 5 6 1 2 + 4 5 6 1 2 3 + +the program produces the following output: + + 4 3 2 1 + 5 4 3 2 + 6 5 4 3 + 1 6 5 4 + 2 1 6 5 + 3 2 1 6 + + +File: gawk.info, Node: Multi-scanning, Next: Array Sorting, Prev: Multi-dimensional, Up: Arrays + +7.10 Scanning Multidimensional Arrays +===================================== + +There is no special `for' statement for scanning a "multidimensional" +array. There cannot be one, because, in truth, there are no +multidimensional arrays or elements--there is only a multidimensional +_way of accessing_ an array. + + However, if your program has an array that is always accessed as +multidimensional, you can get the effect of scanning it by combining +the scanning `for' statement (*note Scanning an Array::) with the +built-in `split' function (*note String Functions::). It works in the +following manner: + + for (combined in array) { + split(combined, separate, SUBSEP) + ... + } + +This sets the variable `combined' to each concatenated combined index +in the array, and splits it into the individual indices by breaking it +apart where the value of `SUBSEP' appears. The individual indices then +become the elements of the array `separate'. + + Thus, if a value is previously stored in `array[1, "foo"]'; then an +element with index `"1\034foo"' exists in `array'. (Recall that the +default value of `SUBSEP' is the character with code 034.) Sooner or +later, the `for' statement finds that index and does an iteration with +the variable `combined' set to `"1\034foo"'. Then the `split' function +is called as follows: + + split("1\034foo", separate, "\034") + +The result is to set `separate[1]' to `"1"' and `separate[2]' to +`"foo"'. Presto! The original sequence of separate indices is +recovered. + + +File: gawk.info, Node: Array Sorting, Prev: Multi-scanning, Up: Arrays + +7.11 Sorting Array Values and Indices with `gawk' +================================================= + +The order in which an array is scanned with a `for (i in array)' loop +is essentially arbitrary. In most `awk' implementations, sorting an +array requires writing a `sort' function. While this can be +educational for exploring different sorting algorithms, usually that's +not the point of the program. `gawk' provides the built-in `asort' and +`asorti' functions (*note String Functions::) for sorting arrays. For +example: + + POPULATE THE ARRAY data + n = asort(data) + for (i = 1; i <= n; i++) + DO SOMETHING WITH data[i] + + After the call to `asort', the array `data' is indexed from 1 to +some number N, the total number of elements in `data'. (This count is +`asort''s return value.) `data[1]' <= `data[2]' <= `data[3]', and so +on. The comparison of array elements is done using `gawk''s usual +comparison rules (*note Typing and Comparison::). + + An important side effect of calling `asort' is that _the array's +original indices are irrevocably lost_. As this isn't always +desirable, `asort' accepts a second argument: + + POPULATE THE ARRAY source + n = asort(source, dest) + for (i = 1; i <= n; i++) + DO SOMETHING WITH dest[i] + + In this case, `gawk' copies the `source' array into the `dest' array +and then sorts `dest', destroying its indices. However, the `source' +array is not affected. + + Often, what's needed is to sort on the values of the _indices_ +instead of the values of the elements. To do that, starting with +`gawk' 3.1.2, use the `asorti' function. The interface is identical to +that of `asort', except that the index values are used for sorting, and +become the values of the result array: + + { source[$0] = some_func($0) } + + END { + n = asorti(source, dest) + for (i = 1; i <= n; i++) { + DO SOMETHING WITH dest[i] Work with sorted indices directly + ... + DO SOMETHING WITH source[dest[i]] Access original array via sorted indices + } + } + + If your version of `gawk' is 3.1.0 or 3.1.1, you don't have +`asorti'. Instead, use a helper array to hold the sorted index values, +and then access the original array's elements. It works in the +following way: + + POPULATE THE ARRAY data + # copy indices + j = 1 + for (i in data) { + ind[j] = i # index value becomes element value + j++ + } + n = asort(ind) # index values are now sorted + for (i = 1; i <= n; i++) { + DO SOMETHING WITH ind[i] Work with sorted indices directly + ... + DO SOMETHING WITH data[ind[i]] Access original array via sorted indices + } + + Sorting the array by replacing the indices provides maximal +flexibility. To traverse the elements in decreasing order, use a loop +that goes from N down to 1, either over the elements or over the +indices. + + Copying array indices and elements isn't expensive in terms of +memory. Internally, `gawk' maintains "reference counts" to data. For +example, when `asort' copies the first array to the second one, there +is only one copy of the original array elements' data, even though both +arrays use the values. Similarly, when copying the indices from `data' +to `ind', there is only one copy of the actual index strings. + + We said previously that comparisons are done using `gawk''s "usual +comparison rules." Because `IGNORECASE' affects string comparisons, +the value of `IGNORECASE' also affects sorting for both `asort' and +`asorti'. Caveat Emptor. + + +File: gawk.info, Node: Functions, Next: Internationalization, Prev: Arrays, Up: Top + +8 Functions +*********** + +This major node describes `awk''s built-in functions, which fall into +three categories: numeric, string, and I/O. `gawk' provides additional +groups of functions to work with values that represent time, do bit +manipulation, and internationalize and localize programs. + + Besides the built-in functions, `awk' has provisions for writing new +functions that the rest of a program can use. The second half of this +major node describes these "user-defined" functions. + +* Menu: + +* Built-in:: Summarizes the built-in functions. +* User-defined:: Describes User-defined functions in detail. + + +File: gawk.info, Node: Built-in, Next: User-defined, Up: Functions + +8.1 Built-in Functions +====================== + +"Built-in" functions are always available for your `awk' program to +call. This minor node defines all the built-in functions in `awk'; +some of these are mentioned in other sections but are summarized here +for your convenience. + +* Menu: + +* Calling Built-in:: How to call built-in functions. +* Numeric Functions:: Functions that work with numbers, including + `int', `sin' and `rand'. +* String Functions:: Functions for string manipulation, such as + `split', `match' and `sprintf'. +* I/O Functions:: Functions for files and shell commands. +* Time Functions:: Functions for dealing with timestamps. +* Bitwise Functions:: Functions for bitwise operations. +* I18N Functions:: Functions for string translation. + + +File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Up: Built-in + +8.1.1 Calling Built-in Functions +-------------------------------- + +To call one of `awk''s built-in functions, write the name of the +function followed by arguments in parentheses. For example, `atan2(y + +z, 1)' is a call to the function `atan2' and has two arguments. + + Whitespace is ignored between the built-in function name and the +open parenthesis, and it is good practice to avoid using whitespace +there. User-defined functions do not permit whitespace in this way, and +it is easier to avoid mistakes by following a simple convention that +always works--no whitespace after a function name. + + Each built-in function accepts a certain number of arguments. In +some cases, arguments can be omitted. The defaults for omitted +arguments vary from function to function and are described under the +individual functions. In some `awk' implementations, extra arguments +given to built-in functions are ignored. However, in `gawk', it is a +fatal error to give extra arguments to a built-in function. + + When a function is called, expressions that create the function's +actual parameters are evaluated completely before the call is performed. +For example, in the following code fragment: + + i = 4 + j = sqrt(i++) + +the variable `i' is incremented to the value five before `sqrt' is +called with a value of four for its actual parameter. The order of +evaluation of the expressions used for the function's parameters is +undefined. Thus, avoid writing programs that assume that parameters +are evaluated from left to right or from right to left. For example: + + i = 5 + j = atan2(i++, i *= 2) + + If the order of evaluation is left to right, then `i' first becomes +6, and then 12, and `atan2' is called with the two arguments 6 and 12. +But if the order of evaluation is right to left, `i' first becomes 10, +then 11, and `atan2' is called with the two arguments 11 and 10. + + +File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev: Calling Built-in, Up: Built-in + +8.1.2 Numeric Functions +----------------------- + +The following list describes all of the built-in functions that work +with numbers. Optional parameters are enclosed in square +brackets ([ ]): + +`int(X)' + This returns the nearest integer to X, located between X and zero + and truncated toward zero. + + For example, `int(3)' is 3, `int(3.9)' is 3, `int(-3.9)' is -3, + and `int(-3)' is -3 as well. + +`sqrt(X)' + This returns the positive square root of X. `gawk' reports an + error if X is negative. Thus, `sqrt(4)' is 2. + +`exp(X)' + This returns the exponential of X (`e ^ X') or reports an error if + X is out of range. The range of values X can have depends on your + machine's floating-point representation. + +`log(X)' + This returns the natural logarithm of X, if X is positive; + otherwise, it reports an error. + +`sin(X)' + This returns the sine of X, with X in radians. + +`cos(X)' + This returns the cosine of X, with X in radians. + +`atan2(Y, X)' + This returns the arctangent of `Y / X' in radians. + +`rand()' + This returns a random number. The values of `rand' are uniformly + distributed between zero and one. The value could be zero but is + never one.(1) + + Often random integers are needed instead. Following is a + user-defined function that can be used to obtain a random + non-negative integer less than N: + + function randint(n) { + return int(n * rand()) + } + + The multiplication produces a random number greater than zero and + less than `n'. Using `int', this result is made into an integer + between zero and `n' - 1, inclusive. + + The following example uses a similar function to produce random + integers between one and N. This program prints a new random + number for each input record: + + # Function to roll a simulated die. + function roll(n) { return 1 + int(rand() * n) } + + # Roll 3 six-sided dice and + # print total number of points. + { + printf("%d points\n", + roll(6)+roll(6)+roll(6)) + } + + *Caution:* In most `awk' implementations, including `gawk', `rand' + starts generating numbers from the same starting number, or + "seed", each time you run `awk'. Thus, a program generates the + same results each time you run it. The numbers are random within + one `awk' run but predictable from run to run. This is convenient + for debugging, but if you want a program to do different things + each time it is used, you must change the seed to a value that is + different in each run. To do this, use `srand'. + +`srand([X])' + The function `srand' sets the starting point, or seed, for + generating random numbers to the value X. + + Each seed value leads to a particular sequence of random + numbers.(2) Thus, if the seed is set to the same value a second + time, the same sequence of random numbers is produced again. + + Different `awk' implementations use different random-number + generators internally. Don't expect the same `awk' program to + produce the same series of random numbers when executed by + different versions of `awk'. + + If the argument X is omitted, as in `srand()', then the current + date and time of day are used for a seed. This is the way to get + random numbers that are truly unpredictable. + + The return value of `srand' is the previous seed. This makes it + easy to keep track of the seeds in case you need to consistently + reproduce sequences of random numbers. + + ---------- Footnotes ---------- + + (1) The C version of `rand' is known to produce fairly poor +sequences of random numbers. However, nothing requires that an `awk' +implementation use the C `rand' to implement the `awk' version of +`rand'. In fact, `gawk' uses the BSD `random' function, which is +considerably better than `rand', to produce random numbers. + + (2) Computer-generated random numbers really are not truly random. +They are technically known as "pseudorandom." This means that while +the numbers in a sequence appear to be random, you can in fact generate +the same sequence of random numbers over and over again. + + +File: gawk.info, Node: String Functions, Next: I/O Functions, Prev: Numeric Functions, Up: Built-in + +8.1.3 String-Manipulation Functions +----------------------------------- + +The functions in this minor node look at or change the text of one or +more strings. Optional parameters are enclosed in square +brackets ([ ]). Those functions that are specific to `gawk' are marked +with a pound sign (`#'): + +* Menu: + +* Gory Details:: More than you want to know about `\' and + `&' with `sub', `gsub', and + `gensub'. + +`asort(SOURCE [, DEST]) #' + `asort' is a `gawk'-specific extension, returning the number of + elements in the array SOURCE. The contents of SOURCE are sorted + using `gawk''s normal rules for comparing values (in particular, + `IGNORECASE' affects the sorting) and the indices of the sorted + values of SOURCE are replaced with sequential integers starting + with one. If the optional array DEST is specified, then SOURCE is + duplicated into DEST. DEST is then sorted, leaving the indices of + SOURCE unchanged. For example, if the contents of `a' are as + follows: + + a["last"] = "de" + a["first"] = "sac" + a["middle"] = "cul" + + A call to `asort': + + asort(a) + + results in the following contents of `a': + + a[1] = "cul" + a[2] = "de" + a[3] = "sac" + + The `asort' function is described in more detail in *note Array + Sorting::. `asort' is a `gawk' extension; it is not available in + compatibility mode (*note Options::). + +`asorti(SOURCE [, DEST]) #' + `asorti' is a `gawk'-specific extension, returning the number of + elements in the array SOURCE. It works similarly to `asort', + however, the _indices_ are sorted, instead of the values. As + array indices are always strings, the comparison performed is + always a string comparison. (Here too, `IGNORECASE' affects the + sorting.) + + The `asorti' function is described in more detail in *note Array + Sorting::. It was added in `gawk' 3.1.2. `asorti' is a `gawk' + extension; it is not available in compatibility mode (*note + Options::). + +`index(IN, FIND)' + This searches the string IN for the first occurrence of the string + FIND, and returns the position in characters where that occurrence + begins in the string IN. Consider the following example: + + $ awk 'BEGIN { print index("peanut", "an") }' + -| 3 + + If FIND is not found, `index' returns zero. (Remember that string + indices in `awk' start at one.) + +`length([STRING])' + This returns the number of characters in STRING. If STRING is a + number, the length of the digit string representing that number is + returned. For example, `length("abcde")' is 5. By contrast, + `length(15 * 35)' works out to 3. In this example, 15 * 35 = 525, + and 525 is then converted to the string `"525"', which has three + characters. + + If no argument is supplied, `length' returns the length of `$0'. + + NOTE: In older versions of `awk', the `length' function could + be called without any parentheses. Doing so is marked as + "deprecated" in the POSIX standard. This means that while a + program can do this, it is a feature that can eventually be + removed from a future version of the standard. Therefore, + for programs to be maximally portable, always supply the + parentheses. + + Beginning with `gawk' version 3.2, when supplied an array + argument, the `length' function returns the number of elements in + the array. This is less useful than it might seem at first, as the + array is not guaranteed to be indexed from one to the number of + elements in it. If `--lint' is provided on the command line + (*note Options::), `gawk' warns that passing an array argument is + not portable. If `--posix' is supplied, using an array argument + is a fatal error (*note Arrays::). + +`match(STRING, REGEXP [, ARRAY])' + The `match' function searches STRING for the longest, leftmost + substring matched by the regular expression, REGEXP. It returns + the character position, or "index", at which that substring begins + (one, if it starts at the beginning of STRING). If no match is + found, it returns zero. + + The REGEXP argument may be either a regexp constant (`/.../') or a + string constant ("..."). In the latter case, the string is + treated as a regexp to be matched. *note Computed Regexps::, for a + discussion of the difference between the two forms, and the + implications for writing your program correctly. + + The order of the first two arguments is backwards from most other + string functions that work with regular expressions, such as `sub' + and `gsub'. It might help to remember that for `match', the order + is the same as for the `~' operator: `STRING ~ REGEXP'. + + The `match' function sets the built-in variable `RSTART' to the + index. It also sets the built-in variable `RLENGTH' to the length + in characters of the matched substring. If no match is found, + `RSTART' is set to zero, and `RLENGTH' to -1. + + For example: + + { + if ($1 == "FIND") + regex = $2 + else { + where = match($0, regex) + if (where != 0) + print "Match of", regex, "found at", + where, "in", $0 + } + } + + This program looks for lines that match the regular expression + stored in the variable `regex'. This regular expression can be + changed. If the first word on a line is `FIND', `regex' is + changed to be the second word on that line. Therefore, if given: + + FIND ru+n + My program runs + but not very quickly + FIND Melvin + JF+KM + This line is property of Reality Engineering Co. + Melvin was here. + + `awk' prints: + + Match of ru+n found at 12 in My program runs + Match of Melvin found at 1 in Melvin was here. + + If ARRAY is present, it is cleared, and then the 0th element of + ARRAY is set to the entire portion of STRING matched by REGEXP. + If REGEXP contains parentheses, the integer-indexed elements of + ARRAY are set to contain the portion of STRING matching the + corresponding parenthesized subexpression. For example: + + $ echo foooobazbarrrrr | + > gawk '{ match($0, /(fo+).+(bar*)/, arr) + > print arr[1], arr[2] }' + -| foooo barrrrr + + In addition, beginning with `gawk' 3.1.2, multidimensional + subscripts are available providing the start index and length of + each matched subexpression: + + $ echo foooobazbarrrrr | + > gawk '{ match($0, /(fo+).+(bar*)/, arr) + > print arr[1], arr[2] + > print arr[1, "start"], arr[1, "length"] + > print arr[2, "start"], arr[2, "length"] + > }' + -| foooo barrrrr + -| 1 5 + -| 9 7 + + There may not be subscripts for the start and index for every + parenthesized subexpressions, since they may not all have matched + text; thus they should be tested for with the `in' operator (*note + Reference to Elements::). + + The ARRAY argument to `match' is a `gawk' extension. In + compatibility mode (*note Options::), using a third argument is a + fatal error. + +`split(STRING, ARRAY [, FIELDSEP])' + This function divides STRING into pieces separated by FIELDSEP and + stores the pieces in ARRAY. The first piece is stored in + `ARRAY[1]', the second piece in `ARRAY[2]', and so forth. The + string value of the third argument, FIELDSEP, is a regexp + describing where to split STRING (much as `FS' can be a regexp + describing where to split input records). If FIELDSEP is omitted, + the value of `FS' is used. `split' returns the number of elements + created. + + The `split' function splits strings into pieces in a manner + similar to the way input lines are split into fields. For example: + + split("cul-de-sac", a, "-") + + splits the string `cul-de-sac' into three fields using `-' as the + separator. It sets the contents of the array `a' as follows: + + a[1] = "cul" + a[2] = "de" + a[3] = "sac" + + The value returned by this call to `split' is three. + + As with input field-splitting, when the value of FIELDSEP is + `" "', leading and trailing whitespace is ignored, and the elements + are separated by runs of whitespace. Also as with input + field-splitting, if FIELDSEP is the null string, each individual + character in the string is split into its own array element. + (This is a `gawk'-specific extension.) + + Note, however, that `RS' has no effect on the way `split' works. + Even though `RS = ""' causes newline to also be an input field + separator, this does not affect how `split' splits strings. + + Modern implementations of `awk', including `gawk', allow the third + argument to be a regexp constant (`/abc/') as well as a string. + (d.c.) The POSIX standard allows this as well. *note Computed + Regexps::, for a discussion of the difference between using a + string constant or a regexp constant, and the implications for + writing your program correctly. + + Before splitting the string, `split' deletes any previously + existing elements in the array ARRAY. + + If STRING is null, the array has no elements. (So this is a + portable way to delete an entire array with one statement. *Note + Delete::.) + + If STRING does not match FIELDSEP at all (but is not null), ARRAY + has one element only. The value of that element is the original + STRING. + +`sprintf(FORMAT, EXPRESSION1, ...)' + This returns (without printing) the string that `printf' would + have printed out with the same arguments (*note Printf::). For + example: + + pival = sprintf("pi = %.2f (approx.)", 22/7) + + assigns the string `"pi = 3.14 (approx.)"' to the variable `pival'. + +`strtonum(STR) #' + Examines STR and returns its numeric value. If STR begins with a + leading `0', `strtonum' assumes that STR is an octal number. If + STR begins with a leading `0x' or `0X', `strtonum' assumes that + STR is a hexadecimal number. For example: + + $ echo 0x11 | + > gawk '{ printf "%d\n", strtonum($1) }' + -| 17 + + Using the `strtonum' function is _not_ the same as adding zero to + a string value; the automatic coercion of strings to numbers works + only for decimal data, not for octal or hexadecimal.(1) + + Note also that `strtonum' uses the current locale's decimal point + for recognizing numbers. + + `strtonum' is a `gawk' extension; it is not available in + compatibility mode (*note Options::). + +`sub(REGEXP, REPLACEMENT [, TARGET])' + The `sub' function alters the value of TARGET. It searches this + value, which is treated as a string, for the leftmost, longest + substring matched by the regular expression REGEXP. Then the + entire string is changed by replacing the matched text with + REPLACEMENT. The modified string becomes the new value of TARGET. + + The REGEXP argument may be either a regexp constant (`/.../') or a + string constant ("..."). In the latter case, the string is + treated as a regexp to be matched. *note Computed Regexps::, for a + discussion of the difference between the two forms, and the + implications for writing your program correctly. + + This function is peculiar because TARGET is not simply used to + compute a value, and not just any expression will do--it must be a + variable, field, or array element so that `sub' can store a + modified value there. If this argument is omitted, then the + default is to use and alter `$0'.(2) For example: + + str = "water, water, everywhere" + sub(/at/, "ith", str) + + sets `str' to `"wither, water, everywhere"', by replacing the + leftmost longest occurrence of `at' with `ith'. + + The `sub' function returns the number of substitutions made (either + one or zero). + + If the special character `&' appears in REPLACEMENT, it stands for + the precise substring that was matched by REGEXP. (If the regexp + can match more than one string, then this precise substring may + vary.) For example: + + { sub(/candidate/, "& and his wife"); print } + + changes the first occurrence of `candidate' to `candidate and his + wife' on each input line. Here is another example: + + $ awk 'BEGIN { + > str = "daabaaa" + > sub(/a+/, "C&C", str) + > print str + > }' + -| dCaaCbaaa + + This shows how `&' can represent a nonconstant string and also + illustrates the "leftmost, longest" rule in regexp matching (*note + Leftmost Longest::). + + The effect of this special character (`&') can be turned off by + putting a backslash before it in the string. As usual, to insert + one backslash in the string, you must write two backslashes. + Therefore, write `\\&' in a string constant to include a literal + `&' in the replacement. For example, the following shows how to + replace the first `|' on each line with an `&': + + { sub(/\|/, "\\&"); print } + + As mentioned, the third argument to `sub' must be a variable, + field or array reference. Some versions of `awk' allow the third + argument to be an expression that is not an lvalue. In such a + case, `sub' still searches for the pattern and returns zero or + one, but the result of the substitution (if any) is thrown away + because there is no place to put it. Such versions of `awk' + accept expressions such as the following: + + sub(/USA/, "United States", "the USA and Canada") + + For historical compatibility, `gawk' accepts erroneous code, such + as in the previous example. However, using any other nonchangeable + object as the third parameter causes a fatal error and your program + will not run. + + Finally, if the REGEXP is not a regexp constant, it is converted + into a string, and then the value of that string is treated as the + regexp to match. + +`gsub(REGEXP, REPLACEMENT [, TARGET])' + This is similar to the `sub' function, except `gsub' replaces + _all_ of the longest, leftmost, _nonoverlapping_ matching + substrings it can find. The `g' in `gsub' stands for "global," + which means replace everywhere. For example: + + { gsub(/Britain/, "United Kingdom"); print } + + replaces all occurrences of the string `Britain' with `United + Kingdom' for all input records. + + The `gsub' function returns the number of substitutions made. If + the variable to search and alter (TARGET) is omitted, then the + entire input record (`$0') is used. As in `sub', the characters + `&' and `\' are special, and the third argument must be assignable. + +`gensub(REGEXP, REPLACEMENT, HOW [, TARGET]) #' + `gensub' is a general substitution function. Like `sub' and + `gsub', it searches the target string TARGET for matches of the + regular expression REGEXP. Unlike `sub' and `gsub', the modified + string is returned as the result of the function and the original + target string is _not_ changed. If HOW is a string beginning with + `g' or `G', then it replaces all matches of REGEXP with + REPLACEMENT. Otherwise, HOW is treated as a number that indicates + which match of REGEXP to replace. If no TARGET is supplied, `$0' + is used. + + `gensub' provides an additional feature that is not available in + `sub' or `gsub': the ability to specify components of a regexp in + the replacement text. This is done by using parentheses in the + regexp to mark the components and then specifying `\N' in the + replacement text, where N is a digit from 1 to 9. For example: + + $ gawk ' + > BEGIN { + > a = "abc def" + > b = gensub(/(.+) (.+)/, "\\2 \\1", "g", a) + > print b + > }' + -| def abc + + As with `sub', you must type two backslashes in order to get one + into the string. In the replacement text, the sequence `\0' + represents the entire matched text, as does the character `&'. + + The following example shows how you can use the third argument to + control which match of the regexp should be changed: + + $ echo a b c a b c | + > gawk '{ print gensub(/a/, "AA", 2) }' + -| a b c AA b c + + In this case, `$0' is used as the default target string. `gensub' + returns the new string as its result, which is passed directly to + `print' for printing. + + If the HOW argument is a string that does not begin with `g' or + `G', or if it is a number that is less than or equal to zero, only + one substitution is performed. If HOW is zero, `gawk' issues a + warning message. + + If REGEXP does not match TARGET, `gensub''s return value is the + original unchanged value of TARGET. + + `gensub' is a `gawk' extension; it is not available in + compatibility mode (*note Options::). + +`substr(STRING, START [, LENGTH])' + This returns a LENGTH-character-long substring of STRING, starting + at character number START. The first character of a string is + character number one.(3) For example, `substr("washington", 5, 3)' + returns `"ing"'. + + If LENGTH is not present, this function returns the whole suffix of + STRING that begins at character number START. For example, + `substr("washington", 5)' returns `"ington"'. The whole suffix is + also returned if LENGTH is greater than the number of characters + remaining in the string, counting from character START. + + If START is less than one, `substr' treats it as if it was one. + (POSIX doesn't specify what to do in this case: Unix `awk' acts + this way, and therefore `gawk' does too.) If START is greater + than the number of characters in the string, `substr' returns the + null string. Similarly, if LENGTH is present but less than or + equal to zero, the null string is returned. + + The string returned by `substr' _cannot_ be assigned. Thus, it is + a mistake to attempt to change a portion of a string, as shown in + the following example: + + string = "abcdef" + # try to get "abCDEf", won't work + substr(string, 3, 3) = "CDE" + + It is also a mistake to use `substr' as the third argument of + `sub' or `gsub': + + gsub(/xyz/, "pdq", substr($0, 5, 20)) # WRONG + + (Some commercial versions of `awk' do in fact let you use `substr' + this way, but doing so is not portable.) + + If you need to replace bits and pieces of a string, combine + `substr' with string concatenation, in the following manner: + + string = "abcdef" + ... + string = substr(string, 1, 2) "CDE" substr(string, 6) + +`tolower(STRING)' + This returns a copy of STRING, with each uppercase character in + the string replaced with its corresponding lowercase character. + Nonalphabetic characters are left unchanged. For example, + `tolower("MiXeD cAsE 123")' returns `"mixed case 123"'. + +`toupper(STRING)' + This returns a copy of STRING, with each lowercase character in + the string replaced with its corresponding uppercase character. + Nonalphabetic characters are left unchanged. For example, + `toupper("MiXeD cAsE 123")' returns `"MIXED CASE 123"'. + + ---------- Footnotes ---------- + + (1) Unless you use the `--non-decimal-data' option, which isn't +recommended. *Note Nondecimal Data::, for more information. + + (2) Note that this means that the record will first be regenerated +using the value of `OFS' if any fields have been changed, and that the +fields will be updated after the substitution, even if the operation is +a "no-op" such as `sub(/^/, "")'. + + (3) This is different from C and C++, in which the first character +is number zero. + + +File: gawk.info, Node: Gory Details, Up: String Functions + +8.1.3.1 More About `\' and `&' with `sub', `gsub', and `gensub' +............................................................... + +When using `sub', `gsub', or `gensub', and trying to get literal +backslashes and ampersands into the replacement text, you need to +remember that there are several levels of "escape processing" going on. + + First, there is the "lexical" level, which is when `awk' reads your +program and builds an internal copy of it that can be executed. Then +there is the runtime level, which is when `awk' actually scans the +replacement string to determine what to generate. + + At both levels, `awk' looks for a defined set of characters that can +come after a backslash. At the lexical level, it looks for the escape +sequences listed in *note Escape Sequences::. Thus, for every `\' that +`awk' processes at the runtime level, type two backslashes at the +lexical level. When a character that is not valid for an escape +sequence follows the `\', Unix `awk' and `gawk' both simply remove the +initial `\' and put the next character into the string. Thus, for +example, `"a\qb"' is treated as `"aqb"'. + + At the runtime level, the various functions handle sequences of `\' +and `&' differently. The situation is (sadly) somewhat complex. +Historically, the `sub' and `gsub' functions treated the two character +sequence `\&' specially; this sequence was replaced in the generated +text with a single `&'. Any other `\' within the REPLACEMENT string +that did not precede an `&' was passed through unchanged. This is +illustrated in *note table-sub-escapes::. + + You type `sub' sees `sub' generates + ------- --------- -------------- + `\&' `&' the matched text + `\\&' `\&' a literal `&' + `\\\&' `\&' a literal `&' + `\\\\&' `\\&' a literal `\&' + `\\\\\&' `\\&' a literal `\&' + `\\\\\\&' `\\\&' a literal `\\&' + `\\q' `\q' a literal `\q' + +Table 8.1: Historical Escape Sequence Processing for sub and gsub + +This table shows both the lexical-level processing, where an odd number +of backslashes becomes an even number at the runtime level, as well as +the runtime processing done by `sub'. (For the sake of simplicity, the +rest of the following tables only show the case of even numbers of +backslashes entered at the lexical level.) + + The problem with the historical approach is that there is no way to +get a literal `\' followed by the matched text. + + The 1992 POSIX standard attempted to fix this problem. That standard +says that `sub' and `gsub' look for either a `\' or an `&' after the +`\'. If either one follows a `\', that character is output literally. +The interpretation of `\' and `&' then becomes as shown in *note +table-sub-posix-92::. + + You type `sub' sees `sub' generates + ------- --------- -------------- + `&' `&' the matched text + `\\&' `\&' a literal `&' + `\\\\&' `\\&' a literal `\', then the matched text + `\\\\\\&' `\\\&' a literal `\&' + +Table 8.2: 1992 POSIX Rules for sub and gsub Escape Sequence Processing + +This appears to solve the problem. Unfortunately, the phrasing of the +standard is unusual. It says, in effect, that `\' turns off the special +meaning of any following character, but for anything other than `\' and +`&', such special meaning is undefined. This wording leads to two +problems: + + * Backslashes must now be doubled in the REPLACEMENT string, breaking + historical `awk' programs. + + * To make sure that an `awk' program is portable, _every_ character + in the REPLACEMENT string must be preceded with a backslash.(1) + + Because of the problems just listed, in 1996, the `gawk' maintainer +submitted proposed text for a revised standard that reverts to rules +that correspond more closely to the original existing practice. The +proposed rules have special cases that make it possible to produce a +`\' preceding the matched text. This is shown in *note +table-sub-proposed::. + + You type `sub' sees `sub' generates + ------- --------- -------------- + `\\\\\\&' `\\\&' a literal `\&' + `\\\\&' `\\&' a literal `\', followed by the matched text + `\\&' `\&' a literal `&' + `\\q' `\q' a literal `\q' + `\\\\' `\\' `\\' + +Table 8.3: Proposed rules for sub and backslash + + In a nutshell, at the runtime level, there are now three special +sequences of characters (`\\\&', `\\&' and `\&') whereas historically +there was only one. However, as in the historical case, any `\' that +is not part of one of these three sequences is not special and appears +in the output literally. + + `gawk' 3.0 and 3.1 follow these proposed POSIX rules for `sub' and +`gsub'. The POSIX standard took much longer to be revised than was +expected in 1996. The 2001 standard does not follow the above rules. +Instead, the rules there are somewhat simpler. The results are similar +except for one case. + + The 2001 POSIX rules state that `\&' in the replacement string +produces a literal `&', `\\' produces a literal `\', and `\' followed +by anything else is not special; the `\' is placed straight into the +output. These rules are presented in *note table-posix-2001-sub::. + + You type `sub' sees `sub' generates + ------- --------- -------------- + `\\\\\\&' `\\\&' a literal `\&' + `\\\\&' `\\&' a literal `\', followed by the matched text + `\\&' `\&' a literal `&' + `\\q' `\q' a literal `\q' + `\\\\' `\\' `\' + +Table 8.4: POSIX 2001 rules for sub + + The only case where the difference is noticeable is the last one: +`\\\\' is seen as `\\' and produces `\' instead of `\\'. + + Starting with version 3.1.4, `gawk' follows the POSIX rules when +`--posix' is specified (*note Options::). Otherwise, it continues to +follow the 1996 proposed rules, since, as of this writing, that has +been its behavior for over seven years. + + NOTE: At the next major release, `gawk' will switch to using the + POSIX 2001 rules by default. + + The rules for `gensub' are considerably simpler. At the runtime +level, whenever `gawk' sees a `\', if the following character is a +digit, then the text that matched the corresponding parenthesized +subexpression is placed in the generated output. Otherwise, no matter +what character follows the `\', it appears in the generated text and +the `\' does not, as shown in *note table-gensub-escapes::. + + You type `gensub' sees `gensub' generates + ------- ------------ ----------------- + `&' `&' the matched text + `\\&' `\&' a literal `&' + `\\\\' `\\' a literal `\' + `\\\\&' `\\&' a literal `\', then the matched text + `\\\\\\&' `\\\&' a literal `\&' + `\\q' `\q' a literal `q' + +Table 8.5: Escape Sequence Processing for gensub + + Because of the complexity of the lexical and runtime level processing +and the special cases for `sub' and `gsub', we recommend the use of +`gawk' and `gensub' when you have to do substitutions. + +Advanced Notes: Matching the Null String +---------------------------------------- + +In `awk', the `*' operator can match the null string. This is +particularly important for the `sub', `gsub', and `gensub' functions. +For example: + + $ echo abc | awk '{ gsub(/m*/, "X"); print }' + -| XaXbXcX + +Although this makes a certain amount of sense, it can be surprising. + + ---------- Footnotes ---------- + + (1) This consequence was certainly unintended. + + +File: gawk.info, Node: I/O Functions, Next: Time Functions, Prev: String Functions, Up: Built-in + +8.1.4 Input/Output Functions +---------------------------- + +The following functions relate to input/output (I/O). Optional +parameters are enclosed in square brackets ([ ]): + +`close(FILENAME [, HOW])' + Close the file FILENAME for input or output. Alternatively, the + argument may be a shell command that was used for creating a + coprocess, or for redirecting to or from a pipe; then the + coprocess or pipe is closed. *Note Close Files And Pipes::, for + more information. + + When closing a coprocess, it is occasionally useful to first close + one end of the two-way pipe and then to close the other. This is + done by providing a second argument to `close'. This second + argument should be one of the two string values `"to"' or `"from"', + indicating which end of the pipe to close. Case in the string does + not matter. *Note Two-way I/O::, which discusses this feature in + more detail and gives an example. + +`fflush([FILENAME])' + Flush any buffered output associated with FILENAME, which is + either a file opened for writing or a shell command for + redirecting output to a pipe or coprocess. + + Many utility programs "buffer" their output; i.e., they save + information to write to a disk file or terminal in memory until + there is enough for it to be worthwhile to send the data to the + output device. This is often more efficient than writing every + little bit of information as soon as it is ready. However, + sometimes it is necessary to force a program to "flush" its + buffers; that is, write the information to its destination, even + if a buffer is not full. This is the purpose of the `fflush' + function--`gawk' also buffers its output and the `fflush' function + forces `gawk' to flush its buffers. + + `fflush' was added to the Bell Laboratories research version of + `awk' in 1994; it is not part of the POSIX standard and is not + available if `--posix' has been specified on the command line + (*note Options::). + + `gawk' extends the `fflush' function in two ways. The first is to + allow no argument at all. In this case, the buffer for the + standard output is flushed. The second is to allow the null string + (`""') as the argument. In this case, the buffers for _all_ open + output files and pipes are flushed. + + `fflush' returns zero if the buffer is successfully flushed; + otherwise, it returns -1. In the case where all buffers are + flushed, the return value is zero only if all buffers were flushed + successfully. Otherwise, it is -1, and `gawk' warns about the + problem FILENAME. + + `gawk' also issues a warning message if you attempt to flush a + file or pipe that was opened for reading (such as with `getline'), + or if FILENAME is not an open file, pipe, or coprocess. In such a + case, `fflush' returns -1, as well. + +`system(COMMAND)' + Executes operating-system commands and then returns to the `awk' + program. The `system' function executes the command given by the + string COMMAND. It returns the status returned by the command + that was executed as its value. + + For example, if the following fragment of code is put in your `awk' + program: + + END { + system("date | mail -s 'awk run done' root") + } + + the system administrator is sent mail when the `awk' program + finishes processing input and begins its end-of-input processing. + + Note that redirecting `print' or `printf' into a pipe is often + enough to accomplish your task. If you need to run many commands, + it is more efficient to simply print them down a pipeline to the + shell: + + while (MORE STUFF TO DO) + print COMMAND | "/bin/sh" + close("/bin/sh") + + However, if your `awk' program is interactive, `system' is useful + for cranking up large self-contained programs, such as a shell or + an editor. Some operating systems cannot implement the `system' + function. `system' causes a fatal error if it is not supported. + +Advanced Notes: Interactive Versus Noninteractive Buffering +----------------------------------------------------------- + +As a side point, buffering issues can be even more confusing, depending +upon whether your program is "interactive", i.e., communicating with a +user sitting at a keyboard.(1) + + Interactive programs generally "line buffer" their output; i.e., they +write out every line. Noninteractive programs wait until they have a +full buffer, which may be many lines of output. Here is an example of +the difference: + + $ awk '{ print $1 + $2 }' + 1 1 + -| 2 + 2 3 + -| 5 + Ctrl-d + +Each line of output is printed immediately. Compare that behavior with +this example: + + $ awk '{ print $1 + $2 }' | cat + 1 1 + 2 3 + Ctrl-d + -| 2 + -| 5 + +Here, no output is printed until after the `Ctrl-d' is typed, because +it is all buffered and sent down the pipe to `cat' in one shot. + +Advanced Notes: Controlling Output Buffering with `system' +---------------------------------------------------------- + +The `fflush' function provides explicit control over output buffering +for individual files and pipes. However, its use is not portable to +many other `awk' implementations. An alternative method to flush output +buffers is to call `system' with a null string as its argument: + + system("") # flush output + +`gawk' treats this use of the `system' function as a special case and +is smart enough not to run a shell (or other command interpreter) with +the empty command. Therefore, with `gawk', this idiom is not only +useful, it is also efficient. While this method should work with other +`awk' implementations, it does not necessarily avoid starting an +unnecessary shell. (Other implementations may only flush the buffer +associated with the standard output and not necessarily all buffered +output.) + + If you think about what a programmer expects, it makes sense that +`system' should flush any pending output. The following program: + + BEGIN { + print "first print" + system("echo system echo") + print "second print" + } + +must print: + + first print + system echo + second print + +and not: + + system echo + first print + second print + + If `awk' did not flush its buffers before calling `system', you +would see the latter (undesirable) output. + + ---------- Footnotes ---------- + + (1) A program is interactive if the standard output is connected to +a terminal device. + + +File: gawk.info, Node: Time Functions, Next: Bitwise Functions, Prev: I/O Functions, Up: Built-in + +8.1.5 Using `gawk''s Timestamp Functions +---------------------------------------- + +`awk' programs are commonly used to process log files containing +timestamp information, indicating when a particular log record was +written. Many programs log their timestamp in the form returned by the +`time' system call, which is the number of seconds since a particular +epoch. On POSIX-compliant systems, it is the number of seconds since +1970-01-01 00:00:00 UTC, not counting leap seconds.(1) All known +POSIX-compliant systems support timestamps from 0 through 2^31 - 1, +which is sufficient to represent times through 2038-01-19 03:14:07 UTC. +Many systems support a wider range of timestamps, including negative +timestamps that represent times before the epoch. + + In order to make it easier to process such log files and to produce +useful reports, `gawk' provides the following functions for working +with timestamps. They are `gawk' extensions; they are not specified in +the POSIX standard, nor are they in any other known version of `awk'.(2) +Optional parameters are enclosed in square brackets ([ ]): + +`systime()' + This function returns the current time as the number of seconds + since the system epoch. On POSIX systems, this is the number of + seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. + It may be a different number on other systems. + +`mktime(DATESPEC)' + This function turns DATESPEC into a timestamp in the same form as + is returned by `systime'. It is similar to the function of the + same name in ISO C. The argument, DATESPEC, is a string of the + form `"YYYY MM DD HH MM SS [DST]"'. The string consists of six or + seven numbers representing, respectively, the full year including + century, the month from 1 to 12, the day of the month from 1 to + 31, the hour of the day from 0 to 23, the minute from 0 to 59, the + second from 0 to 60,(3) and an optional daylight-savings flag. + + The values of these numbers need not be within the ranges + specified; for example, an hour of -1 means 1 hour before midnight. + The origin-zero Gregorian calendar is assumed, with year 0 + preceding year 1 and year -1 preceding year 0. The time is + assumed to be in the local timezone. If the daylight-savings flag + is positive, the time is assumed to be daylight savings time; if + zero, the time is assumed to be standard time; and if negative + (the default), `mktime' attempts to determine whether daylight + savings time is in effect for the specified time. + + If DATESPEC does not contain enough elements or if the resulting + time is out of range, `mktime' returns -1. + +`strftime([FORMAT [, TIMESTAMP [, UTC-FLAG]]])' + This function returns a string. It is similar to the function of + the same name in ISO C. The time specified by TIMESTAMP is used to + produce a string, based on the contents of the FORMAT string. If + UTC-FLAG is present and is either non-zero or non-null, the value + is formatted as UTC (Coordinated Universal Time, formerly GMT or + Greenwich Mean Time). Otherwise, the value is formatted for the + local time zone. The TIMESTAMP is in the same format as the value + returned by the `systime' function. If no TIMESTAMP argument is + supplied, `gawk' uses the current time of day as the timestamp. + If no FORMAT argument is supplied, `strftime' uses + `"%a %b %d %H:%M:%S %Z %Y"'. This format string produces output + that is (almost) equivalent to that of the `date' utility. + (Versions of `gawk' prior to 3.0 require the FORMAT argument.) + + The `systime' function allows you to compare a timestamp from a log +file with the current time of day. In particular, it is easy to +determine how long ago a particular record was logged. It also allows +you to produce log records using the "seconds since the epoch" format. + + The `mktime' function allows you to convert a textual representation +of a date and time into a timestamp. This makes it easy to do +before/after comparisons of dates and times, particularly when dealing +with date and time data coming from an external source, such as a log +file. + + The `strftime' function allows you to easily turn a timestamp into +human-readable information. It is similar in nature to the `sprintf' +function (*note String Functions::), in that it copies nonformat +specification characters verbatim to the returned string, while +substituting date and time values for format specifications in the +FORMAT string. + + `strftime' is guaranteed by the 1999 ISO C standard(4) to support +the following date format specifications: + +`%a' + The locale's abbreviated weekday name. + +`%A' + The locale's full weekday name. + +`%b' + The locale's abbreviated month name. + +`%B' + The locale's full month name. + +`%c' + The locale's "appropriate" date and time representation. (This is + `%A %B %d %T %Y' in the `"C"' locale.) + +`%C' + The century. This is the year divided by 100 and truncated to the + next lower integer. + +`%d' + The day of the month as a decimal number (01-31). + +`%D' + Equivalent to specifying `%m/%d/%y'. + +`%e' + The day of the month, padded with a space if it is only one digit. + +`%F' + Equivalent to specifying `%Y-%m-%d'. This is the ISO 8601 date + format. + +`%g' + The year modulo 100 of the ISO week number, as a decimal number + (00-99). For example, January 1, 1993 is in week 53 of 1992. + Thus, the year of its ISO week number is 1992, even though its + year is 1993. Similarly, December 31, 1973 is in week 1 of 1974. + Thus, the year of its ISO week number is 1974, even though its + year is 1973. + +`%G' + The full year of the ISO week number, as a decimal number. + +`%h' + Equivalent to `%b'. + +`%H' + The hour (24-hour clock) as a decimal number (00-23). + +`%I' + The hour (12-hour clock) as a decimal number (01-12). + +`%j' + The day of the year as a decimal number (001-366). + +`%m' + The month as a decimal number (01-12). + +`%M' + The minute as a decimal number (00-59). + +`%n' + A newline character (ASCII LF). + +`%p' + The locale's equivalent of the AM/PM designations associated with + a 12-hour clock. + +`%r' + The locale's 12-hour clock time. (This is `%I:%M:%S %p' in the + `"C"' locale.) + +`%R' + Equivalent to specifying `%H:%M'. + +`%S' + The second as a decimal number (00-60). + +`%t' + A TAB character. + +`%T' + Equivalent to specifying `%H:%M:%S'. + +`%u' + The weekday as a decimal number (1-7). Monday is day one. + +`%U' + The week number of the year (the first Sunday as the first day of + week one) as a decimal number (00-53). + +`%V' + The week number of the year (the first Monday as the first day of + week one) as a decimal number (01-53). The method for determining + the week number is as specified by ISO 8601. (To wit: if the week + containing January 1 has four or more days in the new year, then + it is week one; otherwise it is week 53 of the previous year and + the next week is week one.) + +`%w' + The weekday as a decimal number (0-6). Sunday is day zero. + +`%W' + The week number of the year (the first Monday as the first day of + week one) as a decimal number (00-53). + +`%x' + The locale's "appropriate" date representation. (This is `%A %B + %d %Y' in the `"C"' locale.) + +`%X' + The locale's "appropriate" time representation. (This is `%T' in + the `"C"' locale.) + +`%y' + The year modulo 100 as a decimal number (00-99). + +`%Y' + The full year as a decimal number (e.g., 1995). + +`%z' + The timezone offset in a +HHMM format (e.g., the format necessary + to produce RFC 822/RFC 1036 date headers). + +`%Z' + The time zone name or abbreviation; no characters if no time zone + is determinable. + +`%Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH' +`%OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy' + "Alternate representations" for the specifications that use only + the second letter (`%c', `%C', and so on).(5) (These facilitate + compliance with the POSIX `date' utility.) + +`%%' + A literal `%'. + + If a conversion specifier is not one of the above, the behavior is +undefined.(6) + + Informally, a "locale" is the geographic place in which a program is +meant to run. For example, a common way to abbreviate the date +September 4, 1991 in the United States is "9/4/91." In many countries +in Europe, however, it is abbreviated "4.9.91." Thus, the `%x' +specification in a `"US"' locale might produce `9/4/91', while in a +`"EUROPE"' locale, it might produce `4.9.91'. The ISO C standard +defines a default `"C"' locale, which is an environment that is typical +of what most C programmers are used to. + + For systems that are not yet fully standards-compliant, `gawk' +supplies a copy of `strftime' from the GNU C Library. It supports all +of the just listed format specifications. If that version is used to +compile `gawk' (*note Installation::), then the following additional +format specifications are available: + +`%k' + The hour (24-hour clock) as a decimal number (0-23). Single-digit + numbers are padded with a space. + +`%l' + The hour (12-hour clock) as a decimal number (1-12). Single-digit + numbers are padded with a space. + +`%s' + The time as a decimal timestamp in seconds since the epoch. + + + Additionally, the alternate representations are recognized but their +normal representations are used. + + This example is an `awk' implementation of the POSIX `date' utility. +Normally, the `date' utility prints the current date and time of day in +a well-known format. However, if you provide an argument to it that +begins with a `+', `date' copies nonformat specifier characters to the +standard output and interprets the current time according to the format +specifiers in the string. For example: + + $ date '+Today is %A, %B %d, %Y.' + -| Today is Thursday, September 14, 2000. + + Here is the `gawk' version of the `date' utility. It has a shell +"wrapper" to handle the `-u' option, which requires that `date' run as +if the time zone is set to UTC: + + #! /bin/sh + # + # date --- approximate the P1003.2 'date' command + + case $1 in + -u) TZ=UTC0 # use UTC + export TZ + shift ;; + esac + + gawk 'BEGIN { + format = "%a %b %d %H:%M:%S %Z %Y" + exitval = 0 + + if (ARGC > 2) + exitval = 1 + else if (ARGC == 2) { + format = ARGV[1] + if (format ~ /^\+/) + format = substr(format, 2) # remove leading + + } + print strftime(format) + exit exitval + }' "$@" + + ---------- Footnotes ---------- + + (1) *Note Glossary::, especially the entries "Epoch" and "UTC." + + (2) The GNU `date' utility can also do many of the things described +here. Its use may be preferable for simple time-related operations in +shell scripts. + + (3) Occasionally there are minutes in a year with a leap second, +which is why the seconds can go up to 60. + + (4) As this is a recent standard, not every system's `strftime' +necessarily supports all of the conversions listed here. + + (5) If you don't understand any of this, don't worry about it; these +facilities are meant to make it easier to "internationalize" programs. +Other internationalization features are described in *note +Internationalization::. + + (6) This is because ISO C leaves the behavior of the C version of +`strftime' undefined and `gawk' uses the system's version of `strftime' +if it's there. Typically, the conversion specifier either does not +appear in the returned string or appears literally. + + +File: gawk.info, Node: Bitwise Functions, Next: I18N Functions, Prev: Time Functions, Up: Built-in + +8.1.6 Bit-Manipulation Functions of `gawk' +------------------------------------------ + + I can explain it for you, but I can't understand it for you. + Anonymous + + Many languages provide the ability to perform "bitwise" operations +on two integer numbers. In other words, the operation is performed on +each successive pair of bits in the operands. Three common operations +are bitwise AND, OR, and XOR. The operations are described in *note +table-bitwise-ops::. + + Bit Operator + | AND | OR | XOR + |--+--+--+--+--+-- + Operands | 0 | 1 | 0 | 1 | 0 | 1 + ---------+--+--+--+--+--+-- + 0 | 0 0 | 0 1 | 0 1 + 1 | 0 1 | 1 1 | 1 0 + +Table 8.6: Bitwise Operations + + As you can see, the result of an AND operation is 1 only when _both_ +bits are 1. The result of an OR operation is 1 if _either_ bit is 1. +The result of an XOR operation is 1 if either bit is 1, but not both. +The next operation is the "complement"; the complement of 1 is 0 and +the complement of 0 is 1. Thus, this operation "flips" all the bits of +a given value. + + Finally, two other common operations are to shift the bits left or +right. For example, if you have a bit string `10111001' and you shift +it right by three bits, you end up with `00010111'.(1) If you start over +again with `10111001' and shift it left by three bits, you end up with +`11001000'. `gawk' provides built-in functions that implement the +bitwise operations just described. They are: + +`and(V1, V2)' Returns the bitwise AND of the values provided by V1 + and V2. +`or(V1, V2)' Returns the bitwise OR of the values provided by V1 + and V2. +`xor(V1, V2)' Returns the bitwise XOR of the values provided by V1 + and V2. +`compl(VAL)' Returns the bitwise complement of VAL. +`lshift(VAL, COUNT)' Returns the value of VAL, shifted left by COUNT bits. +`rshift(VAL, COUNT)' Returns the value of VAL, shifted right by COUNT bits. + + For all of these functions, first the double-precision +floating-point value is converted to the widest C unsigned integer +type, then the bitwise operation is performed. If the result cannot be +represented exactly as a C `double', leading nonzero bits are removed +one by one until it can be represented exactly. The result is then +converted back into a C `double'. (If you don't understand this +paragraph, don't worry about it.) + + Here is a user-defined function (*note User-defined::) that +illustrates the use of these functions: + + # bits2str --- turn a byte into readable 1's and 0's + + function bits2str(bits, data, mask) + { + if (bits == 0) + return "0" + + mask = 1 + for (; bits != 0; bits = rshift(bits, 1)) + data = (and(bits, mask) ? "1" : "0") data + + while ((length(data) % 8) != 0) + data = "0" data + + return data + } + + BEGIN { + printf "123 = %s\n", bits2str(123) + printf "0123 = %s\n", bits2str(0123) + printf "0x99 = %s\n", bits2str(0x99) + comp = compl(0x99) + printf "compl(0x99) = %#x = %s\n", comp, bits2str(comp) + shift = lshift(0x99, 2) + printf "lshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift) + shift = rshift(0x99, 2) + printf "rshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift) + } + +This program produces the following output when run: + + $ gawk -f testbits.awk + -| 123 = 01111011 + -| 0123 = 01010011 + -| 0x99 = 10011001 + -| compl(0x99) = 0xffffff66 = 11111111111111111111111101100110 + -| lshift(0x99, 2) = 0x264 = 0000001001100100 + -| rshift(0x99, 2) = 0x26 = 00100110 + + The `bits2str' function turns a binary number into a string. The +number `1' represents a binary value where the rightmost bit is set to +1. Using this mask, the function repeatedly checks the rightmost bit. +ANDing the mask with the value indicates whether the rightmost bit is 1 +or not. If so, a `"1"' is concatenated onto the front of the string. +Otherwise, a `"0"' is added. The value is then shifted right by one +bit and the loop continues until there are no more 1 bits. + + If the initial value is zero it returns a simple `"0"'. Otherwise, +at the end, it pads the value with zeros to represent multiples of +8-bit quantities. This is typical in modern computers. + + The main code in the `BEGIN' rule shows the difference between the +decimal and octal values for the same numbers (*note +Nondecimal-numbers::), and then demonstrates the results of the +`compl', `lshift', and `rshift' functions. + + ---------- Footnotes ---------- + + (1) This example shows that 0's come in on the left side. For +`gawk', this is always true, but in some languages, it's possible to +have the left side fill with 1's. Caveat emptor. + + +File: gawk.info, Node: I18N Functions, Prev: Bitwise Functions, Up: Built-in + +8.1.7 Using `gawk''s String-Translation Functions +------------------------------------------------- + +`gawk' provides facilities for internationalizing `awk' programs. +These include the functions described in the following list. The +descriptions here are purposely brief. *Note Internationalization::, +for the full story. Optional parameters are enclosed in square +brackets ([ ]): + +`dcgettext(STRING [, DOMAIN [, CATEGORY]])' + This function returns the translation of STRING in text domain + DOMAIN for locale category CATEGORY. The default value for DOMAIN + is the current value of `TEXTDOMAIN'. The default value for + CATEGORY is `"LC_MESSAGES"'. + +`dcngettext(STRING1, STRING2, NUMBER [, DOMAIN [, CATEGORY]])' + This function returns the plural form used for NUMBER of the + translation of STRING1 and STRING2 in text domain DOMAIN for + locale category CATEGORY. STRING1 is the English singular variant + of a message, and STRING2 the English plural variant of the same + message. The default value for DOMAIN is the current value of + `TEXTDOMAIN'. The default value for CATEGORY is `"LC_MESSAGES"'. + +`bindtextdomain(DIRECTORY [, DOMAIN])' + This function allows you to specify the directory in which `gawk' + will look for message translation files, in case they will not or + cannot be placed in the "standard" locations (e.g., during + testing). It returns the directory in which DOMAIN is "bound." + + The default DOMAIN is the value of `TEXTDOMAIN'. If DIRECTORY is + the null string (`""'), then `bindtextdomain' returns the current + binding for the given DOMAIN. + + +File: gawk.info, Node: User-defined, Prev: Built-in, Up: Functions + +8.2 User-Defined Functions +========================== + +Complicated `awk' programs can often be simplified by defining your own +functions. User-defined functions can be called just like built-in +ones (*note Function Calls::), but it is up to you to define them, +i.e., to tell `awk' what they should do. + +* Menu: + +* Definition Syntax:: How to write definitions and what they mean. +* Function Example:: An example function definition and what it + does. +* Function Caveats:: Things to watch out for. +* Return Statement:: Specifying the value a function returns. +* Dynamic Typing:: How variable types can change at runtime. + + +File: gawk.info, Node: Definition Syntax, Next: Function Example, Up: User-defined + +8.2.1 Function Definition Syntax +-------------------------------- + +Definitions of functions can appear anywhere between the rules of an +`awk' program. Thus, the general form of an `awk' program is extended +to include sequences of rules _and_ user-defined function definitions. +There is no need to put the definition of a function before all uses of +the function. This is because `awk' reads the entire program before +starting to execute any of it. + + The definition of a function named NAME looks like this: + + function NAME(PARAMETER-LIST) + { + BODY-OF-FUNCTION + } + +NAME is the name of the function to define. A valid function name is +like a valid variable name: a sequence of letters, digits, and +underscores that doesn't start with a digit. Within a single `awk' +program, any particular name can only be used as a variable, array, or +function. + + PARAMETER-LIST is a list of the function's arguments and local +variable names, separated by commas. When the function is called, the +argument names are used to hold the argument values given in the call. +The local variables are initialized to the empty string. A function +cannot have two parameters with the same name, nor may it have a +parameter with the same name as the function itself. + + The BODY-OF-FUNCTION consists of `awk' statements. It is the most +important part of the definition, because it says what the function +should actually _do_. The argument names exist to give the body a way +to talk about the arguments; local variables exist to give the body +places to keep temporary values. + + Argument names are not distinguished syntactically from local +variable names. Instead, the number of arguments supplied when the +function is called determines how many argument variables there are. +Thus, if three argument values are given, the first three names in +PARAMETER-LIST are arguments and the rest are local variables. + + It follows that if the number of arguments is not the same in all +calls to the function, some of the names in PARAMETER-LIST may be +arguments on some occasions and local variables on others. Another way +to think of this is that omitted arguments default to the null string. + + Usually when you write a function, you know how many names you +intend to use for arguments and how many you intend to use as local +variables. It is conventional to place some extra space between the +arguments and the local variables, in order to document how your +function is supposed to be used. + + During execution of the function body, the arguments and local +variable values hide, or "shadow", any variables of the same names used +in the rest of the program. The shadowed variables are not accessible +in the function definition, because there is no way to name them while +their names have been taken away for the local variables. All other +variables used in the `awk' program can be referenced or set normally +in the function's body. + + The arguments and local variables last only as long as the function +body is executing. Once the body finishes, you can once again access +the variables that were shadowed while the function was running. + + The function body can contain expressions that call functions. They +can even call this function, either directly or by way of another +function. When this happens, we say the function is "recursive". The +act of a function calling itself is called "recursion". + + In many `awk' implementations, including `gawk', the keyword +`function' may be abbreviated `func'. However, POSIX only specifies +the use of the keyword `function'. This actually has some practical +implications. If `gawk' is in POSIX-compatibility mode (*note +Options::), then the following statement does _not_ define a function: + + func foo() { a = sqrt($1) ; print a } + +Instead it defines a rule that, for each record, concatenates the value +of the variable `func' with the return value of the function `foo'. If +the resulting string is non-null, the action is executed. This is +probably not what is desired. (`awk' accepts this input as +syntactically valid, because functions may be used before they are +defined in `awk' programs.) + + To ensure that your `awk' programs are portable, always use the +keyword `function' when defining a function. + + +File: gawk.info, Node: Function Example, Next: Function Caveats, Prev: Definition Syntax, Up: User-defined + +8.2.2 Function Definition Examples +---------------------------------- + +Here is an example of a user-defined function, called `myprint', that +takes a number and prints it in a specific format: + + function myprint(num) + { + printf "%6.3g\n", num + } + +To illustrate, here is an `awk' rule that uses our `myprint' function: + + $3 > 0 { myprint($3) } + +This program prints, in our special format, all the third fields that +contain a positive number in our input. Therefore, when given the +following: + + 1.2 3.4 5.6 7.8 + 9.10 11.12 -13.14 15.16 + 17.18 19.20 21.22 23.24 + +this program, using our function to format the results, prints: + + 5.6 + 21.2 + + This function deletes all the elements in an array: + + function delarray(a, i) + { + for (i in a) + delete a[i] + } + + When working with arrays, it is often necessary to delete all the +elements in an array and start over with a new list of elements (*note +Delete::). Instead of having to repeat this loop everywhere that you +need to clear out an array, your program can just call `delarray'. +(This guarantees portability. The use of `delete ARRAY' to delete the +contents of an entire array is a nonstandard extension.) + + The following is an example of a recursive function. It takes a +string as an input parameter and returns the string in backwards order. +Recursive functions must always have a test that stops the recursion. +In this case, the recursion terminates when the starting position is +zero, i.e., when there are no more characters left in the string. + + function rev(str, start) + { + if (start == 0) + return "" + + return (substr(str, start, 1) rev(str, start - 1)) + } + + If this function is in a file named `rev.awk', it can be tested this +way: + + $ echo "Don't Panic!" | + > gawk --source '{ print rev($0, length($0)) }' -f rev.awk + -| !cinaP t'noD + + The C `ctime' function takes a timestamp and returns it in a string, +formatted in a well-known fashion. The following example uses the +built-in `strftime' function (*note Time Functions::) to create an +`awk' version of `ctime': + + # ctime.awk + # + # awk version of C ctime(3) function + + function ctime(ts, format) + { + format = "%a %b %d %H:%M:%S %Z %Y" + if (ts == 0) + ts = systime() # use current time as default + return strftime(format, ts) + } + + +File: gawk.info, Node: Function Caveats, Next: Return Statement, Prev: Function Example, Up: User-defined + +8.2.3 Calling User-Defined Functions +------------------------------------ + +"Calling a function" means causing the function to run and do its job. +A function call is an expression and its value is the value returned by +the function. + + A function call consists of the function name followed by the +arguments in parentheses. `awk' expressions are what you write in the +call for the arguments. Each time the call is executed, these +expressions are evaluated, and the values are the actual arguments. For +example, here is a call to `foo' with three arguments (the first being +a string concatenation): + + foo(x y, "lose", 4 * z) + + *Caution:* Whitespace characters (spaces and tabs) are not allowed +between the function name and the open-parenthesis of the argument list. +If you write whitespace by mistake, `awk' might think that you mean to +concatenate a variable with an expression in parentheses. However, it +notices that you used a function name and not a variable name, and +reports an error. + + When a function is called, it is given a _copy_ of the values of its +arguments. This is known as "call by value". The caller may use a +variable as the expression for the argument, but the called function +does not know this--it only knows what value the argument had. For +example, if you write the following code: + + foo = "bar" + z = myfunc(foo) + +then you should not think of the argument to `myfunc' as being "the +variable `foo'." Instead, think of the argument as the string value +`"bar"'. If the function `myfunc' alters the values of its local +variables, this has no effect on any other variables. Thus, if `myfunc' +does this: + + function myfunc(str) + { + print str + str = "zzz" + print str + } + +to change its first argument variable `str', it does _not_ change the +value of `foo' in the caller. The role of `foo' in calling `myfunc' +ended when its value (`"bar"') was computed. If `str' also exists +outside of `myfunc', the function body cannot alter this outer value, +because it is shadowed during the execution of `myfunc' and cannot be +seen or changed from there. + + However, when arrays are the parameters to functions, they are _not_ +copied. Instead, the array itself is made available for direct +manipulation by the function. This is usually called "call by +reference". Changes made to an array parameter inside the body of a +function _are_ visible outside that function. + + NOTE: Changing an array parameter inside a function can be very + dangerous if you do not watch what you are doing. For example: + + function changeit(array, ind, nvalue) + { + array[ind] = nvalue + } + + BEGIN { + a[1] = 1; a[2] = 2; a[3] = 3 + changeit(a, 2, "two") + printf "a[1] = %s, a[2] = %s, a[3] = %s\n", + a[1], a[2], a[3] + } + + prints `a[1] = 1, a[2] = two, a[3] = 3', because `changeit' stores + `"two"' in the second element of `a'. + + Some `awk' implementations allow you to call a function that has not +been defined. They only report a problem at runtime when the program +actually tries to call the function. For example: + + BEGIN { + if (0) + foo() + else + bar() + } + function bar() { ... } + # note that `foo' is not defined + +Because the `if' statement will never be true, it is not really a +problem that `foo' has not been defined. Usually, though, it is a +problem if a program calls an undefined function. + + If `--lint' is specified (*note Options::), `gawk' reports calls to +undefined functions. + + Some `awk' implementations generate a runtime error if you use the +`next' statement (*note Next Statement::) inside a user-defined +function. `gawk' does not have this limitation. + + +File: gawk.info, Node: Return Statement, Next: Dynamic Typing, Prev: Function Caveats, Up: User-defined + +8.2.4 The `return' Statement +---------------------------- + +The body of a user-defined function can contain a `return' statement. +This statement returns control to the calling part of the `awk' +program. It can also be used to return a value for use in the rest of +the `awk' program. It looks like this: + + return [EXPRESSION] + + The EXPRESSION part is optional. If it is omitted, then the returned +value is undefined, and therefore, unpredictable. + + A `return' statement with no value expression is assumed at the end +of every function definition. So if control reaches the end of the +function body, then the function returns an unpredictable value. `awk' +does _not_ warn you if you use the return value of such a function. + + Sometimes, you want to write a function for what it does, not for +what it returns. Such a function corresponds to a `void' function in C +or to a `procedure' in Pascal. Thus, it may be appropriate to not +return any value; simply bear in mind that if you use the return value +of such a function, you do so at your own risk. + + The following is an example of a user-defined function that returns +a value for the largest number among the elements of an array: + + function maxelt(vec, i, ret) + { + for (i in vec) { + if (ret == "" || vec[i] > ret) + ret = vec[i] + } + return ret + } + +You call `maxelt' with one argument, which is an array name. The local +variables `i' and `ret' are not intended to be arguments; while there +is nothing to stop you from passing more than one argument to `maxelt', +the results would be strange. The extra space before `i' in the +function parameter list indicates that `i' and `ret' are not supposed +to be arguments. You should follow this convention when defining +functions. + + The following program uses the `maxelt' function. It loads an +array, calls `maxelt', and then reports the maximum number in that +array: + + function maxelt(vec, i, ret) + { + for (i in vec) { + if (ret == "" || vec[i] > ret) + ret = vec[i] + } + return ret + } + + # Load all fields of each record into nums. + { + for(i = 1; i <= NF; i++) + nums[NR, i] = $i + } + + END { + print maxelt(nums) + } + + Given the following input: + + 1 5 23 8 16 + 44 3 5 2 8 26 + 256 291 1396 2962 100 + -6 467 998 1101 + 99385 11 0 225 + +the program reports (predictably) that `99385' is the largest number in +the array. + + +File: gawk.info, Node: Dynamic Typing, Prev: Return Statement, Up: User-defined + +8.2.5 Functions and Their Effects on Variable Typing +---------------------------------------------------- + +`awk' is a very fluid language. It is possible that `awk' can't tell +if an identifier represents a regular variable or an array until +runtime. Here is an annotated sample program: + + function foo(a) + { + a[1] = 1 # parameter is an array + } + + BEGIN { + b = 1 + foo(b) # invalid: fatal type mismatch + + foo(x) # x uninitialized, becomes an array dynamically + x = 1 # now not allowed, runtime error + } + + Usually, such things aren't a big issue, but it's worth being aware +of them. + + +File: gawk.info, Node: Internationalization, Next: Advanced Features, Prev: Functions, Up: Top + +9 Internationalization with `gawk' +********************************** + +Once upon a time, computer makers wrote software that worked only in +English. Eventually, hardware and software vendors noticed that if +their systems worked in the native languages of non-English-speaking +countries, they were able to sell more systems. As a result, +internationalization and localization of programs and software systems +became a common practice. + + Until recently, the ability to provide internationalization was +largely restricted to programs written in C and C++. This major node +describes the underlying library `gawk' uses for internationalization, +as well as how `gawk' makes internationalization features available at +the `awk' program level. Having internationalization available at the +`awk' level gives software developers additional flexibility--they are +no longer required to write in C when internationalization is a +requirement. + +* Menu: + +* I18N and L10N:: Internationalization and Localization. +* Explaining gettext:: How GNU `gettext' works. +* Programmer i18n:: Features for the programmer. +* Translator i18n:: Features for the translator. +* I18N Example:: A simple i18n example. +* Gawk I18N:: `gawk' is also internationalized. + + +File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Up: Internationalization + +9.1 Internationalization and Localization +========================================= + +"Internationalization" means writing (or modifying) a program once, in +such a way that it can use multiple languages without requiring further +source-code changes. "Localization" means providing the data necessary +for an internationalized program to work in a particular language. +Most typically, these terms refer to features such as the language used +for printing error messages, the language used to read responses, and +information related to how numerical and monetary values are printed +and read. + + +File: gawk.info, Node: Explaining gettext, Next: Programmer i18n, Prev: I18N and L10N, Up: Internationalization + +9.2 GNU `gettext' +================= + +The facilities in GNU `gettext' focus on messages; strings printed by a +program, either directly or via formatting with `printf' or +`sprintf'.(1) + + When using GNU `gettext', each application has its own "text +domain". This is a unique name, such as `kpilot' or `gawk', that +identifies the application. A complete application may have multiple +components--programs written in C or C++, as well as scripts written in +`sh' or `awk'. All of the components use the same text domain. + + To make the discussion concrete, assume we're writing an application +named `guide'. Internationalization consists of the following steps, +in this order: + + 1. The programmer goes through the source for all of `guide''s + components and marks each string that is a candidate for + translation. For example, `"`-F': option required"' is a good + candidate for translation. A table with strings of option names + is not (e.g., `gawk''s `--profile' option should remain the same, + no matter what the local language). + + 2. The programmer indicates the application's text domain (`"guide"') + to the `gettext' library, by calling the `textdomain' function. + + 3. Messages from the application are extracted from the source code + and collected into a portable object file (`guide.po'), which + lists the strings and their translations. The translations are + initially empty. The original (usually English) messages serve as + the key for lookup of the translations. + + 4. For each language with a translator, `guide.po' is copied and + translations are created and shipped with the application. + + 5. Each language's `.po' file is converted into a binary message + object (`.mo') file. A message object file contains the original + messages and their translations in a binary format that allows + fast lookup of translations at runtime. + + 6. When `guide' is built and installed, the binary translation files + are installed in a standard place. + + 7. For testing and development, it is possible to tell `gettext' to + use `.mo' files in a different directory than the standard one by + using the `bindtextdomain' function. + + 8. At runtime, `guide' looks up each string via a call to `gettext'. + The returned string is the translated string if available, or the + original string if not. + + 9. If necessary, it is possible to access messages from a different + text domain than the one belonging to the application, without + having to switch the application's default text domain back and + forth. + + In C (or C++), the string marking and dynamic translation lookup are +accomplished by wrapping each string in a call to `gettext': + + printf(gettext("Don't Panic!\n")); + + The tools that extract messages from source code pull out all +strings enclosed in calls to `gettext'. + + The GNU `gettext' developers, recognizing that typing `gettext' over +and over again is both painful and ugly to look at, use the macro `_' +(an underscore) to make things easier: + + /* In the standard header file: */ + #define _(str) gettext(str) + + /* In the program text: */ + printf(_("Don't Panic!\n")); + +This reduces the typing overhead to just three extra characters per +string and is considerably easier to read as well. There are locale +"categories" for different types of locale-related information. The +defined locale categories that `gettext' knows about are: + +`LC_MESSAGES' + Text messages. This is the default category for `gettext' + operations, but it is possible to supply a different one + explicitly, if necessary. (It is almost never necessary to supply + a different category.) + +`LC_COLLATE' + Text-collation information; i.e., how different characters and/or + groups of characters sort in a given language. + +`LC_CTYPE' + Character-type information (alphabetic, digit, upper- or + lowercase, and so on). This information is accessed via the POSIX + character classes in regular expressions, such as `/[[:alnum:]]/' + (*note Regexp Operators::). + +`LC_MONETARY' + Monetary information, such as the currency symbol, and whether the + symbol goes before or after a number. + +`LC_NUMERIC' + Numeric information, such as which characters to use for the + decimal point and the thousands separator.(2) + +`LC_RESPONSE' + Response information, such as how "yes" and "no" appear in the + local language, and possibly other information as well. + +`LC_TIME' + Time- and date-related information, such as 12- or 24-hour clock, + month printed before or after day in a date, local month + abbreviations, and so on. + +`LC_ALL' + All of the above. (Not too useful in the context of `gettext'.) + + ---------- Footnotes ---------- + + (1) For some operating systems, the `gawk' port doesn't support GNU +`gettext'. This applies most notably to the PC operating systems. As +such, these features are not available if you are using one of those +operating systems. Sorry. + + (2) Americans use a comma every three decimal places and a period +for the decimal point, while many Europeans do exactly the opposite: +`1,234.56' versus `1.234,56'. + + +File: gawk.info, Node: Programmer i18n, Next: Translator i18n, Prev: Explaining gettext, Up: Internationalization + +9.3 Internationalizing `awk' Programs +===================================== + +`gawk' provides the following variables and functions for +internationalization: + +`TEXTDOMAIN' + This variable indicates the application's text domain. For + compatibility with GNU `gettext', the default value is + `"messages"'. + +`_"your message here"' + String constants marked with a leading underscore are candidates + for translation at runtime. String constants without a leading + underscore are not translated. + +`dcgettext(STRING [, DOMAIN [, CATEGORY]])' + This built-in function returns the translation of STRING in text + domain DOMAIN for locale category CATEGORY. The default value for + DOMAIN is the current value of `TEXTDOMAIN'. The default value + for CATEGORY is `"LC_MESSAGES"'. + + If you supply a value for CATEGORY, it must be a string equal to + one of the known locale categories described in *note Explaining + gettext::. You must also supply a text domain. Use `TEXTDOMAIN' + if you want to use the current domain. + + *Caution:* The order of arguments to the `awk' version of the + `dcgettext' function is purposely different from the order for the + C version. The `awk' version's order was chosen to be simple and + to allow for reasonable `awk'-style default arguments. + +`dcngettext(STRING1, STRING2, NUMBER [, DOMAIN [, CATEGORY]])' + This built-in function returns the plural form used for NUMBER of + the translation of STRING1 and STRING2 in text domain DOMAIN for + locale category CATEGORY. STRING1 is the English singular variant + of a message, and STRING2 the English plural variant of the same + message. The default value for DOMAIN is the current value of + `TEXTDOMAIN'. The default value for CATEGORY is `"LC_MESSAGES"'. + + The same remarks as for the `dcgettext' function apply. + +`bindtextdomain(DIRECTORY [, DOMAIN])' + This built-in function allows you to specify the directory in which + `gettext' looks for `.mo' files, in case they will not or cannot + be placed in the standard locations (e.g., during testing). It + returns the directory in which DOMAIN is "bound." + + The default DOMAIN is the value of `TEXTDOMAIN'. If DIRECTORY is + the null string (`""'), then `bindtextdomain' returns the current + binding for the given DOMAIN. + + To use these facilities in your `awk' program, follow the steps +outlined in *note Explaining gettext::, like so: + + 1. Set the variable `TEXTDOMAIN' to the text domain of your program. + This is best done in a `BEGIN' rule (*note BEGIN/END::), or it can + also be done via the `-v' command-line option (*note Options::): + + BEGIN { + TEXTDOMAIN = "guide" + ... + } + + 2. Mark all translatable strings with a leading underscore (`_') + character. It _must_ be adjacent to the opening quote of the + string. For example: + + print _"hello, world" + x = _"you goofed" + printf(_"Number of users is %d\n", nusers) + + 3. If you are creating strings dynamically, you can still translate + them, using the `dcgettext' built-in function: + + message = nusers " users logged in" + message = dcgettext(message, "adminprog") + print message + + Here, the call to `dcgettext' supplies a different text domain + (`"adminprog"') in which to find the message, but it uses the + default `"LC_MESSAGES"' category. + + 4. During development, you might want to put the `.mo' file in a + private directory for testing. This is done with the + `bindtextdomain' built-in function: + + BEGIN { + TEXTDOMAIN = "guide" # our text domain + if (Testing) { + # where to find our files + bindtextdomain("testdir") + # joe is in charge of adminprog + bindtextdomain("../joe/testdir", "adminprog") + } + ... + } + + + *Note I18N Example::, for an example program showing the steps to +create and use translations from `awk'. + + +File: gawk.info, Node: Translator i18n, Next: I18N Example, Prev: Programmer i18n, Up: Internationalization + +9.4 Translating `awk' Programs +============================== + +Once a program's translatable strings have been marked, they must be +extracted to create the initial `.po' file. As part of translation, it +is often helpful to rearrange the order in which arguments to `printf' +are output. + + `gawk''s `--gen-po' command-line option extracts the messages and is +discussed next. After that, `printf''s ability to rearrange the order +for `printf' arguments at runtime is covered. + +* Menu: + +* String Extraction:: Extracting marked strings. +* Printf Ordering:: Rearranging `printf' arguments. +* I18N Portability:: `awk'-level portability issues. + + +File: gawk.info, Node: String Extraction, Next: Printf Ordering, Up: Translator i18n + +9.4.1 Extracting Marked Strings +------------------------------- + +Once your `awk' program is working, and all the strings have been +marked and you've set (and perhaps bound) the text domain, it is time +to produce translations. First, use the `--gen-po' command-line option +to create the initial `.po' file: + + $ gawk --gen-po -f guide.awk > guide.po + + When run with `--gen-po', `gawk' does not execute your program. +Instead, it parses it as usual and prints all marked strings to +standard output in the format of a GNU `gettext' Portable Object file. +Also included in the output are any constant strings that appear as the +first argument to `dcgettext' or as the first and second argument to +`dcngettext'.(1) *Note I18N Example::, for the full list of steps to go +through to create and test translations for `guide'. + + ---------- Footnotes ---------- + + (1) Starting with `gettext' version 0.11.5, the `xgettext' utility +that comes with GNU `gettext' can handle `.awk' files. + + +File: gawk.info, Node: Printf Ordering, Next: I18N Portability, Prev: String Extraction, Up: Translator i18n + +9.4.2 Rearranging `printf' Arguments +------------------------------------ + +Format strings for `printf' and `sprintf' (*note Printf::) present a +special problem for translation. Consider the following:(1) + + printf(_"String `%s' has %d characters\n", + string, length(string))) + + A possible German translation for this might be: + + "%d Zeichen lang ist die Zeichenkette `%s'\n" + + The problem should be obvious: the order of the format +specifications is different from the original! Even though `gettext' +can return the translated string at runtime, it cannot change the +argument order in the call to `printf'. + + To solve this problem, `printf' format specifiers may have an +additional optional element, which we call a "positional specifier". +For example: + + "%2$d Zeichen lang ist die Zeichenkette `%1$s'\n" + + Here, the positional specifier consists of an integer count, which +indicates which argument to use, and a `$'. Counts are one-based, and +the format string itself is _not_ included. Thus, in the following +example, `string' is the first argument and `length(string)' is the +second: + + $ gawk 'BEGIN { + > string = "Dont Panic" + > printf _"%2$d characters live in \"%1$s\"\n", + > string, length(string) + > }' + -| 10 characters live in "Dont Panic" + + If present, positional specifiers come first in the format +specification, before the flags, the field width, and/or the precision. + + Positional specifiers can be used with the dynamic field width and +precision capability: + + $ gawk 'BEGIN { + > printf("%*.*s\n", 10, 20, "hello") + > printf("%3$*2$.*1$s\n", 20, 10, "hello") + > }' + -| hello + -| hello + + NOTE: When using `*' with a positional specifier, the `*' comes + first, then the integer position, and then the `$'. This is + somewhat counterintuitive. + + `gawk' does not allow you to mix regular format specifiers and those +with positional specifiers in the same string: + + $ gawk 'BEGIN { printf _"%d %3$s\n", 1, 2, "hi" }' + error--> gawk: cmd. line:1: fatal: must use `count$' on all formats or none + + NOTE: There are some pathological cases that `gawk' may fail to + diagnose. In such cases, the output may not be what you expect. + It's still a bad idea to try mixing them, even if `gawk' doesn't + detect it. + + Although positional specifiers can be used directly in `awk' +programs, their primary purpose is to help in producing correct +translations of format strings into languages different from the one in +which the program is first written. + + ---------- Footnotes ---------- + + (1) This example is borrowed from the GNU `gettext' manual. + + +File: gawk.info, Node: I18N Portability, Prev: Printf Ordering, Up: Translator i18n + +9.4.3 `awk' Portability Issues +------------------------------ + +`gawk''s internationalization features were purposely chosen to have as +little impact as possible on the portability of `awk' programs that use +them to other versions of `awk'. Consider this program: + + BEGIN { + TEXTDOMAIN = "guide" + if (Test_Guide) # set with -v + bindtextdomain("/test/guide/messages") + print _"don't panic!" + } + +As written, it won't work on other versions of `awk'. However, it is +actually almost portable, requiring very little change: + + * Assignments to `TEXTDOMAIN' won't have any effect, since + `TEXTDOMAIN' is not special in other `awk' implementations. + + * Non-GNU versions of `awk' treat marked strings as the + concatenation of a variable named `_' with the string following + it.(1) Typically, the variable `_' has the null string (`""') as + its value, leaving the original string constant as the result. + + * By defining "dummy" functions to replace `dcgettext', `dcngettext' + and `bindtextdomain', the `awk' program can be made to run, but + all the messages are output in the original language. For example: + + function bindtextdomain(dir, domain) + { + return dir + } + + function dcgettext(string, domain, category) + { + return string + } + + function dcngettext(string1, string2, number, domain, category) + { + return (number == 1 ? string1 : string2) + } + + * The use of positional specifications in `printf' or `sprintf' is + _not_ portable. To support `gettext' at the C level, many + systems' C versions of `sprintf' do support positional specifiers. + But it works only if enough arguments are supplied in the function + call. Many versions of `awk' pass `printf' formats and arguments + unchanged to the underlying C library version of `sprintf', but + only one format and argument at a time. What happens if a + positional specification is used is anybody's guess. However, + since the positional specifications are primarily for use in + _translated_ format strings, and since non-GNU `awk's never + retrieve the translated string, this should not be a problem in + practice. + + ---------- Footnotes ---------- + + (1) This is good fodder for an "Obfuscated `awk'" contest. + + +File: gawk.info, Node: I18N Example, Next: Gawk I18N, Prev: Translator i18n, Up: Internationalization + +9.5 A Simple Internationalization Example +========================================= + +Now let's look at a step-by-step example of how to internationalize and +localize a simple `awk' program, using `guide.awk' as our original +source: + + BEGIN { + TEXTDOMAIN = "guide" + bindtextdomain(".") # for testing + print _"Don't Panic" + print _"The Answer Is", 42 + print "Pardon me, Zaphod who?" + } + +Run `gawk --gen-po' to create the `.po' file: + + $ gawk --gen-po -f guide.awk > guide.po + +This produces: + + #: guide.awk:4 + msgid "Don't Panic" + msgstr "" + + #: guide.awk:5 + msgid "The Answer Is" + msgstr "" + + This original portable object file is saved and reused for each +language into which the application is translated. The `msgid' is the +original string and the `msgstr' is the translation. + + NOTE: Strings not marked with a leading underscore do not appear + in the `guide.po' file. + + Next, the messages must be translated. Here is a translation to a +hypothetical dialect of English, called "Mellow":(1) + + $ cp guide.po guide-mellow.po + ADD TRANSLATIONS TO guide-mellow.po ... + +Following are the translations: + + #: guide.awk:4 + msgid "Don't Panic" + msgstr "Hey man, relax!" + + #: guide.awk:5 + msgid "The Answer Is" + msgstr "Like, the scoop is" + + The next step is to make the directory to hold the binary message +object file and then to create the `guide.mo' file. The directory +layout shown here is standard for GNU `gettext' on GNU/Linux systems. +Other versions of `gettext' may use a different layout: + + $ mkdir en_US en_US/LC_MESSAGES + + The `msgfmt' utility does the conversion from human-readable `.po' +file to machine-readable `.mo' file. By default, `msgfmt' creates a +file named `messages'. This file must be renamed and placed in the +proper directory so that `gawk' can find it: + + $ msgfmt guide-mellow.po + $ mv messages en_US/LC_MESSAGES/guide.mo + + Finally, we run the program to test it: + + $ gawk -f guide.awk + -| Hey man, relax! + -| Like, the scoop is 42 + -| Pardon me, Zaphod who? + + If the three replacement functions for `dcgettext', `dcngettext' and +`bindtextdomain' (*note I18N Portability::) are in a file named +`libintl.awk', then we can run `guide.awk' unchanged as follows: + + $ gawk --posix -f guide.awk -f libintl.awk + -| Don't Panic + -| The Answer Is 42 + -| Pardon me, Zaphod who? + + ---------- Footnotes ---------- + + (1) Perhaps it would be better if it were called "Hippy." Ah, well. + + +File: gawk.info, Node: Gawk I18N, Prev: I18N Example, Up: Internationalization + +9.6 `gawk' Can Speak Your Language +================================== + +As of version 3.1, `gawk' itself has been internationalized using the +GNU `gettext' package. (GNU `gettext' is described in complete detail +in *note Top::.) As of this writing, the latest version of GNU +`gettext' is version 0.11.5 +(ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.5.tar.gz). + + If a translation of `gawk''s messages exists, then `gawk' produces +usage messages, warnings, and fatal errors in the local language. + + +File: gawk.info, Node: Advanced Features, Next: Invoking Gawk, Prev: Internationalization, Up: Top + +10 Advanced Features of `gawk' +****************************** + + Write documentation as if whoever reads it is a violent psychopath + who knows where you live. + Steve English, as quoted by Peter Langston + + This major node discusses advanced features in `gawk'. It's a bit +of a "grab bag" of items that are otherwise unrelated to each other. +First, a command-line option allows `gawk' to recognize nondecimal +numbers in input data, not just in `awk' programs. Next, two-way I/O, +discussed briefly in earlier parts of this Info file, is described in +full detail, along with the basics of TCP/IP networking and BSD portal +files. Finally, `gawk' can "profile" an `awk' program, making it +possible to tune it for performance. + + *note Dynamic Extensions::, discusses the ability to dynamically add +new built-in functions to `gawk'. As this feature is still immature +and likely to change, its description is relegated to an appendix. + +* Menu: + +* Nondecimal Data:: Allowing nondecimal input data. +* Two-way I/O:: Two-way communications with another process. +* TCP/IP Networking:: Using `gawk' for network programming. +* Portal Files:: Using `gawk' with BSD portals. +* Profiling:: Profiling your `awk' programs. + + +File: gawk.info, Node: Nondecimal Data, Next: Two-way I/O, Up: Advanced Features + +10.1 Allowing Nondecimal Input Data +=================================== + +If you run `gawk' with the `--non-decimal-data' option, you can have +nondecimal constants in your input data: + + $ echo 0123 123 0x123 | + > gawk --non-decimal-data '{ printf "%d, %d, %d\n", + > $1, $2, $3 }' + -| 83, 123, 291 + + For this feature to work, write your program so that `gawk' treats +your data as numeric: + + $ echo 0123 123 0x123 | gawk '{ print $1, $2, $3 }' + -| 0123 123 0x123 + +The `print' statement treats its expressions as strings. Although the +fields can act as numbers when necessary, they are still strings, so +`print' does not try to treat them numerically. You may need to add +zero to a field to force it to be treated as a number. For example: + + $ echo 0123 123 0x123 | gawk --non-decimal-data ' + > { print $1, $2, $3 + > print $1 + 0, $2 + 0, $3 + 0 }' + -| 0123 123 0x123 + -| 83 123 291 + + Because it is common to have decimal data with leading zeros, and +because using it could lead to surprising results, the default is to +leave this facility disabled. If you want it, you must explicitly +request it. + + *Caution:* _Use of this option is not recommended._ It can break old +programs very badly. Instead, use the `strtonum' function to convert +your data (*note Nondecimal-numbers::). This makes your programs +easier to write and easier to read, and leads to less surprising +results. + + +File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Nondecimal Data, Up: Advanced Features + +10.2 Two-Way Communications with Another Process +================================================ + + From: brennan@whidbey.com (Mike Brennan) + Newsgroups: comp.lang.awk + Subject: Re: Learn the SECRET to Attract Women Easily + Date: 4 Aug 1997 17:34:46 GMT + Message-ID: <5s53rm$eca@news.whidbey.com> + + On 3 Aug 1997 13:17:43 GMT, Want More Dates??? + wrote: + >Learn the SECRET to Attract Women Easily + > + >The SCENT(tm) Pheromone Sex Attractant For Men to Attract Women + + The scent of awk programmers is a lot more attractive to women than + the scent of perl programmers. + -- + Mike Brennan + + It is often useful to be able to send data to a separate program for +processing and then read the result. This can always be done with +temporary files: + + # write the data for processing + tempfile = ("mydata." PROCINFO["pid"]) + while (NOT DONE WITH DATA) + print DATA | ("subprogram > " tempfile) + close("subprogram > " tempfile) + + # read the results, remove tempfile when done + while ((getline newdata < tempfile) > 0) + PROCESS newdata APPROPRIATELY + close(tempfile) + system("rm " tempfile) + +This works, but not elegantly. Among other things, it requires that +the program be run in a directory that cannot be shared among users; +for example, `/tmp' will not do, as another user might happen to be +using a temporary file with the same name. + + Starting with version 3.1 of `gawk', it is possible to open a +_two-way_ pipe to another process. The second process is termed a +"coprocess", since it runs in parallel with `gawk'. The two-way +connection is created using the new `|&' operator (borrowed from the +Korn shell, `ksh'):(1) + + do { + print DATA |& "subprogram" + "subprogram" |& getline results + } while (DATA LEFT TO PROCESS) + close("subprogram") + + The first time an I/O operation is executed using the `|&' operator, +`gawk' creates a two-way pipeline to a child process that runs the +other program. Output created with `print' or `printf' is written to +the program's standard input, and output from the program's standard +output can be read by the `gawk' program using `getline'. As is the +case with processes started by `|', the subprogram can be any program, +or pipeline of programs, that can be started by the shell. + + There are some cautionary items to be aware of: + + * As the code inside `gawk' currently stands, the coprocess's + standard error goes to the same place that the parent `gawk''s + standard error goes. It is not possible to read the child's + standard error separately. + + * I/O buffering may be a problem. `gawk' automatically flushes all + output down the pipe to the child process. However, if the + coprocess does not flush its output, `gawk' may hang when doing a + `getline' in order to read the coprocess's results. This could + lead to a situation known as "deadlock", where each process is + waiting for the other one to do something. + + It is possible to close just one end of the two-way pipe to a +coprocess, by supplying a second argument to the `close' function of +either `"to"' or `"from"' (*note Close Files And Pipes::). These +strings tell `gawk' to close the end of the pipe that sends data to the +process or the end that reads from it, respectively. + + This is particularly necessary in order to use the system `sort' +utility as part of a coprocess; `sort' must read _all_ of its input +data before it can produce any output. The `sort' program does not +receive an end-of-file indication until `gawk' closes the write end of +the pipe. + + When you have finished writing data to the `sort' utility, you can +close the `"to"' end of the pipe, and then start reading sorted data +via `getline'. For example: + + BEGIN { + command = "LC_ALL=C sort" + n = split("abcdefghijklmnopqrstuvwxyz", a, "") + + for (i = n; i > 0; i--) + print a[i] |& command + close(command, "to") + + while ((command |& getline line) > 0) + print "got", line + close(command) + } + + This program writes the letters of the alphabet in reverse order, one +per line, down the two-way pipe to `sort'. It then closes the write +end of the pipe, so that `sort' receives an end-of-file indication. +This causes `sort' to sort the data and write the sorted data back to +the `gawk' program. Once all of the data has been read, `gawk' +terminates the coprocess and exits. + + As a side note, the assignment `LC_ALL=C' in the `sort' command +ensures traditional Unix (ASCII) sorting from `sort'. + + Beginning with `gawk' 3.1.2, you may use Pseudo-ttys (ptys) for +two-way communication instead of pipes, if your system supports them. +This is done on a per-command basis, by setting a special element in +the `PROCINFO' array (*note Auto-set::), like so: + + command = "sort -nr" # command, saved in variable for convenience + PROCINFO[command, "pty"] = 1 # update PROCINFO + print ... |& command # start two-way pipe + ... + +Using ptys avoids the buffer deadlock issues described earlier, at some +loss in performance. If your system does not have ptys, or if all the +system's ptys are in use, `gawk' automatically falls back to using +regular pipes. + + ---------- Footnotes ---------- + + (1) This is very different from the same operator in the C shell, +`csh'. + + +File: gawk.info, Node: TCP/IP Networking, Next: Portal Files, Prev: Two-way I/O, Up: Advanced Features + +10.3 Using `gawk' for Network Programming +========================================= + + `EMISTERED': A host is a host from coast to coast, + and no-one can talk to host that's close, + unless the host that isn't close + is busy hung or dead. + + In addition to being able to open a two-way pipeline to a coprocess +on the same system (*note Two-way I/O::), it is possible to make a +two-way connection to another process on another system across an IP +networking connection. + + You can think of this as just a _very long_ two-way pipeline to a +coprocess. The way `gawk' decides that you want to use TCP/IP +networking is by recognizing special file names that begin with +`/inet/'. + + The full syntax of the special file name is +`/inet/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The components +are: + +PROTOCOL + The protocol to use over IP. This must be either `tcp', `udp', or + `raw', for a TCP, UDP, or raw IP connection, respectively. The + use of TCP is recommended for most applications. + + *Caution:* The use of raw sockets is not currently supported in + version 3.1 of `gawk'. + +LOCAL-PORT + The local TCP or UDP port number to use. Use a port number of `0' + when you want the system to pick a port. This is what you should do + when writing a TCP or UDP client. You may also use a well-known + service name, such as `smtp' or `http', in which case `gawk' + attempts to determine the predefined port number using the C + `getservbyname' function. + +REMOTE-HOST + The IP address or fully-qualified domain name of the Internet host + to which you want to connect. + +REMOTE-PORT + The TCP or UDP port number to use on the given REMOTE-HOST. + Again, use `0' if you don't care, or else a well-known service + name. + + Consider the following very simple example: + + BEGIN { + Service = "/inet/tcp/0/localhost/daytime" + Service |& getline + print $0 + close(Service) + } + + This program reads the current date and time from the local system's +TCP `daytime' server. It then prints the results and closes the +connection. + + Because this topic is extensive, the use of `gawk' for TCP/IP +programming is documented separately. *Note Top::, for a much more +complete introduction and discussion, as well as extensive examples. + + +File: gawk.info, Node: Portal Files, Next: Profiling, Prev: TCP/IP Networking, Up: Advanced Features + +10.4 Using `gawk' with BSD Portals +================================== + +Similar to the `/inet' special files, if `gawk' is configured with the +`--enable-portals' option (*note Quick Installation::), then `gawk' +treats files whose pathnames begin with `/p' as 4.4 BSD-style portals. + + When used with the `|&' operator, `gawk' opens the file for two-way +communications. The operating system's portal mechanism then manages +creating the process associated with the portal and the corresponding +communications with the portal's process. + + +File: gawk.info, Node: Profiling, Prev: Portal Files, Up: Advanced Features + +10.5 Profiling Your `awk' Programs +================================== + +Beginning with version 3.1 of `gawk', you may produce execution traces +of your `awk' programs. This is done with a specially compiled version +of `gawk', called `pgawk' ("profiling `gawk'"). + + `pgawk' is identical in every way to `gawk', except that when it has +finished running, it creates a profile of your program in a file named +`awkprof.out'. Because it is profiling, it also executes up to 45% +slower than `gawk' normally does. + + As shown in the following example, the `--profile' option can be +used to change the name of the file where `pgawk' will write the +profile: + + $ pgawk --profile=myprog.prof -f myprog.awk data1 data2 + +In the above example, `pgawk' places the profile in `myprog.prof' +instead of in `awkprof.out'. + + Regular `gawk' also accepts this option. When called with just +`--profile', `gawk' "pretty prints" the program into `awkprof.out', +without any execution counts. You may supply an option to `--profile' +to change the file name. Here is a sample session showing a simple +`awk' program, its input data, and the results from running `pgawk'. +First, the `awk' program: + + BEGIN { print "First BEGIN rule" } + + END { print "First END rule" } + + /foo/ { + print "matched /foo/, gosh" + for (i = 1; i <= 3; i++) + sing() + } + + { + if (/foo/) + print "if is true" + else + print "else is true" + } + + BEGIN { print "Second BEGIN rule" } + + END { print "Second END rule" } + + function sing( dummy) + { + print "I gotta be me!" + } + + Following is the input data: + + foo + bar + baz + foo + junk + + Here is the `awkprof.out' that results from running `pgawk' on this +program and data (this example also illustrates that `awk' programmers +sometimes have to work late): + + # gawk profile, created Sun Aug 13 00:00:15 2000 + + # BEGIN block(s) + + BEGIN { + 1 print "First BEGIN rule" + 1 print "Second BEGIN rule" + } + + # Rule(s) + + 5 /foo/ { # 2 + 2 print "matched /foo/, gosh" + 6 for (i = 1; i <= 3; i++) { + 6 sing() + } + } + + 5 { + 5 if (/foo/) { # 2 + 2 print "if is true" + 3 } else { + 3 print "else is true" + } + } + + # END block(s) + + END { + 1 print "First END rule" + 1 print "Second END rule" + } + + # Functions, listed alphabetically + + 6 function sing(dummy) + { + 6 print "I gotta be me!" + } + + This example illustrates many of the basic rules for profiling +output. The rules are as follows: + + * The program is printed in the order `BEGIN' rule, pattern/action + rules, `END' rule and functions, listed alphabetically. Multiple + `BEGIN' and `END' rules are merged together. + + * Pattern-action rules have two counts. The first count, to the + left of the rule, shows how many times the rule's pattern was + _tested_. The second count, to the right of the rule's opening + left brace in a comment, shows how many times the rule's action + was _executed_. The difference between the two indicates how many + times the rule's pattern evaluated to false. + + * Similarly, the count for an `if'-`else' statement shows how many + times the condition was tested. To the right of the opening left + brace for the `if''s body is a count showing how many times the + condition was true. The count for the `else' indicates how many + times the test failed. + + * The count for a loop header (such as `for' or `while') shows how + many times the loop test was executed. (Because of this, you + can't just look at the count on the first statement in a rule to + determine how many times the rule was executed. If the first + statement is a loop, the count is misleading.) + + * For user-defined functions, the count next to the `function' + keyword indicates how many times the function was called. The + counts next to the statements in the body show how many times + those statements were executed. + + * The layout uses "K&R" style with tabs. Braces are used + everywhere, even when the body of an `if', `else', or loop is only + a single statement. + + * Parentheses are used only where needed, as indicated by the + structure of the program and the precedence rules. For example, + `(3 + 5) * 4' means add three plus five, then multiply the total + by four. However, `3 + 5 * 4' has no parentheses, and means `3 + + (5 * 4)'. + + * Parentheses are used around the arguments to `print' and `printf' + only when the `print' or `printf' statement is followed by a + redirection. Similarly, if the target of a redirection isn't a + scalar, it gets parenthesized. + + * `pgawk' supplies leading comments in front of the `BEGIN' and + `END' rules, the pattern/action rules, and the functions. + + + The profiled version of your program may not look exactly like what +you typed when you wrote it. This is because `pgawk' creates the +profiled version by "pretty printing" its internal representation of +the program. The advantage to this is that `pgawk' can produce a +standard representation. The disadvantage is that all source-code +comments are lost, as are the distinctions among multiple `BEGIN' and +`END' rules. Also, things such as: + + /foo/ + +come out as: + + /foo/ { + print $0 + } + +which is correct, but possibly surprising. + + Besides creating profiles when a program has completed, `pgawk' can +produce a profile while it is running. This is useful if your `awk' +program goes into an infinite loop and you want to see what has been +executed. To use this feature, run `pgawk' in the background: + + $ pgawk -f myprog & + [1] 13992 + +The shell prints a job number and process ID number; in this case, +13992. Use the `kill' command to send the `USR1' signal to `pgawk': + + $ kill -USR1 13992 + +As usual, the profiled version of the program is written to +`awkprof.out', or to a different file if you use the `--profile' option. + + Along with the regular profile, as shown earlier, the profile +includes a trace of any active functions: + + # Function Call Stack: + + # 3. baz + # 2. bar + # 1. foo + # -- main -- + + You may send `pgawk' the `USR1' signal as many times as you like. +Each time, the profile and function call trace are appended to the +output profile file. + + If you use the `HUP' signal instead of the `USR1' signal, `pgawk' +produces the profile and the function call trace and then exits. + + When `pgawk' runs on MS-DOS or MS-Windows, it uses the `INT' and +`QUIT' signals for producing the profile and, in the case of the `INT' +signal, `pgawk' exits. This is because these systems don't support the +`kill' command, so the only signals you can deliver to a program are +those generated by the keyboard. The `INT' signal is generated by the +`Ctrl-' or `Ctrl-' key, while the `QUIT' signal is generated +by the `Ctrl-<\>' key. + + +File: gawk.info, Node: Invoking Gawk, Next: Library Functions, Prev: Advanced Features, Up: Top + +11 Running `awk' and `gawk' +*************************** + +This major node covers how to run awk, both POSIX-standard and +`gawk'-specific command-line options, and what `awk' and `gawk' do with +non-option arguments. It then proceeds to cover how `gawk' searches +for source files, obsolete options and/or features, and known bugs in +`gawk'. This major node rounds out the discussion of `awk' as a +program and as a language. + + While a number of the options and features described here were +discussed in passing earlier in the book, this major node provides the +full details. + +* Menu: + +* Command Line:: How to run `awk'. +* Options:: Command-line options and their meanings. +* Other Arguments:: Input file names and variable assignments. +* AWKPATH Variable:: Searching directories for `awk' + programs. +* Obsolete:: Obsolete Options and/or features. +* Undocumented:: Undocumented Options and Features. +* Known Bugs:: Known Bugs in `gawk'. + + +File: gawk.info, Node: Command Line, Next: Options, Up: Invoking Gawk + +11.1 Invoking `awk' +=================== + +There are two ways to run `awk'--with an explicit program or with one +or more program files. Here are templates for both of them; items +enclosed in [...] in these templates are optional: + + awk [OPTIONS] -f progfile [`--'] FILE ... + awk [OPTIONS] [`--'] 'PROGRAM' FILE ... + + Besides traditional one-letter POSIX-style options, `gawk' also +supports GNU long options. + + It is possible to invoke `awk' with an empty program: + + awk '' datafile1 datafile2 + +Doing so makes little sense, though; `awk' exits silently when given an +empty program. (d.c.) If `--lint' has been specified on the command +line, `gawk' issues a warning that the program is empty. + + +File: gawk.info, Node: Options, Next: Other Arguments, Prev: Command Line, Up: Invoking Gawk + +11.2 Command-Line Options +========================= + +Options begin with a dash and consist of a single character. GNU-style +long options consist of two dashes and a keyword. The keyword can be +abbreviated, as long as the abbreviation allows the option to be +uniquely identified. If the option takes an argument, then the keyword +is either immediately followed by an equals sign (`=') and the +argument's value, or the keyword and the argument's value are separated +by whitespace. If a particular option with a value is given more than +once, it is the last value that counts. + + Each long option for `gawk' has a corresponding POSIX-style option. +The long and short options are interchangeable in all contexts. The +options and their meanings are as follows: + +`-F FS' +`--field-separator FS' + Sets the `FS' variable to FS (*note Field Separators::). + +`-f SOURCE-FILE' +`--file SOURCE-FILE' + Indicates that the `awk' program is to be found in SOURCE-FILE + instead of in the first non-option argument. + +`-v VAR=VAL' +`--assign VAR=VAL' + Sets the variable VAR to the value VAL _before_ execution of the + program begins. Such variable values are available inside the + `BEGIN' rule (*note Other Arguments::). + + The `-v' option can only set one variable, but it can be used more + than once, setting another variable each time, like this: `awk + -v foo=1 -v bar=2 ...'. + + *Caution:* Using `-v' to set the values of the built-in variables + may lead to surprising results. `awk' will reset the values of + those variables as it needs to, possibly ignoring any predefined + value you may have given. + +`-mf N' +`-mr N' + Sets various memory limits to the value N. The `f' flag sets the + maximum number of fields and the `r' flag sets the maximum record + size. These two flags and the `-m' option are from the Bell + Laboratories research version of Unix `awk'. They are provided + for compatibility but otherwise ignored by `gawk', since `gawk' + has no predefined limits. (The Bell Laboratories `awk' no longer + needs these options; it continues to accept them to avoid breaking + old programs.) + +`-W GAWK-OPT' + Following the POSIX standard, implementation-specific options are + supplied as arguments to the `-W' option. These options also have + corresponding GNU-style long options. Note that the long options + may be abbreviated, as long as the abbreviations remain unique. + The full list of `gawk'-specific options is provided next. + +`--' + Signals the end of the command-line options. The following + arguments are not treated as options even if they begin with `-'. + This interpretation of `--' follows the POSIX argument parsing + conventions. + + This is useful if you have file names that start with `-', or in + shell scripts, if you have file names that will be specified by + the user that could start with `-'. + + The previous list described options mandated by the POSIX standard, +as well as options available in the Bell Laboratories version of `awk'. +The following list describes `gawk'-specific options: + +`-W compat' +`-W traditional' +`--compat' +`--traditional' + Specifies "compatibility mode", in which the GNU extensions to the + `awk' language are disabled, so that `gawk' behaves just like the + Bell Laboratories research version of Unix `awk'. `--traditional' + is the preferred form of this option. *Note POSIX/GNU::, which + summarizes the extensions. Also see *note Compatibility Mode::. + +`-W copyright' +`--copyright' + Print the short version of the General Public License and then + exit. + +`-W copyleft' +`--copyleft' + Just like `--copyright'. This option may disappear in a future + version of `gawk'. + +`-W dump-variables[=FILE]' +`--dump-variables[=FILE]' + Prints a sorted list of global variables, their types, and final + values to FILE. If no FILE is provided, `gawk' prints this list + to the file named `awkvars.out' in the current directory. + + Having a list of all global variables is a good way to look for + typographical errors in your programs. You would also use this + option if you have a large program with a lot of functions, and + you want to be sure that your functions don't inadvertently use + global variables that you meant to be local. (This is a + particularly easy mistake to make with simple variable names like + `i', `j', etc.) + +`-W exec FILE' +`--exec FILE' + Similar to `-f', reads `awk' program text from FILE. There are + two differences. The fist is that this option also terminates + option processing; anything else on the command line is passed on + directly to the `awk' program. The second is that command line + variable assignments of the form `VAR=VALUE' are disallowed. + + This option is particularly necessary for World Wide Web CGI + applications that pass arguments through the URL; using this + option prevents a malicious (or other) user from passing in + options, assignments, or `awk' source code (via `--source') to the + CGI application. This option should be used with `#!' scripts + (*note Executable Scripts::), like so: + + #! /usr/local/bin/gawk --exec + + AWK PROGRAM HERE ... + +`-W gen-po' +`--gen-po' + Analyzes the source program and generates a GNU `gettext' Portable + Object file on standard output for all string constants that have + been marked for translation. *Note Internationalization::, for + information about this option. + +`-W help' +`-W usage' +`--help' +`--usage' + Prints a "usage" message summarizing the short and long style + options that `gawk' accepts and then exit. + +`-W lint[=fatal]' +`--lint[=fatal]' + Warns about constructs that are dubious or nonportable to other + `awk' implementations. Some warnings are issued when `gawk' first + reads your program. Others are issued at runtime, as your program + executes. With an optional argument of `fatal', lint warnings + become fatal errors. This may be drastic, but its use will + certainly encourage the development of cleaner `awk' programs. + With an optional argument of `invalid', only warnings about things + that are actually invalid are issued. (This is not fully + implemented yet.) + + Some warnings are only printed once, even if the dubious + constructs they warn about occur multiple times in your `awk' + program. Thus, when eliminating problems pointed out by `--lint', + you should take care to search for all occurrences of each + inappropriate construct. As `awk' programs are usually short, + doing so is not burdensome. + +`-W lint-old' +`--lint-old' + Warns about constructs that are not available in the original + version of `awk' from Version 7 Unix (*note V7/SVR3.1::). + +`-W non-decimal-data' +`--non-decimal-data' + Enable automatic interpretation of octal and hexadecimal values in + input data (*note Nondecimal Data::). + + *Caution:* This option can severely break old programs. Use with + care. + +`-W posix' +`--posix' + Operates in strict POSIX mode. This disables all `gawk' + extensions (just like `--traditional') and adds the following + additional restrictions: + + * `\x' escape sequences are not recognized (*note Escape + Sequences::). + + * Newlines do not act as whitespace to separate fields when + `FS' is equal to a single space (*note Fields::). + + * Newlines are not allowed after `?' or `:' (*note Conditional + Exp::). + + * The synonym `func' for the keyword `function' is not + recognized (*note Definition Syntax::). + + * The `**' and `**=' operators cannot be used in place of `^' + and `^=' (*note Arithmetic Ops::, and also *note Assignment + Ops::). + + * Specifying `-Ft' on the command-line does not set the value + of `FS' to be a single TAB character (*note Field + Separators::). + + * The locale's decimal point character is used for parsing input + data (*note Locales::). + + * The `fflush' built-in function is not supported (*note I/O + Functions::). + + If you supply both `--traditional' and `--posix' on the command + line, `--posix' takes precedence. `gawk' also issues a warning if + both options are supplied. + +`-W profile[=FILE]' +`--profile[=FILE]' + Enable profiling of `awk' programs (*note Profiling::). By + default, profiles are created in a file named `awkprof.out'. The + optional FILE argument allows you to specify a different file name + for the profile file. + + When run with `gawk', the profile is just a "pretty printed" + version of the program. When run with `pgawk', the profile + contains execution counts for each statement in the program in the + left margin, and function call counts for each function. + +`-W re-interval' +`--re-interval' + Allows interval expressions (*note Regexp Operators::) in regexps. + Because interval expressions were traditionally not available in + `awk', `gawk' does not provide them by default. This prevents old + `awk' programs from breaking. + +`-W source PROGRAM-TEXT' +`--source PROGRAM-TEXT' + Allows you to mix source code in files with source code that you + enter on the command line. Program source code is taken from the + PROGRAM-TEXT. This is particularly useful when you have library + functions that you want to use from your command-line programs + (*note AWKPATH Variable::). + +`-W use-lc-numeric' +`--use-lc-numeric' + This option forces the use of the locale's decimal point character + when parsing numeric input data (*note Locales::). + +`-W version' +`--version' + Prints version information for this particular copy of `gawk'. + This allows you to determine if your copy of `gawk' is up to date + with respect to whatever the Free Software Foundation is currently + distributing. It is also useful for bug reports (*note Bugs::). + + As long as program text has been supplied, any other options are +flagged as invalid with a warning message but are otherwise ignored. + + In compatibility mode, as a special case, if the value of FS supplied +to the `-F' option is `t', then `FS' is set to the TAB character +(`"\t"'). This is true only for `--traditional' and not for `--posix' +(*note Field Separators::). + + The `-f' option may be used more than once on the command line. If +it is, `awk' reads its program source from all of the named files, as +if they had been concatenated together into one big file. This is +useful for creating libraries of `awk' functions. These functions can +be written once and then retrieved from a standard place, instead of +having to be included into each individual program. (As mentioned in +*note Definition Syntax::, function names must be unique.) + + Library functions can still be used, even if the program is entered +at the terminal, by specifying `-f /dev/tty'. After typing your +program, type `Ctrl-d' (the end-of-file character) to terminate it. +(You may also use `-f -' to read program source from the standard input +but then you will not be able to also use the standard input as a +source of data.) + + Because it is clumsy using the standard `awk' mechanisms to mix +source file and command-line `awk' programs, `gawk' provides the +`--source' option. This does not require you to pre-empt the standard +input for your source code; it allows you to easily mix command-line +and library source code (*note AWKPATH Variable::). + + If no `-f' or `--source' option is specified, then `gawk' uses the +first non-option command-line argument as the text of the program +source code. + + If the environment variable `POSIXLY_CORRECT' exists, then `gawk' +behaves in strict POSIX mode, exactly as if you had supplied the +`--posix' command-line option. Many GNU programs look for this +environment variable to turn on strict POSIX mode. If `--lint' is +supplied on the command line and `gawk' turns on POSIX mode because of +`POSIXLY_CORRECT', then it issues a warning message indicating that +POSIX mode is in effect. You would typically set this variable in your +shell's startup file. For a Bourne-compatible shell (such as `bash'), +you would add these lines to the `.profile' file in your home directory: + + POSIXLY_CORRECT=true + export POSIXLY_CORRECT + + For a `csh'-compatible shell,(1) you would add this line to the +`.login' file in your home directory: + + setenv POSIXLY_CORRECT true + + Having `POSIXLY_CORRECT' set is not recommended for daily use, but +it is good for testing the portability of your programs to other +environments. + + ---------- Footnotes ---------- + + (1) Not recommended. + + +File: gawk.info, Node: Other Arguments, Next: AWKPATH Variable, Prev: Options, Up: Invoking Gawk + +11.3 Other Command-Line Arguments +================================= + +Any additional arguments on the command line are normally treated as +input files to be processed in the order specified. However, an +argument that has the form `VAR=VALUE', assigns the value VALUE to the +variable VAR--it does not specify a file at all. (This was discussed +earlier in *note Assignment Options::.) + + All these arguments are made available to your `awk' program in the +`ARGV' array (*note Built-in Variables::). Command-line options and +the program text (if present) are omitted from `ARGV'. All other +arguments, including variable assignments, are included. As each +element of `ARGV' is processed, `gawk' sets the variable `ARGIND' to +the index in `ARGV' of the current element. + + The distinction between file name arguments and variable-assignment +arguments is made when `awk' is about to open the next input file. At +that point in execution, it checks the file name to see whether it is +really a variable assignment; if so, `awk' sets the variable instead of +reading a file. + + Therefore, the variables actually receive the given values after all +previously specified files have been read. In particular, the values of +variables assigned in this fashion are _not_ available inside a `BEGIN' +rule (*note BEGIN/END::), because such rules are run before `awk' +begins scanning the argument list. + + The variable values given on the command line are processed for +escape sequences (*note Escape Sequences::). (d.c.) + + In some earlier implementations of `awk', when a variable assignment +occurred before any file names, the assignment would happen _before_ +the `BEGIN' rule was executed. `awk''s behavior was thus inconsistent; +some command-line assignments were available inside the `BEGIN' rule, +while others were not. Unfortunately, some applications came to depend +upon this "feature." When `awk' was changed to be more consistent, the +`-v' option was added to accommodate applications that depended upon +the old behavior. + + The variable assignment feature is most useful for assigning to +variables such as `RS', `OFS', and `ORS', which control input and +output formats before scanning the data files. It is also useful for +controlling state if multiple passes are needed over a data file. For +example: + + awk 'pass == 1 { PASS 1 STUFF } + pass == 2 { PASS 2 STUFF }' pass=1 mydata pass=2 mydata + + Given the variable assignment feature, the `-F' option for setting +the value of `FS' is not strictly necessary. It remains for historical +compatibility. + + +File: gawk.info, Node: AWKPATH Variable, Next: Obsolete, Prev: Other Arguments, Up: Invoking Gawk + +11.4 The `AWKPATH' Environment Variable +======================================= + +The previous minor node described how `awk' program files can be named +on the command-line with the `-f' option. In most `awk' +implementations, you must supply a precise path name for each program +file, unless the file is in the current directory. But in `gawk', if +the file name supplied to the `-f' option does not contain a `/', then +`gawk' searches a list of directories (called the "search path"), one +by one, looking for a file with the specified name. + +The search path is a string consisting of directory names separated by +colons. `gawk' gets its search path from the `AWKPATH' environment +variable. If that variable does not exist, `gawk' uses a default path, +`.:/usr/local/share/awk'.(1) (Programs written for use by system +administrators should use an `AWKPATH' variable that does not include +the current directory, `.'.) + + The search path feature is particularly useful for building libraries +of useful `awk' functions. The library files can be placed in a +standard directory in the default path and then specified on the +command line with a short file name. Otherwise, the full file name +would have to be typed for each file. + + By using both the `--source' and `-f' options, your command-line +`awk' programs can use facilities in `awk' library files (*note Library +Functions::). Path searching is not done if `gawk' is in compatibility +mode. This is true for both `--traditional' and `--posix'. *Note +Options::. + + NOTE: If you want files in the current directory to be found, you + must include the current directory in the path, either by including + `.' explicitly in the path or by writing a null entry in the path. + (A null entry is indicated by starting or ending the path with a + colon or by placing two colons next to each other (`::').) If the + current directory is not included in the path, then files cannot be + found in the current directory. This path search mechanism is + identical to the shell's. + + Starting with version 3.0, if `AWKPATH' is not defined in the +environment, `gawk' places its default search path into +`ENVIRON["AWKPATH"]'. This makes it easy to determine the actual search +path that `gawk' will use from within an `awk' program. + + While you can change `ENVIRON["AWKPATH"]' within your `awk' program, +this has no effect on the running program's behavior. This makes +sense: the `AWKPATH' environment variable is used to find the program +source files. Once your program is running, all the files have been +found, and `gawk' no longer needs to use `AWKPATH'. + + ---------- Footnotes ---------- + + (1) Your version of `gawk' may use a different directory; it will +depend upon how `gawk' was built and installed. The actual directory is +the value of `$(datadir)' generated when `gawk' was configured. You +probably don't need to worry about this, though. + + +File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: AWKPATH Variable, Up: Invoking Gawk + +11.5 Obsolete Options and/or Features +===================================== + +This minor node describes features and/or command-line options from +previous releases of `gawk' that are either not available in the +current version or that are still supported but deprecated (meaning that +they will _not_ be in the next release). + + For version 3.1 of `gawk', there are no deprecated command-line +options from the previous version of `gawk'. The use of `next file' +(two words) for `nextfile' was deprecated in `gawk' 3.0 but still +worked. Starting with version 3.1, the two-word usage is no longer +accepted. + + The process-related special files described in *note Special +Process::, work as described, but are now considered deprecated. +`gawk' prints a warning message every time they are used. (Use +`PROCINFO' instead; see *note Auto-set::.) They will be removed from +the next release of `gawk'. + + +File: gawk.info, Node: Undocumented, Next: Known Bugs, Prev: Obsolete, Up: Invoking Gawk + +11.6 Undocumented Options and Features +====================================== + + Use the Source, Luke! + Obi-Wan + + This minor node intentionally left blank. + + +File: gawk.info, Node: Known Bugs, Prev: Undocumented, Up: Invoking Gawk + +11.7 Known Bugs in `gawk' +========================= + + * The `-F' option for changing the value of `FS' (*note Options::) + is not necessary given the command-line variable assignment + feature; it remains only for backward compatibility. + + * Syntactically invalid single-character programs tend to overflow + the parse stack, generating a rather unhelpful message. Such + programs are surprisingly difficult to diagnose in the completely + general case, and the effort to do so really is not worth it. + + +File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Invoking Gawk, Up: Top + +12 A Library of `awk' Functions +******************************* + +*note User-defined::, describes how to write your own `awk' functions. +Writing functions is important, because it allows you to encapsulate +algorithms and program tasks in a single place. It simplifies +programming, making program development more manageable, and making +programs more readable. + + One valuable way to learn a new programming language is to _read_ +programs in that language. To that end, this major node and *note +Sample Programs::, provide a good-sized body of code for you to read, +and hopefully, to learn from. + + This major node presents a library of useful `awk' functions. Many +of the sample programs presented later in this Info file use these +functions. The functions are presented here in a progression from +simple to complex. + + *note Extract Program::, presents a program that you can use to +extract the source code for these example library functions and +programs from the Texinfo source for this Info file. (This has already +been done as part of the `gawk' distribution.) + + If you have written one or more useful, general-purpose `awk' +functions and would like to contribute them to the author's collection +of `awk' programs, see *note How To Contribute::, for more information. + + The programs in this major node and in *note Sample Programs::, +freely use features that are `gawk'-specific. Rewriting these programs +for different implementations of awk is pretty straightforward. + + Diagnostic error messages are sent to `/dev/stderr'. Use `| "cat +1>&2"' instead of `> "/dev/stderr"' if your system does not have a +`/dev/stderr', or if you cannot use `gawk'. + + A number of programs use `nextfile' (*note Nextfile Statement::) to +skip any remaining input in the input file. *note Nextfile Function::, +shows you how to write a function that does the same thing. + + Finally, some of the programs choose to ignore upper- and lowercase +distinctions in their input. They do so by assigning one to +`IGNORECASE'. You can achieve almost the same effect(1) by adding the +following rule to the beginning of the program: + + # ignore case + { $0 = tolower($0) } + +Also, verify that all regexp and string constants used in comparisons +use only lowercase letters. + +* Menu: + +* Library Names:: How to best name private global variables in + library functions. +* General Functions:: Functions that are of general use. +* Data File Management:: Functions for managing command-line data + files. +* Getopt Function:: A function for processing command-line + arguments. +* Passwd Functions:: Functions for getting user information. +* Group Functions:: Functions for getting group information. + + ---------- Footnotes ---------- + + (1) The effects are not identical. Output of the transformed record +will be in all lowercase, while `IGNORECASE' preserves the original +contents of the input record. + + +File: gawk.info, Node: Library Names, Next: General Functions, Up: Library Functions + +12.1 Naming Library Function Global Variables +============================================= + +Due to the way the `awk' language evolved, variables are either +"global" (usable by the entire program) or "local" (usable just by a +specific function). There is no intermediate state analogous to +`static' variables in C. + + Library functions often need to have global variables that they can +use to preserve state information between calls to the function--for +example, `getopt''s variable `_opti' (*note Getopt Function::). Such +variables are called "private", since the only functions that need to +use them are the ones in the library. + + When writing a library function, you should try to choose names for +your private variables that will not conflict with any variables used by +either another library function or a user's main program. For example, +a name like `i' or `j' is not a good choice, because user programs +often use variable names like these for their own purposes. + + The example programs shown in this major node all start the names of +their private variables with an underscore (`_'). Users generally +don't use leading underscores in their variable names, so this +convention immediately decreases the chances that the variable name +will be accidentally shared with the user's program. + + In addition, several of the library functions use a prefix that helps +indicate what function or set of functions use the variables--for +example, `_pw_byname' in the user database routines (*note Passwd +Functions::). This convention is recommended, since it even further +decreases the chance of inadvertent conflict among variable names. +Note that this convention is used equally well for variable names and +for private function names as well.(1) + + As a final note on variable naming, if a function makes global +variables available for use by a main program, it is a good convention +to start that variable's name with a capital letter--for example, +`getopt''s `Opterr' and `Optind' variables (*note Getopt Function::). +The leading capital letter indicates that it is global, while the fact +that the variable name is not all capital letters indicates that the +variable is not one of `awk''s built-in variables, such as `FS'. + + It is also important that _all_ variables in library functions that +do not need to save state are, in fact, declared local.(2) If this is +not done, the variable could accidentally be used in the user's +program, leading to bugs that are very difficult to track down: + + function lib_func(x, y, l1, l2) + { + ... + USE VARIABLE some_var # some_var should be local + ... # but is not by oversight + } + + A different convention, common in the Tcl community, is to use a +single associative array to hold the values needed by the library +function(s), or "package." This significantly decreases the number of +actual global names in use. For example, the functions described in +*note Passwd Functions::, might have used array elements +`PW_data["inited"]', `PW_data["total"]', `PW_data["count"]', and +`PW_data["awklib"]', instead of `_pw_inited', `_pw_awklib', `_pw_total', +and `_pw_count'. + + The conventions presented in this minor node are exactly that: +conventions. You are not required to write your programs this way--we +merely recommend that you do so. + + ---------- Footnotes ---------- + + (1) While all the library routines could have been rewritten to use +this convention, this was not done, in order to show how my own `awk' +programming style has evolved and to provide some basis for this +discussion. + + (2) `gawk''s `--dump-variables' command-line option is useful for +verifying this. + + +File: gawk.info, Node: General Functions, Next: Data File Management, Prev: Library Names, Up: Library Functions + +12.2 General Programming +======================== + +This minor node presents a number of functions that are of general +programming use. + +* Menu: + +* Nextfile Function:: Two implementations of a `nextfile' + function. +* Strtonum Function:: A replacement for the built-in `strtonum' + function. +* Assert Function:: A function for assertions in `awk' + programs. +* Round Function:: A function for rounding if `sprintf' does + not do it correctly. +* Cliff Random Function:: The Cliff Random Number Generator. +* Ordinal Functions:: Functions for using characters as numbers and + vice versa. +* Join Function:: A function to join an array into a string. +* Gettimeofday Function:: A function to get formatted times. + + +File: gawk.info, Node: Nextfile Function, Next: Strtonum Function, Up: General Functions + +12.2.1 Implementing `nextfile' as a Function +-------------------------------------------- + +The `nextfile' statement, presented in *note Nextfile Statement::, is a +`gawk'-specific extension--it is not available in most other +implementations of `awk'. This minor node shows two versions of a +`nextfile' function that you can use to simulate `gawk''s `nextfile' +statement if you cannot use `gawk'. + + A first attempt at writing a `nextfile' function is as follows: + + # nextfile --- skip remaining records in current file + # this should be read in before the "main" awk program + + function nextfile() { _abandon_ = FILENAME; next } + _abandon_ == FILENAME { next } + + Because it supplies a rule that must be executed first, this file +should be included before the main program. This rule compares the +current data file's name (which is always in the `FILENAME' variable) to +a private variable named `_abandon_'. If the file name matches, then +the action part of the rule executes a `next' statement to go on to the +next record. (The use of `_' in the variable name is a convention. It +is discussed more fully in *note Library Names::.) + + The use of the `next' statement effectively creates a loop that reads +all the records from the current data file. The end of the file is +eventually reached and a new data file is opened, changing the value of +`FILENAME'. Once this happens, the comparison of `_abandon_' to +`FILENAME' fails, and execution continues with the first rule of the +"real" program. + + The `nextfile' function itself simply sets the value of `_abandon_' +and then executes a `next' statement to start the loop. + + This initial version has a subtle problem. If the same data file is +listed _twice_ on the command line, one right after the other or even +with just a variable assignment between them, this code skips right +through the file a second time, even though it should stop when it gets +to the end of the first occurrence. A second version of `nextfile' +that remedies this problem is shown here: + + # nextfile --- skip remaining records in current file + # correctly handle successive occurrences of the same file + # this should be read in before the "main" awk program + + function nextfile() { _abandon_ = FILENAME; next } + + _abandon_ == FILENAME { + if (FNR == 1) + _abandon_ = "" + else + next + } + + The `nextfile' function has not changed. It makes `_abandon_' equal +to the current file name and then executes a `next' statement. The +`next' statement reads the next record and increments `FNR' so that +`FNR' is guaranteed to have a value of at least two. However, if +`nextfile' is called for the last record in the file, then `awk' closes +the current data file and moves on to the next one. Upon doing so, +`FILENAME' is set to the name of the new file and `FNR' is reset to +one. If this next file is the same as the previous one, `_abandon_' is +still equal to `FILENAME'. However, `FNR' is equal to one, telling us +that this is a new occurrence of the file and not the one we were +reading when the `nextfile' function was executed. In that case, +`_abandon_' is reset to the empty string, so that further executions of +this rule fail (until the next time that `nextfile' is called). + + If `FNR' is not one, then we are still in the original data file and +the program executes a `next' statement to skip through it. + + An important question to ask at this point is: given that the +functionality of `nextfile' can be provided with a library file, why is +it built into `gawk'? Adding features for little reason leads to +larger, slower programs that are harder to maintain. The answer is +that building `nextfile' into `gawk' provides significant gains in +efficiency. If the `nextfile' function is executed at the beginning of +a large data file, `awk' still has to scan the entire file, splitting +it up into records, just to skip over it. The built-in `nextfile' can +simply close the file immediately and proceed to the next one, which +saves a lot of time. This is particularly important in `awk', because +`awk' programs are generally I/O-bound (i.e., they spend most of their +time doing input and output, instead of performing computations). + + +File: gawk.info, Node: Strtonum Function, Next: Assert Function, Prev: Nextfile Function, Up: General Functions + +12.2.2 Converting Strings To Numbers +------------------------------------ + +The `strtonum' function (*note String Functions::) is a `gawk' +extension. The following function provides an implementation for other +versions of `awk': + + # strtonum --- convert string to number + function mystrtonum(str, ret, chars, n, i, k, c) + { + if (str ~ /^0[0-7]*$/) { + # octal + n = length(str) + ret = 0 + for (i = 1; i <= n; i++) { + c = substr(str, i, 1) + if ((k = index("01234567", c)) > 0) + k-- # adjust for 1-basing in awk + + ret = ret * 8 + k + } + } else if (str ~ /^0[xX][0-9a-fA-f]+/) { + # hexadecimal + str = substr(str, 3) # lop off leading 0x + n = length(str) + ret = 0 + for (i = 1; i <= n; i++) { + c = substr(str, i, 1) + c = tolower(c) + if ((k = index("0123456789", c)) > 0) + k-- # adjust for 1-basing in awk + else if ((k = index("abcdef", c)) > 0) + k += 9 + + ret = ret * 16 + k + } + } else if (str ~ /^[-+]?([0-9]+([.][0-9]*([Ee][0-9]+)?)?|([.][0-9]+([Ee][-+]?[0-9]+)?))$/) { + # decimal number, possibly floating point + ret = str + 0 + } else + ret = "NOT-A-NUMBER" + + return ret + } + + # BEGIN { # gawk test harness + # a[1] = "25" + # a[2] = ".31" + # a[3] = "0123" + # a[4] = "0xdeadBEEF" + # a[5] = "123.45" + # a[6] = "1.e3" + # a[7] = "1.32" + # a[7] = "1.32E2" + # + # for (i = 1; i in a; i++) + # print a[i], strtonum(a[i]), mystrtonum(a[i]) + # } + + The function first looks for C-style octal numbers (base 8). If the +input string matches a regular expression describing octal numbers, +then `mystrtonum' loops through each character in the string. It sets +`k' to the index in `"01234567"' of the current octal digit. Since the +return value is one-based, the `k--' adjusts `k' so it can be used in +computing the return value. + + Similar logic applies to the code that checks for and converts a +hexadecimal value, which starts with `0x' or `0X'. The use of +`tolower' simplifies the computation for finding the correct numeric +value for each hexadecimal digit. + + Finally, if the string matches the (rather complicated) regex for a +regular decimal integer or floating-point number, the computation `ret += str + 0' lets `awk' convert the value to a number. + + A commented-out test program is included, so that the function can +be tested with `gawk' and the results compared to the built-in +`strtonum' function. + + +File: gawk.info, Node: Assert Function, Next: Round Function, Prev: Strtonum Function, Up: General Functions + +12.2.3 Assertions +----------------- + +When writing large programs, it is often useful to know that a +condition or set of conditions is true. Before proceeding with a +particular computation, you make a statement about what you believe to +be the case. Such a statement is known as an "assertion". The C +language provides an `' header file and corresponding +`assert' macro that the programmer can use to make assertions. If an +assertion fails, the `assert' macro arranges to print a diagnostic +message describing the condition that should have been true but was +not, and then it kills the program. In C, using `assert' looks this: + + #include + + int myfunc(int a, double b) + { + assert(a <= 5 && b >= 17.1); + ... + } + + If the assertion fails, the program prints a message similar to this: + + prog.c:5: assertion failed: a <= 5 && b >= 17.1 + + The C language makes it possible to turn the condition into a string +for use in printing the diagnostic message. This is not possible in +`awk', so this `assert' function also requires a string version of the +condition that is being tested. Following is the function: + + # assert --- assert that a condition is true. Otherwise exit. + function assert(condition, string) + { + if (! condition) { + printf("%s:%d: assertion failed: %s\n", + FILENAME, FNR, string) > "/dev/stderr" + _assert_exit = 1 + exit 1 + } + } + + END { + if (_assert_exit) + exit 1 + } + + The `assert' function tests the `condition' parameter. If it is +false, it prints a message to standard error, using the `string' +parameter to describe the failed condition. It then sets the variable +`_assert_exit' to one and executes the `exit' statement. The `exit' +statement jumps to the `END' rule. If the `END' rules finds +`_assert_exit' to be true, it exits immediately. + + The purpose of the test in the `END' rule is to keep any other `END' +rules from running. When an assertion fails, the program should exit +immediately. If no assertions fail, then `_assert_exit' is still false +when the `END' rule is run normally, and the rest of the program's +`END' rules execute. For all of this to work correctly, `assert.awk' +must be the first source file read by `awk'. The function can be used +in a program in the following way: + + function myfunc(a, b) + { + assert(a <= 5 && b >= 17.1, "a <= 5 && b >= 17.1") + ... + } + +If the assertion fails, you see a message similar to the following: + + mydata:1357: assertion failed: a <= 5 && b >= 17.1 + + There is a small problem with this version of `assert'. An `END' +rule is automatically added to the program calling `assert'. Normally, +if a program consists of just a `BEGIN' rule, the input files and/or +standard input are not read. However, now that the program has an `END' +rule, `awk' attempts to read the input data files or standard input +(*note Using BEGIN/END::), most likely causing the program to hang as +it waits for input. + + There is a simple workaround to this: make sure the `BEGIN' rule +always ends with an `exit' statement. + + +File: gawk.info, Node: Round Function, Next: Cliff Random Function, Prev: Assert Function, Up: General Functions + +12.2.4 Rounding Numbers +----------------------- + +The way `printf' and `sprintf' (*note Printf::) perform rounding often +depends upon the system's C `sprintf' subroutine. On many machines, +`sprintf' rounding is "unbiased," which means it doesn't always round a +trailing `.5' up, contrary to naive expectations. In unbiased +rounding, `.5' rounds to even, rather than always up, so 1.5 rounds to +2 but 4.5 rounds to 4. This means that if you are using a format that +does rounding (e.g., `"%.0f"'), you should check what your system does. +The following function does traditional rounding; it might be useful if +your awk's `printf' does unbiased rounding: + + # round.awk --- do normal rounding + function round(x, ival, aval, fraction) + { + ival = int(x) # integer part, int() truncates + + # see if fractional part + if (ival == x) # no fraction + return x + + if (x < 0) { + aval = -x # absolute value + ival = int(aval) + fraction = aval - ival + if (fraction >= .5) + return int(x) - 1 # -2.5 --> -3 + else + return int(x) # -2.3 --> -2 + } else { + fraction = x - ival + if (fraction >= .5) + return ival + 1 + else + return ival + } + } + + # test harness + { print $0, round($0) } + + +File: gawk.info, Node: Cliff Random Function, Next: Ordinal Functions, Prev: Round Function, Up: General Functions + +12.2.5 The Cliff Random Number Generator +---------------------------------------- + +The Cliff random number generator(1) is a very simple random number +generator that "passes the noise sphere test for randomness by showing +no structure." It is easily programmed, in less than 10 lines of `awk' +code: + + # cliff_rand.awk --- generate Cliff random numbers + BEGIN { _cliff_seed = 0.1 } + + function cliff_rand() + { + _cliff_seed = (100 * log(_cliff_seed)) % 1 + if (_cliff_seed < 0) + _cliff_seed = - _cliff_seed + return _cliff_seed + } + + This algorithm requires an initial "seed" of 0.1. Each new value +uses the current seed as input for the calculation. If the built-in +`rand' function (*note Numeric Functions::) isn't random enough, you +might try using this function instead. + + ---------- Footnotes ---------- + + (1) `http://mathworld.wolfram.com/CliffRandomNumberGenerator.html' + + +File: gawk.info, Node: Ordinal Functions, Next: Join Function, Prev: Cliff Random Function, Up: General Functions + +12.2.6 Translating Between Characters and Numbers +------------------------------------------------- + +One commercial implementation of `awk' supplies a built-in function, +`ord', which takes a character and returns the numeric value for that +character in the machine's character set. If the string passed to +`ord' has more than one character, only the first one is used. + + The inverse of this function is `chr' (from the function of the same +name in Pascal), which takes a number and returns the corresponding +character. Both functions are written very nicely in `awk'; there is +no real reason to build them into the `awk' interpreter: + + # ord.awk --- do ord and chr + + # Global identifiers: + # _ord_: numerical values indexed by characters + # _ord_init: function to initialize _ord_ + BEGIN { _ord_init() } + + function _ord_init( low, high, i, t) + { + low = sprintf("%c", 7) # BEL is ascii 7 + if (low == "\a") { # regular ascii + low = 0 + high = 127 + } else if (sprintf("%c", 128 + 7) == "\a") { + # ascii, mark parity + low = 128 + high = 255 + } else { # ebcdic(!) + low = 0 + high = 255 + } + + for (i = low; i <= high; i++) { + t = sprintf("%c", i) + _ord_[t] = i + } + } + + Some explanation of the numbers used by `chr' is worthwhile. The +most prominent character set in use today is ASCII. Although an 8-bit +byte can hold 256 distinct values (from 0 to 255), ASCII only defines +characters that use the values from 0 to 127.(1) In the now distant +past, at least one minicomputer manufacturer used ASCII, but with mark +parity, meaning that the leftmost bit in the byte is always 1. This +means that on those systems, characters have numeric values from 128 to +255. Finally, large mainframe systems use the EBCDIC character set, +which uses all 256 values. While there are other character sets in use +on some older systems, they are not really worth worrying about: + + function ord(str, c) + { + # only first character is of interest + c = substr(str, 1, 1) + return _ord_[c] + } + + function chr(c) + { + # force c to be numeric by adding 0 + return sprintf("%c", c + 0) + } + + #### test code #### + # BEGIN \ + # { + # for (;;) { + # printf("enter a character: ") + # if (getline var <= 0) + # break + # printf("ord(%s) = %d\n", var, ord(var)) + # } + # } + + An obvious improvement to these functions is to move the code for the +`_ord_init' function into the body of the `BEGIN' rule. It was written +this way initially for ease of development. There is a "test program" +in a `BEGIN' rule, to test the function. It is commented out for +production use. + + ---------- Footnotes ---------- + + (1) ASCII has been extended in many countries to use the values from +128 to 255 for country-specific characters. If your system uses these +extensions, you can simplify `_ord_init' to simply loop from 0 to 255. + + +File: gawk.info, Node: Join Function, Next: Gettimeofday Function, Prev: Ordinal Functions, Up: General Functions + +12.2.7 Merging an Array into a String +------------------------------------- + +When doing string processing, it is often useful to be able to join all +the strings in an array into one long string. The following function, +`join', accomplishes this task. It is used later in several of the +application programs (*note Sample Programs::). + + Good function design is important; this function needs to be general +but it should also have a reasonable default behavior. It is called +with an array as well as the beginning and ending indices of the +elements in the array to be merged. This assumes that the array +indices are numeric--a reasonable assumption since the array was likely +created with `split' (*note String Functions::): + + # join.awk --- join an array into a string + function join(array, start, end, sep, result, i) + { + if (sep == "") + sep = " " + else if (sep == SUBSEP) # magic value + sep = "" + result = array[start] + for (i = start + 1; i <= end; i++) + result = result sep array[i] + return result + } + + An optional additional argument is the separator to use when joining +the strings back together. If the caller supplies a nonempty value, +`join' uses it; if it is not supplied, it has a null value. In this +case, `join' uses a single blank as a default separator for the +strings. If the value is equal to `SUBSEP', then `join' joins the +strings with no separator between them. `SUBSEP' serves as a "magic" +value to indicate that there should be no separation between the +component strings.(1) + + ---------- Footnotes ---------- + + (1) It would be nice if `awk' had an assignment operator for +concatenation. The lack of an explicit operator for concatenation +makes string operations more difficult than they really need to be. + + +File: gawk.info, Node: Gettimeofday Function, Prev: Join Function, Up: General Functions + +12.2.8 Managing the Time of Day +------------------------------- + +The `systime' and `strftime' functions described in *note Time +Functions::, provide the minimum functionality necessary for dealing +with the time of day in human readable form. While `strftime' is +extensive, the control formats are not necessarily easy to remember or +intuitively obvious when reading a program. + + The following function, `gettimeofday', populates a user-supplied +array with preformatted time information. It returns a string with the +current time formatted in the same way as the `date' utility: + + # gettimeofday.awk --- get the time of day in a usable format + + # Returns a string in the format of output of date(1) + # Populates the array argument time with individual values: + # time["second"] -- seconds (0 - 59) + # time["minute"] -- minutes (0 - 59) + # time["hour"] -- hours (0 - 23) + # time["althour"] -- hours (0 - 12) + # time["monthday"] -- day of month (1 - 31) + # time["month"] -- month of year (1 - 12) + # time["monthname"] -- name of the month + # time["shortmonth"] -- short name of the month + # time["year"] -- year modulo 100 (0 - 99) + # time["fullyear"] -- full year + # time["weekday"] -- day of week (Sunday = 0) + # time["altweekday"] -- day of week (Monday = 0) + # time["dayname"] -- name of weekday + # time["shortdayname"] -- short name of weekday + # time["yearday"] -- day of year (0 - 365) + # time["timezone"] -- abbreviation of timezone name + # time["ampm"] -- AM or PM designation + # time["weeknum"] -- week number, Sunday first day + # time["altweeknum"] -- week number, Monday first day + + function gettimeofday(time, ret, now, i) + { + # get time once, avoids unnecessary system calls + now = systime() + + # return date(1)-style output + ret = strftime("%a %b %d %H:%M:%S %Z %Y", now) + + # clear out target array + delete time + + # fill in values, force numeric values to be + # numeric by adding 0 + time["second"] = strftime("%S", now) + 0 + time["minute"] = strftime("%M", now) + 0 + time["hour"] = strftime("%H", now) + 0 + time["althour"] = strftime("%I", now) + 0 + time["monthday"] = strftime("%d", now) + 0 + time["month"] = strftime("%m", now) + 0 + time["monthname"] = strftime("%B", now) + time["shortmonth"] = strftime("%b", now) + time["year"] = strftime("%y", now) + 0 + time["fullyear"] = strftime("%Y", now) + 0 + time["weekday"] = strftime("%w", now) + 0 + time["altweekday"] = strftime("%u", now) + 0 + time["dayname"] = strftime("%A", now) + time["shortdayname"] = strftime("%a", now) + time["yearday"] = strftime("%j", now) + 0 + time["timezone"] = strftime("%Z", now) + time["ampm"] = strftime("%p", now) + time["weeknum"] = strftime("%U", now) + 0 + time["altweeknum"] = strftime("%W", now) + 0 + + return ret + } + + The string indices are easier to use and read than the various +formats required by `strftime'. The `alarm' program presented in *note +Alarm Program::, uses this function. A more general design for the +`gettimeofday' function would have allowed the user to supply an +optional timestamp value to use instead of the current time. + + +File: gawk.info, Node: Data File Management, Next: Getopt Function, Prev: General Functions, Up: Library Functions + +12.3 Data File Management +========================= + +This minor node presents functions that are useful for managing +command-line data files. + +* Menu: + +* Filetrans Function:: A function for handling data file transitions. +* Rewind Function:: A function for rereading the current file. +* File Checking:: Checking that data files are readable. +* Empty Files:: Checking for zero-length files. +* Ignoring Assigns:: Treating assignments as file names. + + +File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data File Management + +12.3.1 Noting Data File Boundaries +---------------------------------- + +The `BEGIN' and `END' rules are each executed exactly once at the +beginning and end of your `awk' program, respectively (*note +BEGIN/END::). We (the `gawk' authors) once had a user who mistakenly +thought that the `BEGIN' rule is executed at the beginning of each data +file and the `END' rule is executed at the end of each data file. When +informed that this was not the case, the user requested that we add new +special patterns to `gawk', named `BEGIN_FILE' and `END_FILE', that +would have the desired behavior. He even supplied us the code to do so. + + Adding these special patterns to `gawk' wasn't necessary; the job +can be done cleanly in `awk' itself, as illustrated by the following +library program. It arranges to call two user-supplied functions, +`beginfile' and `endfile', at the beginning and end of each data file. +Besides solving the problem in only nine(!) lines of code, it does so +_portably_; this works with any implementation of `awk': + + # transfile.awk + # + # Give the user a hook for filename transitions + # + # The user must supply functions beginfile() and endfile() + # that each take the name of the file being started or + # finished, respectively. + + FILENAME != _oldfilename \ + { + if (_oldfilename != "") + endfile(_oldfilename) + _oldfilename = FILENAME + beginfile(FILENAME) + } + + END { endfile(FILENAME) } + + This file must be loaded before the user's "main" program, so that +the rule it supplies is executed first. + + This rule relies on `awk''s `FILENAME' variable that automatically +changes for each new data file. The current file name is saved in a +private variable, `_oldfilename'. If `FILENAME' does not equal +`_oldfilename', then a new data file is being processed and it is +necessary to call `endfile' for the old file. Because `endfile' should +only be called if a file has been processed, the program first checks +to make sure that `_oldfilename' is not the null string. The program +then assigns the current file name to `_oldfilename' and calls +`beginfile' for the file. Because, like all `awk' variables, +`_oldfilename' is initialized to the null string, this rule executes +correctly even for the first data file. + + The program also supplies an `END' rule to do the final processing +for the last file. Because this `END' rule comes before any `END' rules +supplied in the "main" program, `endfile' is called first. Once again +the value of multiple `BEGIN' and `END' rules should be clear. + + This version has same problem as the first version of `nextfile' +(*note Nextfile Function::). If the same data file occurs twice in a +row on the command line, then `endfile' and `beginfile' are not +executed at the end of the first pass and at the beginning of the +second pass. The following version solves the problem: + + # ftrans.awk --- handle data file transitions + # + # user supplies beginfile() and endfile() functions + FNR == 1 { + if (_filename_ != "") + endfile(_filename_) + _filename_ = FILENAME + beginfile(FILENAME) + } + + END { endfile(_filename_) } + + *note Wc Program::, shows how this library function can be used and +how it simplifies writing the main program. + + +File: gawk.info, Node: Rewind Function, Next: File Checking, Prev: Filetrans Function, Up: Data File Management + +12.3.2 Rereading the Current File +--------------------------------- + +Another request for a new built-in function was for a `rewind' function +that would make it possible to reread the current file. The requesting +user didn't want to have to use `getline' (*note Getline::) inside a +loop. + + However, as long as you are not in the `END' rule, it is quite easy +to arrange to immediately close the current input file and then start +over with it from the top. For lack of a better name, we'll call it +`rewind': + + # rewind.awk --- rewind the current file and start over + function rewind( i) + { + # shift remaining arguments up + for (i = ARGC; i > ARGIND; i--) + ARGV[i] = ARGV[i-1] + + # make sure gawk knows to keep going + ARGC++ + + # make current file next to get done + ARGV[ARGIND+1] = FILENAME + + # do it + nextfile + } + + This code relies on the `ARGIND' variable (*note Auto-set::), which +is specific to `gawk'. If you are not using `gawk', you can use ideas +presented in *note Filetrans Function::, to either update `ARGIND' on +your own or modify this code as appropriate. + + The `rewind' function also relies on the `nextfile' keyword (*note +Nextfile Statement::). *Note Nextfile Function::, for a function +version of `nextfile'. + + +File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management + +12.3.3 Checking for Readable Data Files +--------------------------------------- + +Normally, if you give `awk' a data file that isn't readable, it stops +with a fatal error. There are times when you might want to just ignore +such files and keep going. You can do this by prepending the following +program to your `awk' program: + + # readable.awk --- library file to skip over unreadable files + BEGIN { + for (i = 1; i < ARGC; i++) { + if (ARGV[i] ~ /^[A-Za-z_][A-Za-z0-9_]*=.*/ \ + || ARGV[i] == "-") + continue # assignment or standard input + else if ((getline junk < ARGV[i]) < 0) # unreadable + delete ARGV[i] + else + close(ARGV[i]) + } + } + + In `gawk', the `getline' won't be fatal (unless `--posix' is in +force). Removing the element from `ARGV' with `delete' skips the file +(since it's no longer in the list). + + +File: gawk.info, Node: Empty Files, Next: Ignoring Assigns, Prev: File Checking, Up: Data File Management + +12.3.4 Checking For Zero-length Files +------------------------------------- + +All known `awk' implementations silently skip over zero-length files. +This is a by-product of `awk''s implicit +read-a-record-and-match-against-the-rules loop: when `awk' tries to +read a record from an empty file, it immediately receives an end of +file indication, closes the file, and proceeds on to the next +command-line data file, _without_ executing any user-level `awk' +program code. + + Using `gawk''s `ARGIND' variable (*note Built-in Variables::), it is +possible to detect when an empty data file has been skipped. Similar +to the library file presented in *note Filetrans Function::, the +following library file calls a function named `zerofile' that the user +must provide. The arguments passed are the file name and the position +in `ARGV' where it was found: + + # zerofile.awk --- library file to process empty input files + BEGIN { Argind = 0 } + + ARGIND > Argind + 1 { + for (Argind++; Argind < ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) + } + + ARGIND != Argind { Argind = ARGIND } + + END { + if (ARGIND > Argind) + for (Argind++; Argind <= ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) + } + + The user-level variable `Argind' allows the `awk' program to track +its progress through `ARGV'. Whenever the program detects that +`ARGIND' is greater than `Argind + 1', it means that one or more empty +files were skipped. The action then calls `zerofile' for each such +file, incrementing `Argind' along the way. + + The `Argind != ARGIND' rule simply keeps `Argind' up to date in the +normal case. + + Finally, the `END' rule catches the case of any empty files at the +end of the command-line arguments. Note that the test in the condition +of the `for' loop uses the `<=' operator, not `<'. + + As an exercise, you might consider whether this same problem can be +solved without relying on `gawk''s `ARGIND' variable. + + As a second exercise, revise this code to handle the case where an +intervening value in `ARGV' is a variable assignment. + + +File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Management + +12.3.5 Treating Assignments as File Names +----------------------------------------- + +Occasionally, you might not want `awk' to process command-line variable +assignments (*note Assignment Options::). In particular, if you have +file names that contain an `=' character, `awk' treats the file name as +an assignment, and does not process it. + + Some users have suggested an additional command-line option for +`gawk' to disable command-line assignments. However, some simple +programming with a library file does the trick: + + # noassign.awk --- library file to avoid the need for a + # special option that disables command-line assignments + function disable_assigns(argc, argv, i) + { + for (i = 1; i < argc; i++) + if (argv[i] ~ /^[A-Za-z_][A-Za-z_0-9]*=.*/) + argv[i] = ("./" argv[i]) + } + + BEGIN { + if (No_command_assign) + disable_assigns(ARGC, ARGV) + } + + You then run your program this way: + + awk -v No_command_assign=1 -f noassign.awk -f yourprog.awk * + + The function works by looping through the arguments. It prepends +`./' to any argument that matches the form of a variable assignment, +turning that argument into a file name. + + The use of `No_command_assign' allows you to disable command-line +assignments at invocation time, by giving the variable a true value. +When not set, it is initially zero (i.e., false), so the command-line +arguments are left alone. + + +File: gawk.info, Node: Getopt Function, Next: Passwd Functions, Prev: Data File Management, Up: Library Functions + +12.4 Processing Command-Line Options +==================================== + +Most utilities on POSIX compatible systems take options, or "switches," +on the command line that can be used to change the way a program +behaves. `awk' is an example of such a program (*note Options::). +Often, options take "arguments"; i.e., data that the program needs to +correctly obey the command-line option. For example, `awk''s `-F' +option requires a string to use as the field separator. The first +occurrence on the command line of either `--' or a string that does not +begin with `-' ends the options. + + Modern Unix systems provide a C function named `getopt' for +processing command-line arguments. The programmer provides a string +describing the one-letter options. If an option requires an argument, +it is followed in the string with a colon. `getopt' is also passed the +count and values of the command-line arguments and is called in a loop. +`getopt' processes the command-line arguments for option letters. Each +time around the loop, it returns a single character representing the +next option letter that it finds, or `?' if it finds an invalid option. +When it returns -1, there are no options left on the command line. + + When using `getopt', options that do not take arguments can be +grouped together. Furthermore, options that take arguments require +that the argument is present. The argument can immediately follow the +option letter, or it can be a separate command-line argument. + + Given a hypothetical program that takes three command-line options, +`-a', `-b', and `-c', where `-b' requires an argument, all of the +following are valid ways of invoking the program: + + prog -a -b foo -c data1 data2 data3 + prog -ac -bfoo -- data1 data2 data3 + prog -acbfoo data1 data2 data3 + + Notice that when the argument is grouped with its option, the rest of +the argument is considered to be the option's argument. In this +example, `-acbfoo' indicates that all of the `-a', `-b', and `-c' +options were supplied, and that `foo' is the argument to the `-b' +option. + + `getopt' provides four external variables that the programmer can +use: + +`optind' + The index in the argument value array (`argv') where the first + nonoption command-line argument can be found. + +`optarg' + The string value of the argument to an option. + +`opterr' + Usually `getopt' prints an error message when it finds an invalid + option. Setting `opterr' to zero disables this feature. (An + application might want to print its own error message.) + +`optopt' + The letter representing the command-line option. + + The following C fragment shows how `getopt' might process +command-line arguments for `awk': + + int + main(int argc, char *argv[]) + { + ... + /* print our own message */ + opterr = 0; + while ((c = getopt(argc, argv, "v:f:F:W:")) != -1) { + switch (c) { + case 'f': /* file */ + ... + break; + case 'F': /* field separator */ + ... + break; + case 'v': /* variable assignment */ + ... + break; + case 'W': /* extension */ + ... + break; + case '?': + default: + usage(); + break; + } + } + ... + } + + As a side point, `gawk' actually uses the GNU `getopt_long' function +to process both normal and GNU-style long options (*note Options::). + + The abstraction provided by `getopt' is very useful and is quite +handy in `awk' programs as well. Following is an `awk' version of +`getopt'. This function highlights one of the greatest weaknesses in +`awk', which is that it is very poor at manipulating single characters. +Repeated calls to `substr' are necessary for accessing individual +characters (*note String Functions::).(1) + + The discussion that follows walks through the code a bit at a time: + + # getopt.awk --- do C library getopt(3) function in awk + # External variables: + # Optind -- index in ARGV of first nonoption argument + # Optarg -- string value of argument to current option + # Opterr -- if nonzero, print our own diagnostic + # Optopt -- current option letter + + # Returns: + # -1 at end of options + # ? for unrecognized option + # a character representing the current option + + # Private Data: + # _opti -- index in multi-flag option, e.g., -abc + + The function starts out with a list of the global variables it uses, +what the return values are, what they mean, and any global variables +that are "private" to this library function. Such documentation is +essential for any program, and particularly for library functions. + + The `getopt' function first checks that it was indeed called with a +string of options (the `options' parameter). If `options' has a zero +length, `getopt' immediately returns -1: + + function getopt(argc, argv, options, thisopt, i) + { + if (length(options) == 0) # no options given + return -1 + + if (argv[Optind] == "--") { # all done + Optind++ + _opti = 0 + return -1 + } else if (argv[Optind] !~ /^-[^: \t\n\f\r\v\b]/) { + _opti = 0 + return -1 + } + + The next thing to check for is the end of the options. A `--' ends +the command-line options, as does any command-line argument that does +not begin with a `-'. `Optind' is used to step through the array of +command-line arguments; it retains its value across calls to `getopt', +because it is a global variable. + + The regular expression that is used, `/^-[^: \t\n\f\r\v\b]/', is +perhaps a bit of overkill; it checks for a `-' followed by anything +that is not whitespace and not a colon. If the current command-line +argument does not match this pattern, it is not an option, and it ends +option processing: + + if (_opti == 0) + _opti = 2 + thisopt = substr(argv[Optind], _opti, 1) + Optopt = thisopt + i = index(options, thisopt) + if (i == 0) { + if (Opterr) + printf("%c -- invalid option\n", + thisopt) > "/dev/stderr" + if (_opti >= length(argv[Optind])) { + Optind++ + _opti = 0 + } else + _opti++ + return "?" + } + + The `_opti' variable tracks the position in the current command-line +argument (`argv[Optind]'). If multiple options are grouped together +with one `-' (e.g., `-abx'), it is necessary to return them to the user +one at a time. + + If `_opti' is equal to zero, it is set to two, which is the index in +the string of the next character to look at (we skip the `-', which is +at position one). The variable `thisopt' holds the character, obtained +with `substr'. It is saved in `Optopt' for the main program to use. + + If `thisopt' is not in the `options' string, then it is an invalid +option. If `Opterr' is nonzero, `getopt' prints an error message on +the standard error that is similar to the message from the C version of +`getopt'. + + Because the option is invalid, it is necessary to skip it and move +on to the next option character. If `_opti' is greater than or equal +to the length of the current command-line argument, it is necessary to +move on to the next argument, so `Optind' is incremented and `_opti' is +reset to zero. Otherwise, `Optind' is left alone and `_opti' is merely +incremented. + + In any case, because the option is invalid, `getopt' returns `?'. +The main program can examine `Optopt' if it needs to know what the +invalid option letter actually is. Continuing on: + + if (substr(options, i + 1, 1) == ":") { + # get option argument + if (length(substr(argv[Optind], _opti + 1)) > 0) + Optarg = substr(argv[Optind], _opti + 1) + else + Optarg = argv[++Optind] + _opti = 0 + } else + Optarg = "" + + If the option requires an argument, the option letter is followed by +a colon in the `options' string. If there are remaining characters in +the current command-line argument (`argv[Optind]'), then the rest of +that string is assigned to `Optarg'. Otherwise, the next command-line +argument is used (`-xFOO' versus `-x FOO'). In either case, `_opti' is +reset to zero, because there are no more characters left to examine in +the current command-line argument. Continuing: + + if (_opti == 0 || _opti >= length(argv[Optind])) { + Optind++ + _opti = 0 + } else + _opti++ + return thisopt + } + + Finally, if `_opti' is either zero or greater than the length of the +current command-line argument, it means this element in `argv' is +through being processed, so `Optind' is incremented to point to the +next element in `argv'. If neither condition is true, then only +`_opti' is incremented, so that the next option letter can be processed +on the next call to `getopt'. + + The `BEGIN' rule initializes both `Opterr' and `Optind' to one. +`Opterr' is set to one, since the default behavior is for `getopt' to +print a diagnostic message upon seeing an invalid option. `Optind' is +set to one, since there's no reason to look at the program name, which +is in `ARGV[0]': + + BEGIN { + Opterr = 1 # default is to diagnose + Optind = 1 # skip ARGV[0] + + # test program + if (_getopt_test) { + while ((_go_c = getopt(ARGC, ARGV, "ab:cd")) != -1) + printf("c = <%c>, optarg = <%s>\n", + _go_c, Optarg) + printf("non-option arguments:\n") + for (; Optind < ARGC; Optind++) + printf("\tARGV[%d] = <%s>\n", + Optind, ARGV[Optind]) + } + } + + The rest of the `BEGIN' rule is a simple test program. Here is the +result of two sample runs of the test program: + + $ awk -f getopt.awk -v _getopt_test=1 -- -a -cbARG bax -x + -| c = , optarg = <> + -| c = , optarg = <> + -| c = , optarg = + -| non-option arguments: + -| ARGV[3] = + -| ARGV[4] = <-x> + + $ awk -f getopt.awk -v _getopt_test=1 -- -a -x -- xyz abc + -| c = , optarg = <> + error--> x -- invalid option + -| c = , optarg = <> + -| non-option arguments: + -| ARGV[4] = + -| ARGV[5] = + + In both runs, the first `--' terminates the arguments to `awk', so +that it does not try to interpret the `-a', etc., as its own options. + + NOTE: After `getopt' is through, it is the responsibility of the + user level code to clear out all the elements of `ARGV' from 1 to + `Optind', so that `awk' does not try to process the command-line + options as file names. + + Several of the sample programs presented in *note Sample Programs::, +use `getopt' to process their arguments. + + ---------- Footnotes ---------- + + (1) This function was written before `gawk' acquired the ability to +split strings into single characters using `""' as the separator. We +have left it alone, since using `substr' is more portable. + + +File: gawk.info, Node: Passwd Functions, Next: Group Functions, Prev: Getopt Function, Up: Library Functions + +12.5 Reading the User Database +============================== + +The `PROCINFO' array (*note Built-in Variables::) provides access to +the current user's real and effective user and group ID numbers, and if +available, the user's supplementary group set. However, because these +are numbers, they do not provide very useful information to the average +user. There needs to be some way to find the user information +associated with the user and group ID numbers. This minor node +presents a suite of functions for retrieving information from the user +database. *Note Group Functions::, for a similar suite that retrieves +information from the group database. + + The POSIX standard does not define the file where user information is +kept. Instead, it provides the `' header file and several C +language subroutines for obtaining user information. The primary +function is `getpwent', for "get password entry." The "password" comes +from the original user database file, `/etc/passwd', which stores user +information, along with the encrypted passwords (hence the name). + + While an `awk' program could simply read `/etc/passwd' directly, +this file may not contain complete information about the system's set +of users.(1) To be sure you are able to produce a readable and complete +version of the user database, it is necessary to write a small C +program that calls `getpwent'. `getpwent' is defined as returning a +pointer to a `struct passwd'. Each time it is called, it returns the +next entry in the database. When there are no more entries, it returns +`NULL', the null pointer. When this happens, the C program should call +`endpwent' to close the database. Following is `pwcat', a C program +that "cats" the password database: + + /* + * pwcat.c + * + * Generate a printable version of the password database + */ + #include + #include + + int + main(argc, argv) + int argc; + char **argv; + { + struct passwd *p; + + while ((p = getpwent()) != NULL) + printf("%s:%s:%ld:%ld:%s:%s:%s\n", + p->pw_name, p->pw_passwd, (long) p->pw_uid, + (long) p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell); + + endpwent(); + return 0; + } + + If you don't understand C, don't worry about it. The output from +`pwcat' is the user database, in the traditional `/etc/passwd' format +of colon-separated fields. The fields are: + +Login name The user's login name. +Encrypted password The user's encrypted password. This may not be + available on some systems. +User-ID The user's numeric user ID number. +Group-ID The user's numeric group ID number. +Full name The user's full name, and perhaps other + information associated with the user. +Home directory The user's login (or "home") directory + (familiar to shell programmers as `$HOME'). +Login shell The program that is run when the user logs in. + This is usually a shell, such as `bash'. + + A few lines representative of `pwcat''s output are as follows: + + $ pwcat + -| root:3Ov02d5VaUPB6:0:1:Operator:/:/bin/sh + -| nobody:*:65534:65534::/: + -| daemon:*:1:1::/: + -| sys:*:2:2::/:/bin/csh + -| bin:*:3:3::/bin: + -| arnold:xyzzy:2076:10:Arnold Robbins:/home/arnold:/bin/sh + -| miriam:yxaay:112:10:Miriam Robbins:/home/miriam:/bin/sh + -| andy:abcca2:113:10:Andy Jacobs:/home/andy:/bin/sh + ... + + With that introduction, following is a group of functions for +getting user information. There are several functions here, +corresponding to the C functions of the same names: + + # passwd.awk --- access password file information + BEGIN { + # tailor this to suit your system + _pw_awklib = "/usr/local/libexec/awk/" + } + + function _pw_init( oldfs, oldrs, olddol0, pwcat, using_fw) + { + if (_pw_inited) + return + + oldfs = FS + oldrs = RS + olddol0 = $0 + using_fw = (PROCINFO["FS"] == "FIELDWIDTHS") + FS = ":" + RS = "\n" + + pwcat = _pw_awklib "pwcat" + while ((pwcat | getline) > 0) { + _pw_byname[$1] = $0 + _pw_byuid[$3] = $0 + _pw_bycount[++_pw_total] = $0 + } + close(pwcat) + _pw_count = 0 + _pw_inited = 1 + FS = oldfs + if (using_fw) + FIELDWIDTHS = FIELDWIDTHS + RS = oldrs + $0 = olddol0 + } + + The `BEGIN' rule sets a private variable to the directory where +`pwcat' is stored. Because it is used to help out an `awk' library +routine, we have chosen to put it in `/usr/local/libexec/awk'; however, +you might want it to be in a different directory on your system. + + The function `_pw_init' keeps three copies of the user information +in three associative arrays. The arrays are indexed by username +(`_pw_byname'), by user ID number (`_pw_byuid'), and by order of +occurrence (`_pw_bycount'). The variable `_pw_inited' is used for +efficiency; `_pw_init' needs only to be called once. + + Because this function uses `getline' to read information from +`pwcat', it first saves the values of `FS', `RS', and `$0'. It notes +in the variable `using_fw' whether field splitting with `FIELDWIDTHS' +is in effect or not. Doing so is necessary, since these functions +could be called from anywhere within a user's program, and the user may +have his or her own way of splitting records and fields. + + The `using_fw' variable checks `PROCINFO["FS"]', which is +`"FIELDWIDTHS"' if field splitting is being done with `FIELDWIDTHS'. +This makes it possible to restore the correct field-splitting mechanism +later. The test can only be true for `gawk'. It is false if using +`FS' or on some other `awk' implementation. + + The main part of the function uses a loop to read database lines, +split the line into fields, and then store the line into each array as +necessary. When the loop is done, `_pw_init' cleans up by closing the +pipeline, setting `_pw_inited' to one, and restoring `FS' (and +`FIELDWIDTHS' if necessary), `RS', and `$0'. The use of `_pw_count' is +explained shortly. + + The `getpwnam' function takes a username as a string argument. If +that user is in the database, it returns the appropriate line. +Otherwise, it returns the null string: + + function getpwnam(name) + { + _pw_init() + if (name in _pw_byname) + return _pw_byname[name] + return "" + } + + Similarly, the `getpwuid' function takes a user ID number argument. +If that user number is in the database, it returns the appropriate +line. Otherwise, it returns the null string: + + function getpwuid(uid) + { + _pw_init() + if (uid in _pw_byuid) + return _pw_byuid[uid] + return "" + } + + The `getpwent' function simply steps through the database, one entry +at a time. It uses `_pw_count' to track its current position in the +`_pw_bycount' array: + + function getpwent() + { + _pw_init() + if (_pw_count < _pw_total) + return _pw_bycount[++_pw_count] + return "" + } + + The `endpwent' function resets `_pw_count' to zero, so that +subsequent calls to `getpwent' start over again: + + function endpwent() + { + _pw_count = 0 + } + + A conscious design decision in this suite was made that each +subroutine calls `_pw_init' to initialize the database arrays. The +overhead of running a separate process to generate the user database, +and the I/O to scan it, are only incurred if the user's main program +actually calls one of these functions. If this library file is loaded +along with a user's program, but none of the routines are ever called, +then there is no extra runtime overhead. (The alternative is move the +body of `_pw_init' into a `BEGIN' rule, which always runs `pwcat'. +This simplifies the code but runs an extra process that may never be +needed.) + + In turn, calling `_pw_init' is not too expensive, because the +`_pw_inited' variable keeps the program from reading the data more than +once. If you are worried about squeezing every last cycle out of your +`awk' program, the check of `_pw_inited' could be moved out of +`_pw_init' and duplicated in all the other functions. In practice, +this is not necessary, since most `awk' programs are I/O-bound, and it +clutters up the code. + + The `id' program in *note Id Program::, uses these functions. + + ---------- Footnotes ---------- + + (1) It is often the case that password information is stored in a +network database. + + +File: gawk.info, Node: Group Functions, Prev: Passwd Functions, Up: Library Functions + +12.6 Reading the Group Database +=============================== + +Much of the discussion presented in *note Passwd Functions::, applies +to the group database as well. Although there has traditionally been a +well-known file (`/etc/group') in a well-known format, the POSIX +standard only provides a set of C library routines (`' and +`getgrent') for accessing the information. Even though this file may +exist, it likely does not have complete information. Therefore, as +with the user database, it is necessary to have a small C program that +generates the group database as its output. + + `grcat', a C program that "cats" the group database, is as follows: + + /* + * grcat.c + * + * Generate a printable version of the group database + */ + #include + #include + + int + main(argc, argv) + int argc; + char **argv; + { + struct group *g; + int i; + + while ((g = getgrent()) != NULL) { + printf("%s:%s:%ld:", g->gr_name, g->gr_passwd, + (long) g->gr_gid); + for (i = 0; g->gr_mem[i] != NULL; i++) { + printf("%s", g->gr_mem[i]); + if (g->gr_mem[i+1] != NULL) + putchar(','); + } + putchar('\n'); + } + endgrent(); + return 0; + } + + Each line in the group database represents one group. The fields are +separated with colons and represent the following information: + +Group name The group's name. +Group password The group's encrypted password. In practice, + this field is never used; it is usually empty + or set to `*'. +Group-ID The group's numeric group ID number; this + number should be unique within the file. +Group member list A comma-separated list of user names. These + users are members of the group. Modern Unix + systems allow users to be members of several + groups simultaneously. If your system does, + then there are elements `"group1"' through + `"groupN"' in `PROCINFO' for those group ID + numbers. (Note that `PROCINFO' is a `gawk' + extension; *note Built-in Variables::.) + + Here is what running `grcat' might produce: + + $ grcat + -| wheel:*:0:arnold + -| nogroup:*:65534: + -| daemon:*:1: + -| kmem:*:2: + -| staff:*:10:arnold,miriam,andy + -| other:*:20: + ... + + Here are the functions for obtaining information from the group +database. There are several, modeled after the C library functions of +the same names: + + # group.awk --- functions for dealing with the group file + BEGIN \ + { + # Change to suit your system + _gr_awklib = "/usr/local/libexec/awk/" + } + + function _gr_init( oldfs, oldrs, olddol0, grcat, + using_fw, n, a, i) + { + if (_gr_inited) + return + + oldfs = FS + oldrs = RS + olddol0 = $0 + using_fw = (PROCINFO["FS"] == "FIELDWIDTHS") + FS = ":" + RS = "\n" + + grcat = _gr_awklib "grcat" + while ((grcat | getline) > 0) { + if ($1 in _gr_byname) + _gr_byname[$1] = _gr_byname[$1] "," $4 + else + _gr_byname[$1] = $0 + if ($3 in _gr_bygid) + _gr_bygid[$3] = _gr_bygid[$3] "," $4 + else + _gr_bygid[$3] = $0 + + n = split($4, a, "[ \t]*,[ \t]*") + for (i = 1; i <= n; i++) + if (a[i] in _gr_groupsbyuser) + _gr_groupsbyuser[a[i]] = \ + _gr_groupsbyuser[a[i]] " " $1 + else + _gr_groupsbyuser[a[i]] = $1 + + _gr_bycount[++_gr_count] = $0 + } + close(grcat) + _gr_count = 0 + _gr_inited++ + FS = oldfs + if (using_fw) + FIELDWIDTHS = FIELDWIDTHS + RS = oldrs + $0 = olddol0 + } + + The `BEGIN' rule sets a private variable to the directory where +`grcat' is stored. Because it is used to help out an `awk' library +routine, we have chosen to put it in `/usr/local/libexec/awk'. You +might want it to be in a different directory on your system. + + These routines follow the same general outline as the user database +routines (*note Passwd Functions::). The `_gr_inited' variable is used +to ensure that the database is scanned no more than once. The +`_gr_init' function first saves `FS', `FIELDWIDTHS', `RS', and `$0', +and then sets `FS' and `RS' to the correct values for scanning the +group information. + + The group information is stored is several associative arrays. The +arrays are indexed by group name (`_gr_byname'), by group ID number +(`_gr_bygid'), and by position in the database (`_gr_bycount'). There +is an additional array indexed by user name (`_gr_groupsbyuser'), which +is a space-separated list of groups to which each user belongs. + + Unlike the user database, it is possible to have multiple records in +the database for the same group. This is common when a group has a +large number of members. A pair of such entries might look like the +following: + + tvpeople:*:101:johnny,jay,arsenio + tvpeople:*:101:david,conan,tom,joan + + For this reason, `_gr_init' looks to see if a group name or group ID +number is already seen. If it is, then the user names are simply +concatenated onto the previous list of users. (There is actually a +subtle problem with the code just presented. Suppose that the first +time there were no names. This code adds the names with a leading +comma. It also doesn't check that there is a `$4'.) + + Finally, `_gr_init' closes the pipeline to `grcat', restores `FS' +(and `FIELDWIDTHS' if necessary), `RS', and `$0', initializes +`_gr_count' to zero (it is used later), and makes `_gr_inited' nonzero. + + The `getgrnam' function takes a group name as its argument, and if +that group exists, it is returned. Otherwise, `getgrnam' returns the +null string: + + function getgrnam(group) + { + _gr_init() + if (group in _gr_byname) + return _gr_byname[group] + return "" + } + + The `getgrgid' function is similar, it takes a numeric group ID and +looks up the information associated with that group ID: + + function getgrgid(gid) + { + _gr_init() + if (gid in _gr_bygid) + return _gr_bygid[gid] + return "" + } + + The `getgruser' function does not have a C counterpart. It takes a +user name and returns the list of groups that have the user as a member: + + function getgruser(user) + { + _gr_init() + if (user in _gr_groupsbyuser) + return _gr_groupsbyuser[user] + return "" + } + + The `getgrent' function steps through the database one entry at a +time. It uses `_gr_count' to track its position in the list: + + function getgrent() + { + _gr_init() + if (++_gr_count in _gr_bycount) + return _gr_bycount[_gr_count] + return "" + } + + The `endgrent' function resets `_gr_count' to zero so that +`getgrent' can start over again: + + function endgrent() + { + _gr_count = 0 + } + + As with the user database routines, each function calls `_gr_init' to +initialize the arrays. Doing so only incurs the extra overhead of +running `grcat' if these functions are used (as opposed to moving the +body of `_gr_init' into a `BEGIN' rule). + + Most of the work is in scanning the database and building the various +associative arrays. The functions that the user calls are themselves +very simple, relying on `awk''s associative arrays to do work. + + The `id' program in *note Id Program::, uses these functions. + + +File: gawk.info, Node: Sample Programs, Next: Language History, Prev: Library Functions, Up: Top + +13 Practical `awk' Programs +*************************** + +*note Library Functions::, presents the idea that reading programs in a +language contributes to learning that language. This major node +continues that theme, presenting a potpourri of `awk' programs for your +reading enjoyment. + + Many of these programs use the library functions presented in *note +Library Functions::. + +* Menu: + +* Running Examples:: How to run these examples. +* Clones:: Clones of common utilities. +* Miscellaneous Programs:: Some interesting `awk' programs. + + +File: gawk.info, Node: Running Examples, Next: Clones, Up: Sample Programs + +13.1 Running the Example Programs +================================= + +To run a given program, you would typically do something like this: + + awk -f PROGRAM -- OPTIONS FILES + +Here, PROGRAM is the name of the `awk' program (such as `cut.awk'), +OPTIONS are any command-line options for the program that start with a +`-', and FILES are the actual data files. + + If your system supports the `#!' executable interpreter mechanism +(*note Executable Scripts::), you can instead run your program directly: + + cut.awk -c1-8 myfiles > results + + If your `awk' is not `gawk', you may instead need to use this: + + cut.awk -- -c1-8 myfiles > results + + +File: gawk.info, Node: Clones, Next: Miscellaneous Programs, Prev: Running Examples, Up: Sample Programs + +13.2 Reinventing Wheels for Fun and Profit +========================================== + +This minor node presents a number of POSIX utilities that are +implemented in `awk'. Reinventing these programs in `awk' is often +enjoyable, because the algorithms can be very clearly expressed, and +the code is usually very concise and simple. This is true because +`awk' does so much for you. + + It should be noted that these programs are not necessarily intended +to replace the installed versions on your system. Instead, their +purpose is to illustrate `awk' language programming for "real world" +tasks. + + The programs are presented in alphabetical order. + +* Menu: + +* Cut Program:: The `cut' utility. +* Egrep Program:: The `egrep' utility. +* Id Program:: The `id' utility. +* Split Program:: The `split' utility. +* Tee Program:: The `tee' utility. +* Uniq Program:: The `uniq' utility. +* Wc Program:: The `wc' utility. + + +File: gawk.info, Node: Cut Program, Next: Egrep Program, Up: Clones + +13.2.1 Cutting out Fields and Columns +------------------------------------- + +The `cut' utility selects, or "cuts," characters or fields from its +standard input and sends them to its standard output. Fields are +separated by tabs by default, but you may supply a command-line option +to change the field "delimiter" (i.e., the field-separator character). +`cut''s definition of fields is less general than `awk''s. + + A common use of `cut' might be to pull out just the login name of +logged-on users from the output of `who'. For example, the following +pipeline generates a sorted, unique list of the logged-on users: + + who | cut -c1-8 | sort | uniq + + The options for `cut' are: + +`-c LIST' + Use LIST as the list of characters to cut out. Items within the + list may be separated by commas, and ranges of characters can be + separated with dashes. The list `1-8,15,22-35' specifies + characters 1 through 8, 15, and 22 through 35. + +`-f LIST' + Use LIST as the list of fields to cut out. + +`-d DELIM' + Use DELIM as the field-separator character instead of the tab + character. + +`-s' + Suppress printing of lines that do not contain the field delimiter. + + The `awk' implementation of `cut' uses the `getopt' library function +(*note Getopt Function::) and the `join' library function (*note Join +Function::). + + The program begins with a comment describing the options, the library +functions needed, and a `usage' function that prints out a usage +message and exits. `usage' is called if invalid arguments are supplied: + + # cut.awk --- implement cut in awk + # Options: + # -f list Cut fields + # -d c Field delimiter character + # -c list Cut characters + # + # -s Suppress lines without the delimiter + # + # Requires getopt and join library functions + + function usage( e1, e2) + { + e1 = "usage: cut [-f list] [-d c] [-s] [files...]" + e2 = "usage: cut [-c list] [files...]" + print e1 > "/dev/stderr" + print e2 > "/dev/stderr" + exit 1 + } + +The variables `e1' and `e2' are used so that the function fits nicely +on the screen. + + Next comes a `BEGIN' rule that parses the command-line options. It +sets `FS' to a single TAB character, because that is `cut''s default +field separator. The output field separator is also set to be the same +as the input field separator. Then `getopt' is used to step through +the command-line options. Exactly one of the variables `by_fields' or +`by_chars' is set to true, to indicate that processing should be done +by fields or by characters, respectively. When cutting by characters, +the output field separator is set to the null string: + + BEGIN \ + { + FS = "\t" # default + OFS = FS + while ((c = getopt(ARGC, ARGV, "sf:c:d:")) != -1) { + if (c == "f") { + by_fields = 1 + fieldlist = Optarg + } else if (c == "c") { + by_chars = 1 + fieldlist = Optarg + OFS = "" + } else if (c == "d") { + if (length(Optarg) > 1) { + printf("Using first character of %s" \ + " for delimiter\n", Optarg) > "/dev/stderr" + Optarg = substr(Optarg, 1, 1) + } + FS = Optarg + OFS = FS + if (FS == " ") # defeat awk semantics + FS = "[ ]" + } else if (c == "s") + suppress++ + else + usage() + } + + for (i = 1; i < Optind; i++) + ARGV[i] = "" + + Special care is taken when the field delimiter is a space. Using a +single space (`" "') for the value of `FS' is incorrect--`awk' would +separate fields with runs of spaces, tabs, and/or newlines, and we want +them to be separated with individual spaces. Also remember that after +`getopt' is through (as described in *note Getopt Function::), we have +to clear out all the elements of `ARGV' from 1 to `Optind', so that +`awk' does not try to process the command-line options as file names. + + After dealing with the command-line options, the program verifies +that the options make sense. Only one or the other of `-c' and `-f' +should be used, and both require a field list. Then the program calls +either `set_fieldlist' or `set_charlist' to pull apart the list of +fields or characters: + + if (by_fields && by_chars) + usage() + + if (by_fields == 0 && by_chars == 0) + by_fields = 1 # default + + if (fieldlist == "") { + print "cut: needs list for -c or -f" > "/dev/stderr" + exit 1 + } + + if (by_fields) + set_fieldlist() + else + set_charlist() + } + + `set_fieldlist' is used to split the field list apart at the commas +and into an array. Then, for each element of the array, it looks to +see if it is actually a range, and if so, splits it apart. The range is +verified to make sure the first number is smaller than the second. +Each number in the list is added to the `flist' array, which simply +lists the fields that will be printed. Normal field splitting is used. +The program lets `awk' handle the job of doing the field splitting: + + function set_fieldlist( n, m, i, j, k, f, g) + { + n = split(fieldlist, f, ",") + j = 1 # index in flist + for (i = 1; i <= n; i++) { + if (index(f[i], "-") != 0) { # a range + m = split(f[i], g, "-") + if (m != 2 || g[1] >= g[2]) { + printf("bad field list: %s\n", + f[i]) > "/dev/stderr" + exit 1 + } + for (k = g[1]; k <= g[2]; k++) + flist[j++] = k + } else + flist[j++] = f[i] + } + nfields = j - 1 + } + + The `set_charlist' function is more complicated than `set_fieldlist'. +The idea here is to use `gawk''s `FIELDWIDTHS' variable (*note Constant +Size::), which describes constant-width input. When using a character +list, that is exactly what we have. + + Setting up `FIELDWIDTHS' is more complicated than simply listing the +fields that need to be printed. We have to keep track of the fields to +print and also the intervening characters that have to be skipped. For +example, suppose you wanted characters 1 through 8, 15, and 22 through +35. You would use `-c 1-8,15,22-35'. The necessary value for +`FIELDWIDTHS' is `"8 6 1 6 14"'. This yields five fields, and the +fields to print are `$1', `$3', and `$5'. The intermediate fields are +"filler", which is stuff in between the desired data. `flist' lists +the fields to print, and `t' tracks the complete field list, including +filler fields: + + function set_charlist( field, i, j, f, g, t, + filler, last, len) + { + field = 1 # count total fields + n = split(fieldlist, f, ",") + j = 1 # index in flist + for (i = 1; i <= n; i++) { + if (index(f[i], "-") != 0) { # range + m = split(f[i], g, "-") + if (m != 2 || g[1] >= g[2]) { + printf("bad character list: %s\n", + f[i]) > "/dev/stderr" + exit 1 + } + len = g[2] - g[1] + 1 + if (g[1] > 1) # compute length of filler + filler = g[1] - last - 1 + else + filler = 0 + if (filler) + t[field++] = filler + t[field++] = len # length of field + last = g[2] + flist[j++] = field - 1 + } else { + if (f[i] > 1) + filler = f[i] - last - 1 + else + filler = 0 + if (filler) + t[field++] = filler + t[field++] = 1 + last = f[i] + flist[j++] = field - 1 + } + } + FIELDWIDTHS = join(t, 1, field - 1) + nfields = j - 1 + } + + Next is the rule that actually processes the data. If the `-s' +option is given, then `suppress' is true. The first `if' statement +makes sure that the input record does have the field separator. If +`cut' is processing fields, `suppress' is true, and the field separator +character is not in the record, then the record is skipped. + + If the record is valid, then `gawk' has split the data into fields, +either using the character in `FS' or using fixed-length fields and +`FIELDWIDTHS'. The loop goes through the list of fields that should be +printed. The corresponding field is printed if it contains data. If +the next field also has data, then the separator character is written +out between the fields: + + { + if (by_fields && suppress && index($0, FS) != 0) + next + + for (i = 1; i <= nfields; i++) { + if ($flist[i] != "") { + printf "%s", $flist[i] + if (i < nfields && $flist[i+1] != "") + printf "%s", OFS + } + } + print "" + } + + This version of `cut' relies on `gawk''s `FIELDWIDTHS' variable to +do the character-based cutting. While it is possible in other `awk' +implementations to use `substr' (*note String Functions::), it is also +extremely painful. The `FIELDWIDTHS' variable supplies an elegant +solution to the problem of picking the input line apart by characters. + + +File: gawk.info, Node: Egrep Program, Next: Id Program, Prev: Cut Program, Up: Clones + +13.2.2 Searching for Regular Expressions in Files +------------------------------------------------- + +The `egrep' utility searches files for patterns. It uses regular +expressions that are almost identical to those available in `awk' +(*note Regexp::). It is used in the following manner: + + egrep [ OPTIONS ] 'PATTERN' FILES ... + + The PATTERN is a regular expression. In typical usage, the regular +expression is quoted to prevent the shell from expanding any of the +special characters as file name wildcards. Normally, `egrep' prints +the lines that matched. If multiple file names are provided on the +command line, each output line is preceded by the name of the file and +a colon. + + The options to `egrep' are as follows: + +`-c' + Print out a count of the lines that matched the pattern, instead + of the lines themselves. + +`-s' + Be silent. No output is produced and the exit value indicates + whether the pattern was matched. + +`-v' + Invert the sense of the test. `egrep' prints the lines that do + _not_ match the pattern and exits successfully if the pattern is + not matched. + +`-i' + Ignore case distinctions in both the pattern and the input data. + +`-l' + Only print (list) the names of the files that matched, not the + lines that matched. + +`-e PATTERN' + Use PATTERN as the regexp to match. The purpose of the `-e' + option is to allow patterns that start with a `-'. + + This version uses the `getopt' library function (*note Getopt +Function::) and the file transition library program (*note Filetrans +Function::). + + The program begins with a descriptive comment and then a `BEGIN' rule +that processes the command-line arguments with `getopt'. The `-i' +(ignore case) option is particularly easy with `gawk'; we just use the +`IGNORECASE' built-in variable (*note Built-in Variables::): + + # egrep.awk --- simulate egrep in awk + # Options: + # -c count of lines + # -s silent - use exit value + # -v invert test, success if no match + # -i ignore case + # -l print filenames only + # -e argument is pattern + # + # Requires getopt and file transition library functions + + BEGIN { + while ((c = getopt(ARGC, ARGV, "ce:svil")) != -1) { + if (c == "c") + count_only++ + else if (c == "s") + no_print++ + else if (c == "v") + invert++ + else if (c == "i") + IGNORECASE = 1 + else if (c == "l") + filenames_only++ + else if (c == "e") + pattern = Optarg + else + usage() + } + + Next comes the code that handles the `egrep'-specific behavior. If no +pattern is supplied with `-e', the first nonoption on the command line +is used. The `awk' command-line arguments up to `ARGV[Optind]' are +cleared, so that `awk' won't try to process them as files. If no files +are specified, the standard input is used, and if multiple files are +specified, we make sure to note this so that the file names can precede +the matched lines in the output: + + if (pattern == "") + pattern = ARGV[Optind++] + + for (i = 1; i < Optind; i++) + ARGV[i] = "" + if (Optind >= ARGC) { + ARGV[1] = "-" + ARGC = 2 + } else if (ARGC - Optind > 1) + do_filenames++ + + # if (IGNORECASE) + # pattern = tolower(pattern) + } + + The last two lines are commented out, since they are not needed in +`gawk'. They should be uncommented if you have to use another version +of `awk'. + + The next set of lines should be uncommented if you are not using +`gawk'. This rule translates all the characters in the input line into +lowercase if the `-i' option is specified.(1) The rule is commented out +since it is not necessary with `gawk': + + #{ + # if (IGNORECASE) + # $0 = tolower($0) + #} + + The `beginfile' function is called by the rule in `ftrans.awk' when +each new file is processed. In this case, it is very simple; all it +does is initialize a variable `fcount' to zero. `fcount' tracks how +many lines in the current file matched the pattern (naming the +parameter `junk' shows we know that `beginfile' is called with a +parameter, but that we're not interested in its value): + + function beginfile(junk) + { + fcount = 0 + } + + The `endfile' function is called after each file has been processed. +It affects the output only when the user wants a count of the number of +lines that matched. `no_print' is true only if the exit status is +desired. `count_only' is true if line counts are desired. `egrep' +therefore only prints line counts if printing and counting are enabled. +The output format must be adjusted depending upon the number of files to +process. Finally, `fcount' is added to `total', so that we know the +total number of lines that matched the pattern: + + function endfile(file) + { + if (! no_print && count_only) + if (do_filenames) + print file ":" fcount + else + print fcount + + total += fcount + } + + The following rule does most of the work of matching lines. The +variable `matches' is true if the line matched the pattern. If the user +wants lines that did not match, the sense of `matches' is inverted +using the `!' operator. `fcount' is incremented with the value of +`matches', which is either one or zero, depending upon a successful or +unsuccessful match. If the line does not match, the `next' statement +just moves on to the next record. + + A number of additional tests are made, but they are only done if we +are not counting lines. First, if the user only wants exit status +(`no_print' is true), then it is enough to know that _one_ line in this +file matched, and we can skip on to the next file with `nextfile'. +Similarly, if we are only printing file names, we can print the file +name, and then skip to the next file with `nextfile'. Finally, each +line is printed, with a leading file name and colon if necessary: + + { + matches = ($0 ~ pattern) + if (invert) + matches = ! matches + + fcount += matches # 1 or 0 + + if (! matches) + next + + if (! count_only) { + if (no_print) + nextfile + + if (filenames_only) { + print FILENAME + nextfile + } + + if (do_filenames) + print FILENAME ":" $0 + else + print + } + } + + The `END' rule takes care of producing the correct exit status. If +there are no matches, the exit status is one; otherwise it is zero: + + END \ + { + if (total == 0) + exit 1 + exit 0 + } + + The `usage' function prints a usage message in case of invalid +options, and then exits: + + function usage( e) + { + e = "Usage: egrep [-csvil] [-e pat] [files ...]" + e = e "\n\tegrep [-csvil] pat [files ...]" + print e > "/dev/stderr" + exit 1 + } + + The variable `e' is used so that the function fits nicely on the +printed page. + + Just a note on programming style: you may have noticed that the `END' +rule uses backslash continuation, with the open brace on a line by +itself. This is so that it more closely resembles the way functions +are written. Many of the examples in this major node use this style. +You can decide for yourself if you like writing your `BEGIN' and `END' +rules this way or not. + + ---------- Footnotes ---------- + + (1) It also introduces a subtle bug; if a match happens, we output +the translated line, not the original. + + +File: gawk.info, Node: Id Program, Next: Split Program, Prev: Egrep Program, Up: Clones + +13.2.3 Printing out User Information +------------------------------------ + +The `id' utility lists a user's real and effective user ID numbers, +real and effective group ID numbers, and the user's group set, if any. +`id' only prints the effective user ID and group ID if they are +different from the real ones. If possible, `id' also supplies the +corresponding user and group names. The output might look like this: + + $ id + -| uid=2076(arnold) gid=10(staff) groups=10(staff),4(tty) + + This information is part of what is provided by `gawk''s `PROCINFO' +array (*note Built-in Variables::). However, the `id' utility provides +a more palatable output than just individual numbers. + + Here is a simple version of `id' written in `awk'. It uses the user +database library functions (*note Passwd Functions::) and the group +database library functions (*note Group Functions::): + + The program is fairly straightforward. All the work is done in the +`BEGIN' rule. The user and group ID numbers are obtained from +`PROCINFO'. The code is repetitive. The entry in the user database +for the real user ID number is split into parts at the `:'. The name is +the first field. Similar code is used for the effective user ID number +and the group numbers: + + # id.awk --- implement id in awk + # + # Requires user and group library functions + # output is: + # uid=12(foo) euid=34(bar) gid=3(baz) \ + # egid=5(blat) groups=9(nine),2(two),1(one) + + BEGIN \ + { + uid = PROCINFO["uid"] + euid = PROCINFO["euid"] + gid = PROCINFO["gid"] + egid = PROCINFO["egid"] + + printf("uid=%d", uid) + pw = getpwuid(uid) + if (pw != "") { + split(pw, a, ":") + printf("(%s)", a[1]) + } + + if (euid != uid) { + printf(" euid=%d", euid) + pw = getpwuid(euid) + if (pw != "") { + split(pw, a, ":") + printf("(%s)", a[1]) + } + } + + printf(" gid=%d", gid) + pw = getgrgid(gid) + if (pw != "") { + split(pw, a, ":") + printf("(%s)", a[1]) + } + + if (egid != gid) { + printf(" egid=%d", egid) + pw = getgrgid(egid) + if (pw != "") { + split(pw, a, ":") + printf("(%s)", a[1]) + } + } + + for (i = 1; ("group" i) in PROCINFO; i++) { + if (i == 1) + printf(" groups=") + group = PROCINFO["group" i] + printf("%d", group) + pw = getgrgid(group) + if (pw != "") { + split(pw, a, ":") + printf("(%s)", a[1]) + } + if (("group" (i+1)) in PROCINFO) + printf(",") + } + + print "" + } + + The test in the `for' loop is worth noting. Any supplementary +groups in the `PROCINFO' array have the indices `"group1"' through +`"groupN"' for some N, i.e., the total number of supplementary groups. +However, we don't know in advance how many of these groups there are. + + This loop works by starting at one, concatenating the value with +`"group"', and then using `in' to see if that value is in the array. +Eventually, `i' is incremented past the last group in the array and the +loop exits. + + The loop is also correct if there are _no_ supplementary groups; +then the condition is false the first time it's tested, and the loop +body never executes. + + +File: gawk.info, Node: Split Program, Next: Tee Program, Prev: Id Program, Up: Clones + +13.2.4 Splitting a Large File into Pieces +----------------------------------------- + +The `split' program splits large text files into smaller pieces. Usage +is as follows: + + split [-COUNT] file [ PREFIX ] + + By default, the output files are named `xaa', `xab', and so on. Each +file has 1000 lines in it, with the likely exception of the last file. +To change the number of lines in each file, supply a number on the +command line preceded with a minus; e.g., `-500' for files with 500 +lines in them instead of 1000. To change the name of the output files +to something like `myfileaa', `myfileab', and so on, supply an +additional argument that specifies the file name prefix. + + Here is a version of `split' in `awk'. It uses the `ord' and `chr' +functions presented in *note Ordinal Functions::. + + The program first sets its defaults, and then tests to make sure +there are not too many arguments. It then looks at each argument in +turn. The first argument could be a minus sign followed by a number. +If it is, this happens to look like a negative number, so it is made +positive, and that is the count of lines. The data file name is +skipped over and the final argument is used as the prefix for the +output file names: + + # split.awk --- do split in awk + # + # Requires ord and chr library functions + # usage: split [-num] [file] [outname] + + BEGIN { + outfile = "x" # default + count = 1000 + if (ARGC > 4) + usage() + + i = 1 + if (ARGV[i] ~ /^-[0-9]+$/) { + count = -ARGV[i] + ARGV[i] = "" + i++ + } + # test argv in case reading from stdin instead of file + if (i in ARGV) + i++ # skip data file name + if (i in ARGV) { + outfile = ARGV[i] + ARGV[i] = "" + } + + s1 = s2 = "a" + out = (outfile s1 s2) + } + + The next rule does most of the work. `tcount' (temporary count) +tracks how many lines have been printed to the output file so far. If +it is greater than `count', it is time to close the current file and +start a new one. `s1' and `s2' track the current suffixes for the file +name. If they are both `z', the file is just too big. Otherwise, `s1' +moves to the next letter in the alphabet and `s2' starts over again at +`a': + + { + if (++tcount > count) { + close(out) + if (s2 == "z") { + if (s1 == "z") { + printf("split: %s is too large to split\n", + FILENAME) > "/dev/stderr" + exit 1 + } + s1 = chr(ord(s1) + 1) + s2 = "a" + } + else + s2 = chr(ord(s2) + 1) + out = (outfile s1 s2) + tcount = 1 + } + print > out + } + +The `usage' function simply prints an error message and exits: + + function usage( e) + { + e = "usage: split [-num] [file] [outname]" + print e > "/dev/stderr" + exit 1 + } + +The variable `e' is used so that the function fits nicely on the screen. + + This program is a bit sloppy; it relies on `awk' to automatically +close the last file instead of doing it in an `END' rule. It also +assumes that letters are contiguous in the character set, which isn't +true for EBCDIC systems. + + +File: gawk.info, Node: Tee Program, Next: Uniq Program, Prev: Split Program, Up: Clones + +13.2.5 Duplicating Output into Multiple Files +--------------------------------------------- + +The `tee' program is known as a "pipe fitting." `tee' copies its +standard input to its standard output and also duplicates it to the +files named on the command line. Its usage is as follows: + + tee [-a] file ... + + The `-a' option tells `tee' to append to the named files, instead of +truncating them and starting over. + + The `BEGIN' rule first makes a copy of all the command-line arguments +into an array named `copy'. `ARGV[0]' is not copied, since it is not +needed. `tee' cannot use `ARGV' directly, since `awk' attempts to +process each file name in `ARGV' as input data. + + If the first argument is `-a', then the flag variable `append' is +set to true, and both `ARGV[1]' and `copy[1]' are deleted. If `ARGC' is +less than two, then no file names were supplied and `tee' prints a +usage message and exits. Finally, `awk' is forced to read the standard +input by setting `ARGV[1]' to `"-"' and `ARGC' to two: + + # tee.awk --- tee in awk + BEGIN \ + { + for (i = 1; i < ARGC; i++) + copy[i] = ARGV[i] + + if (ARGV[1] == "-a") { + append = 1 + delete ARGV[1] + delete copy[1] + ARGC-- + } + if (ARGC < 2) { + print "usage: tee [-a] file ..." > "/dev/stderr" + exit 1 + } + ARGV[1] = "-" + ARGC = 2 + } + + The single rule does all the work. Since there is no pattern, it is +executed for each line of input. The body of the rule simply prints the +line into each file on the command line, and then to the standard +output: + + { + # moving the if outside the loop makes it run faster + if (append) + for (i in copy) + print >> copy[i] + else + for (i in copy) + print > copy[i] + print + } + +It is also possible to write the loop this way: + + for (i in copy) + if (append) + print >> copy[i] + else + print > copy[i] + +This is more concise but it is also less efficient. The `if' is tested +for each record and for each output file. By duplicating the loop +body, the `if' is only tested once for each input record. If there are +N input records and M output files, the first method only executes N +`if' statements, while the second executes N`*'M `if' statements. + + Finally, the `END' rule cleans up by closing all the output files: + + END \ + { + for (i in copy) + close(copy[i]) + } + + +File: gawk.info, Node: Uniq Program, Next: Wc Program, Prev: Tee Program, Up: Clones + +13.2.6 Printing Nonduplicated Lines of Text +------------------------------------------- + +The `uniq' utility reads sorted lines of data on its standard input, +and by default removes duplicate lines. In other words, it only prints +unique lines--hence the name. `uniq' has a number of options. The +usage is as follows: + + uniq [-udc [-N]] [+N] [ INPUT FILE [ OUTPUT FILE ]] + + The options for `uniq' are: + +`-d' + Pnly print only repeated lines. + +`-u' + Print only nonrepeated lines. + +`-c' + Count lines. This option overrides `-d' and `-u'. Both repeated + and nonrepeated lines are counted. + +`-N' + Skip N fields before comparing lines. The definition of fields is + similar to `awk''s default: nonwhitespace characters separated by + runs of spaces and/or tabs. + +`+N' + Skip N characters before comparing lines. Any fields specified + with `-N' are skipped first. + +`INPUT FILE' + Data is read from the input file named on the command line, + instead of from the standard input. + +`OUTPUT FILE' + The generated output is sent to the named output file, instead of + to the standard output. + + Normally `uniq' behaves as if both the `-d' and `-u' options are +provided. + + `uniq' uses the `getopt' library function (*note Getopt Function::) +and the `join' library function (*note Join Function::). + + The program begins with a `usage' function and then a brief outline +of the options and their meanings in a comment. The `BEGIN' rule deals +with the command-line arguments and options. It uses a trick to get +`getopt' to handle options of the form `-25', treating such an option +as the option letter `2' with an argument of `5'. If indeed two or more +digits are supplied (`Optarg' looks like a number), `Optarg' is +concatenated with the option digit and then the result is added to zero +to make it into a number. If there is only one digit in the option, +then `Optarg' is not needed. In this case, `Optind' must be decremented +so that `getopt' processes it next time. This code is admittedly a bit +tricky. + + If no options are supplied, then the default is taken, to print both +repeated and nonrepeated lines. The output file, if provided, is +assigned to `outputfile'. Early on, `outputfile' is initialized to the +standard output, `/dev/stdout': + + # uniq.awk --- do uniq in awk + # + # Requires getopt and join library functions + function usage( e) + { + e = "Usage: uniq [-udc [-n]] [+n] [ in [ out ]]" + print e > "/dev/stderr" + exit 1 + } + + # -c count lines. overrides -d and -u + # -d only repeated lines + # -u only non-repeated lines + # -n skip n fields + # +n skip n characters, skip fields first + + BEGIN \ + { + count = 1 + outputfile = "/dev/stdout" + opts = "udc0:1:2:3:4:5:6:7:8:9:" + while ((c = getopt(ARGC, ARGV, opts)) != -1) { + if (c == "u") + non_repeated_only++ + else if (c == "d") + repeated_only++ + else if (c == "c") + do_count++ + else if (index("0123456789", c) != 0) { + # getopt requires args to options + # this messes us up for things like -5 + if (Optarg ~ /^[0-9]+$/) + fcount = (c Optarg) + 0 + else { + fcount = c + 0 + Optind-- + } + } else + usage() + } + + if (ARGV[Optind] ~ /^\+[0-9]+$/) { + charcount = substr(ARGV[Optind], 2) + 0 + Optind++ + } + + for (i = 1; i < Optind; i++) + ARGV[i] = "" + + if (repeated_only == 0 && non_repeated_only == 0) + repeated_only = non_repeated_only = 1 + + if (ARGC - Optind == 2) { + outputfile = ARGV[ARGC - 1] + ARGV[ARGC - 1] = "" + } + } + + The following function, `are_equal', compares the current line, +`$0', to the previous line, `last'. It handles skipping fields and +characters. If no field count and no character count are specified, +`are_equal' simply returns one or zero depending upon the result of a +simple string comparison of `last' and `$0'. Otherwise, things get more +complicated. If fields have to be skipped, each line is broken into an +array using `split' (*note String Functions::); the desired fields are +then joined back into a line using `join'. The joined lines are stored +in `clast' and `cline'. If no fields are skipped, `clast' and `cline' +are set to `last' and `$0', respectively. Finally, if characters are +skipped, `substr' is used to strip off the leading `charcount' +characters in `clast' and `cline'. The two strings are then compared +and `are_equal' returns the result: + + function are_equal( n, m, clast, cline, alast, aline) + { + if (fcount == 0 && charcount == 0) + return (last == $0) + + if (fcount > 0) { + n = split(last, alast) + m = split($0, aline) + clast = join(alast, fcount+1, n) + cline = join(aline, fcount+1, m) + } else { + clast = last + cline = $0 + } + if (charcount) { + clast = substr(clast, charcount + 1) + cline = substr(cline, charcount + 1) + } + + return (clast == cline) + } + + The following two rules are the body of the program. The first one +is executed only for the very first line of data. It sets `last' equal +to `$0', so that subsequent lines of text have something to be compared +to. + + The second rule does the work. The variable `equal' is one or zero, +depending upon the results of `are_equal''s comparison. If `uniq' is +counting repeated lines, and the lines are equal, then it increments +the `count' variable. Otherwise, it prints the line and resets `count', +since the two lines are not equal. + + If `uniq' is not counting, and if the lines are equal, `count' is +incremented. Nothing is printed, since the point is to remove +duplicates. Otherwise, if `uniq' is counting repeated lines and more +than one line is seen, or if `uniq' is counting nonrepeated lines and +only one line is seen, then the line is printed, and `count' is reset. + + Finally, similar logic is used in the `END' rule to print the final +line of input data: + + NR == 1 { + last = $0 + next + } + + { + equal = are_equal() + + if (do_count) { # overrides -d and -u + if (equal) + count++ + else { + printf("%4d %s\n", count, last) > outputfile + last = $0 + count = 1 # reset + } + next + } + + if (equal) + count++ + else { + if ((repeated_only && count > 1) || + (non_repeated_only && count == 1)) + print last > outputfile + last = $0 + count = 1 + } + } + + END { + if (do_count) + printf("%4d %s\n", count, last) > outputfile + else if ((repeated_only && count > 1) || + (non_repeated_only && count == 1)) + print last > outputfile + } + + +File: gawk.info, Node: Wc Program, Prev: Uniq Program, Up: Clones + +13.2.7 Counting Things +---------------------- + +The `wc' (word count) utility counts lines, words, and characters in +one or more input files. Its usage is as follows: + + wc [-lwc] [ FILES ... ] + + If no files are specified on the command line, `wc' reads its +standard input. If there are multiple files, it also prints total +counts for all the files. The options and their meanings are shown in +the following list: + +`-l' + Count only lines. + +`-w' + Count only words. A "word" is a contiguous sequence of + nonwhitespace characters, separated by spaces and/or tabs. + Luckily, this is the normal way `awk' separates fields in its + input data. + +`-c' + Count only characters. + + Implementing `wc' in `awk' is particularly elegant, since `awk' does +a lot of the work for us; it splits lines into words (i.e., fields) and +counts them, it counts lines (i.e., records), and it can easily tell us +how long a line is. + + This uses the `getopt' library function (*note Getopt Function::) +and the file-transition functions (*note Filetrans Function::). + + This version has one notable difference from traditional versions of +`wc': it always prints the counts in the order lines, words, and +characters. Traditional versions note the order of the `-l', `-w', and +`-c' options on the command line, and print the counts in that order. + + The `BEGIN' rule does the argument processing. The variable +`print_total' is true if more than one file is named on the command +line: + + # wc.awk --- count lines, words, characters + + # Options: + # -l only count lines + # -w only count words + # -c only count characters + # + # Default is to count lines, words, characters + # + # Requires getopt and file transition library functions + + BEGIN { + # let getopt print a message about + # invalid options. we ignore them + while ((c = getopt(ARGC, ARGV, "lwc")) != -1) { + if (c == "l") + do_lines = 1 + else if (c == "w") + do_words = 1 + else if (c == "c") + do_chars = 1 + } + for (i = 1; i < Optind; i++) + ARGV[i] = "" + + # if no options, do all + if (! do_lines && ! do_words && ! do_chars) + do_lines = do_words = do_chars = 1 + + print_total = (ARGC - i > 2) + } + + The `beginfile' function is simple; it just resets the counts of +lines, words, and characters to zero, and saves the current file name in +`fname': + + function beginfile(file) + { + chars = lines = words = 0 + fname = FILENAME + } + + The `endfile' function adds the current file's numbers to the running +totals of lines, words, and characters.(1) It then prints out those +numbers for the file that was just read. It relies on `beginfile' to +reset the numbers for the following data file: + + function endfile(file) + { + tchars += chars + tlines += lines + twords += words + if (do_lines) + printf "\t%d", lines + if (do_words) + printf "\t%d", words + if (do_chars) + printf "\t%d", chars + printf "\t%s\n", fname + } + + There is one rule that is executed for each line. It adds the length +of the record, plus one, to `chars'. Adding one plus the record length +is needed because the newline character separating records (the value +of `RS') is not part of the record itself, and thus not included in its +length. Next, `lines' is incremented for each line read, and `words' +is incremented by the value of `NF', which is the number of "words" on +this line: + + # do per line + { + chars += length($0) + 1 # get newline + lines++ + words += NF + } + + Finally, the `END' rule simply prints the totals for all the files: + + END { + if (print_total) { + if (do_lines) + printf "\t%d", tlines + if (do_words) + printf "\t%d", twords + if (do_chars) + printf "\t%d", tchars + print "\ttotal" + } + } + + ---------- Footnotes ---------- + + (1) `wc' can't just use the value of `FNR' in `endfile'. If you +examine the code in *note Filetrans Function::, you will see that `FNR' +has already been reset by the time `endfile' is called. + + +File: gawk.info, Node: Miscellaneous Programs, Prev: Clones, Up: Sample Programs + +13.3 A Grab Bag of `awk' Programs +================================= + +This minor node is a large "grab bag" of miscellaneous programs. We +hope you find them both interesting and enjoyable. + +* Menu: + +* Dupword Program:: Finding duplicated words in a document. +* Alarm Program:: An alarm clock. +* Translate Program:: A program similar to the `tr' utility. +* Labels Program:: Printing mailing labels. +* Word Sorting:: A program to produce a word usage count. +* History Sorting:: Eliminating duplicate entries from a history + file. +* Extract Program:: Pulling out programs from Texinfo source + files. +* Simple Sed:: A Simple Stream Editor. +* Igawk Program:: A wrapper for `awk' that includes + files. + + +File: gawk.info, Node: Dupword Program, Next: Alarm Program, Up: Miscellaneous Programs + +13.3.1 Finding Duplicated Words in a Document +--------------------------------------------- + +A common error when writing large amounts of prose is to accidentally +duplicate words. Typically you will see this in text as something like +"the the program does the following..." When the text is online, often +the duplicated words occur at the end of one line and the beginning of +another, making them very difficult to spot. + + This program, `dupword.awk', scans through a file one line at a time +and looks for adjacent occurrences of the same word. It also saves the +last word on a line (in the variable `prev') for comparison with the +first word on the next line. + + The first two statements make sure that the line is all lowercase, +so that, for example, "The" and "the" compare equal to each other. The +next statement replaces nonalphanumeric and nonwhitespace characters +with spaces, so that punctuation does not affect the comparison either. +The characters are replaced with spaces so that formatting controls +don't create nonsense words (e.g., the Texinfo `@code{NF}' becomes +`codeNF' if punctuation is simply deleted). The record is then resplit +into fields, yielding just the actual words on the line, and ensuring +that there are no empty fields. + + If there are no fields left after removing all the punctuation, the +current record is skipped. Otherwise, the program loops through each +word, comparing it to the previous one: + + # dupword.awk --- find duplicate words in text + { + $0 = tolower($0) + gsub(/[^[:alnum:][:blank:]]/, " "); + $0 = $0 # re-split + if (NF == 0) + next + if ($1 == prev) + printf("%s:%d: duplicate %s\n", + FILENAME, FNR, $1) + for (i = 2; i <= NF; i++) + if ($i == $(i-1)) + printf("%s:%d: duplicate %s\n", + FILENAME, FNR, $i) + prev = $NF + } + + +File: gawk.info, Node: Alarm Program, Next: Translate Program, Prev: Dupword Program, Up: Miscellaneous Programs + +13.3.2 An Alarm Clock Program +----------------------------- + + Nothing cures insomnia like a ringing alarm clock. + Arnold Robbins + + The following program is a simple "alarm clock" program. You give +it a time of day and an optional message. At the specified time, it +prints the message on the standard output. In addition, you can give it +the number of times to repeat the message as well as a delay between +repetitions. + + This program uses the `gettimeofday' function from *note +Gettimeofday Function::. + + All the work is done in the `BEGIN' rule. The first part is argument +checking and setting of defaults: the delay, the count, and the message +to print. If the user supplied a message without the ASCII BEL +character (known as the "alert" character, `"\a"'), then it is added to +the message. (On many systems, printing the ASCII BEL generates an +audible alert. Thus when the alarm goes off, the system calls attention +to itself in case the user is not looking at the computer or terminal.) +Here is the program: + + # alarm.awk --- set an alarm + # + # Requires gettimeofday library function + # usage: alarm time [ "message" [ count [ delay ] ] ] + + BEGIN \ + { + # Initial argument sanity checking + usage1 = "usage: alarm time ['message' [count [delay]]]" + usage2 = sprintf("\t(%s) time ::= hh:mm", ARGV[1]) + + if (ARGC < 2) { + print usage1 > "/dev/stderr" + print usage2 > "/dev/stderr" + exit 1 + } else if (ARGC == 5) { + delay = ARGV[4] + 0 + count = ARGV[3] + 0 + message = ARGV[2] + } else if (ARGC == 4) { + count = ARGV[3] + 0 + message = ARGV[2] + } else if (ARGC == 3) { + message = ARGV[2] + } else if (ARGV[1] !~ /[0-9]?[0-9]:[0-9][0-9]/) { + print usage1 > "/dev/stderr" + print usage2 > "/dev/stderr" + exit 1 + } + + # set defaults for once we reach the desired time + if (delay == 0) + delay = 180 # 3 minutes + if (count == 0) + count = 5 + if (message == "") + message = sprintf("\aIt is now %s!\a", ARGV[1]) + else if (index(message, "\a") == 0) + message = "\a" message "\a" + + The next minor node of code turns the alarm time into hours and +minutes, converts it (if necessary) to a 24-hour clock, and then turns +that time into a count of the seconds since midnight. Next it turns +the current time into a count of seconds since midnight. The +difference between the two is how long to wait before setting off the +alarm: + + # split up alarm time + split(ARGV[1], atime, ":") + hour = atime[1] + 0 # force numeric + minute = atime[2] + 0 # force numeric + + # get current broken down time + gettimeofday(now) + + # if time given is 12-hour hours and it's after that + # hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m., + # then add 12 to real hour + if (hour < 12 && now["hour"] > hour) + hour += 12 + + # set target time in seconds since midnight + target = (hour * 60 * 60) + (minute * 60) + + # get current time in seconds since midnight + current = (now["hour"] * 60 * 60) + \ + (now["minute"] * 60) + now["second"] + + # how long to sleep for + naptime = target - current + if (naptime <= 0) { + print "time is in the past!" > "/dev/stderr" + exit 1 + } + + Finally, the program uses the `system' function (*note I/O +Functions::) to call the `sleep' utility. The `sleep' utility simply +pauses for the given number of seconds. If the exit status is not zero, +the program assumes that `sleep' was interrupted and exits. If `sleep' +exited with an OK status (zero), then the program prints the message in +a loop, again using `sleep' to delay for however many seconds are +necessary: + + # zzzzzz..... go away if interrupted + if (system(sprintf("sleep %d", naptime)) != 0) + exit 1 + + # time to notify! + command = sprintf("sleep %d", delay) + for (i = 1; i <= count; i++) { + print message + # if sleep command interrupted, go away + if (system(command) != 0) + break + } + + exit 0 + } + + +File: gawk.info, Node: Translate Program, Next: Labels Program, Prev: Alarm Program, Up: Miscellaneous Programs + +13.3.3 Transliterating Characters +--------------------------------- + +The system `tr' utility transliterates characters. For example, it is +often used to map uppercase letters into lowercase for further +processing: + + GENERATE DATA | tr 'A-Z' 'a-z' | PROCESS DATA ... + + `tr' requires two lists of characters.(1) When processing the +input, the first character in the first list is replaced with the first +character in the second list, the second character in the first list is +replaced with the second character in the second list, and so on. If +there are more characters in the "from" list than in the "to" list, the +last character of the "to" list is used for the remaining characters in +the "from" list. + + Some time ago, a user proposed that a transliteration function should +be added to `gawk'. The following program was written to prove that +character transliteration could be done with a user-level function. +This program is not as complete as the system `tr' utility but it does +most of the job. + + The `translate' program demonstrates one of the few weaknesses of +standard `awk': dealing with individual characters is very painful, +requiring repeated use of the `substr', `index', and `gsub' built-in +functions (*note String Functions::).(2) There are two functions. The +first, `stranslate', takes three arguments: + +`from' + A list of characters from which to translate. + +`to' + A list of characters to which to translate. + +`target' + The string on which to do the translation. + + Associative arrays make the translation part fairly easy. `t_ar' +holds the "to" characters, indexed by the "from" characters. Then a +simple loop goes through `from', one character at a time. For each +character in `from', if the character appears in `target', `gsub' is +used to change it to the corresponding `to' character. + + The `translate' function simply calls `stranslate' using `$0' as the +target. The main program sets two global variables, `FROM' and `TO', +from the command line, and then changes `ARGV' so that `awk' reads from +the standard input. + + Finally, the processing rule simply calls `translate' for each +record: + + # translate.awk --- do tr-like stuff + # Bugs: does not handle things like: tr A-Z a-z, it has + # to be spelled out. However, if `to' is shorter than `from', + # the last character in `to' is used for the rest of `from'. + + function stranslate(from, to, target, lf, lt, t_ar, i, c) + { + lf = length(from) + lt = length(to) + for (i = 1; i <= lt; i++) + t_ar[substr(from, i, 1)] = substr(to, i, 1) + if (lt < lf) + for (; i <= lf; i++) + t_ar[substr(from, i, 1)] = substr(to, lt, 1) + for (i = 1; i <= lf; i++) { + c = substr(from, i, 1) + if (index(target, c) > 0) + gsub(c, t_ar[c], target) + } + return target + } + + function translate(from, to) + { + return $0 = stranslate(from, to, $0) + } + + # main program + BEGIN { + if (ARGC < 3) { + print "usage: translate from to" > "/dev/stderr" + exit + } + FROM = ARGV[1] + TO = ARGV[2] + ARGC = 2 + ARGV[1] = "-" + } + + { + translate(FROM, TO) + print + } + + While it is possible to do character transliteration in a user-level +function, it is not necessarily efficient, and we (the `gawk' authors) +started to consider adding a built-in function. However, shortly after +writing this program, we learned that the System V Release 4 `awk' had +added the `toupper' and `tolower' functions (*note String Functions::). +These functions handle the vast majority of the cases where character +transliteration is necessary, and so we chose to simply add those +functions to `gawk' as well and then leave well enough alone. + + An obvious improvement to this program would be to set up the `t_ar' +array only once, in a `BEGIN' rule. However, this assumes that the +"from" and "to" lists will never change throughout the lifetime of the +program. + + ---------- Footnotes ---------- + + (1) On some older System V systems, `tr' may require that the lists +be written as range expressions enclosed in square brackets (`[a-z]') +and quoted, to prevent the shell from attempting a file name expansion. +This is not a feature. + + (2) This program was written before `gawk' acquired the ability to +split each character in a string into separate array elements. + + +File: gawk.info, Node: Labels Program, Next: Word Sorting, Prev: Translate Program, Up: Miscellaneous Programs + +13.3.4 Printing Mailing Labels +------------------------------ + +Here is a "real world"(1) program. This script reads lists of names and +addresses and generates mailing labels. Each page of labels has 20 +labels on it, 2 across and 10 down. The addresses are guaranteed to be +no more than 5 lines of data. Each address is separated from the next +by a blank line. + + The basic idea is to read 20 labels worth of data. Each line of +each label is stored in the `line' array. The single rule takes care +of filling the `line' array and printing the page when 20 labels have +been read. + + The `BEGIN' rule simply sets `RS' to the empty string, so that `awk' +splits records at blank lines (*note Records::). It sets `MAXLINES' to +100, since 100 is the maximum number of lines on the page (20 * 5 = +100). + + Most of the work is done in the `printpage' function. The label +lines are stored sequentially in the `line' array. But they have to +print horizontally; `line[1]' next to `line[6]', `line[2]' next to +`line[7]', and so on. Two loops are used to accomplish this. The +outer loop, controlled by `i', steps through every 10 lines of data; +this is each row of labels. The inner loop, controlled by `j', goes +through the lines within the row. As `j' goes from 0 to 4, `i+j' is +the `j'-th line in the row, and `i+j+5' is the entry next to it. The +output ends up looking something like this: + + line 1 line 6 + line 2 line 7 + line 3 line 8 + line 4 line 9 + line 5 line 10 + ... + + As a final note, an extra blank line is printed at lines 21 and 61, +to keep the output lined up on the labels. This is dependent on the +particular brand of labels in use when the program was written. You +will also note that there are 2 blank lines at the top and 2 blank +lines at the bottom. + + The `END' rule arranges to flush the final page of labels; there may +not have been an even multiple of 20 labels in the data: + + # labels.awk --- print mailing labels + + # Each label is 5 lines of data that may have blank lines. + # The label sheets have 2 blank lines at the top and 2 at + # the bottom. + + BEGIN { RS = "" ; MAXLINES = 100 } + + function printpage( i, j) + { + if (Nlines <= 0) + return + + printf "\n\n" # header + + for (i = 1; i <= Nlines; i += 10) { + if (i == 21 || i == 61) + print "" + for (j = 0; j < 5; j++) { + if (i + j > MAXLINES) + break + printf " %-41s %s\n", line[i+j], line[i+j+5] + } + print "" + } + + printf "\n\n" # footer + + for (i in line) + line[i] = "" + } + + # main rule + { + if (Count >= 20) { + printpage() + Count = 0 + Nlines = 0 + } + n = split($0, a, "\n") + for (i = 1; i <= n; i++) + line[++Nlines] = a[i] + for (; i <= 5; i++) + line[++Nlines] = "" + Count++ + } + + END \ + { + printpage() + } + + ---------- Footnotes ---------- + + (1) "Real world" is defined as "a program actually used to get +something done." + + +File: gawk.info, Node: Word Sorting, Next: History Sorting, Prev: Labels Program, Up: Miscellaneous Programs + +13.3.5 Generating Word-Usage Counts +----------------------------------- + +The following `awk' program prints the number of occurrences of each +word in its input. It illustrates the associative nature of `awk' +arrays by using strings as subscripts. It also demonstrates the `for +INDEX in ARRAY' mechanism. Finally, it shows how `awk' is used in +conjunction with other utility programs to do a useful task of some +complexity with a minimum of effort. Some explanations follow the +program listing: + + # Print list of word frequencies + { + for (i = 1; i <= NF; i++) + freq[$i]++ + } + + END { + for (word in freq) + printf "%s\t%d\n", word, freq[word] + } + + This program has two rules. The first rule, because it has an empty +pattern, is executed for every input line. It uses `awk''s +field-accessing mechanism (*note Fields::) to pick out the individual +words from the line, and the built-in variable `NF' (*note Built-in +Variables::) to know how many fields are available. For each input +word, it increments an element of the array `freq' to reflect that the +word has been seen an additional time. + + The second rule, because it has the pattern `END', is not executed +until the input has been exhausted. It prints out the contents of the +`freq' table that has been built up inside the first action. This +program has several problems that would prevent it from being useful by +itself on real text files: + + * Words are detected using the `awk' convention that fields are + separated just by whitespace. Other characters in the input + (except newlines) don't have any special meaning to `awk'. This + means that punctuation characters count as part of words. + + * The `awk' language considers upper- and lowercase characters to be + distinct. Therefore, "bartender" and "Bartender" are not treated + as the same word. This is undesirable, since in normal text, words + are capitalized if they begin sentences, and a frequency analyzer + should not be sensitive to capitalization. + + * The output does not come out in any useful order. You're more + likely to be interested in which words occur most frequently or in + having an alphabetized table of how frequently each word occurs. + + The way to solve these problems is to use some of `awk''s more +advanced features. First, we use `tolower' to remove case +distinctions. Next, we use `gsub' to remove punctuation characters. +Finally, we use the system `sort' utility to process the output of the +`awk' script. Here is the new version of the program: + + # wordfreq.awk --- print list of word frequencies + + { + $0 = tolower($0) # remove case distinctions + # remove punctuation + gsub(/[^[:alnum:]_[:blank:]]/, "", $0) + for (i = 1; i <= NF; i++) + freq[$i]++ + } + + END { + for (word in freq) + printf "%s\t%d\n", word, freq[word] + } + + Assuming we have saved this program in a file named `wordfreq.awk', +and that the data is in `file1', the following pipeline: + + awk -f wordfreq.awk file1 | sort -k 2nr + +produces a table of the words appearing in `file1' in order of +decreasing frequency. The `awk' program suitably massages the data and +produces a word frequency table, which is not ordered. + + The `awk' script's output is then sorted by the `sort' utility and +printed on the terminal. The options given to `sort' specify a sort +that uses the second field of each input line (skipping one field), +that the sort keys should be treated as numeric quantities (otherwise +`15' would come before `5'), and that the sorting should be done in +descending (reverse) order. + + The `sort' could even be done from within the program, by changing +the `END' action to: + + END { + sort = "sort -k 2nr" + for (word in freq) + printf "%s\t%d\n", word, freq[word] | sort + close(sort) + } + + This way of sorting must be used on systems that do not have true +pipes at the command-line (or batch-file) level. See the general +operating system documentation for more information on how to use the +`sort' program. + + +File: gawk.info, Node: History Sorting, Next: Extract Program, Prev: Word Sorting, Up: Miscellaneous Programs + +13.3.6 Removing Duplicates from Unsorted Text +--------------------------------------------- + +The `uniq' program (*note Uniq Program::), removes duplicate lines from +_sorted_ data. + + Suppose, however, you need to remove duplicate lines from a data +file but that you want to preserve the order the lines are in. A good +example of this might be a shell history file. The history file keeps +a copy of all the commands you have entered, and it is not unusual to +repeat a command several times in a row. Occasionally you might want +to compact the history by removing duplicate entries. Yet it is +desirable to maintain the order of the original commands. + + This simple program does the job. It uses two arrays. The `data' +array is indexed by the text of each line. For each line, `data[$0]' +is incremented. If a particular line has not been seen before, then +`data[$0]' is zero. In this case, the text of the line is stored in +`lines[count]'. Each element of `lines' is a unique command, and the +indices of `lines' indicate the order in which those lines are +encountered. The `END' rule simply prints out the lines, in order: + + # histsort.awk --- compact a shell history file + # Thanks to Byron Rakitzis for the general idea + { + if (data[$0]++ == 0) + lines[++count] = $0 + } + + END { + for (i = 1; i <= count; i++) + print lines[i] + } + + This program also provides a foundation for generating other useful +information. For example, using the following `print' statement in the +`END' rule indicates how often a particular command is used: + + print data[lines[i]], lines[i] + + This works because `data[$0]' is incremented each time a line is +seen. + + +File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorting, Up: Miscellaneous Programs + +13.3.7 Extracting Programs from Texinfo Source Files +---------------------------------------------------- + +The nodes *note Library Functions::, and *note Sample Programs::, are +the top level nodes for a large number of `awk' programs. If you want +to experiment with these programs, it is tedious to have to type them +in by hand. Here we present a program that can extract parts of a +Texinfo input file into separate files. + +This Info file is written in Texinfo, the GNU project's document +formatting language. A single Texinfo source file can be used to +produce both printed and online documentation. The Texinfo language is +described fully, starting with *note Top::. + + For our purposes, it is enough to know three things about Texinfo +input files: + + * The "at" symbol (`@') is special in Texinfo, much as the backslash + (`\') is in C or `awk'. Literal `@' symbols are represented in + Texinfo source files as `@@'. + + * Comments start with either `@c' or `@comment'. The + file-extraction program works by using special comments that start + at the beginning of a line. + + * Lines containing `@group' and `@end group' commands bracket + example text that should not be split across a page boundary. + (Unfortunately, TeX isn't always smart enough to do things exactly + right, and we have to give it some help.) + + The following program, `extract.awk', reads through a Texinfo source +file and does two things, based on the special comments. Upon seeing +`@c system ...', it runs a command, by extracting the command text from +the control line and passing it on to the `system' function (*note I/O +Functions::). Upon seeing `@c file FILENAME', each subsequent line is +sent to the file FILENAME, until `@c endfile' is encountered. The +rules in `extract.awk' match either `@c' or `@comment' by letting the +`omment' part be optional. Lines containing `@group' and `@end group' +are simply removed. `extract.awk' uses the `join' library function +(*note Join Function::). + + The example programs in the online Texinfo source for `GAWK: +Effective AWK Programming' (`gawk.texi') have all been bracketed inside +`file' and `endfile' lines. The `gawk' distribution uses a copy of +`extract.awk' to extract the sample programs and install many of them +in a standard directory where `gawk' can find them. The Texinfo file +looks something like this: + + ... + This program has a @code{BEGIN} rule, + that prints a nice message: + + @example + @c file examples/messages.awk + BEGIN @{ print "Don't panic!" @} + @c end file + @end example + + It also prints some final advice: + + @example + @c file examples/messages.awk + END @{ print "Always avoid bored archeologists!" @} + @c end file + @end example + ... + + `extract.awk' begins by setting `IGNORECASE' to one, so that mixed +upper- and lowercase letters in the directives won't matter. + + The first rule handles calling `system', checking that a command is +given (`NF' is at least three) and also checking that the command exits +with a zero exit status, signifying OK: + + # extract.awk --- extract files and run programs + # from texinfo files + BEGIN { IGNORECASE = 1 } + + /^@c(omment)?[ \t]+system/ \ + { + if (NF < 3) { + e = (FILENAME ":" FNR) + e = (e ": badly formed `system' line") + print e > "/dev/stderr" + next + } + $1 = "" + $2 = "" + stat = system($0) + if (stat != 0) { + e = (FILENAME ":" FNR) + e = (e ": warning: system returned " stat) + print e > "/dev/stderr" + } + } + +The variable `e' is used so that the function fits nicely on the screen. + + The second rule handles moving data into files. It verifies that a +file name is given in the directive. If the file named is not the +current file, then the current file is closed. Keeping the current file +open until a new file is encountered allows the use of the `>' +redirection for printing the contents, keeping open file management +simple. + + The `for' loop does the work. It reads lines using `getline' (*note +Getline::). For an unexpected end of file, it calls the +`unexpected_eof' function. If the line is an "endfile" line, then it +breaks out of the loop. If the line is an `@group' or `@end group' +line, then it ignores it and goes on to the next line. Similarly, +comments within examples are also ignored. + + Most of the work is in the following few lines. If the line has no +`@' symbols, the program can print it directly. Otherwise, each +leading `@' must be stripped off. To remove the `@' symbols, the line +is split into separate elements of the array `a', using the `split' +function (*note String Functions::). The `@' symbol is used as the +separator character. Each element of `a' that is empty indicates two +successive `@' symbols in the original line. For each two empty +elements (`@@' in the original file), we have to add a single `@' +symbol back in. + + When the processing of the array is finished, `join' is called with +the value of `SUBSEP', to rejoin the pieces back into a single line. +That line is then printed to the output file: + + /^@c(omment)?[ \t]+file/ \ + { + if (NF != 3) { + e = (FILENAME ":" FNR ": badly formed `file' line") + print e > "/dev/stderr" + next + } + if ($3 != curfile) { + if (curfile != "") + close(curfile) + curfile = $3 + } + + for (;;) { + if ((getline line) <= 0) + unexpected_eof() + if (line ~ /^@c(omment)?[ \t]+endfile/) + break + else if (line ~ /^@(end[ \t]+)?group/) + continue + else if (line ~ /^@c(omment+)?[ \t]+/) + continue + if (index(line, "@") == 0) { + print line > curfile + continue + } + n = split(line, a, "@") + # if a[1] == "", means leading @, + # don't add one back in. + for (i = 2; i <= n; i++) { + if (a[i] == "") { # was an @@ + a[i] = "@" + if (a[i+1] == "") + i++ + } + } + print join(a, 1, n, SUBSEP) > curfile + } + } + + An important thing to note is the use of the `>' redirection. +Output done with `>' only opens the file once; it stays open and +subsequent output is appended to the file (*note Redirection::). This +makes it easy to mix program text and explanatory prose for the same +sample source file (as has been done here!) without any hassle. The +file is only closed when a new data file name is encountered or at the +end of the input file. + + Finally, the function `unexpected_eof' prints an appropriate error +message and then exits. The `END' rule handles the final cleanup, +closing the open file: + + function unexpected_eof() { + printf("%s:%d: unexpected EOF or error\n", + FILENAME, FNR) > "/dev/stderr" + exit 1 + } + + END { + if (curfile) + close(curfile) + } + + +File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program, Up: Miscellaneous Programs + +13.3.8 A Simple Stream Editor +----------------------------- + +The `sed' utility is a stream editor, a program that reads a stream of +data, makes changes to it, and passes it on. It is often used to make +global changes to a large file or to a stream of data generated by a +pipeline of commands. While `sed' is a complicated program in its own +right, its most common use is to perform global substitutions in the +middle of a pipeline: + + command1 < orig.data | sed 's/old/new/g' | command2 > result + + Here, `s/old/new/g' tells `sed' to look for the regexp `old' on each +input line and globally replace it with the text `new', i.e., all the +occurrences on a line. This is similar to `awk''s `gsub' function +(*note String Functions::). + + The following program, `awksed.awk', accepts at least two +command-line arguments: the pattern to look for and the text to replace +it with. Any additional arguments are treated as data file names to +process. If none are provided, the standard input is used: + + # awksed.awk --- do s/foo/bar/g using just print + # Thanks to Michael Brennan for the idea + function usage() + { + print "usage: awksed pat repl [files...]" > "/dev/stderr" + exit 1 + } + + BEGIN { + # validate arguments + if (ARGC < 3) + usage() + + RS = ARGV[1] + ORS = ARGV[2] + + # don't use arguments as files + ARGV[1] = ARGV[2] = "" + } + + # look ma, no hands! + { + if (RT == "") + printf "%s", $0 + else + print + } + + The program relies on `gawk''s ability to have `RS' be a regexp, as +well as on the setting of `RT' to the actual text that terminates the +record (*note Records::). + + The idea is to have `RS' be the pattern to look for. `gawk' +automatically sets `$0' to the text between matches of the pattern. +This is text that we want to keep, unmodified. Then, by setting `ORS' +to the replacement text, a simple `print' statement outputs the text we +want to keep, followed by the replacement text. + + There is one wrinkle to this scheme, which is what to do if the last +record doesn't end with text that matches `RS'. Using a `print' +statement unconditionally prints the replacement text, which is not +correct. However, if the file did not end in text that matches `RS', +`RT' is set to the null string. In this case, we can print `$0' using +`printf' (*note Printf::). + + The `BEGIN' rule handles the setup, checking for the right number of +arguments and calling `usage' if there is a problem. Then it sets `RS' +and `ORS' from the command-line arguments and sets `ARGV[1]' and +`ARGV[2]' to the null string, so that they are not treated as file names +(*note ARGC and ARGV::). + + The `usage' function prints an error message and exits. Finally, +the single rule handles the printing scheme outlined above, using +`print' or `printf' as appropriate, depending upon the value of `RT'. + + +File: gawk.info, Node: Igawk Program, Prev: Simple Sed, Up: Miscellaneous Programs + +13.3.9 An Easy Way to Use Library Functions +------------------------------------------- + +Using library functions in `awk' can be very beneficial. It encourages +code reuse and the writing of general functions. Programs are smaller +and therefore clearer. However, using library functions is only easy +when writing `awk' programs; it is painful when running them, requiring +multiple `-f' options. If `gawk' is unavailable, then so too is the +`AWKPATH' environment variable and the ability to put `awk' functions +into a library directory (*note Options::). It would be nice to be +able to write programs in the following manner: + + # library functions + @include getopt.awk + @include join.awk + ... + + # main program + BEGIN { + while ((c = getopt(ARGC, ARGV, "a:b:cde")) != -1) + ... + ... + } + + The following program, `igawk.sh', provides this service. It +simulates `gawk''s searching of the `AWKPATH' variable and also allows +"nested" includes; i.e., a file that is included with `@include' can +contain further `@include' statements. `igawk' makes an effort to only +include files once, so that nested includes don't accidentally include +a library function twice. + + `igawk' should behave just like `gawk' externally. This means it +should accept all of `gawk''s command-line arguments, including the +ability to have multiple source files specified via `-f', and the +ability to mix command-line and library source files. + + The program is written using the POSIX Shell (`sh') command +language.(1) It works as follows: + + 1. Loop through the arguments, saving anything that doesn't represent + `awk' source code for later, when the expanded program is run. + + 2. For any arguments that do represent `awk' text, put the arguments + into a shell variable that will be expanded. There are two cases: + + a. Literal text, provided with `--source' or `--source='. This + text is just appended directly. + + b. Source file names, provided with `-f'. We use a neat trick + and append `@include FILENAME' to the shell variable's + contents. Since the file-inclusion program works the way + `gawk' does, this gets the text of the file included into the + program at the correct point. + + 3. Run an `awk' program (naturally) over the shell variable's + contents to expand `@include' statements. The expanded program is + placed in a second shell variable. + + 4. Run the expanded program with `gawk' and any other original + command-line arguments that the user supplied (such as the data + file names). + + This program uses shell variables extensively; for storing command +line arguments, the text of the `awk' program that will expand the +user's program, for the user's original program, and for the expanded +program. Doing so removes some potential problems that might arise +were we to use temporary files instead, at the cost of making the +script somewhat more complicated. + + The initial part of the program turns on shell tracing if the first +argument is `debug'. + + The next part loops through all the command-line arguments. There +are several cases of interest: + +`--' + This ends the arguments to `igawk'. Anything else should be + passed on to the user's `awk' program without being evaluated. + +`-W' + This indicates that the next option is specific to `gawk'. To make + argument processing easier, the `-W' is appended to the front of + the remaining arguments and the loop continues. (This is an `sh' + programming trick. Don't worry about it if you are not familiar + with `sh'.) + +`-v, -F' + These are saved and passed on to `gawk'. + +`-f, --file, --file=, -Wfile=' + The file name is appended to the shell variable `program' with an + `@include' statement. The `expr' utility is used to remove the + leading option part of the argument (e.g., `--file='). (Typical + `sh' usage would be to use the `echo' and `sed' utilities to do + this work. Unfortunately, some versions of `echo' evaluate escape + sequences in their arguments, possibly mangling the program text. + Using `expr' avoids this problem.) + +`--source, --source=, -Wsource=' + The source text is appended to `program'. + +`--version, -Wversion' + `igawk' prints its version number, runs `gawk --version' to get + the `gawk' version information, and then exits. + + If none of the `-f', `--file', `-Wfile', `--source', or `-Wsource' +arguments are supplied, then the first nonoption argument should be the +`awk' program. If there are no command-line arguments left, `igawk' +prints an error message and exits. Otherwise, the first argument is +appended to `program'. In any case, after the arguments have been +processed, `program' contains the complete text of the original `awk' +program. + + The program is as follows: + + #! /bin/sh + # igawk --- like gawk but do @include processing + if [ "$1" = debug ] + then + set -x + shift + fi + + # A literal newline, so that program text is formatted correctly + n=' + ' + + # Initialize variables to empty + program= + opts= + + while [ $# -ne 0 ] # loop over arguments + do + case $1 in + --) shift; break;; + + -W) shift + # The ${x?'message here'} construct prints a + # diagnostic if $x is the null string + set -- -W"${@?'missing operand'}" + continue;; + + -[vF]) opts="$opts $1 '${2?'missing operand'}'" + shift;; + + -[vF]*) opts="$opts '$1'" ;; + + -f) program="$program$n@include ${2?'missing operand'}" + shift;; + + -f*) f=`expr "$1" : '-f\(.*\)'` + program="$program$n@include $f";; + + -[W-]file=*) + f=`expr "$1" : '-.file=\(.*\)'` + program="$program$n@include $f";; + + -[W-]file) + program="$program$n@include ${2?'missing operand'}" + shift;; + + -[W-]source=*) + t=`expr "$1" : '-.source=\(.*\)'` + program="$program$n$t";; + + -[W-]source) + program="$program$n${2?'missing operand'}" + shift;; + + -[W-]version) + echo igawk: version 2.0 1>&2 + gawk --version + exit 0 ;; + + -[W-]*) opts="$opts '$1'" ;; + + *) break;; + esac + shift + done + + if [ -z "$program" ] + then + program=${1?'missing program'} + shift + fi + + # At this point, `program' has the program. + + The `awk' program to process `@include' directives is stored in the +shell variable `expand_prog'. Doing this keeps the shell script +readable. The `awk' program reads through the user's program, one line +at a time, using `getline' (*note Getline::). The input file names and +`@include' statements are managed using a stack. As each `@include' is +encountered, the current file name is "pushed" onto the stack and the +file named in the `@include' directive becomes the current file name. +As each file is finished, the stack is "popped," and the previous input +file becomes the current input file again. The process is started by +making the original file the first one on the stack. + + The `pathto' function does the work of finding the full path to a +file. It simulates `gawk''s behavior when searching the `AWKPATH' +environment variable (*note AWKPATH Variable::). If a file name has a +`/' in it, no path search is done. Otherwise, the file name is +concatenated with the name of each directory in the path, and an +attempt is made to open the generated file name. The only way to test +if a file can be read in `awk' is to go ahead and try to read it with +`getline'; this is what `pathto' does.(2) If the file can be read, it +is closed and the file name is returned: + + expand_prog=' + + function pathto(file, i, t, junk) + { + if (index(file, "/") != 0) + return file + + for (i = 1; i <= ndirs; i++) { + t = (pathlist[i] "/" file) + if ((getline junk < t) > 0) { + # found it + close(t) + return t + } + } + return "" + } + + The main program is contained inside one `BEGIN' rule. The first +thing it does is set up the `pathlist' array that `pathto' uses. After +splitting the path on `:', null elements are replaced with `"."', which +represents the current directory: + + BEGIN { + path = ENVIRON["AWKPATH"] + ndirs = split(path, pathlist, ":") + for (i = 1; i <= ndirs; i++) { + if (pathlist[i] == "") + pathlist[i] = "." + } + + The stack is initialized with `ARGV[1]', which will be `/dev/stdin'. +The main loop comes next. Input lines are read in succession. Lines +that do not start with `@include' are printed verbatim. If the line +does start with `@include', the file name is in `$2'. `pathto' is +called to generate the full path. If it cannot, then we print an error +message and continue. + + The next thing to check is if the file is included already. The +`processed' array is indexed by the full file name of each included +file and it tracks this information for us. If the file is seen again, +a warning message is printed. Otherwise, the new file name is pushed +onto the stack and processing continues. + + Finally, when `getline' encounters the end of the input file, the +file is closed and the stack is popped. When `stackptr' is less than +zero, the program is done: + + stackptr = 0 + input[stackptr] = ARGV[1] # ARGV[1] is first file + + for (; stackptr >= 0; stackptr--) { + while ((getline < input[stackptr]) > 0) { + if (tolower($1) != "@include") { + print + continue + } + fpath = pathto($2) + if (fpath == "") { + printf("igawk:%s:%d: cannot find %s\n", + input[stackptr], FNR, $2) > "/dev/stderr" + continue + } + if (! (fpath in processed)) { + processed[fpath] = input[stackptr] + input[++stackptr] = fpath # push onto stack + } else + print $2, "included in", input[stackptr], + "already included in", + processed[fpath] > "/dev/stderr" + } + close(input[stackptr]) + } + }' # close quote ends `expand_prog' variable + + processed_program=`gawk -- "$expand_prog" /dev/stdin < + URL: `http://www.gnu.org' + + Ordering from the FSF directly contributes to the support of the + foundation and to the production of more free software. + + * Retrieve `gawk' by using anonymous `ftp' to the Internet host + `ftp.gnu.org', in the directory `/gnu/gawk'. + + The GNU software archive is mirrored around the world. The +up-to-date list of mirror sites is available from the main FSF web site +(http://www.gnu.org/order/ftp.html). Try to use one of the mirrors; +they will be less busy, and you can usually find one closer to your +site. + + +File: gawk.info, Node: Extracting, Next: Distribution contents, Prev: Getting, Up: Gawk Distribution + +B.1.2 Extracting the Distribution +--------------------------------- + +`gawk' is distributed as a `tar' file compressed with the GNU Zip +program, `gzip'. + + Once you have the distribution (for example, `gawk-3.1.6.tar.gz'), +use `gzip' to expand the file and then use `tar' to extract it. You +can use the following pipeline to produce the `gawk' distribution: + + # Under System V, add 'o' to the tar options + gzip -d -c gawk-3.1.6.tar.gz | tar -xvpf - + +This creates a directory named `gawk-3.1.6' in the current directory. + + The distribution file name is of the form `gawk-V.R.P.tar.gz'. The +V represents the major version of `gawk', the R represents the current +release of version V, and the P represents a "patch level", meaning +that minor bugs have been fixed in the release. The current patch +level is 6, but when retrieving distributions, you should get the +version with the highest version, release, and patch level. (Note, +however, that patch levels greater than or equal to 80 denote "beta" or +nonproduction software; you might not want to retrieve such a version +unless you don't mind experimenting.) If you are not on a Unix system, +you need to make other arrangements for getting and extracting the +`gawk' distribution. You should consult a local expert. + + +File: gawk.info, Node: Distribution contents, Prev: Extracting, Up: Gawk Distribution + +B.1.3 Contents of the `gawk' Distribution +----------------------------------------- + +The `gawk' distribution has a number of C source files, documentation +files, subdirectories, and files related to the configuration process +(*note Unix Installation::), as well as several subdirectories related +to different non-Unix operating systems: + +Various `.c', `.y', and `.h' files + The actual `gawk' source code. + +`README' +`README_d/README.*' + Descriptive files: `README' for `gawk' under Unix and the rest for + the various hardware and software combinations. + +`INSTALL' + A file providing an overview of the configuration and installation + process. + +`ChangeLog' + A detailed list of source code changes as bugs are fixed or + improvements made. + +`NEWS' + A list of changes to `gawk' since the last release or patch. + +`COPYING' + The GNU General Public License. + +`FUTURES' + A brief list of features and changes being contemplated for future + releases, with some indication of the time frame for the feature, + based on its difficulty. + +`LIMITATIONS' + A list of those factors that limit `gawk''s performance. Most of + these depend on the hardware or operating system software and are + not limits in `gawk' itself. + +`POSIX.STD' + A description of one area in which the POSIX standard for `awk' is + incorrect as well as how `gawk' handles the problem. + +`doc/awkforai.txt' + A short article describing why `gawk' is a good language for AI + (Artificial Intelligence) programming. + +`doc/README.card' +`doc/ad.block' +`doc/awkcard.in' +`doc/cardfonts' +`doc/colors' +`doc/macros' +`doc/no.colors' +`doc/setter.outline' + The `troff' source for a five-color `awk' reference card. A + modern version of `troff' such as GNU `troff' (`groff') is needed + to produce the color version. See the file `README.card' for + instructions if you have an older `troff'. + +`doc/gawk.1' + The `troff' source for a manual page describing `gawk'. This is + distributed for the convenience of Unix users. + +`doc/gawk.texi' + The Texinfo source file for this Info file. It should be + processed with TeX to produce a printed document, and with + `makeinfo' to produce an Info or HTML file. + +`doc/gawk.info' + The generated Info file for this Info file. + +`doc/gawkinet.texi' + The Texinfo source file for *Note Top::. It should be processed + with TeX to produce a printed document and with `makeinfo' to + produce an Info or HTML file. + +`doc/gawkinet.info' + The generated Info file for `TCP/IP Internetworking with `gawk''. + +`doc/igawk.1' + The `troff' source for a manual page describing the `igawk' + program presented in *note Igawk Program::. + +`doc/Makefile.in' + The input file used during the configuration process to generate + the actual `Makefile' for creating the documentation. + +`Makefile.am' +`*/Makefile.am' + Files used by the GNU `automake' software for generating the + `Makefile.in' files used by `autoconf' and `configure'. + +`Makefile.in' +`acconfig.h' +`acinclude.m4' +`aclocal.m4' +`configh.in' +`configure.in' +`configure' +`custom.h' +`missing_d/*' +`m4/*' + These files and subdirectories are used when configuring `gawk' + for various Unix systems. They are explained in *note Unix + Installation::. + +`po/*' + The `po' library contains message translations. + +`awklib/extract.awk' +`awklib/Makefile.am' +`awklib/Makefile.in' +`awklib/eg/*' + The `awklib' directory contains a copy of `extract.awk' (*note + Extract Program::), which can be used to extract the sample + programs from the Texinfo source file for this Info file. It also + contains a `Makefile.in' file, which `configure' uses to generate + a `Makefile'. `Makefile.am' is used by GNU Automake to create + `Makefile.in'. The library functions from *note Library + Functions::, and the `igawk' program from *note Igawk Program::, + are included as ready-to-use files in the `gawk' distribution. + They are installed as part of the installation process. The rest + of the programs in this Info file are available in appropriate + subdirectories of `awklib/eg'. + +`unsupported/atari/*' + Files needed for building `gawk' on an Atari ST (*note Atari + Installation::, for details). + +`unsupported/tandem/*' + Files needed for building `gawk' on a Tandem (*note Tandem + Installation::, for details). + +`posix/*' + Files needed for building `gawk' on POSIX-compliant systems. + +`pc/*' + Files needed for building `gawk' under MS-DOS, MS Windows and OS/2 + (*note PC Installation::, for details). + +`vms/*' + Files needed for building `gawk' under VMS (*note VMS + Installation::, for details). + +`test/*' + A test suite for `gawk'. You can use `make check' from the + top-level `gawk' directory to run your version of `gawk' against + the test suite. If `gawk' successfully passes `make check', then + you can be confident of a successful port. + + +File: gawk.info, Node: Unix Installation, Next: Non-Unix Installation, Prev: Gawk Distribution, Up: Installation + +B.2 Compiling and Installing `gawk' on Unix +=========================================== + +Usually, you can compile and install `gawk' by typing only two +commands. However, if you use an unusual system, you may need to +configure `gawk' for your system yourself. + +* Menu: + +* Quick Installation:: Compiling `gawk' under Unix. +* Additional Configuration Options:: Other compile-time options. +* Configuration Philosophy:: How it's all supposed to work. + + +File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation + +B.2.1 Compiling `gawk' for Unix +------------------------------- + +After you have extracted the `gawk' distribution, `cd' to +`gawk-3.1.6'. Like most GNU software, `gawk' is configured +automatically for your Unix system by running the `configure' program. +This program is a Bourne shell script that is generated automatically +using GNU `autoconf'. (The `autoconf' software is described fully +starting with *note Top::.) + + To configure `gawk', simply run `configure': + + sh ./configure + + This produces a `Makefile' and `config.h' tailored to your system. +The `config.h' file describes various facts about your system. You +might want to edit the `Makefile' to change the `CFLAGS' variable, +which controls the command-line options that are passed to the C +compiler (such as optimization levels or compiling for debugging). + + Alternatively, you can add your own values for most `make' variables +on the command line, such as `CC' and `CFLAGS', when running +`configure': + + CC=cc CFLAGS=-g sh ./configure + +See the file `INSTALL' in the `gawk' distribution for all the details. + + After you have run `configure' and possibly edited the `Makefile', +type: + + make + +Shortly thereafter, you should have an executable version of `gawk'. +That's all there is to it! To verify that `gawk' is working properly, +run `make check'. All of the tests should succeed. If these steps do +not work, or if any of the tests fail, check the files in the +`README_d' directory to see if you've found a known problem. If the +failure is not described there, please send in a bug report (*note +Bugs::.) + + +File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Quick Installation, Up: Unix Installation + +B.2.2 Additional Configuration Options +-------------------------------------- + +There are several additional options you may use on the `configure' +command line when compiling `gawk' from scratch, including: + +`--enable-portals' + Treat pathnames that begin with `/p' as BSD portal files when + doing two-way I/O with the `|&' operator (*note Portal Files::). + +`--enable-switch' + Enable the recognition and execution of C-style `switch' statements + in `awk' programs (*note Switch Statement::.) + +`--disable-lint' + This option disables all lint checking within `gawk'. The + `--lint' and `--lint-old' options (*note Options::) are accepted, + but silently do nothing. Similarly, setting the `LINT' variable + (*note User-modified::) has no effect on the running `awk' program. + + When used with GCC's automatic dead-code-elimination, this option + cuts almost 200K bytes off the size of the `gawk' executable on + GNU/Linux x86 systems. Results on other systems and with other + compilers are likely to vary. Using this option may bring you + some slight performance improvement. + + Using this option will cause some of the tests in the test suite + to fail. This option may be removed at a later date. + +`--disable-nls' + Disable all message-translation facilities. This is usually not + desirable, but it may bring you some slight performance + improvement. + +`--disable-directories-fatal' + Causes `gawk' to silently skip directories named on the command + line. + + As of version 3.1.5, the `--with-included-gettext' configuration +option is no longer available, since `gawk' expects the GNU `gettext' +library to be installed as an external library. + + +File: gawk.info, Node: Configuration Philosophy, Prev: Additional Configuration Options, Up: Unix Installation + +B.2.3 The Configuration Process +------------------------------- + +This minor node is of interest only if you know something about using +the C language and the Unix operating system. + + The source code for `gawk' generally attempts to adhere to formal +standards wherever possible. This means that `gawk' uses library +routines that are specified by the ISO C standard and by the POSIX +operating system interface standard. When using an ISO C compiler, +function prototypes are used to help improve the compile-time checking. + + Many Unix systems do not support all of either the ISO or the POSIX +standards. The `missing_d' subdirectory in the `gawk' distribution +contains replacement versions of those functions that are most likely +to be missing. + + The `config.h' file that `configure' creates contains definitions +that describe features of the particular operating system where you are +attempting to compile `gawk'. The three things described by this file +are: what header files are available, so that they can be correctly +included, what (supposedly) standard functions are actually available +in your C libraries, and various miscellaneous facts about your variant +of Unix. For example, there may not be an `st_blksize' element in the +`stat' structure. In this case, `HAVE_ST_BLKSIZE' is undefined. + + It is possible for your C compiler to lie to `configure'. It may do +so by not exiting with an error when a library function is not +available. To get around this, edit the file `custom.h'. Use an +`#ifdef' that is appropriate for your system, and either `#define' any +constants that `configure' should have defined but didn't, or `#undef' +any constants that `configure' defined and should not have. `custom.h' +is automatically included by `config.h'. + + It is also possible that the `configure' program generated by +`autoconf' will not work on your system in some other fashion. If you +do have a problem, the file `configure.in' is the input for `autoconf'. +You may be able to change this file and generate a new version of +`configure' that works on your system (*note Bugs::, for information on +how to report problems in configuring `gawk'). The same mechanism may +be used to send in updates to `configure.in' and/or `custom.h'. + + +File: gawk.info, Node: Non-Unix Installation, Next: Unsupported, Prev: Unix Installation, Up: Installation + +B.3 Installation on Other Operating Systems +=========================================== + +This minor node describes how to install `gawk' on various non-Unix +systems. + +* Menu: + +* Amiga Installation:: Installing `gawk' on an Amiga. +* BeOS Installation:: Installing `gawk' on BeOS. +* PC Installation:: Installing and Compiling `gawk' on + MS-DOS and OS/2. +* VMS Installation:: Installing `gawk' on VMS. + + +File: gawk.info, Node: Amiga Installation, Next: BeOS Installation, Up: Non-Unix Installation + +B.3.1 Installing `gawk' on an Amiga +----------------------------------- + +You can install `gawk' on an Amiga system using a Unix emulation +environment, available via anonymous `ftp' from `ftp.ninemoons.com' in +the directory `pub/ade/current'. This includes a shell based on +`pdksh'. The primary component of this environment is a Unix emulation +library, `ixemul.lib'. + + A more complete distribution for the Amiga is available on the Geek +Gadgets CD-ROM, available from: + + CRONUS + 1840 E. Warner Road #105-265 + Tempe, AZ 85284 USA + US Toll Free: (800) 804-0833 + Phone: +1-602-491-0442 + FAX: +1-602-491-0048 + Email: + WWW: `http://www.ninemoons.com' + Anonymous `ftp' site: `ftp.ninemoons.com' + + Once you have the distribution, you can configure `gawk' simply by +running `configure': + + configure -v m68k-amigaos + + Then run `make' and you should be all set! If these steps do not +work, please send in a bug report (*note Bugs::). + + +File: gawk.info, Node: BeOS Installation, Next: PC Installation, Prev: Amiga Installation, Up: Non-Unix Installation + +B.3.2 Installing `gawk' on BeOS +------------------------------- + +Since BeOS DR9, all the tools that you should need to build `gawk' are +included with BeOS. The process is basically identical to the Unix +process of running `configure' and then `make'. Full instructions are +given below. + + You can compile `gawk' under BeOS by extracting the standard sources +and running `configure'. You _must_ specify the location prefix for the +installation directory. For BeOS DR9 and beyond, the best directory to +use is `/boot/home/config', so the `configure' command is: + + configure --prefix=/boot/home/config + + This installs the compiled application into `/boot/home/config/bin', +which is already specified in the standard `PATH'. + + Once the configuration process is completed, you can run `make', and +then `make install': + + $ make + ... + $ make install + + BeOS uses `bash' as its shell; thus, you use `gawk' the same way you +would under Unix. If these steps do not work, please send in a bug +report (*note Bugs::). + + +File: gawk.info, Node: PC Installation, Next: VMS Installation, Prev: BeOS Installation, Up: Non-Unix Installation + +B.3.3 Installation on PC Operating Systems +------------------------------------------ + +This minor node covers installation and usage of `gawk' on x86 machines +running DOS, any version of Windows, or OS/2. In this minor node, the +term "Windows32" refers to any of Windows-95/98/ME/NT/2000. + + The limitations of DOS (and DOS shells under Windows or OS/2) has +meant that various "DOS extenders" are often used with programs such as +`gawk'. The varying capabilities of Microsoft Windows 3.1 and +Windows32 can add to the confusion. For an overview of the +considerations, please refer to `README_d/README.pc' in the +distribution. + +* Menu: + +* PC Binary Installation:: Installing a prepared distribution. +* PC Compiling:: Compiling `gawk' for MS-DOS, Windows32, + and OS/2. +* PC Dynamic:: Compiling `gawk' for dynamic libraries. +* PC Using:: Running `gawk' on MS-DOS, Windows32 and + OS/2. +* Cygwin:: Building and running `gawk' for + Cygwin. + + +File: gawk.info, Node: PC Binary Installation, Next: PC Compiling, Up: PC Installation + +B.3.3.1 Installing a Prepared Distribution for PC Systems +......................................................... + +If you have received a binary distribution prepared by the DOS +maintainers, then `gawk' and the necessary support files appear under +the `gnu' directory, with executables in `gnu/bin', libraries in +`gnu/lib/awk', and manual pages under `gnu/man'. This is designed for +easy installation to a `/gnu' directory on your drive--however, the +files can be installed anywhere provided `AWKPATH' is set properly. +Regardless of the installation directory, the first line of `igawk.cmd' +and `igawk.bat' (in `gnu/bin') may need to be edited. + + The binary distribution contains a separate file describing the +contents. In particular, it may include more than one version of the +`gawk' executable. + + OS/2 (32 bit, EMX) binary distributions are prepared for the `/usr' +directory of your preferred drive. Set `UNIXROOT' to your installation +drive (e.g., `e:') if you want to install `gawk' onto another drive +than the hardcoded default `c:'. Executables appear in `/usr/bin', +libraries under `/usr/share/awk', manual pages under `/usr/man', +Texinfo documentation under `/usr/info' and NLS files under +`/usr/share/locale'. If you already have a file `/usr/info/dir' from +another package _do not overwrite it!_ Instead enter the following +commands at your prompt (replace `x:' by your installation drive): + + install-info --info-dir=x:/usr/info x:/usr/info/gawk.info + install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info + + However, the files can be installed anywhere provided `AWKPATH' is +set properly. + + The binary distribution may contain a separate file containing +additional or more detailed installation instructions. + + +File: gawk.info, Node: PC Compiling, Next: PC Dynamic, Prev: PC Binary Installation, Up: PC Installation + +B.3.3.2 Compiling `gawk' for PC Operating Systems +................................................. + +`gawk' can be compiled for MS-DOS, Windows32, and OS/2 using the GNU +development tools from DJ Delorie (DJGPP; MS-DOS only) or Eberhard +Mattes (EMX; MS-DOS, Windows32 and OS/2). Microsoft Visual C/C++ can +be used to build a Windows32 version, and Microsoft C/C++ can be used +to build 16-bit versions for MS-DOS and OS/2. (As of `gawk' 3.1.2, the +MSC version doesn't work. However, the maintainer is working on fixing +it.) The file `README_d/README.pc' in the `gawk' distribution contains +additional notes, and `pc/Makefile' contains important information on +compilation options. + + To build `gawk' for MS-DOS, Windows32, and OS/2 (16 bit only; for 32 +bit (EMX) you can use the `configure' script and skip the following +paragraphs; for details see below), copy the files in the `pc' +directory (_except_ for `ChangeLog') to the directory with the rest of +the `gawk' sources. The `Makefile' contains a configuration section +with comments and may need to be edited in order to work with your +`make' utility. + + The `Makefile' contains a number of targets for building various +MS-DOS, Windows32, and OS/2 versions. A list of targets is printed if +the `make' command is given without a target. As an example, to build +`gawk' using the DJGPP tools, enter `make djgpp'. (The DJGPP tools may +be found at `ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/'.) + + Using `make' to run the standard tests and to install `gawk' +requires additional Unix-like tools, including `sh', `sed', and `cp'. +In order to run the tests, the `test/*.ok' files may need to be +converted so that they have the usual DOS-style end-of-line markers. +Most of the tests work properly with Stewartson's shell along with the +companion utilities or appropriate GNU utilities. However, some +editing of `test/Makefile' is required. It is recommended that you copy +the file `pc/Makefile.tst' over the file `test/Makefile' as a +replacement. Details can be found in `README_d/README.pc' and in the +file `pc/Makefile.tst'. + + The 32 bit EMX version of `gawk' works "out of the box" under OS/2. +In principle, it is possible to compile `gawk' the following way: + + $ ./configure + $ make + + This is not recommended, though. To get an OMF executable you should +use the following commands at your `sh' prompt: + + $ CPPFLAGS="-D__ST_MT_ERRNO__" + $ export CPPFLAGS + $ CFLAGS="-O2 -Zomf -Zmt" + $ export CFLAGS + $ LDFLAGS="-s -Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000" + $ export LDFLAGS + $ RANLIB="echo" + $ export RANLIB + $ ./configure --prefix=c:/usr --without-included-gettext + $ make AR=emxomfar + + These are just suggestions. You may use any other set of +(self-consistent) environment variables and compiler flags. + + To get an FHS-compliant file hierarchy it is recommended to use the +additional `configure' options `--infodir=c:/usr/share/info', +`--mandir=c:/usr/share/man' and `--libexecdir=c:/usr/lib'. + + If you use GCC 2.95 it is recommended to use also: + + $ LIBS="-lgcc" + $ export LIBS + + You can also get an `a.out' executable if you prefer: + + $ CPPFLAGS="-D__ST_MT_ERRNO__" + $ export CPPFLAGS + $ CFLAGS="-O2 -Zmt" + $ export CFLAGS + $ LDFLAGS="-s -Zstack 0x6000" + $ LIBS="-lgcc" + $ unset RANLIB + $ ./configure --prefix=c:/usr + $ make + + NOTE: Versions later than GCC 2.95, i.e., GCC 3.x using the + Innotek libc were not tested. + + NOTE: Even if the compiled `gawk.exe' (`a.out') executable + contains a DOS header, it does _not_ work under DOS. To compile an + executable that runs under DOS, `"-DPIPES_SIMULATED"' must be + added to `CPPFLAGS'. But then some nonstandard extensions of + `gawk' (e.g., `|&') do not work! + + After compilation the internal tests can be performed. Enter `make +check CMP="diff -a"' at your command prompt. All tests except for the +`pid' test are expected to work properly. The `pid' test fails because +child processes are not started by `fork()'. + + `make install' works as expected. + + NOTE: Most OS/2 ports of GNU `make' are not able to handle the + Makefiles of this package. If you encounter any problems with + `make' try GNU Make 3.79.1 or later versions. You should find the + latest version on `http://www.unixos2.org/sw/pub/binary/make/' or + on `ftp://hobbes.nmsu.edu/pub/os2/'. + + +File: gawk.info, Node: PC Dynamic, Next: PC Using, Prev: PC Compiling, Up: PC Installation + +B.3.3.3 Compiling `gawk' For Dynamic Libraries +.............................................. + +To compile `gawk' with dynamic extension support, uncomment the +definitions of `DYN_FLAGS', `DYN_EXP', `DYN_OBJ', and `DYN_MAKEXP' in +the configuration section of the `Makefile'. There are two definitions +for `DYN_MAKEXP': pick the one that matches your target. + + To build some of the example extension libraries, `cd' to the +extension directory and copy `Makefile.pc' to `Makefile'. You can then +build using the same two targets. To run the example `awk' scripts, +you'll need to either change the call to the `extension' function to +match the name of the library (for instance, change `"./ordchr.so"' to +`"ordchr.dll"' or simply `"ordchr"'), or rename the library to match +the call (for instance, rename `ordchr.dll' to `ordchr.so'). + + If you build `gawk.exe' with one compiler but want to build an +extension library with the other, you need to copy the import library. +Visual C uses a library called `gawk.lib', while MinGW uses a library +called `libgawk.a'. These files are equivalent and will interoperate if +you give them the correct name. The resulting shared libraries are +also interoperable. + + To create your own extension library, you can use the examples as +models, but you're essentially on your own. Post to `comp.lang.awk' or +send electronic mail to if you have problems getting +started. If you need to access functions or variables which are not +exported by `gawk.exe', add them to `gawkw32.def' and rebuild. You +should also add `ATTRIBUTE_EXPORTED' to the declaration in `awk.h' of +any variables you add to `gawkw32.def'. + + Note that extension libraries have the name of the `awk' executable +embedded in them at link time, so they will work only with `gawk.exe'. +In particular, they won't work if you rename `gawk.exe' to `awk.exe' or +if you try to use `pgawk.exe'. You can perform profiling by temporarily +renaming `pgawk.exe' to `gawk.exe'. You can resolve this problem by +changing the program name in the definition of `DYN_MAKEXP' for your +compiler. + + On Windows32, libraries are sought first in the current directory, +then in the directory containing `gawk.exe', and finally through the +`PATH' environment variable. + + +File: gawk.info, Node: PC Using, Next: Cygwin, Prev: PC Dynamic, Up: PC Installation + +B.3.3.4 Using `gawk' on PC Operating Systems +............................................ + +With the exception of the Cygwin environment, the `|&' operator and +TCP/IP networking (*note TCP/IP Networking::) are not supported for +MS-DOS or MS-Windows. EMX (OS/2 only) does support at least the `|&' +operator. + + The OS/2 and MS-DOS versions of `gawk' search for program files as +described in *note AWKPATH Variable::. However, semicolons (rather +than colons) separate elements in the `AWKPATH' variable. If `AWKPATH' +is not set or is empty, then the default search path for OS/2 (16 bit) +and MS-DOS versions is `".;c:/lib/awk;c:/gnu/lib/awk"'. + + The search path for OS/2 (32 bit, EMX) is determined by the prefix +directory (most likely `/usr' or `c:/usr') that has been specified as +an option of the `configure' script like it is the case for the Unix +versions. If `c:/usr' is the prefix directory then the default search +path contains `.' and `c:/usr/share/awk'. Additionally, to support +binary distributions of `gawk' for OS/2 systems whose drive `c:' might +not support long file names or might not exist at all, there is a +special environment variable. If `UNIXROOT' specifies a drive then this +specific drive is also searched for program files. E.g., if `UNIXROOT' +is set to `e:' the complete default search path is +`".;c:/usr/share/awk;e:/usr/share/awk"'. + + An `sh'-like shell (as opposed to `command.com' under MS-DOS or +`cmd.exe' under OS/2) may be useful for `awk' programming. Ian +Stewartson has written an excellent shell for MS-DOS and OS/2, Daisuke +Aoyama has ported GNU `bash' to MS-DOS using the DJGPP tools, and +several shells are available for OS/2, including `ksh'. The file +`README_d/README.pc' in the `gawk' distribution contains information on +these shells. Users of Stewartson's shell on DOS should examine its +documentation for handling command lines; in particular, the setting +for `gawk' in the shell configuration may need to be changed and the +`ignoretype' option may also be of interest. + + Under OS/2 and DOS, `gawk' (and many other text programs) silently +translate end-of-line `"\r\n"' to `"\n"' on input and `"\n"' to +`"\r\n"' on output. A special `BINMODE' variable allows control over +these translations and is interpreted as follows: + + * If `BINMODE' is `"r"', or `(BINMODE & 1)' is nonzero, then binary + mode is set on read (i.e., no translations on reads). + + * If `BINMODE' is `"w"', or `(BINMODE & 2)' is nonzero, then binary + mode is set on write (i.e., no translations on writes). + + * If `BINMODE' is `"rw"' or `"wr"', binary mode is set for both read + and write (same as `(BINMODE & 3)'). + + * `BINMODE=NON-NULL-STRING' is the same as `BINMODE=3' (i.e., no + translations on reads or writes). However, `gawk' issues a warning + message if the string is not one of `"rw"' or `"wr"'. + +The modes for standard input and standard output are set one time only +(after the command line is read, but before processing any of the `awk' +program). Setting `BINMODE' for standard input or standard output is +accomplished by using an appropriate `-v BINMODE=N' option on the +command line. `BINMODE' is set at the time a file or pipe is opened +and cannot be changed mid-stream. + + The name `BINMODE' was chosen to match `mawk' (*note Other +Versions::). Both `mawk' and `gawk' handle `BINMODE' similarly; +however, `mawk' adds a `-W BINMODE=N' option and an environment +variable that can set `BINMODE', `RS', and `ORS'. The files +`binmode[1-3].awk' (under `gnu/lib/awk' in some of the prepared +distributions) have been chosen to match `mawk''s `-W BINMODE=N' +option. These can be changed or discarded; in particular, the setting +of `RS' giving the fewest "surprises" is open to debate. `mawk' uses +`RS = "\r\n"' if binary mode is set on read, which is appropriate for +files with the DOS-style end-of-line. + + To illustrate, the following examples set binary mode on writes for +standard output and other files, and set `ORS' as the "usual" DOS-style +end-of-line: + + gawk -v BINMODE=2 -v ORS="\r\n" ... + +or: + + gawk -v BINMODE=w -f binmode2.awk ... + +These give the same result as the `-W BINMODE=2' option in `mawk'. The +following changes the record separator to `"\r\n"' and sets binary mode +on reads, but does not affect the mode on standard input: + + gawk -v RS="\r\n" --source "BEGIN { BINMODE = 1 }" ... + +or: + + gawk -f binmode1.awk ... + +With proper quoting, in the first example the setting of `RS' can be +moved into the `BEGIN' rule. + + +File: gawk.info, Node: Cygwin, Prev: PC Using, Up: PC Installation + +B.3.3.5 Using `gawk' In The Cygwin Environment +.............................................. + +`gawk' can be used "out of the box" under Windows if you are using the +Cygwin environment.(1) This environment provides an excellent +simulation of Unix, using the GNU tools, such as `bash', the GNU +Compiler Collection (GCC), GNU Make, and other GNU tools. Compilation +and installation for Cygwin is the same as for a Unix system: + + tar -xvpzf gawk-3.1.6.tar.gz + cd gawk-3.1.6 + ./configure + make + + When compared to GNU/Linux on the same system, the `configure' step +on Cygwin takes considerably longer. However, it does finish, and then +the `make' proceeds as usual. + + NOTE: The `|&' operator and TCP/IP networking (*note TCP/IP + Networking::) are fully supported in the Cygwin environment. This + is not true for any other environment for MS-DOS or MS-Windows. + + ---------- Footnotes ---------- + + (1) `http://www.cygwin.com' + + +File: gawk.info, Node: VMS Installation, Prev: PC Installation, Up: Non-Unix Installation + +B.3.4 How to Compile and Install `gawk' on VMS +---------------------------------------------- + +This node describes how to compile and install `gawk' under VMS. + +* Menu: + +* VMS Compilation:: How to compile `gawk' under VMS. +* VMS Installation Details:: How to install `gawk' under VMS. +* VMS Running:: How to run `gawk' under VMS. +* VMS POSIX:: Alternate instructions for VMS POSIX. +* VMS Old Gawk:: An old version comes with some VMS systems. + + +File: gawk.info, Node: VMS Compilation, Next: VMS Installation Details, Up: VMS Installation + +B.3.4.1 Compiling `gawk' on VMS +............................... + +To compile `gawk' under VMS, there is a `DCL' command procedure that +issues all the necessary `CC' and `LINK' commands. There is also a +`Makefile' for use with the `MMS' utility. From the source directory, +use either: + + $ @[.VMS]VMSBUILD.COM + +or: + + $ MMS/DESCRIPTION=[.VMS]DESCRIP.MMS GAWK + + Depending upon which C compiler you are using, follow one of the sets +of instructions in this table: + +VAX C V3.x + Use either `vmsbuild.com' or `descrip.mms' as is. These use + `CC/OPTIMIZE=NOLINE', which is essential for Version 3.0. + +VAX C V2.x + You must have Version 2.3 or 2.4; older ones won't work. Edit + either `vmsbuild.com' or `descrip.mms' according to the comments + in them. For `vmsbuild.com', this just entails removing two `!' + delimiters. Also edit `config.h' (which is a copy of file + `[.config]vms-conf.h') and comment out or delete the two lines + `#define __STDC__ 0' and `#define VAXC_BUILTINS' near the end. + +GNU C + Edit `vmsbuild.com' or `descrip.mms'; the changes are different + from those for VAX C V2.x but equally straightforward. No changes + to `config.h' are needed. + +DEC C + Edit `vmsbuild.com' or `descrip.mms' according to their comments. + No changes to `config.h' are needed. + + `gawk' has been tested under VAX/VMS 5.5-1 using VAX C V3.2, and GNU +C 1.40 and 2.3. It should work without modifications for VMS V4.6 and +up. + + +File: gawk.info, Node: VMS Installation Details, Next: VMS Running, Prev: VMS Compilation, Up: VMS Installation + +B.3.4.2 Installing `gawk' on VMS +................................ + +To install `gawk', all you need is a "foreign" command, which is a +`DCL' symbol whose value begins with a dollar sign. For example: + + $ GAWK :== $disk1:[gnubin]GAWK + +Substitute the actual location of `gawk.exe' for `$disk1:[gnubin]'. The +symbol should be placed in the `login.com' of any user who wants to run +`gawk', so that it is defined every time the user logs on. +Alternatively, the symbol may be placed in the system-wide +`sylogin.com' procedure, which allows all users to run `gawk'. + + Optionally, the help entry can be loaded into a VMS help library: + + $ LIBRARY/HELP SYS$HELP:HELPLIB [.VMS]GAWK.HLP + +(You may want to substitute a site-specific help library rather than +the standard VMS library `HELPLIB'.) After loading the help text, the +command: + + $ HELP GAWK + +provides information about both the `gawk' implementation and the `awk' +programming language. + + The logical name `AWK_LIBRARY' can designate a default location for +`awk' program files. For the `-f' option, if the specified file name +has no device or directory path information in it, `gawk' looks in the +current directory first, then in the directory specified by the +translation of `AWK_LIBRARY' if the file is not found. If, after +searching in both directories, the file still is not found, `gawk' +appends the suffix `.awk' to the filename and retries the file search. +If `AWK_LIBRARY' is not defined, that portion of the file search fails +benignly. + + +File: gawk.info, Node: VMS Running, Next: VMS POSIX, Prev: VMS Installation Details, Up: VMS Installation + +B.3.4.3 Running `gawk' on VMS +............................. + +Command-line parsing and quoting conventions are significantly different +on VMS, so examples in this Info file or from other sources often need +minor changes. They _are_ minor though, and all `awk' programs should +run correctly. + + Here are a couple of trivial tests: + + $ gawk -- "BEGIN {print ""Hello, World!""}" + $ gawk -"W" version + ! could also be -"W version" or "-W version" + +Note that uppercase and mixed-case text must be quoted. + + The VMS port of `gawk' includes a `DCL'-style interface in addition +to the original shell-style interface (see the help entry for details). +One side effect of dual command-line parsing is that if there is only a +single parameter (as in the quoted string program above), the command +becomes ambiguous. To work around this, the normally optional `--' +flag is required to force Unix style rather than `DCL' parsing. If any +other dash-type options (or multiple parameters such as data files to +process) are present, there is no ambiguity and `--' can be omitted. + + The default search path, when looking for `awk' program files +specified by the `-f' option, is `"SYS$DISK:[],AWK_LIBRARY:"'. The +logical name `AWKPATH' can be used to override this default. The format +of `AWKPATH' is a comma-separated list of directory specifications. +When defining it, the value should be quoted so that it retains a single +translation and not a multitranslation `RMS' searchlist. + + +File: gawk.info, Node: VMS POSIX, Next: VMS Old Gawk, Prev: VMS Running, Up: VMS Installation + +B.3.4.4 Building and Using `gawk' on VMS POSIX +.............................................. + +Ignore the instructions above, although `vms/gawk.hlp' should still be +made available in a help library. The source tree should be unpacked +into a container file subsystem rather than into the ordinary VMS +filesystem. Make sure that the two scripts, `configure' and +`vms/posix-cc.sh', are executable; use `chmod +x' on them if necessary. +Then execute the following two commands: + + psx> CC=vms/posix-cc.sh configure + psx> make CC=c89 gawk + +The first command constructs files `config.h' and `Makefile' out of +templates, using a script to make the C compiler fit `configure''s +expectations. The second command compiles and links `gawk' using the C +compiler directly; ignore any warnings from `make' about being unable +to redefine `CC'. `configure' takes a very long time to execute, but +at least it provides incremental feedback as it runs. + + This has been tested with VAX/VMS V6.2, VMS POSIX V2.0, and DEC C +V5.2. + + Once built, `gawk' works like any other shell utility. Unlike the +normal VMS port of `gawk', no special command-line manipulation is +needed in the VMS POSIX environment. + + +File: gawk.info, Node: VMS Old Gawk, Prev: VMS POSIX, Up: VMS Installation + +B.3.4.5 Some VMS Systems Have An Old Version of `gawk' +...................................................... + +Some versions of VMS have an old version of `gawk'. To access it, +define a symbol, as follows: + + $ gawk :== $ sys$common:[syshlp.examples.tcpip.snmp]gawk.exe + + This is apparently version 2.15.6, which is quite old. We recommend +compiling and using the current version. + + +File: gawk.info, Node: Unsupported, Next: Bugs, Prev: Non-Unix Installation, Up: Installation + +B.4 Unsupported Operating System Ports +====================================== + +This sections describes systems for which the `gawk' port is no longer +supported. + +* Menu: + +* Atari Installation:: Installing `gawk' on the Atari ST. +* Tandem Installation:: Installing `gawk' on a Tandem. + + +File: gawk.info, Node: Atari Installation, Next: Tandem Installation, Up: Unsupported + +B.4.1 Installing `gawk' on the Atari ST +--------------------------------------- + +The Atari port is no longer supported. It is included for those who +might want to use it but it is no longer being actively maintained. + + There are no substantial differences when installing `gawk' on +various Atari models. Compiled `gawk' executables do not require a +large amount of memory with most `awk' programs, and should run on all +Motorola processor-based models (called further ST, even if that is not +exactly right). + + In order to use `gawk', you need to have a shell, either text or +graphics, that does not map all the characters of a command line to +uppercase. Maintaining case distinction in option flags is very +important (*note Options::). These days this is the default and it may +only be a problem for some very old machines. If your system does not +preserve the case of option flags, you need to upgrade your tools. +Support for I/O redirection is necessary to make it easy to import +`awk' programs from other environments. Pipes are nice to have but not +vital. + +* Menu: + +* Atari Compiling:: Compiling `gawk' on Atari. +* Atari Using:: Running `gawk' on Atari. + + +File: gawk.info, Node: Atari Compiling, Next: Atari Using, Up: Atari Installation + +B.4.1.1 Compiling `gawk' on the Atari ST +........................................ + +A proper compilation of `gawk' sources when `sizeof(int)' differs from +`sizeof(void *)' requires an ISO C compiler. An initial port was done +with `gcc'. You may actually prefer executables where `int's are four +bytes wide but the other variant works as well. + + You may need quite a bit of memory when trying to recompile the +`gawk' sources, as some source files (`regex.c' in particular) are quite +big. If you run out of memory compiling such a file, try reducing the +optimization level for this particular file, which may help. + + With a reasonable shell (`bash' will do), you have a pretty good +chance that the `configure' utility will succeed, and in particular if +you run GNU/Linux, MiNT or a similar operating system. Otherwise +sample versions of `config.h' and `Makefile.st' are given in the +`atari' subdirectory and can be edited and copied to the corresponding +files in the main source directory. Even if `configure' produces +something, it might be advisable to compare its results with the sample +versions and possibly make adjustments. + + Some `gawk' source code fragments depend on a preprocessor define +`atarist'. This basically assumes the TOS environment with `gcc'. +Modify these sections as appropriate if they are not right for your +environment. Also see the remarks about `AWKPATH' and `envsep' in +*note Atari Using::. + + As shipped, the sample `config.h' claims that the `system' function +is missing from the libraries, which is not true, and an alternative +implementation of this function is provided in +`unsupported/atari/system.c'. Depending upon your particular +combination of shell and operating system, you might want to change the +file to indicate that `system' is available. + + +File: gawk.info, Node: Atari Using, Prev: Atari Compiling, Up: Atari Installation + +B.4.1.2 Running `gawk' on the Atari ST +...................................... + +An executable version of `gawk' should be placed, as usual, anywhere in +your `PATH' where your shell can find it. + + While executing, the Atari version of `gawk' creates a number of +temporary files. When using `gcc' libraries for TOS, `gawk' looks for +either of the environment variables, `TEMP' or `TMPDIR', in that order. +If either one is found, its value is assumed to be a directory for +temporary files. This directory must exist, and if you can spare the +memory, it is a good idea to put it on a RAM drive. If neither `TEMP' +nor `TMPDIR' are found, then `gawk' uses the current directory for its +temporary files. + + The ST version of `gawk' searches for its program files, as +described in *note AWKPATH Variable::. The default value for the +`AWKPATH' variable is taken from `DEFPATH' defined in `Makefile'. The +sample `gcc'/TOS `Makefile' for the ST in the distribution sets +`DEFPATH' to `".,c:\lib\awk,c:\gnu\lib\awk"'. The search path can be +modified by explicitly setting `AWKPATH' to whatever you want. Note +that colons cannot be used on the ST to separate elements in the +`AWKPATH' variable, since they have another reserved meaning. Instead, +you must use a comma to separate elements in the path. When +recompiling, the separating character can be modified by initializing +the `envsep' variable in `unsupported/atari/gawkmisc.atr' to another +value. + + Although `awk' allows great flexibility in doing I/O redirections +from within a program, this facility should be used with care on the ST +running under TOS. In some circumstances, the OS routines for +file-handle pool processing lose track of certain events, causing the +computer to crash and requiring a reboot. Often a warm reboot is +sufficient. Fortunately, this happens infrequently and in rather +esoteric situations. In particular, avoid having one part of an `awk' +program using `print' statements explicitly redirected to +`/dev/stdout', while other `print' statements use the default standard +output, and a calling shell has redirected standard output to a file. + + When `gawk' is compiled with the ST version of `gcc' and its usual +libraries, it accepts both `/' and `\' as path separators. While this +is convenient, it should be remembered that this removes one +technically valid character (`/') from your file name. It may also +create problems for external programs called via the `system' function, +which may not support this convention. Whenever it is possible that a +file created by `gawk' will be used by some other program, use only +backslashes. Also remember that in `awk', backslashes in strings have +to be doubled in order to get literal backslashes (*note Escape +Sequences::). + + +File: gawk.info, Node: Tandem Installation, Prev: Atari Installation, Up: Unsupported + +B.4.2 Installing `gawk' on a Tandem +----------------------------------- + +The Tandem port is only minimally supported. The port's contributor no +longer has access to a Tandem system. + + The Tandem port was done on a Cyclone machine running D20. The port +is pretty clean and all facilities seem to work except for the I/O +piping facilities (*note Getline/Pipe::, *note Getline/Variable/Pipe::, +and *note Redirection::), which is just too foreign a concept for +Tandem. + + To build a Tandem executable from source, download all of the files +so that the file names on the Tandem box conform to the restrictions of +D20. For example, `array.c' becomes `ARRAYC', and `awk.h' becomes +`AWKH'. The totally Tandem-specific files are in the `tandem' +"subvolume" (`unsupported/tandem' in the `gawk' distribution) and +should be copied to the main source directory before building `gawk'. + + The file `compit' can then be used to compile and bind an executable. +Alas, there is no `configure' or `make'. + + Usage is the same as for Unix, except that D20 requires all `{' and +`}' characters to be escaped with `~' on the command line (but _not_ in +script files). Also, the standard Tandem syntax for `/in filename,out +filename/' must be used instead of the usual Unix `<' and `>' for file +redirection. (Redirection options on `getline', `print' etc., are +supported.) + + The `-mr VAL' option (*note Options::) has been "stolen" to enable +Tandem users to process fixed-length records with no "end-of-line" +character. That is, `-mr 74' tells `gawk' to read the input file as +fixed 74-byte records. + + +File: gawk.info, Node: Bugs, Next: Other Versions, Prev: Unsupported, Up: Installation + +B.5 Reporting Problems and Bugs +=============================== + + There is nothing more dangerous than a bored archeologist. + The Hitchhiker's Guide to the Galaxy + + If you have problems with `gawk' or think that you have found a bug, +please report it to the developers; we cannot promise to do anything +but we might well want to fix it. + + Before reporting a bug, make sure you have actually found a real bug. +Carefully reread the documentation and see if it really says you can do +what you're trying to do. If it's not clear whether you should be able +to do something or not, report that too; it's a bug in the +documentation! + + Before reporting a bug or trying to fix it yourself, try to isolate +it to the smallest possible `awk' program and input data file that +reproduces the problem. Then send us the program and data file, some +idea of what kind of Unix system you're using, the compiler you used to +compile `gawk', and the exact results `gawk' gave you. Also say what +you expected to occur; this helps us decide whether the problem is +really in the documentation. + + Once you have a precise problem, send email to . + + Please include the version number of `gawk' you are using. You can +get this information with the command `gawk --version'. Using this +address automatically sends a carbon copy of your mail to me. If +necessary, I can be reached directly at . The bug +reporting address is preferred since the email list is archived at the +GNU Project. _All email should be in English, since that is my native +language._ + + *Caution:* Do _not_ try to report bugs in `gawk' by posting to the +Usenet/Internet newsgroup `comp.lang.awk'. While the `gawk' developers +do occasionally read this newsgroup, there is no guarantee that we will +see your posting. The steps described above are the official +recognized ways for reporting bugs. + + Non-bug suggestions are always welcome as well. If you have +questions about things that are unclear in the documentation or are +just obscure features, ask me; I will try to help you out, although I +may not have the time to fix the problem. You can send me electronic +mail at the Internet address noted previously. + + If you find bugs in one of the non-Unix ports of `gawk', please send +an electronic mail message to the person who maintains that port. They +are named in the following list, as well as in the `README' file in the +`gawk' distribution. Information in the `README' file should be +considered authoritative if it conflicts with this Info file. + + The people maintaining the non-Unix ports of `gawk' are as follows: + +Amiga Fred Fish, . +BeOS Martin Brown, . +MS-DOS Scott Deifik, and Darrel + Hankerson, . +MS-Windows Juan Grigera, . +OS/2 The Unix for OS/2 team, + . +Tandem Stephen Davies, . +VMS Pat Rankin, . + + If your bug is also reproducible under Unix, please send a copy of +your report to the email list as well. + + +File: gawk.info, Node: Other Versions, Prev: Bugs, Up: Installation + +B.6 Other Freely Available `awk' Implementations +================================================ + + It's kind of fun to put comments like this in your awk code. + `// Do C++ comments work? answer: yes! of course' + Michael Brennan + + There are a number of other freely available `awk' implementations. +This minor node briefly describes where to get them: + +Unix `awk' + Brian Kernighan has made his implementation of `awk' freely + available. You can retrieve this version via the World Wide Web + from his home page.(1) It is available in several archive formats: + + Shell archive + `http://cm.bell-labs.com/who/bwk/awk.shar' + + Compressed `tar' file + `http://cm.bell-labs.com/who/bwk/awk.tar.gz' + + Zip file + `http://cm.bell-labs.com/who/bwk/awk.zip' + + This version requires an ISO C (1990 standard) compiler; the C + compiler from GCC (the GNU Compiler Collection) works quite nicely. + + *Note BTL::, for a list of extensions in this `awk' that are not + in POSIX `awk'. + +`mawk' + Michael Brennan has written an independent implementation of `awk', + called `mawk'. It is available under the GPL (*note Copying::), + just as `gawk' is. + + You can get it via anonymous `ftp' to the host `ftp.whidbey.net'. + Change directory to `/pub/brennan'. Use "binary" or "image" mode, + and retrieve `mawk1.3.3.tar.gz' (or the latest version that is + there). + + `gunzip' may be used to decompress this file. Installation is + similar to `gawk''s (*note Unix Installation::). + + `mawk' has the following extensions that are not in POSIX `awk': + + * The `fflush' built-in function for flushing buffered output + (*note I/O Functions::). + + * The `**' and `**=' operators (*note Arithmetic Ops:: and also + see *note Assignment Ops::). + + * The use of `func' as an abbreviation for `function' (*note + Definition Syntax::). + + * The `\x' escape sequence (*note Escape Sequences::). + + * The `/dev/stdout', and `/dev/stderr' special files (*note + Special Files::). Use `"-"' instead of `"/dev/stdin"' with + `mawk'. + + * The ability for `FS' and for the third argument to `split' to + be null strings (*note Single Character Fields::). + + * The ability to delete all of an array at once with `delete + ARRAY' (*note Delete::). + + * The ability for `RS' to be a regexp (*note Records::). + + * The `BINMODE' special variable for non-Unix operating systems + (*note PC Using::). + + The next version of `mawk' will support `nextfile'. + +`awka' + Written by Andrew Sumner, `awka' translates `awk' programs into C, + compiles them, and links them with a library of functions that + provides the core `awk' functionality. It also has a number of + extensions. + + The `awk' translator is released under the GPL, and the library is + under the LGPL. + + To get `awka', go to `http://awka.sourceforge.net'. You can reach + Andrew Sumner at . + +`pawk' + Nelson H.F. Beebe at the University of Utah has modified the Bell + Labs `awk' to provide timing and profiling information. It is + different from `pgawk' (*note Profiling::), in that it uses + CPU-based profiling, not line-count profiling. You may find it at + either `ftp://ftp.math.utah.edu/pub/pawk/pawk-20020210.tar.gz' or + `http://www.math.utah.edu/pub/pawk/pawk-20020210.tar.gz'. + +The OpenSolaris POSIX `awk' + The version of `awk' in `/usr/xpg4/bin' on Solaris is POSIX + compliant. It is based on the `awk' from Mortice Kern Systems for + PCs. The source code can be downloaded from the OpenSolaris web + site.(2) This author was able to make it compile and work under + GNU/Linux with 1-2 hours of work. Making it more generally + portable (using GNU Autoconf and/or Automake) would take more + work, and this has not been done, at least to our knowledge. + +`jawk' + This is an interpreter for `awk' written in Java. It claims to be + a full interpreter, although because it uses Java facilities for + I/O and for regexp matching, the language it supports is different + from POSIX `awk'. More information is available on the project's + home page.(3). + + + ---------- Footnotes ---------- + + (1) `http://cm.bell-labs.com/who/bwk' + + (2) `http://www.opensolaris.org' + + (3) `http://jawk.sourceforge.net' + + +File: gawk.info, Node: Notes, Next: Basic Concepts, Prev: Installation, Up: Top + +Appendix C Implementation Notes +******************************* + +This appendix contains information mainly of interest to implementors +and maintainers of `gawk'. Everything in it applies specifically to +`gawk' and not to other implementations. + +* Menu: + +* Compatibility Mode:: How to disable certain `gawk' + extensions. +* Additions:: Making Additions To `gawk'. +* Dynamic Extensions:: Adding new built-in functions to + `gawk'. +* Future Extensions:: New features that may be implemented one day. + + +File: gawk.info, Node: Compatibility Mode, Next: Additions, Up: Notes + +C.1 Downward Compatibility and Debugging +======================================== + +*Note POSIX/GNU::, for a summary of the GNU extensions to the `awk' +language and program. All of these features can be turned off by +invoking `gawk' with the `--traditional' option or with the `--posix' +option. + + If `gawk' is compiled for debugging with `-DDEBUG', then there is +one more option available on the command line: + +`-W parsedebug' +`--parsedebug' + Prints out the parse stack information as the program is being + parsed. + + This option is intended only for serious `gawk' developers and not +for the casual user. It probably has not even been compiled into your +version of `gawk', since it slows down execution. + + +File: gawk.info, Node: Additions, Next: Dynamic Extensions, Prev: Compatibility Mode, Up: Notes + +C.2 Making Additions to `gawk' +============================== + +If you find that you want to enhance `gawk' in a significant fashion, +you are perfectly free to do so. That is the point of having free +software; the source code is available and you are free to change it as +you want (*note Copying::). + + This minor node discusses the ways you might want to change `gawk' +as well as any considerations you should bear in mind. + +* Menu: + +* Adding Code:: Adding code to the main body of + `gawk'. +* New Ports:: Porting `gawk' to a new operating + system. + + +File: gawk.info, Node: Adding Code, Next: New Ports, Up: Additions + +C.2.1 Adding New Features +------------------------- + +You are free to add any new features you like to `gawk'. However, if +you want your changes to be incorporated into the `gawk' distribution, +there are several steps that you need to take in order to make it +possible for me to include your changes: + + 1. Before building the new feature into `gawk' itself, consider + writing it as an extension module (*note Dynamic Extensions::). + If that's not possible, continue with the rest of the steps in + this list. + + 2. Get the latest version. It is much easier for me to integrate + changes if they are relative to the most recent distributed + version of `gawk'. If your version of `gawk' is very old, I may + not be able to integrate them at all. (*Note Getting::, for + information on getting the latest version of `gawk'.) + + 3. See *note (Version)Top:: standards, GNU Coding Standards. This + document describes how GNU software should be written. If you + haven't read it, please do so, preferably _before_ starting to + modify `gawk'. (The `GNU Coding Standards' are available from the + GNU Project's `ftp' site, at + `ftp://ftp.gnu.org/gnu/GNUinfo/standards.text'. An HTML version, + suitable for reading with a WWW browser, is available at + `http://www.gnu.org/prep/standards_toc.html'. Texinfo, Info, and + DVI versions are also available.) + + 4. Use the `gawk' coding style. The C code for `gawk' follows the + instructions in the `GNU Coding Standards', with minor exceptions. + The code is formatted using the traditional "K&R" style, + particularly as regards to the placement of braces and the use of + tabs. In brief, the coding rules for `gawk' are as follows: + + * Use ANSI/ISO style (prototype) function headers when defining + functions. + + * Put the name of the function at the beginning of its own line. + + * Put the return type of the function, even if it is `int', on + the line above the line with the name and arguments of the + function. + + * Put spaces around parentheses used in control structures + (`if', `while', `for', `do', `switch', and `return'). + + * Do not put spaces in front of parentheses used in function + calls. + + * Put spaces around all C operators and after commas in + function calls. + + * Do not use the comma operator to produce multiple side + effects, except in `for' loop initialization and increment + parts, and in macro bodies. + + * Use real tabs for indenting, not spaces. + + * Use the "K&R" brace layout style. + + * Use comparisons against `NULL' and `'\0'' in the conditions of + `if', `while', and `for' statements, as well as in the `case's + of `switch' statements, instead of just the plain pointer or + character value. + + * Use the `TRUE', `FALSE' and `NULL' symbolic constants and the + character constant `'\0'' where appropriate, instead of `1' + and `0'. + + * Use the `ISALPHA', `ISDIGIT', etc. macros, instead of the + traditional lowercase versions; these macros are better + behaved for non-ASCII character sets. + + * Provide one-line descriptive comments for each function. + + * Do not use `#elif'. Many older Unix C compilers cannot handle + it. + + * Do not use the `alloca' function for allocating memory off + the stack. Its use causes more portability trouble than is + worth the minor benefit of not having to free the storage. + Instead, use `malloc' and `free'. + + NOTE: If I have to reformat your code to follow the coding + style used in `gawk', I may not bother to integrate your + changes at all. + + 5. Be prepared to sign the appropriate paperwork. In order for the + FSF to distribute your changes, you must either place those + changes in the public domain and submit a signed statement to that + effect, or assign the copyright in your changes to the FSF. Both + of these actions are easy to do and _many_ people have done so + already. If you have questions, please contact me (*note Bugs::), + or . + + 6. Update the documentation. Along with your new code, please supply + new sections and/or chapters for this Info file. If at all + possible, please use real Texinfo, instead of just supplying + unformatted ASCII text (although even that is better than no + documentation at all). Conventions to be followed in `GAWK: + Effective AWK Programming' are provided after the `@bye' at the + end of the Texinfo source file. If possible, please update the + `man' page as well. + + You will also have to sign paperwork for your documentation + changes. + + 7. Submit changes as context diffs or unified diffs. Use `diff -c -r + -N' or `diff -u -r -N' to compare the original `gawk' source tree + with your version. (I find context diffs to be more readable but + unified diffs are more compact.) I recommend using the GNU + version of `diff'. Send the output produced by either run of + `diff' to me when you submit your changes. (*Note Bugs::, for the + electronic mail information.) + + Using this format makes it easy for me to apply your changes to the + master version of the `gawk' source code (using `patch'). If I + have to apply the changes manually, using a text editor, I may not + do so, particularly if there are lots of changes. + + 8. Include an entry for the `ChangeLog' file with your submission. + This helps further minimize the amount of work I have to do, + making it easier for me to accept patches. + + Although this sounds like a lot of work, please remember that while +you may write the new code, I have to maintain it and support it. If it +isn't possible for me to do that with a minimum of extra work, then I +probably will not. + + +File: gawk.info, Node: New Ports, Prev: Adding Code, Up: Additions + +C.2.2 Porting `gawk' to a New Operating System +---------------------------------------------- + +If you want to port `gawk' to a new operating system, there are several +steps: + + 1. Follow the guidelines in *note Adding Code::, concerning coding + style, submission of diffs, and so on. + + 2. When doing a port, bear in mind that your code must coexist + peacefully with the rest of `gawk' and the other ports. Avoid + gratuitous changes to the system-independent parts of the code. If + at all possible, avoid sprinkling `#ifdef's just for your port + throughout the code. + + If the changes needed for a particular system affect too much of + the code, I probably will not accept them. In such a case, you + can, of course, distribute your changes on your own, as long as + you comply with the GPL (*note Copying::). + + 3. A number of the files that come with `gawk' are maintained by other + people at the Free Software Foundation. Thus, you should not + change them unless it is for a very good reason; i.e., changes are + not out of the question, but changes to these files are + scrutinized extra carefully. The files are `getopt.h', + `getopt.c', `getopt1.c', `regex.h', `regex.c', `regcomp.c', + `regex_internal.c', `regex_internal.h', `regexec.c', `dfa.h', + `dfa.c', `install-sh', and `mkinstalldirs'. + + 4. Be willing to continue to maintain the port. Non-Unix operating + systems are supported by volunteers who maintain the code needed + to compile and run `gawk' on their systems. If noone volunteers to + maintain a port, it becomes unsupported and it may be necessary to + remove it from the distribution. + + 5. Supply an appropriate `gawkmisc.???' file. Each port has its own + `gawkmisc.???' that implements certain operating system specific + functions. This is cleaner than a plethora of `#ifdef's scattered + throughout the code. The `gawkmisc.c' in the main source + directory includes the appropriate `gawkmisc.???' file from each + subdirectory. Be sure to update it as well. + + Each port's `gawkmisc.???' file has a suffix reminiscent of the + machine or operating system for the port--for example, + `pc/gawkmisc.pc' and `vms/gawkmisc.vms'. The use of separate + suffixes, instead of plain `gawkmisc.c', makes it possible to move + files from a port's subdirectory into the main subdirectory, + without accidentally destroying the real `gawkmisc.c' file. + (Currently, this is only an issue for the PC operating system + ports.) + + 6. Supply a `Makefile' as well as any other C source and header files + that are necessary for your operating system. All your code + should be in a separate subdirectory, with a name that is the same + as, or reminiscent of, either your operating system or the + computer system. If possible, try to structure things so that it + is not necessary to move files out of the subdirectory into the + main source directory. If that is not possible, then be sure to + avoid using names for your files that duplicate the names of files + in the main source directory. + + 7. Update the documentation. Please write a section (or sections) + for this Info file describing the installation and compilation + steps needed to compile and/or install `gawk' for your system. + + 8. Be prepared to sign the appropriate paperwork. In order for the + FSF to distribute your code, you must either place your code in + the public domain and submit a signed statement to that effect, or + assign the copyright in your code to the FSF. Both of these + actions are easy to do and _many_ people have done so already. If + you have questions, please contact me, or . + + Following these steps makes it much easier to integrate your changes +into `gawk' and have them coexist happily with other operating systems' +code that is already there. + + In the code that you supply and maintain, feel free to use a coding +style and brace layout that suits your taste. + + +File: gawk.info, Node: Dynamic Extensions, Next: Future Extensions, Prev: Additions, Up: Notes + +C.3 Adding New Built-in Functions to `gawk' +=========================================== + + Danger Will Robinson! Danger!! + Warning! Warning! + The Robot + + Beginning with `gawk' 3.1, it is possible to add new built-in +functions to `gawk' using dynamically loaded libraries. This facility +is available on systems (such as GNU/Linux) that support the `dlopen' +and `dlsym' functions. This minor node describes how to write and use +dynamically loaded extensions for `gawk'. Experience with programming +in C or C++ is necessary when reading this minor node. + + *Caution:* The facilities described in this minor node are very much +subject to change in a future `gawk' release. Be aware that you may +have to re-do everything, perhaps from scratch, at some future time. + + *Caution:* If you have written your own dynamic extensions, be sure +to recompile them for each new `gawk' release. There is no guarantee +of binary compatibility between different releases, nor will there ever +be such a guarantee. + +* Menu: + +* Internals:: A brief look at some `gawk' internals. +* Sample Library:: A example of new functions. + + +File: gawk.info, Node: Internals, Next: Sample Library, Up: Dynamic Extensions + +C.3.1 A Minimal Introduction to `gawk' Internals +------------------------------------------------ + +The truth is that `gawk' was not designed for simple extensibility. +The facilities for adding functions using shared libraries work, but +are something of a "bag on the side." Thus, this tour is brief and +simplistic; would-be `gawk' hackers are encouraged to spend some time +reading the source code before trying to write extensions based on the +material presented here. Of particular note are the files `awk.h', +`builtin.c', and `eval.c'. Reading `awkgram.y' in order to see how the +parse tree is built would also be of use. + + With the disclaimers out of the way, the following types, structure +members, functions, and macros are declared in `awk.h' and are of use +when writing extensions. The next minor node shows how they are used: + +`AWKNUM' + An `AWKNUM' is the internal type of `awk' floating-point numbers. + Typically, it is a C `double'. + +`NODE' + Just about everything is done using objects of type `NODE'. These + contain both strings and numbers, as well as variables and arrays. + +`AWKNUM force_number(NODE *n)' + This macro forces a value to be numeric. It returns the actual + numeric value contained in the node. It may end up calling an + internal `gawk' function. + +`void force_string(NODE *n)' + This macro guarantees that a `NODE''s string value is current. It + may end up calling an internal `gawk' function. It also + guarantees that the string is zero-terminated. + +`size_t get_curfunc_arg_count(void)' + This function returns the actual number of parameters passed to + the current function. Inside the code of an extension this can be + used to determine the maximum index which is safe to use with + `stack_ptr'. If this value is greater than `tree->param_cnt', the + function was called incorrectly from the `awk' program. + + *Caution:* This function is new as of `gawk' 3.1.4. + +`n->param_cnt' + Inside an extension function, this is the maximum number of + expected parameters, as set by the `make_builtin' function. + +`n->stptr' +`n->stlen' + The data and length of a `NODE''s string value, respectively. The + string is _not_ guaranteed to be zero-terminated. If you need to + pass the string value to a C library function, save the value in + `n->stptr[n->stlen]', assign `'\0'' to it, call the routine, and + then restore the value. + +`n->type' + The type of the `NODE'. This is a C `enum'. Values should be + either `Node_var' or `Node_var_array' for function parameters. + +`n->vname' + The "variable name" of a node. This is not of much use inside + externally written extensions. + +`void assoc_clear(NODE *n)' + Clears the associative array pointed to by `n'. Make sure that + `n->type == Node_var_array' first. + +`NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference)' + Finds, and installs if necessary, array elements. `symbol' is the + array, `subs' is the subscript. This is usually a value created + with `tmp_string' (see below). `reference' should be `TRUE' if it + is an error to use the value before it is created. Typically, + `FALSE' is the correct value to use from extension functions. + +`NODE *make_string(char *s, size_t len)' + Take a C string and turn it into a pointer to a `NODE' that can be + stored appropriately. This is permanent storage; understanding of + `gawk' memory management is helpful. + +`NODE *make_number(AWKNUM val)' + Take an `AWKNUM' and turn it into a pointer to a `NODE' that can + be stored appropriately. This is permanent storage; understanding + of `gawk' memory management is helpful. + +`NODE *tmp_string(char *s, size_t len);' + Take a C string and turn it into a pointer to a `NODE' that can be + stored appropriately. This is temporary storage; understanding of + `gawk' memory management is helpful. + +`NODE *tmp_number(AWKNUM val)' + Take an `AWKNUM' and turn it into a pointer to a `NODE' that can + be stored appropriately. This is temporary storage; understanding + of `gawk' memory management is helpful. + +`NODE *dupnode(NODE *n)' + Duplicate a node. In most cases, this increments an internal + reference count instead of actually duplicating the entire `NODE'; + understanding of `gawk' memory management is helpful. + +`void free_temp(NODE *n)' + This macro releases the memory associated with a `NODE' allocated + with `tmp_string' or `tmp_number'. Understanding of `gawk' memory + management is helpful. + +`void make_builtin(char *name, NODE *(*func)(NODE *), int count)' + Register a C function pointed to by `func' as new built-in + function `name'. `name' is a regular C string. `count' is the + maximum number of arguments that the function takes. The function + should be written in the following manner: + + /* do_xxx --- do xxx function for gawk */ + + NODE * + do_xxx(NODE *tree) + { + ... + } + +`NODE *get_argument(NODE *tree, int i)' + This function is called from within a C extension function to get + the `i'-th argument from the function call. The first argument is + argument zero. + +`NODE *get_actual_argument(NODE *tree, unsigned int i,' +` int optional, int wantarray);' + This function retrieves a particular argument `i'. `wantarray' is + `TRUE' if the argument should be an array, `FALSE' otherwise. If + `optional' is `TRUE', the argument need not have been supplied. + If it wasn't, the return value is `NULL'. It is a fatal error if + `optional' is `TRUE' but the argument was not provided. + + *Caution:* This function is new as of `gawk' 3.1.4. + +`get_scalar_argument(t, i, opt)' + This is a convenience macro that calls `get_actual_argument'. + + *Caution:* This macro is new as of `gawk' 3.1.4. + +`get_array_argument(t, i, opt)' + This is a convenience macro that calls `get_actual_argument'. + + *Caution:* This macro is new as of `gawk' 3.1.4. + +`void set_value(NODE *tree)' + This function is called from within a C extension function to set + the return value from the extension function. This value is what + the `awk' program sees as the return value from the new `awk' + function. + +`void update_ERRNO(void)' + This function is called from within a C extension function to set + the value of `gawk''s `ERRNO' variable, based on the current value + of the C `errno' variable. It is provided as a convenience. + +`void update_ERRNO_saved(int errno_saved)' + This function is called from within a C extension function to set + the value of `gawk''s `ERRNO' variable, based on the saved value + of the C `errno' variable provided as the argument. It is + provided as a convenience. + + *Caution:* This function is new as of `gawk' 3.1.5. + +`void register_deferred_variable(const char *name, NODE *(*load_func)(void))' + This function is called to register a function to be called when a + reference to an undefined variable with the given name is + encountered. The callback function will never be called if the + variable exists already, so, unless the calling code is running at + program startup, it should first check whether a variable of the + given name already exists. The argument function must return a + pointer to a NODE containing the newly created variable. This + function is used to implement the builtin `ENVIRON' and `PROCINFO' + variables, so you can refer to them for examples. + + *Caution:* This function is new as of `gawk' 3.1.5. + +`void register_open_hook(void *(*open_func)(IOBUF *))' + This function is called to register a function to be called + whenever a new data file is opened, leading to the creation of an + `IOBUF' structure in `iop_alloc'. After creating the new `IOBUF', + `iop_alloc' will call (in reverse order of registration, so the + last function registered is called first) each open hook until one + returns non-NULL. If any hook returns a non-NULL value, that + value is assigned to the `IOBUF''s `opaque' field (which will + presumably point to a structure containing additional state + associated with the input processing), and no further open hooks + are called. + + The function called will most likely want to set the `IOBUF' + `get_record' method to indicate that future input records should + be retrieved by calling that method instead of using the standard + `gawk' input processing. + + And the function will also probably want to set the `IOBUF' + `close_func' method to be called when the file is closed to clean + up any state associated with the input. + + Finally, hook functions should be prepared to receive an `IOBUF' + structure where the `fd' field is set to `INVALID_HANDLE', meaning + that `gawk' was not able to open the file itself. In this case, + the hook function must be able to successfully open the file and + place a valid file descriptor there. + + Currently, for example, the hook function facility is used to + implement the XML parser shared library extension. For more info, + please look in `awk.h' and in `io.c'. + + *Caution:* This function is new as of `gawk' 3.1.5. + + An argument that is supposed to be an array needs to be handled with +some extra code, in case the array being passed in is actually from a +function parameter. + + In versions of `gawk' up to and including 3.1.2, the following +boilerplate code shows how to do this: + + NODE *the_arg; + + the_arg = get_argument(tree, 2); /* assume need 3rd arg, 0-based */ + + /* if a parameter, get it off the stack */ + if (the_arg->type == Node_param_list) + the_arg = stack_ptr[the_arg->param_cnt]; + + /* parameter referenced an array, get it */ + if (the_arg->type == Node_array_ref) + the_arg = the_arg->orig_array; + + /* check type */ + if (the_arg->type != Node_var && the_arg->type != Node_var_array) + fatal("newfunc: third argument is not an array"); + + /* force it to be an array, if necessary, clear it */ + the_arg->type = Node_var_array; + assoc_clear(the_arg); + + For versions 3.1.3 and later, the internals changed. In particular, +the interface was actually _simplified_ drastically. The following +boilerplate code now suffices: + + NODE *the_arg; + + the_arg = get_argument(tree, 2); /* assume need 3rd arg, 0-based */ + + /* force it to be an array: */ + the_arg = get_array(the_arg); + + /* if necessary, clear it: */ + assoc_clear(the_arg); + + As of version 3.1.4, the internals improved again, and became even +simpler: + + NODE *the_arg; + + the_arg = get_array_argument(tree, 2, FALSE); /* assume need 3rd arg, 0-based */ + + Again, you should spend time studying the `gawk' internals; don't +just blindly copy this code. + + +File: gawk.info, Node: Sample Library, Prev: Internals, Up: Dynamic Extensions + +C.3.2 Directory and File Operation Built-ins +-------------------------------------------- + +Two useful functions that are not in `awk' are `chdir' (so that an +`awk' program can change its directory) and `stat' (so that an `awk' +program can gather information about a file). This minor node +implements these functions for `gawk' in an external extension library. + +* Menu: + +* Internal File Description:: What the new functions will do. +* Internal File Ops:: The code for internal file operations. +* Using Internal File Ops:: How to use an external extension. + + +File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library + +C.3.2.1 Using `chdir' and `stat' +................................ + +This minor node shows how to use the new functions at the `awk' level +once they've been integrated into the running `gawk' interpreter. +Using `chdir' is very straightforward. It takes one argument, the new +directory to change to: + + ... + newdir = "/home/arnold/funstuff" + ret = chdir(newdir) + if (ret < 0) { + printf("could not change to %s: %s\n", + newdir, ERRNO) > "/dev/stderr" + exit 1 + } + ... + + The return value is negative if the `chdir' failed, and `ERRNO' +(*note Built-in Variables::) is set to a string indicating the error. + + Using `stat' is a bit more complicated. The C `stat' function fills +in a structure that has a fair amount of information. The right way to +model this in `awk' is to fill in an associative array with the +appropriate information: + + file = "/home/arnold/.profile" + fdata[1] = "x" # force `fdata' to be an array + ret = stat(file, fdata) + if (ret < 0) { + printf("could not stat %s: %s\n", + file, ERRNO) > "/dev/stderr" + exit 1 + } + printf("size of %s is %d bytes\n", file, fdata["size"]) + + The `stat' function always clears the data array, even if the `stat' +fails. It fills in the following elements: + +`"name"' + The name of the file that was `stat''ed. + +`"dev"' +`"ino"' + The file's device and inode numbers, respectively. + +`"mode"' + The file's mode, as a numeric value. This includes both the file's + type and its permissions. + +`"nlink"' + The number of hard links (directory entries) the file has. + +`"uid"' +`"gid"' + The numeric user and group ID numbers of the file's owner. + +`"size"' + The size in bytes of the file. + +`"blocks"' + The number of disk blocks the file actually occupies. This may not + be a function of the file's size if the file has holes. + +`"atime"' +`"mtime"' +`"ctime"' + The file's last access, modification, and inode update times, + respectively. These are numeric timestamps, suitable for + formatting with `strftime' (*note Built-in::). + +`"pmode"' + The file's "printable mode." This is a string representation of + the file's type and permissions, such as what is produced by `ls + -l'--for example, `"drwxr-xr-x"'. + +`"type"' + A printable string representation of the file's type. The value + is one of the following: + + `"blockdev"' + `"chardev"' + The file is a block or character device ("special file"). + + `"directory"' + The file is a directory. + + `"fifo"' + The file is a named-pipe (also known as a FIFO). + + `"file"' + The file is just a regular file. + + `"socket"' + The file is an `AF_UNIX' ("Unix domain") socket in the + filesystem. + + `"symlink"' + The file is a symbolic link. + + Several additional elements may be present depending upon the +operating system and the type of the file. You can test for them in +your `awk' program by using the `in' operator (*note Reference to +Elements::): + +`"blksize"' + The preferred block size for I/O to the file. This field is not + present on all POSIX-like systems in the C `stat' structure. + +`"linkval"' + If the file is a symbolic link, this element is the name of the + file the link points to (i.e., the value of the link). + +`"rdev"' +`"major"' +`"minor"' + If the file is a block or character device file, then these values + represent the numeric device number and the major and minor + components of that number, respectively. + + +File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Sample Library + +C.3.2.2 C Code for `chdir' and `stat' +..................................... + +Here is the C code for these extensions. They were written for +GNU/Linux. The code needs some more work for complete portability to +other POSIX-compliant systems:(1) + + #include "awk.h" + + #include + + /* do_chdir --- provide dynamically loaded + chdir() builtin for gawk */ + + static NODE * + do_chdir(tree) + NODE *tree; + { + NODE *newdir; + int ret = -1; + + if (do_lint && get_curfunc_arg_count() != 1) + lintwarn("chdir: called with incorrect number of arguments"); + + newdir = get_scalar_argument(tree, 0); + + The file includes the `"awk.h"' header file for definitions for the +`gawk' internals. It includes `' for access to the +`major' and `minor' macros. + + By convention, for an `awk' function `foo', the function that +implements it is called `do_foo'. The function should take a `NODE *' +argument, usually called `tree', that represents the argument list to +the function. The `newdir' variable represents the new directory to +change to, retrieved with `get_argument'. Note that the first argument +is numbered zero. + + This code actually accomplishes the `chdir'. It first forces the +argument to be a string and passes the string value to the `chdir' +system call. If the `chdir' fails, `ERRNO' is updated. The result of +`force_string' has to be freed with `free_temp': + + (void) force_string(newdir); + ret = chdir(newdir->stptr); + if (ret < 0) + update_ERRNO(); + free_temp(newdir); + + Finally, the function returns the return value to the `awk' level, +using `set_value'. Then it must return a value from the call to the new +built-in (this value ignored by the interpreter): + + /* Set the return value */ + set_value(tmp_number((AWKNUM) ret)); + + /* Just to make the interpreter happy */ + return tmp_number((AWKNUM) 0); + } + + The `stat' built-in is more involved. First comes a function that +turns a numeric mode into a printable representation (e.g., 644 becomes +`-rw-r--r--'). This is omitted here for brevity: + + /* format_mode --- turn a stat mode field + into something readable */ + + static char * + format_mode(fmode) + unsigned long fmode; + { + ... + } + + Next comes the actual `do_stat' function itself. First come the +variable declarations and argument checking: + + /* do_stat --- provide a stat() function for gawk */ + + static NODE * + do_stat(tree) + NODE *tree; + { + NODE *file, *array; + struct stat sbuf; + int ret; + NODE **aptr; + char *pmode; /* printable mode */ + char *type = "unknown"; + + + if (do_lint && get_curfunc_arg_count() > 2) + lintwarn("stat: called with too many arguments"); + + Then comes the actual work. First, we get the arguments. Then, we +always clear the array. To get the file information, we use `lstat', +in case the file is a symbolic link. If there's an error, we set +`ERRNO' and return: + + /* directory is first arg, array to hold results is second */ + file = get_scalar_argument(tree, 0, FALSE); + array = get_array_argument(tree, 1, FALSE); + + /* empty out the array */ + assoc_clear(array); + + /* lstat the file, if error, set ERRNO and return */ + (void) force_string(file); + ret = lstat(file->stptr, & sbuf); + if (ret < 0) { + update_ERRNO(); + + set_value(tmp_number((AWKNUM) ret)); + + free_temp(file); + return tmp_number((AWKNUM) 0); + } + + Now comes the tedious part: filling in the array. Only a few of the +calls are shown here, since they all follow the same pattern: + + /* fill in the array */ + aptr = assoc_lookup(array, tmp_string("name", 4), FALSE); + *aptr = dupnode(file); + + aptr = assoc_lookup(array, tmp_string("mode", 4), FALSE); + *aptr = make_number((AWKNUM) sbuf.st_mode); + + aptr = assoc_lookup(array, tmp_string("pmode", 5), FALSE); + pmode = format_mode(sbuf.st_mode); + *aptr = make_string(pmode, strlen(pmode)); + + When done, we free the temporary value containing the file name, set +the return value, and return: + + free_temp(file); + + /* Set the return value */ + set_value(tmp_number((AWKNUM) ret)); + + /* Just to make the interpreter happy */ + return tmp_number((AWKNUM) 0); + } + + Finally, it's necessary to provide the "glue" that loads the new +function(s) into `gawk'. By convention, each library has a routine +named `dlload' that does the job: + + /* dlload --- load new builtins in this library */ + + NODE * + dlload(tree, dl) + NODE *tree; + void *dl; + { + make_builtin("chdir", do_chdir, 1); + make_builtin("stat", do_stat, 2); + return tmp_number((AWKNUM) 0); + } + + And that's it! As an exercise, consider adding functions to +implement system calls such as `chown', `chmod', and `umask'. + + ---------- Footnotes ---------- + + (1) This version is edited slightly for presentation. The complete +version can be found in `extension/filefuncs.c' in the `gawk' +distribution. + + +File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Sample Library + +C.3.2.3 Integrating the Extensions +.................................. + +Now that the code is written, it must be possible to add it at runtime +to the running `gawk' interpreter. First, the code must be compiled. +Assuming that the functions are in a file named `filefuncs.c', and IDIR +is the location of the `gawk' include files, the following steps create +a GNU/Linux shared library: + + $ gcc -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c + $ ld -o filefuncs.so -shared filefuncs.o + + Once the library exists, it is loaded by calling the `extension' +built-in function. This function takes two arguments: the name of the +library to load and the name of a function to call when the library is +first loaded. This function adds the new functions to `gawk'. It +returns the value returned by the initialization function within the +shared library: + + # file testff.awk + BEGIN { + extension("./filefuncs.so", "dlload") + + chdir(".") # no-op + + data[1] = 1 # force `data' to be an array + print "Info for testff.awk" + ret = stat("testff.awk", data) + print "ret =", ret + for (i in data) + printf "data[\"%s\"] = %s\n", i, data[i] + print "testff.awk modified:", + strftime("%m %d %y %H:%M:%S", data["mtime"]) + } + + Here are the results of running the program: + + $ gawk -f testff.awk + -| Info for testff.awk + -| ret = 0 + -| data["blksize"] = 4096 + -| data["mtime"] = 932361936 + -| data["mode"] = 33188 + -| data["type"] = file + -| data["dev"] = 2065 + -| data["gid"] = 10 + -| data["ino"] = 878597 + -| data["ctime"] = 971431797 + -| data["blocks"] = 2 + -| data["nlink"] = 1 + -| data["name"] = testff.awk + -| data["atime"] = 971608519 + -| data["pmode"] = -rw-r--r-- + -| data["size"] = 607 + -| data["uid"] = 2076 + -| testff.awk modified: 07 19 99 08:25:36 + + +File: gawk.info, Node: Future Extensions, Prev: Dynamic Extensions, Up: Notes + +C.4 Probable Future Extensions +============================== + + AWK is a language similar to PERL, only considerably more elegant. + Arnold Robbins + + Hey! + Larry Wall + + This minor node briefly lists extensions and possible improvements +that indicate the directions we are currently considering for `gawk'. +The file `FUTURES' in the `gawk' distribution lists these extensions as +well. + + Following is a list of probable future changes visible at the `awk' +language level: + +Loadable module interface + It is not clear that the `awk'-level interface to the modules + facility is as good as it should be. The interface needs to be + redesigned, particularly taking namespace issues into account, as + well as possibly including issues such as library search path order + and versioning. + +`RECLEN' variable for fixed-length records + Along with `FIELDWIDTHS', this would speed up the processing of + fixed-length records. `PROCINFO["RS"]' would be `"RS"' or + `"RECLEN"', depending upon which kind of record processing is in + effect. + +Additional `printf' specifiers + The 1999 ISO C standard added a number of additional `printf' + format specifiers. These should be evaluated for possible + inclusion in `gawk'. + +Databases + It may be possible to map a GDBM/NDBM/SDBM file into an `awk' + array. + +More `lint' warnings + There are more things that could be checked for portability. + + Following is a list of probable improvements that will make `gawk''s +source code easier to work with: + +Loadable module mechanics + The current extension mechanism works (*note Dynamic Extensions::), + but is rather primitive. It requires a fair amount of manual work + to create and integrate a loadable module. Nor is the current + mechanism as portable as might be desired. The GNU `libtool' + package provides a number of features that would make using + loadable modules much easier. `gawk' should be changed to use + `libtool'. + +Loadable module internals + The API to its internals that `gawk' "exports" should be revised. + Too many things are needlessly exposed. A new API should be + designed and implemented to make module writing easier. + +Better array subscript management + `gawk''s management of array subscript storage could use revamping, + so that using the same value to index multiple arrays only stores + one copy of the index value. + +Integrating the DBUG library + Integrating Fred Fish's DBUG library would be helpful during + development, but it's a lot of work to do. + + Following is a list of probable improvements that will make `gawk' +perform better: + +Compilation of `awk' programs + `gawk' uses a Bison (YACC-like) parser to convert the script given + it into a syntax tree; the syntax tree is then executed by a + simple recursive evaluator. This method incurs a lot of overhead, + since the recursive evaluator performs many procedure calls to do + even the simplest things. + + It should be possible for `gawk' to convert the script's parse tree + into a C program which the user would then compile, using the + normal C compiler and a special `gawk' library to provide all the + needed functions (regexps, fields, associative arrays, type + coercion, and so on). + + An easier possibility might be for an intermediate phase of `gawk' + to convert the parse tree into a linear byte code form like the + one used in GNU Emacs Lisp. The recursive evaluator would then be + replaced by a straight line byte code interpreter that would be + intermediate in speed between running a compiled program and doing + what `gawk' does now. + + Finally, the programs in the test suite could use documenting in +this Info file. + + *Note Additions::, if you are interested in tackling any of these +projects. + + +File: gawk.info, Node: Basic Concepts, Next: Glossary, Prev: Notes, Up: Top + +Appendix D Basic Programming Concepts +************************************* + +This major node attempts to define some of the basic concepts and terms +that are used throughout the rest of this Info file. As this Info file +is specifically about `awk', and not about computer programming in +general, the coverage here is by necessity fairly cursory and +simplistic. (If you need more background, there are many other +introductory texts that you should refer to instead.) + +* Menu: + +* Basic High Level:: The high level view. +* Basic Data Typing:: A very quick intro to data types. +* Floating Point Issues:: Stuff to know about floating-point numbers. + + +File: gawk.info, Node: Basic High Level, Next: Basic Data Typing, Up: Basic Concepts + +D.1 What a Program Does +======================= + +At the most basic level, the job of a program is to process some input +data and produce results. + + _______ + +------+ / \ +---------+ + | Data | -----> < Program > -----> | Results | + +------+ \_______/ +---------+ + + The "program" in the figure can be either a compiled program(1) +(such as `ls'), or it may be "interpreted". In the latter case, a +machine-executable program such as `awk' reads your program, and then +uses the instructions in your program to process the data. + + When you write a program, it usually consists of the following, very +basic set of steps: + + ______ + +----------------+ / More \ No +----------+ + | Initialization | -------> < Data > -------> | Clean Up | + +----------------+ ^ \ ? / +----------+ + | +--+-+ + | | Yes + | | + | V + | +---------+ + +-----+ Process | + +---------+ + +Initialization + These are the things you do before actually starting to process + data, such as checking arguments, initializing any data you need + to work with, and so on. This step corresponds to `awk''s `BEGIN' + rule (*note BEGIN/END::). + + If you were baking a cake, this might consist of laying out all the + mixing bowls and the baking pan, and making sure you have all the + ingredients that you need. + +Processing + This is where the actual work is done. Your program reads data, + one logical chunk at a time, and processes it as appropriate. + + In most programming languages, you have to manually manage the + reading of data, checking to see if there is more each time you + read a chunk. `awk''s pattern-action paradigm (*note Getting + Started::) handles the mechanics of this for you. + + In baking a cake, the processing corresponds to the actual labor: + breaking eggs, mixing the flour, water, and other ingredients, and + then putting the cake into the oven. + +Clean Up + Once you've processed all the data, you may have things you need to + do before exiting. This step corresponds to `awk''s `END' rule + (*note BEGIN/END::). + + After the cake comes out of the oven, you still have to wrap it in + plastic wrap to keep anyone from tasting it, as well as wash the + mixing bowls and utensils. + + An "algorithm" is a detailed set of instructions necessary to +accomplish a task, or process data. It is much the same as a recipe +for baking a cake. Programs implement algorithms. Often, it is up to +you to design the algorithm and implement it, simultaneously. + + The "logical chunks" we talked about previously are called "records", +similar to the records a company keeps on employees, a school keeps for +students, or a doctor keeps for patients. Each record has many +component parts, such as first and last names, date of birth, address, +and so on. The component parts are referred to as the "fields" of the +record. + + The act of reading data is termed "input", and that of generating +results, not too surprisingly, is termed "output". They are often +referred to together as "input/output," and even more often, as "I/O" +for short. (You will also see "input" and "output" used as verbs.) + + `awk' manages the reading of data for you, as well as the breaking +it up into records and fields. Your program's job is to tell `awk' +what to with the data. You do this by describing "patterns" in the +data to look for, and "actions" to execute when those patterns are +seen. This "data-driven" nature of `awk' programs usually makes them +both easier to write and easier to read. + + ---------- Footnotes ---------- + + (1) Compiled programs are typically written in lower-level languages +such as C, C++, Fortran, or Ada, and then translated, or "compiled", +into a form that the computer can execute directly. + + +File: gawk.info, Node: Basic Data Typing, Next: Floating Point Issues, Prev: Basic High Level, Up: Basic Concepts + +D.2 Data Values in a Computer +============================= + +In a program, you keep track of information and values in things called +"variables". A variable is just a name for a given value, such as +`first_name', `last_name', `address', and so on. `awk' has several +predefined variables, and it has special names to refer to the current +input record and the fields of the record. You may also group multiple +associated values under one name, as an array. + + Data, particularly in `awk', consists of either numeric values, such +as 42 or 3.1415927, or string values. String values are essentially +anything that's not a number, such as a name. Strings are sometimes +referred to as "character data", since they store the individual +characters that comprise them. Individual variables, as well as +numeric and string variables, are referred to as "scalar" values. +Groups of values, such as arrays, are not scalars. + + Within computers, there are two kinds of numeric values: "integers" +and "floating-point". In school, integer values were referred to as +"whole" numbers--that is, numbers without any fractional part, such as +1, 42, or -17. The advantage to integer numbers is that they represent +values exactly. The disadvantage is that their range is limited. On +most modern systems, this range is -2,147,483,648 to 2,147,483,647. + + Integer values come in two flavors: "signed" and "unsigned". Signed +values may be negative or positive, with the range of values just +described. Unsigned values are always positive. On most modern +systems, the range is from 0 to 4,294,967,295. + + Floating-point numbers represent what are called "real" numbers; +i.e., those that do have a fractional part, such as 3.1415927. The +advantage to floating-point numbers is that they can represent a much +larger range of values. The disadvantage is that there are numbers +that they cannot represent exactly. `awk' uses "double-precision" +floating-point numbers, which can hold more digits than +"single-precision" floating-point numbers. Floating-point issues are +discussed more fully in *note Floating Point Issues::. + + At the very lowest level, computers store values as groups of binary +digits, or "bits". Modern computers group bits into groups of eight, +called "bytes". Advanced applications sometimes have to manipulate +bits directly, and `gawk' provides functions for doing so. + + While you are probably used to the idea of a number without a value +(i.e., zero), it takes a bit more getting used to the idea of +zero-length character data. Nevertheless, such a thing exists. It is +called the "null string". The null string is character data that has +no value. In other words, it is empty. It is written in `awk' programs +like this: `""'. + + Humans are used to working in decimal; i.e., base 10. In base 10, +numbers go from 0 to 9, and then "roll over" into the next column. +(Remember grade school? 42 is 4 times 10 plus 2.) + + There are other number bases though. Computers commonly use base 2 +or "binary", base 8 or "octal", and base 16 or "hexadecimal". In +binary, each column represents two times the value in the column to its +right. Each column may contain either a 0 or a 1. Thus, binary 1010 +represents 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1, +or decimal 10. Octal and hexadecimal are discussed more in *note +Nondecimal-numbers::. + + Programs are written in programming languages. Hundreds, if not +thousands, of programming languages exist. One of the most popular is +the C programming language. The C language had a very strong influence +on the design of the `awk' language. + + There have been several versions of C. The first is often referred +to as "K&R" C, after the initials of Brian Kernighan and Dennis Ritchie, +the authors of the first book on C. (Dennis Ritchie created the +language, and Brian Kernighan was one of the creators of `awk'.) + + In the mid-1980s, an effort began to produce an international +standard for C. This work culminated in 1989, with the production of +the ANSI standard for C. This standard became an ISO standard in 1990. +Where it makes sense, POSIX `awk' is compatible with 1990 ISO C. + + In 1999, a revised ISO C standard was approved and released. Future +versions of `gawk' will be as compatible as possible with this standard. + + +File: gawk.info, Node: Floating Point Issues, Prev: Basic Data Typing, Up: Basic Concepts + +D.3 Floating-Point Number Caveats +================================= + +As mentioned earlier, floating-point numbers represent what are called +"real" numbers, i.e., those that have a fractional part. `awk' uses +double-precision floating-point numbers to represent all numeric +values. This minor node describes some of the issues involved in using +floating-point numbers. + + There is a very nice paper on floating-point arithmetic by David +Goldberg, "What Every Computer Scientist Should Know About +Floating-point Arithmetic," `ACM Computing Surveys' *23*, 1 (1991-03), +5-48.(1) This is worth reading if you are interested in the details, +but it does require a background in computer science. + +* Menu: + +* String Conversion Precision:: The String Value Can Lie. +* Unexpected Results:: Floating Point Numbers Are Not + Abstract Numbers. +* POSIX Floating Point Problems:: Standards Versus Existing Practice. + + ---------- Footnotes ---------- + + (1) `http://www.validlab.com/goldberg/paper.ps'. + + +File: gawk.info, Node: String Conversion Precision, Next: Unexpected Results, Up: Floating Point Issues + +D.3.1 The String Value Can Lie +------------------------------ + +Internally, `awk' keeps both the numeric value (double-precision +floating-point) and the string value for a variable. Separately, `awk' +keeps track of what type the variable has (*note Typing and +Comparison::), which plays a role in how variables are used in +comparisons. + + It is important to note that the string value for a number may not +reflect the full value (all the digits) that the numeric value actually +contains. The following program (`values.awk') illustrates this: + + { + $1 = $2 + $3 + # see it for what it is + printf("$1 = %.12g\n", $1) + # use CONVFMT + a = "<" $1 ">" + print "a =", a + # use OFMT + print "$1 =", $1 + } + +This program shows the full value of the sum of `$2' and `$3' using +`printf', and then prints the string values obtained from both +automatic conversion (via `CONVFMT') and from printing (via `OFMT'). + + Here is what happens when the program is run: + + $ echo 2 3.654321 1.2345678 | awk -f values.awk + -| $1 = 4.8888888 + -| a = <4.88889> + -| $1 = 4.88889 + + This makes it clear that the full numeric value is different from +what the default string representations show. + + `CONVFMT''s default value is `"%.6g"', which yields a value with at +least six significant digits. For some applications, you might want to +change it to specify more precision. On most modern machines, most of +the time, 17 digits is enough to capture a floating-point number's +value exactly.(1) + + ---------- Footnotes ---------- + + (1) Pathological cases can require up to 752 digits (!), but we +doubt that you need to worry about this. + + +File: gawk.info, Node: Unexpected Results, Next: POSIX Floating Point Problems, Prev: String Conversion Precision, Up: Floating Point Issues + +D.3.2 Floating Point Numbers Are Not Abstract Numbers +----------------------------------------------------- + +Unlike numbers in the abstract sense (such as what you studied in high +school or college math), numbers stored in computers are limited in +certain ways. They cannot represent an infinite number of digits, nor +can they always represent things exactly. In particular, +floating-point numbers cannot always represent values exactly. Here is +an example: + + $ awk '{ printf("%010d\n", $1 * 100) }' + 515.79 + -| 0000051579 + 515.80 + -| 0000051579 + 515.81 + -| 0000051580 + 515.82 + -| 0000051582 + Ctrl-d + +This shows that some values can be represented exactly, whereas others +are only approximated. This is not a "bug" in `awk', but simply an +artifact of how computers represent numbers. + + Another peculiarity of floating-point numbers on modern systems is +that they often have more than one representation for the number zero! +In particular, it is possible to represent "minus zero" as well as +regular, or "positive" zero. + + This example shows that negative and positive zero are distinct +values when stored internally, but that they are in fact equal to each +other, as well as to "regular" zero: + + $ gawk 'BEGIN { mz = -0 ; pz = 0 + > printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz + > printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0 + > }' + -| -0 = -0, +0 = 0, (-0 == +0) -> 1 + -| mz == 0 -> 1, pz == 0 -> 1 + + It helps to keep this in mind should you process numeric data that +contains negative zero values; the fact that the zero is negative is +noted and can affect comparisons. + + +File: gawk.info, Node: POSIX Floating Point Problems, Prev: Unexpected Results, Up: Floating Point Issues + +D.3.3 Standards Versus Existing Practice +---------------------------------------- + +Historically, `awk' has converted any non-numeric looking string to the +numeric value zero, when required. Furthermore, the original +definition of the language and the original POSIX standards specified +that `awk' only understands decimal numbers (base 10), and not octal +(base 8) or hexadecimal numbers (base 16). + + As of this writing (February, 2007), changes in the language of the +current POSIX standard can be interpreted to imply that `awk' should +support additional features. These features are: + + * Interpretation of floating point data values specified in + hexadecimal notation (`0xDEADBEEF'). (Note: data values, _not_ + source code constants.) + + * Support for the special IEEE 754 floating point values "Not A + Number" (NaN), positive Infinity ("inf") and negative Infinity + ("-inf"). In particular, the format for these values is as + specified by the ISO C99 standard, which ignores case and can + allow machine-dependent additional characters after the `nan' and + allow either `inf' or `infinity'. + + The first problem is that both of these are clear changes to +historical practice: + + * The `gawk' maintainer feels that hexadecimal floating point + values, in particular, is ugly, and was never intended by the + original designers to be part of the language. + + * Allowing completely alphabetic strings to have valid numeric + values is also a very severe departure from historical practice. + + The second problem is that the `gawk' maintainer feels that this +interpretation of the standard, which requires a certain amount of +"language lawyering" to arrive at in the first place, was not intended +by the standard developers, either. In other words, "we see how you +got where you are, but we don't think that that's where you want to be." + + Nevertheless, on systems that support IEEE floating point, it seems +reasonable to provide _some_ way to support NaN and Infinity values. +The solution implemented in `gawk', as of version 3.1.6, is as follows: + + 1. With the `--posix' command-line option, `gawk' becomes "hands + off." String values are passed directly to the system library's + `strtod()' function, and if it successfuly returns a numeric value, + that is what's used. By definition, the results are not portable + across different systems.(1) They are also a little surprising: + + $ echo nanny | gawk --posix '{ print $1 + 0 }' + -| nan + $ echo 0xDeadBeef | gawk --posix '{ print $1 + 0 }' + -| 3735928559 + + 2. Without `--posix', `gawk' interprets the four strings `+inf', + `-inf', `+nan', and `-nan' specially, producing the corresponding + special numeric values. The leading sign acts a signal to `gawk' + (and the user) that the value is really numeric. Hexadecimal + floating point is not supported (unless you also use + `--non-decimal-data', which is _not_ recommended). For example: + + $ echo nanny | gawk '{ print $1 + 0 }' + -| 0 + $ echo +nan | gawk '{ print $1 + 0 }' + -| nan + $ echo 0xDeadBeef | gawk '{ print $1 + 0 }' + -| 0 + + `gawk' does ignore case distinction in the four special values. + Thus `+nan' and `+NaN' are the same. + + ---------- Footnotes ---------- + + (1) You asked for it, you got it. + + +File: gawk.info, Node: Glossary, Next: Copying, Prev: Basic Concepts, Up: Top + +Glossary +******** + +Action + A series of `awk' statements attached to a rule. If the rule's + pattern matches an input record, `awk' executes the rule's action. + Actions are always enclosed in curly braces. (*Note Action + Overview::.) + +Amazing `awk' Assembler + Henry Spencer at the University of Toronto wrote a retargetable + assembler completely as `sed' and `awk' scripts. It is thousands + of lines long, including machine descriptions for several eight-bit + microcomputers. It is a good example of a program that would have + been better written in another language. You can get it from + `ftp://ftp.freefriends.org/arnold/Awkstuff/aaa.tgz'. + +Amazingly Workable Formatter (`awf') + Henry Spencer at the University of Toronto wrote a formatter that + accepts a large subset of the `nroff -ms' and `nroff -man' + formatting commands, using `awk' and `sh'. It is available over + the Internet from + `ftp://ftp.freefriends.org/arnold/Awkstuff/awf.tgz'. + +Anchor + The regexp metacharacters `^' and `$', which force the match to + the beginning or end of the string, respectively. + +ANSI + The American National Standards Institute. This organization + produces many standards, among them the standards for the C and + C++ programming languages. These standards often become + international standards as well. See also "ISO." + +Array + A grouping of multiple values under the same name. Most languages + just provide sequential arrays. `awk' provides associative arrays. + +Assertion + A statement in a program that a condition is true at this point in + the program. Useful for reasoning about how a program is supposed + to behave. + +Assignment + An `awk' expression that changes the value of some `awk' variable + or data object. An object that you can assign to is called an + "lvalue". The assigned values are called "rvalues". *Note + Assignment Ops::. + +Associative Array + Arrays in which the indices may be numbers or strings, not just + sequential integers in a fixed range. + +`awk' Language + The language in which `awk' programs are written. + +`awk' Program + An `awk' program consists of a series of "patterns" and "actions", + collectively known as "rules". For each input record given to the + program, the program's rules are all processed in turn. `awk' + programs may also contain function definitions. + +`awk' Script + Another name for an `awk' program. + +Bash + The GNU version of the standard shell (the Bourne-Again SHell). + See also "Bourne Shell." + +BBS + See "Bulletin Board System." + +Bit + Short for "Binary Digit." All values in computer memory + ultimately reduce to binary digits: values that are either zero or + one. Groups of bits may be interpreted differently--as integers, + floating-point numbers, character data, addresses of other memory + objects, or other data. `awk' lets you work with floating-point + numbers and strings. `gawk' lets you manipulate bit values with + the built-in functions described in *note Bitwise Functions::. + + Computers are often defined by how many bits they use to represent + integer values. Typical systems are 32-bit systems, but 64-bit + systems are becoming increasingly popular, and 16-bit systems are + waning in popularity. + +Boolean Expression + Named after the English mathematician Boole. See also "Logical + Expression." + +Bourne Shell + The standard shell (`/bin/sh') on Unix and Unix-like systems, + originally written by Steven R. Bourne. Many shells (`bash', + `ksh', `pdksh', `zsh') are generally upwardly compatible with the + Bourne shell. + +Built-in Function + The `awk' language provides built-in functions that perform various + numerical, I/O-related, and string computations. Examples are + `sqrt' (for the square root of a number) and `substr' (for a + substring of a string). `gawk' provides functions for timestamp + management, bit manipulation, and runtime string translation. + (*Note Built-in::.) + +Built-in Variable + `ARGC', `ARGV', `CONVFMT', `ENVIRON', `FILENAME', `FNR', `FS', + `NF', `NR', `OFMT', `OFS', `ORS', `RLENGTH', `RSTART', `RS', and + `SUBSEP' are the variables that have special meaning to `awk'. In + addition, `ARGIND', `BINMODE', `ERRNO', `FIELDWIDTHS', + `IGNORECASE', `LINT', `PROCINFO', `RT', and `TEXTDOMAIN' are the + variables that have special meaning to `gawk'. Changing some of + them affects `awk''s running environment. (*Note Built-in + Variables::.) + +Braces + See "Curly Braces." + +Bulletin Board System + A computer system allowing users to log in and read and/or leave + messages for other users of the system, much like leaving paper + notes on a bulletin board. + +C + The system programming language that most GNU software is written + in. The `awk' programming language has C-like syntax, and this + Info file points out similarities between `awk' and C when + appropriate. + + In general, `gawk' attempts to be as similar to the 1990 version + of ISO C as makes sense. Future versions of `gawk' may adopt + features from the newer 1999 standard, as appropriate. + +C++ + A popular object-oriented programming language derived from C. + +Character Set + The set of numeric codes used by a computer system to represent the + characters (letters, numbers, punctuation, etc.) of a particular + country or place. The most common character set in use today is + ASCII (American Standard Code for Information Interchange). Many + European countries use an extension of ASCII known as ISO-8859-1 + (ISO Latin-1). + +CHEM + A preprocessor for `pic' that reads descriptions of molecules and + produces `pic' input for drawing them. It was written in `awk' by + Brian Kernighan and Jon Bentley, and is available from + `http://cm.bell-labs.com/netlib/typesetting/chem.gz'. + +Coprocess + A subordinate program with which two-way communications is + possible. + +Compiler + A program that translates human-readable source code into + machine-executable object code. The object code is then executed + directly by the computer. See also "Interpreter." + +Compound Statement + A series of `awk' statements, enclosed in curly braces. Compound + statements may be nested. (*Note Statements::.) + +Concatenation + Concatenating two strings means sticking them together, one after + another, producing a new string. For example, the string `foo' + concatenated with the string `bar' gives the string `foobar'. + (*Note Concatenation::.) + +Conditional Expression + An expression using the `?:' ternary operator, such as `EXPR1 ? + EXPR2 : EXPR3'. The expression EXPR1 is evaluated; if the result + is true, the value of the whole expression is the value of EXPR2; + otherwise the value is EXPR3. In either case, only one of EXPR2 + and EXPR3 is evaluated. (*Note Conditional Exp::.) + +Comparison Expression + A relation that is either true or false, such as `(a < b)'. + Comparison expressions are used in `if', `while', `do', and `for' + statements, and in patterns to select which input records to + process. (*Note Typing and Comparison::.) + +Curly Braces + The characters `{' and `}'. Curly braces are used in `awk' for + delimiting actions, compound statements, and function bodies. + +Dark Corner + An area in the language where specifications often were (or still + are) not clear, leading to unexpected or undesirable behavior. + Such areas are marked in this Info file with "(d.c.)" in the text + and are indexed under the heading "dark corner." + +Data Driven + A description of `awk' programs, where you specify the data you + are interested in processing, and what to do when that data is + seen. + +Data Objects + These are numbers and strings of characters. Numbers are + converted into strings and vice versa, as needed. (*Note + Conversion::.) + +Deadlock + The situation in which two communicating processes are each waiting + for the other to perform an action. + +Double-Precision + An internal representation of numbers that can have fractional + parts. Double-precision numbers keep track of more digits than do + single-precision numbers, but operations on them are sometimes + more expensive. This is the way `awk' stores numeric values. It + is the C type `double'. + +Dynamic Regular Expression + A dynamic regular expression is a regular expression written as an + ordinary expression. It could be a string constant, such as + `"foo"', but it may also be an expression whose value can vary. + (*Note Computed Regexps::.) + +Environment + A collection of strings, of the form NAME`='VAL, that each program + has available to it. Users generally place values into the + environment in order to provide information to various programs. + Typical examples are the environment variables `HOME' and `PATH'. + +Empty String + See "Null String." + +Epoch + The date used as the "beginning of time" for timestamps. Time + values in Unix systems are represented as seconds since the epoch, + with library functions available for converting these values into + standard date and time formats. + + The epoch on Unix and POSIX systems is 1970-01-01 00:00:00 UTC. + See also "GMT" and "UTC." + +Escape Sequences + A special sequence of characters used for describing nonprinting + characters, such as `\n' for newline or `\033' for the ASCII ESC + (Escape) character. (*Note Escape Sequences::.) + +FDL + See "Free Documentation License." + +Field + When `awk' reads an input record, it splits the record into pieces + separated by whitespace (or by a separator regexp that you can + change by setting the built-in variable `FS'). Such pieces are + called fields. If the pieces are of fixed length, you can use the + built-in variable `FIELDWIDTHS' to describe their lengths. (*Note + Field Separators::, and *note Constant Size::.) + +Flag + A variable whose truth value indicates the existence or + nonexistence of some condition. + +Floating-Point Number + Often referred to in mathematical terms as a "rational" or real + number, this is just a number that can have a fractional part. + See also "Double-Precision" and "Single-Precision." + +Format + Format strings are used to control the appearance of output in the + `strftime' and `sprintf' functions, and are used in the `printf' + statement as well. Also, data conversions from numbers to strings + are controlled by the format string contained in the built-in + variable `CONVFMT'. (*Note Control Letters::.) + +Free Documentation License + This document describes the terms under which this Info file is + published and may be copied. (*Note GNU Free Documentation + License::.) + +Function + A specialized group of statements used to encapsulate general or + program-specific tasks. `awk' has a number of built-in functions, + and also allows you to define your own. (*Note Functions::.) + +FSF + See "Free Software Foundation." + +Free Software Foundation + A nonprofit organization dedicated to the production and + distribution of freely distributable software. It was founded by + Richard M. Stallman, the author of the original Emacs editor. GNU + Emacs is the most widely used version of Emacs today. + +`gawk' + The GNU implementation of `awk'. + +General Public License + This document describes the terms under which `gawk' and its source + code may be distributed. (*Note Copying::.) + +GMT + "Greenwich Mean Time." This is the old term for UTC. It is the + time of day used as the epoch for Unix and POSIX systems. See + also "Epoch" and "UTC." + +GNU + "GNU's not Unix". An on-going project of the Free Software + Foundation to create a complete, freely distributable, + POSIX-compliant computing environment. + +GNU/Linux + A variant of the GNU system using the Linux kernel, instead of the + Free Software Foundation's Hurd kernel. Linux is a stable, + efficient, full-featured clone of Unix that has been ported to a + variety of architectures. It is most popular on PC-class systems, + but runs well on a variety of other systems too. The Linux kernel + source code is available under the terms of the GNU General Public + License, which is perhaps its most important aspect. + +GPL + See "General Public License." + +Hexadecimal + Base 16 notation, where the digits are `0'-`9' and `A'-`F', with + `A' representing 10, `B' representing 11, and so on, up to `F' for + 15. Hexadecimal numbers are written in C using a leading `0x', to + indicate their base. Thus, `0x12' is 18 (1 times 16 plus 2). + +I/O + Abbreviation for "Input/Output," the act of moving data into and/or + out of a running program. + +Input Record + A single chunk of data that is read in by `awk'. Usually, an + `awk' input record consists of one line of text. (*Note + Records::.) + +Integer + A whole number, i.e., a number that does not have a fractional + part. + +Internationalization + The process of writing or modifying a program so that it can use + multiple languages without requiring further source code changes. + +Interpreter + A program that reads human-readable source code directly, and uses + the instructions in it to process data and produce results. `awk' + is typically (but not always) implemented as an interpreter. See + also "Compiler." + +Interval Expression + A component of a regular expression that lets you specify repeated + matches of some part of the regexp. Interval expressions were not + traditionally available in `awk' programs. + +ISO + The International Standards Organization. This organization + produces international standards for many things, including + programming languages, such as C and C++. In the computer arena, + important standards like those for C, C++, and POSIX become both + American national and ISO international standards simultaneously. + This Info file refers to Standard C as "ISO C" throughout. + +Keyword + In the `awk' language, a keyword is a word that has special + meaning. Keywords are reserved and may not be used as variable + names. + + `gawk''s keywords are: `BEGIN', `END', `if', `else', `while', + `do...while', `for', `for...in', `break', `continue', `delete', + `next', `nextfile', `function', `func', and `exit'. If `gawk' was + configured with the `--enable-switch' option (*note Switch + Statement::), then `switch', `case', and `default' are also + keywords. + +Lesser General Public License + This document describes the terms under which binary library + archives or shared objects, and their source code may be + distributed. + +Linux + See "GNU/Linux." + +LGPL + See "Lesser General Public License." + +Localization + The process of providing the data necessary for an + internationalized program to work in a particular language. + +Logical Expression + An expression using the operators for logic, AND, OR, and NOT, + written `&&', `||', and `!' in `awk'. Often called Boolean + expressions, after the mathematician who pioneered this kind of + mathematical logic. + +Lvalue + An expression that can appear on the left side of an assignment + operator. In most languages, lvalues can be variables or array + elements. In `awk', a field designator can also be used as an + lvalue. + +Matching + The act of testing a string against a regular expression. If the + regexp describes the contents of the string, it is said to "match" + it. + +Metacharacters + Characters used within a regexp that do not stand for themselves. + Instead, they denote regular expression operations, such as + repetition, grouping, or alternation. + +Null String + A string with no characters in it. It is represented explicitly in + `awk' programs by placing two double quote characters next to each + other (`""'). It can appear in input data by having two successive + occurrences of the field separator appear next to each other. + +Number + A numeric-valued data object. Modern `awk' implementations use + double-precision floating-point to represent numbers. Very old + `awk' implementations use single-precision floating-point. + +Octal + Base-eight notation, where the digits are `0'-`7'. Octal numbers + are written in C using a leading `0', to indicate their base. + Thus, `013' is 11 (one times 8 plus 3). + +P1003.2 + See "POSIX." + +Pattern + Patterns tell `awk' which input records are interesting to which + rules. + + A pattern is an arbitrary conditional expression against which + input is tested. If the condition is satisfied, the pattern is + said to "match" the input record. A typical pattern might compare + the input record against a regular expression. (*Note Pattern + Overview::.) + +POSIX + The name for a series of standards that specify a Portable + Operating System interface. The "IX" denotes the Unix heritage of + these standards. The main standard of interest for `awk' users is + `IEEE Standard for Information Technology, Standard 1003.2-1992, + Portable Operating System Interface (POSIX) Part 2: Shell and + Utilities'. Informally, this standard is often referred to as + simply "P1003.2." + +Precedence + The order in which operations are performed when operators are used + without explicit parentheses. + +Private + Variables and/or functions that are meant for use exclusively by + library functions and not for the main `awk' program. Special care + must be taken when naming such variables and functions. (*Note + Library Names::.) + +Range (of input lines) + A sequence of consecutive lines from the input file(s). A pattern + can specify ranges of input lines for `awk' to process or it can + specify single lines. (*Note Pattern Overview::.) + +Recursion + When a function calls itself, either directly or indirectly. If + this isn't clear, refer to the entry for "recursion." + +Redirection + Redirection means performing input from something other than the + standard input stream, or performing output to something other + than the standard output stream. + + You can redirect the output of the `print' and `printf' statements + to a file or a system command, using the `>', `>>', `|', and `|&' + operators. You can redirect input to the `getline' statement using + the `<', `|', and `|&' operators. (*Note Redirection::, and *note + Getline::.) + +Regexp + Short for "regular expression". A regexp is a pattern that + denotes a set of strings, possibly an infinite set. For example, + the regexp `R.*xp' matches any string starting with the letter `R' + and ending with the letters `xp'. In `awk', regexps are used in + patterns and in conditional expressions. Regexps may contain + escape sequences. (*Note Regexp::.) + +Regular Expression + See "regexp." + +Regular Expression Constant + A regular expression constant is a regular expression written + within slashes, such as `/foo/'. This regular expression is chosen + when you write the `awk' program and cannot be changed during its + execution. (*Note Regexp Usage::.) + +Rule + A segment of an `awk' program that specifies how to process single + input records. A rule consists of a "pattern" and an "action". + `awk' reads an input record; then, for each rule, if the input + record satisfies the rule's pattern, `awk' executes the rule's + action. Otherwise, the rule does nothing for that input record. + +Rvalue + A value that can appear on the right side of an assignment + operator. In `awk', essentially every expression has a value. + These values are rvalues. + +Scalar + A single value, be it a number or a string. Regular variables are + scalars; arrays and functions are not. + +Search Path + In `gawk', a list of directories to search for `awk' program + source files. In the shell, a list of directories to search for + executable programs. + +Seed + The initial value, or starting point, for a sequence of random + numbers. + +`sed' + See "Stream Editor." + +Shell + The command interpreter for Unix and POSIX-compliant systems. The + shell works both interactively, and as a programming language for + batch files, or shell scripts. + +Short-Circuit + The nature of the `awk' logical operators `&&' and `||'. If the + value of the entire expression is determinable from evaluating just + the lefthand side of these operators, the righthand side is not + evaluated. (*Note Boolean Ops::.) + +Side Effect + A side effect occurs when an expression has an effect aside from + merely producing a value. Assignment expressions, increment and + decrement expressions, and function calls have side effects. + (*Note Assignment Ops::.) + +Single-Precision + An internal representation of numbers that can have fractional + parts. Single-precision numbers keep track of fewer digits than + do double-precision numbers, but operations on them are sometimes + less expensive in terms of CPU time. This is the type used by + some very old versions of `awk' to store numeric values. It is + the C type `float'. + +Space + The character generated by hitting the space bar on the keyboard. + +Special File + A file name interpreted internally by `gawk', instead of being + handed directly to the underlying operating system--for example, + `/dev/stderr'. (*Note Special Files::.) + +Stream Editor + A program that reads records from an input stream and processes + them one or more at a time. This is in contrast with batch + programs, which may expect to read their input files in entirety + before starting to do anything, as well as with interactive + programs which require input from the user. + +String + A datum consisting of a sequence of characters, such as `I am a + string'. Constant strings are written with double quotes in the + `awk' language and may contain escape sequences. (*Note Escape + Sequences::.) + +Tab + The character generated by hitting the `TAB' key on the keyboard. + It usually expands to up to eight spaces upon output. + +Text Domain + A unique name that identifies an application. Used for grouping + messages that are translated at runtime into the local language. + +Timestamp + A value in the "seconds since the epoch" format used by Unix and + POSIX systems. Used for the `gawk' functions `mktime', + `strftime', and `systime'. See also "Epoch" and "UTC." + +Unix + A computer operating system originally developed in the early + 1970's at AT&T Bell Laboratories. It initially became popular in + universities around the world and later moved into commercial + environments as a software development system and network server + system. There are many commercial versions of Unix, as well as + several work-alike systems whose source code is freely available + (such as GNU/Linux, NetBSD, FreeBSD, and OpenBSD). + +UTC + The accepted abbreviation for "Universal Coordinated Time." This + is standard time in Greenwich, England, which is used as a + reference time for day and date calculations. See also "Epoch" + and "GMT." + +Whitespace + A sequence of space, TAB, or newline characters occurring inside + an input record or a string. + + +File: gawk.info, Node: Copying, Next: GNU Free Documentation License, Prev: Glossary, Up: Top + +GNU General Public License +************************** + + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/' + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + +The GNU General Public License is a free, copyleft license for software +and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains +free software for all its users. We, the Free Software Foundation, use +the GNU General Public License for most of our software; it applies +also to any other work released this way by its authors. You can apply +it to your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the software, +or if you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those domains +in future versions of the GPL, as needed to protect the freedom of +users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it + on a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may + convey the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any + non-source form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work + with that Major Component, or to implement a Standard Interface + for which an implementation is available to the public in source + code form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including + scripts to control those activities. However, it does not include + the work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files + associated with source files for the work, and the source code for + shared libraries and dynamically linked subprograms that the work + is specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, + given its content, constitutes a covered work. This License + acknowledges your rights of fair use or other equivalent, as + provided by copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for + you, or provide you with facilities for running those works, + provided that you comply with the terms of this License in + conveying all material for which you do not control copyright. + Those thus making or running the covered works for you must do so + exclusively on your behalf, under your direction and control, on + terms that prohibit them from making any copies of your + copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention + to limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for + as long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of + the written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access + to the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated + by you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to + the object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long + as needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product + is a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or + installed by the recipient, or for the User Product in which it + has been modified or installed. Access to a network may be denied + when the modification itself materially and adversely affects the + operation of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License + with terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be + marked in reasonable ways as different from the original + version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or + conveying under this License, you may add to a covered work + material governed by the terms of that license document, provided + that the further restriction does not survive such relicensing or + conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under + the third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from + you under this License. If your rights have been terminated and + not permanently reinstated, you do not qualify to receive new + licenses for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to + possession of the Corresponding Source of the work from the + predecessor in interest, if the predecessor has it or can get it + with reasonable efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for + exercise of rights granted under this License, and you may not + initiate litigation (including a cross-claim or counterclaim in a + lawsuit) alleging that any patent claim is infringed by making, + using, selling, offering for sale, or importing the Program or any + portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its + contributor version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To + "grant" such a patent license to a party means to make such an + agreement or commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under + which you make payment to the third party based on the extent of + your activity of conveying the work, and under which the third + party grants, to any of the parties who would receive the covered + work from you, a discriminatory patent license (a) in connection + with copies of the covered work conveyed by you (or copies made + from those copies), or (b) primarily for and in connection with + specific products or compilations that contain the covered work, + unless you entered into that arrangement, or that patent license + was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot convey a covered work so as to satisfy + simultaneously your obligations under this License and any other + pertinent obligations, then as a consequence you may not convey it + at all. For example, if you agree to terms that obligate you to + collect a royalty for further conveying from those to whom you + convey the Program, the only way you could satisfy both those + terms and this License would be to refrain entirely from conveying + the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. + Such new versions will be similar in spirit to the present + version, but may differ in detail to address new problems or + concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the + Free Software Foundation. If the Program does not specify a + version number of the GNU General Public License, you may choose + any version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU + FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see `http://www.gnu.org/licenses/'. + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see `http://www.gnu.org/licenses/'. + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read `http://www.gnu.org/philosophy/why-not-lgpl.html'. + + +File: gawk.info, Node: GNU Free Documentation License, Next: Index, Prev: Copying, Up: Top + +GNU Free Documentation License +****************************** + + Version 1.2, November 2002 + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it + can be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You + accept the license if you copy, modify or distribute the work in a + way requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. If a section does not fit the above definition of + Secondary then it is not allowed to be designated as Invariant. + The Document may contain zero Invariant Sections. If the Document + does not identify any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup, or absence of + markup, has been arranged to thwart or discourage subsequent + modification by readers is not Transparent. An image format is + not Transparent if used for any substantial amount of text. A + copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML, PostScript or PDF designed for + human modification. Examples of transparent image formats include + PNG, XCF and JPG. Opaque formats include proprietary formats that + can be read and edited only by proprietary word processors, SGML or + XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML, PostScript or PDF + produced by some word processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a computer-network location from + which the general network-using public has access to download + using public-standard network protocols a complete Transparent + copy of the Document, free of added material. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of + previous versions (which should, if there were any, be listed + in the History section of the Document). You may use the + same title as a previous version if the original publisher of + that version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on + the Title Page. If there is no section Entitled "History" in + the Document, create one stating the title, year, authors, + and publisher of the Document as given on its Title Page, + then add an item describing the Modified Version as stated in + the previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in + the "History" section. You may omit a network location for a + work that was published at least four years before the + Document itself, or if the original publisher of the version + it refers to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the + section all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section + titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + `http://www.gnu.org/copyleft/'. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: gawk.info, Node: Index, Prev: GNU Free Documentation License, Up: Top + +Index +***** + +[index] +* Menu: + +* ! (exclamation point), ! operator: Boolean Ops. (line 67) +* ! (exclamation point), ! operator <1>: Egrep Program. (line 160) +* ! (exclamation point), ! operator: Precedence. (line 52) +* ! (exclamation point), != operator <1>: Precedence. (line 65) +* ! (exclamation point), != operator: Comparison Operators. + (line 11) +* ! (exclamation point), !~ operator <1>: Expression Patterns. + (line 24) +* ! (exclamation point), !~ operator <2>: Precedence. (line 81) +* ! (exclamation point), !~ operator <3>: Comparison Operators. + (line 11) +* ! (exclamation point), !~ operator <4>: Regexp Constants. (line 6) +* ! (exclamation point), !~ operator <5>: Computed Regexps. (line 6) +* ! (exclamation point), !~ operator <6>: Case-sensitivity. (line 26) +* ! (exclamation point), !~ operator: Regexp Usage. (line 19) +* ! operator <1>: Egrep Program. (line 168) +* ! operator: Ranges. (line 48) +* " (double quote) <1>: Quoting. (line 33) +* " (double quote): Read Terminal. (line 25) +* " (double quote), regexp constants: Computed Regexps. (line 28) +* # (number sign), #! (executable scripts): Executable Scripts. + (line 6) +* # (number sign), #! (executable scripts), portability issues with: Executable Scripts. + (line 6) +* # (number sign), commenting: Comments. (line 6) +* $ (dollar sign): Regexp Operators. (line 35) +* $ (dollar sign), $ field operator <1>: Precedence. (line 43) +* $ (dollar sign), $ field operator: Fields. (line 19) +* $ (dollar sign), incrementing fields and arrays: Increment Ops. + (line 30) +* $ field operator: Fields. (line 19) +* % (percent sign), % operator: Precedence. (line 55) +* % (percent sign), %= operator <1>: Precedence. (line 96) +* % (percent sign), %= operator: Assignment Ops. (line 129) +* & (ampersand), && operator <1>: Precedence. (line 87) +* & (ampersand), && operator: Boolean Ops. (line 57) +* & (ampersand), gsub/gensub/sub functions and: Gory Details. (line 6) +* ' (single quote) <1>: Quoting. (line 27) +* ' (single quote) <2>: Long. (line 33) +* ' (single quote): One-shot. (line 15) +* ' (single quote), vs. apostrophe: Comments. (line 27) +* ' (single quote), with double quotes: Quoting. (line 49) +* () (parentheses): Regexp Operators. (line 78) +* () (parentheses), pgawk program: Profiling. (line 144) +* * (asterisk), * operator, as multiplication operator: Precedence. + (line 55) +* * (asterisk), * operator, as regexp operator: Regexp Operators. + (line 86) +* * (asterisk), * operator, null strings, matching: Gory Details. + (line 160) +* * (asterisk), ** operator <1>: Options. (line 192) +* * (asterisk), ** operator <2>: Precedence. (line 49) +* * (asterisk), ** operator: Arithmetic Ops. (line 81) +* * (asterisk), **= operator <1>: Options. (line 192) +* * (asterisk), **= operator <2>: Precedence. (line 96) +* * (asterisk), **= operator: Assignment Ops. (line 129) +* * (asterisk), *= operator <1>: Precedence. (line 96) +* * (asterisk), *= operator: Assignment Ops. (line 129) +* + (plus sign): Regexp Operators. (line 101) +* + (plus sign), + operator: Precedence. (line 52) +* + (plus sign), ++ operator <1>: Precedence. (line 46) +* + (plus sign), ++ operator: Increment Ops. (line 40) +* + (plus sign), += operator <1>: Precedence. (line 96) +* + (plus sign), += operator: Assignment Ops. (line 82) +* + (plus sign), decrement/increment operators: Increment Ops. + (line 11) +* , (comma), in range patterns: Ranges. (line 6) +* - (hyphen), - operator: Precedence. (line 52) +* - (hyphen), -- (decrement/increment) operator: Precedence. (line 46) +* - (hyphen), -- operator: Increment Ops. (line 48) +* - (hyphen), -= operator <1>: Precedence. (line 96) +* - (hyphen), -= operator: Assignment Ops. (line 129) +* - (hyphen), filenames beginning with: Options. (line 67) +* - (hyphen), in character lists: Character Lists. (line 17) +* --assign option: Options. (line 30) +* --compat option: Options. (line 79) +* --copyleft option: Options. (line 92) +* --copyright option: Options. (line 87) +* --disable-directories-fatal configuration option: Additional Configuration Options. + (line 37) +* --disable-lint configuration option: Additional Configuration Options. + (line 17) +* --disable-nls configuration option: Additional Configuration Options. + (line 32) +* --dump-variables option <1>: Library Names. (line 45) +* --dump-variables option: Options. (line 95) +* --enable-portals configuration option <1>: Additional Configuration Options. + (line 9) +* --enable-portals configuration option: Portal Files. (line 6) +* --enable-switch configuration option: Additional Configuration Options. + (line 13) +* --exec option: Options. (line 111) +* --field-separator option: Options. (line 21) +* --file option: Options. (line 25) +* --gen-po option <1>: Options. (line 130) +* --gen-po option: String Extraction. (line 6) +* --help option: Options. (line 139) +* --lint option <1>: Options. (line 144) +* --lint option: Command Line. (line 20) +* --lint-old option: Options. (line 163) +* --non-decimal-data option <1>: Options. (line 168) +* --non-decimal-data option: Nondecimal Data. (line 6) +* --non-decimal-data option, strtonum function and: Nondecimal Data. + (line 36) +* --posix option: Options. (line 176) +* --posix option, --traditional option and: Options. (line 206) +* --profile option <1>: Options. (line 212) +* --profile option: Profiling. (line 15) +* --re-interval option: Options. (line 224) +* --source option: Options. (line 231) +* --traditional option: Options. (line 79) +* --traditional option, --posix option and: Options. (line 206) +* --usage option: Options. (line 139) +* --use-lc-numeric option: Options. (line 239) +* --version option: Options. (line 244) +* -f option: Options. (line 25) +* -F option <1>: Options. (line 21) +* -F option: Command Line Field Separator. + (line 6) +* -f option: Long. (line 12) +* -F option, -Ft sets FS to TAB: Options. (line 252) +* -f option, on command line: Options. (line 257) +* -F option, troubleshooting: Known Bugs. (line 6) +* -mf/-mr options: Options. (line 45) +* -v option: Options. (line 30) +* -v option, variables, assigning: Assignment Options. (line 12) +* -W option: Options. (line 55) +* . (period): Regexp Operators. (line 43) +* .mo files: Explaining gettext. (line 39) +* .mo files, converting from .po: I18N Example. (line 62) +* .mo files, specifying directory of <1>: Programmer i18n. (line 45) +* .mo files, specifying directory of: Explaining gettext. (line 51) +* .po files <1>: Translator i18n. (line 6) +* .po files: Explaining gettext. (line 36) +* .po files, converting to .mo: I18N Example. (line 62) +* / (forward slash): Regexp. (line 10) +* / (forward slash), / operator: Precedence. (line 55) +* / (forward slash), /= operator <1>: Precedence. (line 96) +* / (forward slash), /= operator: Assignment Ops. (line 129) +* / (forward slash), /= operator, vs. /=.../ regexp constant: Assignment Ops. + (line 148) +* / (forward slash), patterns and: Expression Patterns. (line 24) +* /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) +* /dev/... special files (gawk): Special FD. (line 41) +* /inet/ files (gawk): TCP/IP Networking. (line 6) +* /p files (gawk): Portal Files. (line 6) +* ; (semicolon): Statements/Lines. (line 90) +* ; (semicolon), AWKPATH variable and: PC Using. (line 11) +* ; (semicolon), separating statements in actions <1>: Statements. + (line 10) +* ; (semicolon), separating statements in actions: Action Overview. + (line 19) +* < (left angle bracket), < operator <1>: Precedence. (line 65) +* < (left angle bracket), < operator: Comparison Operators. + (line 11) +* < (left angle bracket), < operator (I/O): Getline/File. (line 6) +* < (left angle bracket), <= operator <1>: Precedence. (line 65) +* < (left angle bracket), <= operator: Comparison Operators. + (line 11) +* = (equals sign), = operator: Assignment Ops. (line 6) +* = (equals sign), == operator <1>: Precedence. (line 65) +* = (equals sign), == operator: Comparison Operators. + (line 11) +* > (right angle bracket), > operator <1>: Precedence. (line 65) +* > (right angle bracket), > operator: Comparison Operators. + (line 11) +* > (right angle bracket), > operator (I/O): Redirection. (line 19) +* > (right angle bracket), >= operator <1>: Precedence. (line 65) +* > (right angle bracket), >= operator: Comparison Operators. + (line 11) +* > (right angle bracket), >> operator (I/O) <1>: Precedence. (line 65) +* > (right angle bracket), >> operator (I/O): Redirection. (line 47) +* ? (question mark) <1>: GNU Regexp Operators. + (line 51) +* ? (question mark): Regexp Operators. (line 110) +* ? (question mark), ?: operator: Precedence. (line 93) +* [] (square brackets): Regexp Operators. (line 55) +* \ (backslash) <1>: Regexp Operators. (line 18) +* \ (backslash) <2>: Quoting. (line 27) +* \ (backslash) <3>: Comments. (line 50) +* \ (backslash): Read Terminal. (line 25) +* \ (backslash), \" escape sequence: Escape Sequences. (line 76) +* \ (backslash), \' operator (gawk): GNU Regexp Operators. + (line 48) +* \ (backslash), \/ escape sequence: Escape Sequences. (line 69) +* \ (backslash), \< operator (gawk): GNU Regexp Operators. + (line 22) +* \ (backslash), \> operator (gawk): GNU Regexp Operators. + (line 26) +* \ (backslash), \` operator (gawk): GNU Regexp Operators. + (line 46) +* \ (backslash), \a escape sequence: Escape Sequences. (line 34) +* \ (backslash), \b escape sequence: Escape Sequences. (line 38) +* \ (backslash), \B operator (gawk): GNU Regexp Operators. + (line 35) +* \ (backslash), \f escape sequence: Escape Sequences. (line 41) +* \ (backslash), \n escape sequence: Escape Sequences. (line 44) +* \ (backslash), \NNN escape sequence: Escape Sequences. (line 56) +* \ (backslash), \r escape sequence: Escape Sequences. (line 47) +* \ (backslash), \t escape sequence: Escape Sequences. (line 50) +* \ (backslash), \v escape sequence: Escape Sequences. (line 53) +* \ (backslash), \W operator (gawk): GNU Regexp Operators. + (line 18) +* \ (backslash), \w operator (gawk): GNU Regexp Operators. + (line 13) +* \ (backslash), \x escape sequence: Escape Sequences. (line 61) +* \ (backslash), \y operator (gawk): GNU Regexp Operators. + (line 30) +* \ (backslash), as field separators: Command Line Field Separator. + (line 27) +* \ (backslash), continuing lines and <1>: Egrep Program. (line 218) +* \ (backslash), continuing lines and: Statements/Lines. (line 19) +* \ (backslash), continuing lines and, comments and: Statements/Lines. + (line 75) +* \ (backslash), continuing lines and, in csh <1>: Statements/Lines. + (line 44) +* \ (backslash), continuing lines and, in csh: More Complex. (line 15) +* \ (backslash), gsub/gensub/sub functions and: Gory Details. (line 6) +* \ (backslash), in character lists: Character Lists. (line 17) +* \ (backslash), in escape sequences: Escape Sequences. (line 6) +* \ (backslash), in escape sequences, POSIX and: Escape Sequences. + (line 113) +* \ (backslash), regexp constants: Computed Regexps. (line 28) +* ^ (caret) <1>: GNU Regexp Operators. + (line 51) +* ^ (caret): Regexp Operators. (line 22) +* ^ (caret), ^ operator <1>: Options. (line 192) +* ^ (caret), ^ operator: Precedence. (line 49) +* ^ (caret), ^= operator <1>: Options. (line 192) +* ^ (caret), ^= operator <2>: Precedence. (line 96) +* ^ (caret), ^= operator: Assignment Ops. (line 129) +* ^ (caret), in character lists: Character Lists. (line 17) +* _ (underscore), _ C macro: Explaining gettext. (line 68) +* _ (underscore), in names of private variables: Library Names. + (line 29) +* _ (underscore), translatable string: Programmer i18n. (line 67) +* _gr_init user-defined function: Group Functions. (line 80) +* _pw_init user-defined function: Passwd Functions. (line 91) +* accessing fields: Fields. (line 6) +* account information <1>: Group Functions. (line 6) +* account information: Passwd Functions. (line 16) +* actions: Action Overview. (line 6) +* actions, control statements in: Statements. (line 6) +* actions, default: Very Simple. (line 34) +* actions, empty: Very Simple. (line 39) +* adding, features to gawk: Adding Code. (line 6) +* adding, fields: Changing Fields. (line 53) +* adding, functions to gawk: Dynamic Extensions. (line 10) +* advanced features, buffering: I/O Functions. (line 95) +* advanced features, close function: Close Files And Pipes. + (line 130) +* advanced features, constants, values of: Nondecimal-numbers. + (line 67) +* advanced features, data files as single record: Records. (line 170) +* advanced features, fixed-width data: Constant Size. (line 9) +* advanced features, FNR/NR variables: Auto-set. (line 187) +* advanced features, gawk: Advanced Features. (line 6) +* advanced features, gawk, BSD portals: Portal Files. (line 6) +* advanced features, gawk, network programming: TCP/IP Networking. + (line 6) +* advanced features, gawk, nondecimal input data: Nondecimal Data. + (line 6) +* advanced features, gawk, processes, communicating with: Two-way I/O. + (line 23) +* advanced features, network connections, See Also networks, connections: Advanced Features. + (line 6) +* advanced features, null strings, matching: Gory Details. (line 160) +* advanced features, operators, precedence: Increment Ops. (line 61) +* advanced features, piping into sh: Redirection. (line 140) +* advanced features, regexp constants: Assignment Ops. (line 148) +* Aho, Alfred <1>: Contributors. (line 12) +* Aho, Alfred: History. (line 17) +* alarm clock example program: Alarm Program. (line 9) +* alarm.awk program: Alarm Program. (line 27) +* algorithms: Basic High Level. (line 66) +* Alpha (DEC): Manual History. (line 28) +* amazing awk assembler (aaa): Glossary. (line 12) +* amazingly workable formatter (awf): Glossary. (line 20) +* ambiguity, syntactic: /= operator vs. /=.../ regexp constant: Assignment Ops. + (line 148) +* amiga: Amiga Installation. (line 6) +* ampersand (&), && operator: Boolean Ops. (line 57) +* ampersand (&), &&operator: Precedence. (line 87) +* ampersand (&), gsub/gensub/sub functions and: Gory Details. (line 6) +* AND bitwise operation: Bitwise Functions. (line 6) +* and Boolean-logic operator: Boolean Ops. (line 6) +* and function (gawk): Bitwise Functions. (line 39) +* ANSI: Glossary. (line 31) +* archeologists: Bugs. (line 6) +* ARGC/ARGV variables <1>: ARGC and ARGV. (line 6) +* ARGC/ARGV variables: Auto-set. (line 11) +* ARGC/ARGV variables, command-line arguments: Other Arguments. + (line 12) +* ARGC/ARGV variables, portability and: Executable Scripts. (line 43) +* ARGIND variable: Auto-set. (line 40) +* ARGIND variable, command-line arguments: Other Arguments. (line 12) +* arguments, command-line <1>: Other Arguments. (line 6) +* arguments, command-line <2>: ARGC and ARGV. (line 6) +* arguments, command-line: Auto-set. (line 11) +* arguments, command-line, invoking awk: Command Line. (line 6) +* arguments, in function calls: Function Calls. (line 16) +* arguments, processing: Getopt Function. (line 6) +* arguments, retrieving: Internals. (line 121) +* arithmetic operators: Arithmetic Ops. (line 6) +* arrays: Arrays. (line 6) +* arrays, as parameters to functions: Function Caveats. (line 55) +* arrays, associative: Array Intro. (line 45) +* arrays, associative, clearing: Internals. (line 66) +* arrays, associative, library functions and: Library Names. (line 57) +* arrays, deleting entire contents: Delete. (line 39) +* arrays, elements, assigning: Assigning Elements. (line 6) +* arrays, elements, deleting: Delete. (line 6) +* arrays, elements, installing: Internals. (line 70) +* arrays, elements, order of: Scanning an Array. (line 47) +* arrays, elements, referencing: Reference to Elements. + (line 6) +* arrays, elements, retrieving number of: String Functions. (line 18) +* arrays, for statement and: Scanning an Array. (line 20) +* arrays, IGNORECASE variable and: Array Intro. (line 87) +* arrays, indexing: Array Intro. (line 45) +* arrays, merging into strings: Join Function. (line 6) +* arrays, multidimensional: Multi-dimensional. (line 6) +* arrays, multidimensional, scanning: Multi-scanning. (line 11) +* arrays, names of: Arrays. (line 17) +* arrays, scanning: Scanning an Array. (line 6) +* arrays, sorting: Array Sorting. (line 6) +* arrays, sorting, IGNORECASE variable and: Array Sorting. (line 86) +* arrays, sparse: Array Intro. (line 66) +* arrays, subscripts: Numeric Array Subscripts. + (line 6) +* arrays, subscripts, uninitialized variables as: Uninitialized Subscripts. + (line 6) +* artificial intelligence, gawk and: Distribution contents. + (line 47) +* ASCII: Ordinal Functions. (line 44) +* asort function (gawk) <1>: String Functions. (line 18) +* asort function (gawk): Array Sorting. (line 6) +* asort function (gawk), arrays, sorting: Array Sorting. (line 6) +* asorti function (gawk): String Functions. (line 47) +* assert function (C library): Assert Function. (line 6) +* assert user-defined function: Assert Function. (line 28) +* assertions: Assert Function. (line 6) +* assignment operators: Assignment Ops. (line 6) +* assignment operators, evaluation order: Assignment Ops. (line 111) +* assignment operators, lvalues/rvalues: Assignment Ops. (line 32) +* assignments as filenames: Ignoring Assigns. (line 6) +* assoc_clear internal function: Internals. (line 66) +* assoc_lookup internal function: Internals. (line 70) +* associative arrays: Array Intro. (line 45) +* asterisk (*), * operator, as multiplication operator: Precedence. + (line 55) +* asterisk (*), * operator, as regexp operator: Regexp Operators. + (line 86) +* asterisk (*), * operator, null strings, matching: Gory Details. + (line 160) +* asterisk (*), ** operator <1>: Options. (line 192) +* asterisk (*), ** operator <2>: Precedence. (line 49) +* asterisk (*), ** operator: Arithmetic Ops. (line 81) +* asterisk (*), **= operator <1>: Options. (line 192) +* asterisk (*), **= operator <2>: Precedence. (line 96) +* asterisk (*), **= operator: Assignment Ops. (line 129) +* asterisk (*), *= operator <1>: Precedence. (line 96) +* asterisk (*), *= operator: Assignment Ops. (line 129) +* atan2 function: Numeric Functions. (line 37) +* atari: Atari Installation. (line 9) +* awf (amazingly workable formatter) program: Glossary. (line 20) +* awk language, POSIX version: Assignment Ops. (line 136) +* awk programs <1>: Two Rules. (line 6) +* awk programs <2>: Executable Scripts. (line 6) +* awk programs: Getting Started. (line 12) +* awk programs, complex: When. (line 30) +* awk programs, documenting <1>: Library Names. (line 6) +* awk programs, documenting: Comments. (line 6) +* awk programs, examples of: Sample Programs. (line 6) +* awk programs, execution of: Next Statement. (line 16) +* awk programs, internationalizing <1>: Programmer i18n. (line 6) +* awk programs, internationalizing: I18N Functions. (line 6) +* awk programs, lengthy: Long. (line 6) +* awk programs, lengthy, assertions: Assert Function. (line 6) +* awk programs, location of: Options. (line 25) +* awk programs, one-line examples: Very Simple. (line 45) +* awk programs, profiling: Profiling. (line 6) +* awk programs, profiling, enabling: Options. (line 212) +* awk programs, running <1>: Long. (line 6) +* awk programs, running: Running gawk. (line 6) +* awk programs, running, from shell scripts: One-shot. (line 22) +* awk programs, running, without input files: Read Terminal. (line 17) +* awk programs, shell variables in: Using Shell Variables. + (line 6) +* awk, function of: Getting Started. (line 6) +* awk, gawk and <1>: This Manual. (line 13) +* awk, gawk and: Preface. (line 22) +* awk, history of: History. (line 17) +* awk, implementation issues, pipes: Redirection. (line 132) +* awk, implementations: Other Versions. (line 6) +* awk, implementations, limits: Getline Notes. (line 14) +* awk, invoking: Command Line. (line 6) +* awk, new vs. old: Names. (line 6) +* awk, new vs. old, OFMT variable: Conversion. (line 54) +* awk, POSIX and: Preface. (line 22) +* awk, POSIX and, See Also POSIX awk: Preface. (line 22) +* awk, regexp constants and: Comparison Operators. + (line 102) +* awk, See Also gawk: Preface. (line 35) +* awk, terms describing: This Manual. (line 6) +* awk, uses for <1>: When. (line 6) +* awk, uses for <2>: Getting Started. (line 12) +* awk, uses for: Preface. (line 22) +* awk, versions of <1>: V7/SVR3.1. (line 6) +* awk, versions of: Names. (line 10) +* awk, versions of, changes between SVR3.1 and SVR4: SVR4. (line 6) +* awk, versions of, changes between SVR4 and POSIX awk: POSIX. + (line 6) +* awk, versions of, changes between V7 and SVR3.1: V7/SVR3.1. (line 6) +* awk, versions of, See Also Bell Laboratories awk: BTL. (line 6) +* awk.h file (internal): Internals. (line 15) +* awka compiler for awk: Other Versions. (line 76) +* AWKNUM internal type: Internals. (line 19) +* AWKPATH environment variable <1>: PC Using. (line 11) +* AWKPATH environment variable: AWKPATH Variable. (line 6) +* awkprof.out file: Profiling. (line 10) +* awksed.awk program: Simple Sed. (line 25) +* awkvars.out file: Options. (line 95) +* backslash (\) <1>: Regexp Operators. (line 18) +* backslash (\) <2>: Quoting. (line 27) +* backslash (\) <3>: Comments. (line 50) +* backslash (\): Read Terminal. (line 25) +* backslash (\), \" escape sequence: Escape Sequences. (line 76) +* backslash (\), \' operator (gawk): GNU Regexp Operators. + (line 48) +* backslash (\), \/ escape sequence: Escape Sequences. (line 69) +* backslash (\), \< operator (gawk): GNU Regexp Operators. + (line 22) +* backslash (\), \> operator (gawk): GNU Regexp Operators. + (line 26) +* backslash (\), \` operator (gawk): GNU Regexp Operators. + (line 46) +* backslash (\), \a escape sequence: Escape Sequences. (line 34) +* backslash (\), \b escape sequence: Escape Sequences. (line 38) +* backslash (\), \B operator (gawk): GNU Regexp Operators. + (line 35) +* backslash (\), \f escape sequence: Escape Sequences. (line 41) +* backslash (\), \n escape sequence: Escape Sequences. (line 44) +* backslash (\), \NNN escape sequence: Escape Sequences. (line 56) +* backslash (\), \r escape sequence: Escape Sequences. (line 47) +* backslash (\), \t escape sequence: Escape Sequences. (line 50) +* backslash (\), \v escape sequence: Escape Sequences. (line 53) +* backslash (\), \W operator (gawk): GNU Regexp Operators. + (line 18) +* backslash (\), \w operator (gawk): GNU Regexp Operators. + (line 13) +* backslash (\), \x escape sequence: Escape Sequences. (line 61) +* backslash (\), \y operator (gawk): GNU Regexp Operators. + (line 30) +* backslash (\), as field separators: Command Line Field Separator. + (line 27) +* backslash (\), continuing lines and <1>: Egrep Program. (line 218) +* backslash (\), continuing lines and: Statements/Lines. (line 19) +* backslash (\), continuing lines and, comments and: Statements/Lines. + (line 75) +* backslash (\), continuing lines and, in csh <1>: Statements/Lines. + (line 44) +* backslash (\), continuing lines and, in csh: More Complex. (line 15) +* backslash (\), gsub/gensub/sub functions and: Gory Details. (line 6) +* backslash (\), in character lists: Character Lists. (line 17) +* backslash (\), in escape sequences: Escape Sequences. (line 6) +* backslash (\), in escape sequences, POSIX and: Escape Sequences. + (line 113) +* backslash (\), regexp constants: Computed Regexps. (line 28) +* BBS-list file: Sample Data Files. (line 6) +* Beebe, Nelson: Acknowledgments. (line 53) +* Beebe, Nelson H.F.: Other Versions. (line 88) +* BEGIN pattern <1>: BEGIN/END. (line 6) +* BEGIN pattern <2>: Field Separators. (line 43) +* BEGIN pattern: Records. (line 29) +* BEGIN pattern, assert user-defined function and: Assert Function. + (line 82) +* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 73) +* BEGIN pattern, exit statement and: Exit Statement. (line 12) +* BEGIN pattern, getline and: Getline Notes. (line 19) +* BEGIN pattern, headings, adding: Print Examples. (line 43) +* BEGIN pattern, next/nextfile statements and <1>: Next Statement. + (line 39) +* BEGIN pattern, next/nextfile statements and: I/O And BEGIN/END. + (line 36) +* BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators. + (line 20) +* BEGIN pattern, operators and: Using BEGIN/END. (line 17) +* BEGIN pattern, pgawk program: Profiling. (line 69) +* BEGIN pattern, print statement and: I/O And BEGIN/END. (line 16) +* BEGIN pattern, pwcat program: Passwd Functions. (line 125) +* BEGIN pattern, running awk programs and: Cut Program. (line 66) +* BEGIN pattern, TEXTDOMAIN variable and: Programmer i18n. (line 58) +* beginfile user-defined function: Filetrans Function. (line 60) +* Bell Laboratories awk extensions: BTL. (line 6) +* Benzinger, Michael: Contributors. (line 86) +* BeOS: BeOS Installation. (line 6) +* Berry, Karl: Acknowledgments. (line 30) +* binary input/output: User-modified. (line 10) +* bindtextdomain function (C library): Explaining gettext. (line 47) +* bindtextdomain function (gawk) <1>: Programmer i18n. (line 45) +* bindtextdomain function (gawk): I18N Functions. (line 26) +* bindtextdomain function (gawk), portability and: I18N Portability. + (line 32) +* BINMODE variable <1>: PC Using. (line 40) +* BINMODE variable: User-modified. (line 10) +* bits2str user-defined function: Bitwise Functions. (line 60) +* bitwise, complement: Bitwise Functions. (line 25) +* bitwise, operations: Bitwise Functions. (line 6) +* bitwise, shift: Bitwise Functions. (line 32) +* body, in actions: Statements. (line 10) +* body, in loops: While Statement. (line 14) +* Boolean expressions: Boolean Ops. (line 6) +* Boolean expressions, as patterns: Expression Patterns. (line 41) +* Boolean operators, See Boolean expressions: Boolean Ops. (line 6) +* Bourne shell, quoting rules for: Quoting. (line 14) +* braces ({}), actions and: Action Overview. (line 19) +* braces ({}), pgawk program: Profiling. (line 140) +* braces ({}), statements, grouping: Statements. (line 10) +* bracket expressions, See character lists: Regexp Operators. (line 55) +* break statement: Break Statement. (line 6) +* Brennan, Michael <1>: Other Versions. (line 6) +* Brennan, Michael <2>: Simple Sed. (line 25) +* Brennan, Michael <3>: Two-way I/O. (line 6) +* Brennan, Michael: Delete. (line 51) +* Broder, Alan J.: Contributors. (line 77) +* Brown, Martin <1>: Bugs. (line 57) +* Brown, Martin <2>: Contributors. (line 72) +* Brown, Martin: Acknowledgments. (line 53) +* BSD portals: Portal Files. (line 6) +* BSD-based operating systems: Glossary. (line 582) +* Buening, Andreas <1>: Contributors. (line 81) +* Buening, Andreas: Acknowledgments. (line 53) +* buffering, input/output <1>: Two-way I/O. (line 71) +* buffering, input/output: I/O Functions. (line 127) +* buffering, interactive vs. noninteractive: I/O Functions. (line 95) +* buffers, flushing: I/O Functions. (line 29) +* buffers, operators for: GNU Regexp Operators. + (line 40) +* bug reports, email address, bug-gawk@gnu.org: Bugs. (line 27) +* bug-gawk@gnu.org bug reporting address: Bugs. (line 27) +* built-in functions: Functions. (line 6) +* built-in functions, evaluation order: Calling Built-in. (line 30) +* built-in variables: Built-in Variables. (line 6) +* built-in variables, -v option, setting with: Options. (line 38) +* built-in variables, conveying information: Auto-set. (line 6) +* built-in variables, user-modifiable: User-modified. (line 6) +* call by reference: Function Caveats. (line 55) +* call by value: Function Caveats. (line 26) +* caret (^) <1>: GNU Regexp Operators. + (line 51) +* caret (^): Regexp Operators. (line 22) +* caret (^), ^ operator <1>: Options. (line 192) +* caret (^), ^ operator: Precedence. (line 49) +* caret (^), ^= operator <1>: Options. (line 192) +* caret (^), ^= operator <2>: Precedence. (line 96) +* caret (^), ^= operator: Assignment Ops. (line 129) +* caret (^), in character lists: Character Lists. (line 17) +* case keyword: Switch Statement. (line 6) +* case sensitivity, array indices and: Array Intro. (line 87) +* case sensitivity, converting case: String Functions. (line 453) +* case sensitivity, example programs: Library Functions. (line 43) +* case sensitivity, gawk: Case-sensitivity. (line 26) +* case sensitivity, regexps and <1>: User-modified. (line 68) +* case sensitivity, regexps and: Case-sensitivity. (line 6) +* case sensitivity, string comparisons and: User-modified. (line 68) +* CGI, awk scripts for: Options. (line 111) +* character encodings: Ordinal Functions. (line 44) +* character lists <1>: Character Lists. (line 6) +* character lists: Regexp Operators. (line 55) +* character lists, character classes: Character Lists. (line 30) +* character lists, collating elements: Character Lists. (line 71) +* character lists, collating symbols: Character Lists. (line 78) +* character lists, complemented: Regexp Operators. (line 62) +* character lists, equivalence classes: Character Lists. (line 84) +* character lists, non-ASCII: Character Lists. (line 71) +* character lists, range expressions: Character Lists. (line 6) +* character sets: Ordinal Functions. (line 44) +* character sets (machine character encodings): Glossary. (line 138) +* character sets, See Also character lists: Regexp Operators. (line 55) +* characters, counting: Wc Program. (line 6) +* characters, transliterating: Translate Program. (line 6) +* characters, values of as numbers: Ordinal Functions. (line 6) +* Chassell, Robert J.: Acknowledgments. (line 30) +* chdir function, implementing in gawk: Sample Library. (line 6) +* chem utility: Glossary. (line 146) +* chr user-defined function: Ordinal Functions. (line 16) +* Cliff random numbers: Cliff Random Function. + (line 6) +* cliff_rand user-defined function: Cliff Random Function. + (line 11) +* close function <1>: I/O Functions. (line 10) +* close function <2>: Close Files And Pipes. + (line 18) +* close function <3>: Getline/Pipe. (line 24) +* close function: Getline/Variable/File. + (line 30) +* close function, return values: Close Files And Pipes. + (line 130) +* close function, two-way pipes and: Two-way I/O. (line 78) +* Close, Diane <1>: Contributors. (line 21) +* Close, Diane: Manual History. (line 40) +* close_func input method: Internals. (line 178) +* collating elements: Character Lists. (line 71) +* collating symbols: Character Lists. (line 78) +* columns, aligning: Print Examples. (line 70) +* columns, cutting: Cut Program. (line 6) +* comma (,), in range patterns: Ranges. (line 6) +* command line, arguments <1>: Other Arguments. (line 6) +* command line, arguments <2>: ARGC and ARGV. (line 6) +* command line, arguments: Auto-set. (line 11) +* command line, formats: Running gawk. (line 12) +* command line, FS on, setting: Command Line Field Separator. + (line 6) +* command line, invoking awk from: Command Line. (line 6) +* command line, options <1>: Options. (line 6) +* command line, options <2>: Command Line Field Separator. + (line 6) +* command line, options: Long. (line 12) +* command line, options, end of: Options. (line 62) +* command line, variables, assigning on: Assignment Options. (line 6) +* command-line options, processing: Getopt Function. (line 6) +* command-line options, string extraction: String Extraction. (line 6) +* commenting: Comments. (line 6) +* commenting, backslash continuation and: Statements/Lines. (line 75) +* comp.lang.awk newsgroup: Bugs. (line 37) +* comparison expressions: Typing and Comparison. + (line 9) +* comparison expressions, as patterns: Expression Patterns. (line 14) +* comparison expressions, string vs. regexp: Comparison Operators. + (line 79) +* compatibility mode (gawk), extensions: POSIX/GNU. (line 6) +* compatibility mode (gawk), file names: Special Caveats. (line 9) +* compatibility mode (gawk), hexadecimal numbers: Nondecimal-numbers. + (line 60) +* compatibility mode (gawk), octal numbers: Nondecimal-numbers. + (line 60) +* compatibility mode (gawk), specifying: Options. (line 79) +* compiled programs <1>: Glossary. (line 156) +* compiled programs: Basic High Level. (line 14) +* compl function (gawk): Bitwise Functions. (line 43) +* complement, bitwise: Bitwise Functions. (line 25) +* compound statements, control statements and: Statements. (line 10) +* concatenating: Concatenation. (line 9) +* conditional expressions: Conditional Exp. (line 6) +* configuration option, --disable-directories-fatal: Additional Configuration Options. + (line 37) +* configuration option, --disable-lint: Additional Configuration Options. + (line 17) +* configuration option, --disable-nls: Additional Configuration Options. + (line 32) +* configuration option, --enable-portals: Additional Configuration Options. + (line 9) +* configuration option, --enable-switch: Additional Configuration Options. + (line 13) +* configuration options, gawk: Additional Configuration Options. + (line 6) +* constants, nondecimal: Nondecimal Data. (line 6) +* constants, types of: Constants. (line 6) +* continue statement: Continue Statement. (line 6) +* control statements: Statements. (line 6) +* converting, case: String Functions. (line 453) +* converting, dates to timestamps: Time Functions. (line 72) +* converting, during subscripting: Numeric Array Subscripts. + (line 31) +* converting, numbers: Conversion. (line 6) +* converting, numbers, to strings: Bitwise Functions. (line 99) +* converting, strings to numbers: Conversion. (line 6) +* CONVFMT variable <1>: User-modified. (line 26) +* CONVFMT variable: Conversion. (line 29) +* CONVFMT variable, array subscripts and: Numeric Array Subscripts. + (line 6) +* coprocesses <1>: Two-way I/O. (line 44) +* coprocesses: Redirection. (line 99) +* coprocesses, closing: Close Files And Pipes. + (line 6) +* coprocesses, getline from: Getline/Coprocess. (line 6) +* cos function: Numeric Functions. (line 34) +* counting: Wc Program. (line 6) +* csh utility: Statements/Lines. (line 44) +* csh utility, backslash continuation and: More Complex. (line 15) +* csh utility, POSIXLY_CORRECT environment variable: Options. (line 295) +* csh utility, |& operator, comparison with: Two-way I/O. (line 44) +* ctime user-defined function: Function Example. (line 72) +* currency symbols, localization: Explaining gettext. (line 99) +* custom.h file: Configuration Philosophy. + (line 29) +* cut utility: Cut Program. (line 6) +* cut.awk program: Cut Program. (line 44) +* d.c., See dark corner: Conventions. (line 37) +* dark corner <1>: Glossary. (line 188) +* dark corner <2>: Truth Values. (line 24) +* dark corner <3>: Assignment Ops. (line 148) +* dark corner <4>: Format Modifiers. (line 59) +* dark corner: Conventions. (line 37) +* dark corner, array subscripts: Uninitialized Subscripts. + (line 42) +* dark corner, break statement: Break Statement. (line 47) +* dark corner, close function: Close Files And Pipes. + (line 130) +* dark corner, command-line arguments: Assignment Options. (line 43) +* dark corner, continue statement: Continue Statement. (line 43) +* dark corner, CONVFMT variable: Conversion. (line 40) +* dark corner, escape sequences: Other Arguments. (line 31) +* dark corner, escape sequences, for metacharacters: Escape Sequences. + (line 136) +* dark corner, exit statement: Exit Statement. (line 29) +* dark corner, field separators: Field Splitting Summary. + (line 47) +* dark corner, FILENAME variable <1>: Auto-set. (line 88) +* dark corner, FILENAME variable: Getline Notes. (line 19) +* dark corner, FNR/NR variables: Auto-set. (line 187) +* dark corner, format-control characters: Control Letters. (line 80) +* dark corner, FS as null string: Single Character Fields. + (line 20) +* dark corner, input files: Records. (line 98) +* dark corner, invoking awk: Command Line. (line 16) +* dark corner, multiline records: Multiple Line. (line 35) +* dark corner, NF variable, decrementing: Changing Fields. (line 107) +* dark corner, OFMT variable: OFMT. (line 27) +* dark corner, regexp constants: Using Constant Regexps. + (line 6) +* dark corner, regexp constants, /= operator and: Assignment Ops. + (line 148) +* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps. + (line 44) +* dark corner, split function: String Functions. (line 220) +* dark corner, strings, storing: Records. (line 186) +* data, fixed-width: Constant Size. (line 9) +* data-driven languages: Basic High Level. (line 83) +* database, group, reading: Group Functions. (line 6) +* database, users, reading: Passwd Functions. (line 6) +* date utility, GNU: Time Functions. (line 17) +* date utility, POSIX: Time Functions. (line 259) +* dates, converting to timestamps: Time Functions. (line 72) +* dates, information related to, localization: Explaining gettext. + (line 111) +* Davies, Stephen <1>: Bugs. (line 62) +* Davies, Stephen: Contributors. (line 68) +* dcgettext function (gawk) <1>: Programmer i18n. (line 19) +* dcgettext function (gawk): I18N Functions. (line 12) +* dcgettext function (gawk), portability and: I18N Portability. + (line 32) +* dcngettext function (gawk) <1>: Programmer i18n. (line 35) +* dcngettext function (gawk): I18N Functions. (line 18) +* dcngettext function (gawk), portability and: I18N Portability. + (line 32) +* deadlocks: Two-way I/O. (line 71) +* debugging gawk: Known Bugs. (line 6) +* debugging gawk, bug reports: Bugs. (line 9) +* decimal point character, locale specific: Options. (line 200) +* decrement operators: Increment Ops. (line 35) +* default keyword: Switch Statement. (line 6) +* Deifik, Scott <1>: Bugs. (line 58) +* Deifik, Scott <2>: Contributors. (line 52) +* Deifik, Scott: Acknowledgments. (line 53) +* delete statement: Delete. (line 6) +* deleting elements in arrays: Delete. (line 6) +* deleting entire arrays: Delete. (line 39) +* differences between gawk and awk: String Functions. (line 88) +* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV. + (line 85) +* differences in awk and gawk, ARGIND variable: Auto-set. (line 40) +* differences in awk and gawk, array elements, deleting: Delete. + (line 39) +* differences in awk and gawk, AWKPATH environment variable: AWKPATH Variable. + (line 6) +* differences in awk and gawk, BEGIN/END patterns: I/O And BEGIN/END. + (line 16) +* differences in awk and gawk, BINMODE variable <1>: PC Using. + (line 40) +* differences in awk and gawk, BINMODE variable: User-modified. + (line 21) +* differences in awk and gawk, close function: Close Files And Pipes. + (line 81) +* differences in awk and gawk, ERRNO variable: Auto-set. (line 72) +* differences in awk and gawk, error messages: Special FD. (line 15) +* differences in awk and gawk, FIELDWIDTHS variable: User-modified. + (line 33) +* differences in awk and gawk, function arguments (gawk): Calling Built-in. + (line 16) +* differences in awk and gawk, getline command: Getline. (line 19) +* differences in awk and gawk, IGNORECASE variable: User-modified. + (line 68) +* differences in awk and gawk, implementation limitations <1>: Redirection. + (line 132) +* differences in awk and gawk, implementation limitations: Getline Notes. + (line 14) +* differences in awk and gawk, input/output operators <1>: Redirection. + (line 99) +* differences in awk and gawk, input/output operators: Getline/Coprocess. + (line 6) +* differences in awk and gawk, line continuations: Conditional Exp. + (line 34) +* differences in awk and gawk, LINT variable: User-modified. (line 83) +* differences in awk and gawk, match function: String Functions. + (line 151) +* differences in awk and gawk, next/nextfile statements: Nextfile Statement. + (line 6) +* differences in awk and gawk, print/printf statements: Format Modifiers. + (line 13) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 119) +* differences in awk and gawk, record separators: Records. (line 112) +* differences in awk and gawk, regexp constants: Using Constant Regexps. + (line 44) +* differences in awk and gawk, regular expressions: Case-sensitivity. + (line 26) +* differences in awk and gawk, RS/RT variables: Records. (line 162) +* differences in awk and gawk, RT variable: Auto-set. (line 176) +* differences in awk and gawk, single-character fields: Single Character Fields. + (line 6) +* differences in awk and gawk, split function: String Functions. + (line 209) +* differences in awk and gawk, strings: Scalar Constants. (line 20) +* differences in awk and gawk, strings, storing: Records. (line 182) +* differences in awk and gawk, strtonum function (gawk): String Functions. + (line 247) +* differences in awk and gawk, TEXTDOMAIN variable: User-modified. + (line 138) +* differences in awk and gawk, trunc-mod operation: Arithmetic Ops. + (line 66) +* directories, changing: Sample Library. (line 6) +* directories, searching <1>: Igawk Program. (line 358) +* directories, searching: AWKPATH Variable. (line 6) +* division: Arithmetic Ops. (line 44) +* do-while statement <1>: Do Statement. (line 6) +* do-while statement: Regexp Usage. (line 19) +* documentation, of awk programs: Library Names. (line 6) +* documentation, online: Manual History. (line 11) +* documents, searching: Dupword Program. (line 6) +* dollar sign ($): Regexp Operators. (line 35) +* dollar sign ($), $ field operator <1>: Precedence. (line 43) +* dollar sign ($), $ field operator: Fields. (line 19) +* dollar sign ($), incrementing fields and arrays: Increment Ops. + (line 30) +* double quote (") <1>: Quoting. (line 33) +* double quote ("): Read Terminal. (line 25) +* double quote ("), regexp constants: Computed Regexps. (line 28) +* double-precision floating-point: Basic Data Typing. (line 33) +* Drepper, Ulrich: Acknowledgments. (line 49) +* dupnode internal function: Internals. (line 97) +* dupword.awk program: Dupword Program. (line 31) +* EBCDIC: Ordinal Functions. (line 44) +* egrep utility <1>: Egrep Program. (line 6) +* egrep utility: Character Lists. (line 24) +* egrep.awk program: Egrep Program. (line 54) +* elements in arrays: Reference to Elements. + (line 6) +* elements in arrays, assigning: Assigning Elements. (line 6) +* elements in arrays, deleting: Delete. (line 6) +* elements in arrays, order of: Scanning an Array. (line 47) +* elements in arrays, scanning: Scanning an Array. (line 6) +* email address for bug reports, bug-gawk@gnu.org: Bugs. (line 27) +* EMISTERED: TCP/IP Networking. (line 6) +* empty pattern: Empty. (line 6) +* empty strings, See null strings: Regexp Field Splitting. + (line 43) +* END pattern: BEGIN/END. (line 6) +* END pattern, assert user-defined function and: Assert Function. + (line 74) +* END pattern, backslash continuation and: Egrep Program. (line 218) +* END pattern, Boolean patterns and: Expression Patterns. (line 73) +* END pattern, exit statement and: Exit Statement. (line 12) +* END pattern, next/nextfile statements and <1>: Next Statement. + (line 39) +* END pattern, next/nextfile statements and: I/O And BEGIN/END. + (line 36) +* END pattern, operators and: Using BEGIN/END. (line 17) +* END pattern, pgawk program: Profiling. (line 69) +* END pattern, print statement and: I/O And BEGIN/END. (line 16) +* endfile user-defined function: Filetrans Function. (line 60) +* endgrent function (C library): Group Functions. (line 213) +* endgrent user-defined function: Group Functions. (line 216) +* endpwent function (C library): Passwd Functions. (line 192) +* endpwent user-defined function: Passwd Functions. (line 195) +* ENVIRON variable <1>: Internals. (line 165) +* ENVIRON variable: Auto-set. (line 60) +* environment variables: Auto-set. (line 60) +* epoch, definition of: Glossary. (line 230) +* equals sign (=), = operator: Assignment Ops. (line 6) +* equals sign (=), == operator <1>: Precedence. (line 65) +* equals sign (=), == operator: Comparison Operators. + (line 11) +* EREs (Extended Regular Expressions): Character Lists. (line 24) +* ERRNO variable <1>: Internals. (line 152) +* ERRNO variable <2>: Auto-set. (line 72) +* ERRNO variable: Getline. (line 19) +* error handling: Special FD. (line 15) +* error handling, ERRNO variable and: Auto-set. (line 72) +* error output: Special FD. (line 6) +* escape processing, gsub/gensub/sub functions: Gory Details. (line 6) +* escape sequences: Escape Sequences. (line 6) +* escape sequences, unrecognized: Options. (line 180) +* evaluation order: Increment Ops. (line 61) +* evaluation order, concatenation: Concatenation. (line 42) +* evaluation order, functions: Calling Built-in. (line 30) +* examining fields: Fields. (line 6) +* exclamation point (!), ! operator <1>: Egrep Program. (line 160) +* exclamation point (!), ! operator <2>: Precedence. (line 52) +* exclamation point (!), ! operator: Boolean Ops. (line 67) +* exclamation point (!), != operator <1>: Precedence. (line 65) +* exclamation point (!), != operator: Comparison Operators. + (line 11) +* exclamation point (!), !~ operator <1>: Expression Patterns. + (line 24) +* exclamation point (!), !~ operator <2>: Precedence. (line 81) +* exclamation point (!), !~ operator <3>: Comparison Operators. + (line 11) +* exclamation point (!), !~ operator <4>: Regexp Constants. (line 6) +* exclamation point (!), !~ operator <5>: Computed Regexps. (line 6) +* exclamation point (!), !~ operator <6>: Case-sensitivity. (line 26) +* exclamation point (!), !~ operator: Regexp Usage. (line 19) +* exit statement: Exit Statement. (line 6) +* exp function: Numeric Functions. (line 22) +* expand utility: Very Simple. (line 69) +* expressions: Expressions. (line 6) +* expressions, as patterns: Expression Patterns. (line 6) +* expressions, assignment: Assignment Ops. (line 6) +* expressions, Boolean: Boolean Ops. (line 6) +* expressions, comparison: Typing and Comparison. + (line 9) +* expressions, conditional: Conditional Exp. (line 6) +* expressions, matching, See comparison expressions: Typing and Comparison. + (line 9) +* expressions, selecting: Conditional Exp. (line 6) +* Extended Regular Expressions (EREs): Character Lists. (line 24) +* extension function (gawk): Using Internal File Ops. + (line 15) +* extensions, Bell Laboratories awk: BTL. (line 6) +* extensions, in gawk, not in POSIX awk: POSIX/GNU. (line 6) +* extensions, mawk: Other Versions. (line 46) +* extract.awk program: Extract Program. (line 77) +* extraction, of marked strings (internationalization): String Extraction. + (line 6) +* false, logical: Truth Values. (line 6) +* FDL (Free Documentation License): GNU Free Documentation License. + (line 6) +* features, adding to gawk: Adding Code. (line 6) +* features, advanced, See advanced features: Obsolete. (line 6) +* features, deprecated: Obsolete. (line 6) +* features, undocumented: Undocumented. (line 6) +* Fenlason, Jay <1>: Contributors. (line 19) +* Fenlason, Jay: History. (line 30) +* fflush function: I/O Functions. (line 25) +* fflush function, unsupported: Options. (line 203) +* field numbers: Nonconstant Fields. (line 6) +* field operator $: Fields. (line 19) +* field operators, dollar sign as: Fields. (line 19) +* field separators <1>: User-modified. (line 43) +* field separators: Field Separators. (line 13) +* field separators, choice of: Field Separators. (line 49) +* field separators, FIELDWIDTHS variable and: User-modified. (line 33) +* field separators, in multiline records: Multiple Line. (line 41) +* field separators, on command line: Command Line Field Separator. + (line 6) +* field separators, POSIX and <1>: Field Splitting Summary. + (line 41) +* field separators, POSIX and: Fields. (line 6) +* field separators, regular expressions as <1>: Regexp Field Splitting. + (line 6) +* field separators, regular expressions as: Field Separators. (line 49) +* field separators, See Also OFS: Changing Fields. (line 64) +* field separators, spaces as: Cut Program. (line 106) +* fields <1>: Basic High Level. (line 71) +* fields <2>: Fields. (line 6) +* fields: Reading Files. (line 14) +* fields, adding: Changing Fields. (line 53) +* fields, changing contents of: Changing Fields. (line 6) +* fields, cutting: Cut Program. (line 6) +* fields, examining: Fields. (line 6) +* fields, number of: Fields. (line 33) +* fields, numbers: Nonconstant Fields. (line 6) +* fields, printing: Print Examples. (line 21) +* fields, separating: Field Separators. (line 13) +* fields, single-character: Single Character Fields. + (line 6) +* FIELDWIDTHS variable <1>: User-modified. (line 33) +* FIELDWIDTHS variable: Constant Size. (line 22) +* file descriptors: Special FD. (line 6) +* file names, distinguishing: Auto-set. (line 52) +* file names, in compatibility mode: Special Caveats. (line 9) +* file names, standard streams in gawk: Special FD. (line 41) +* FILENAME variable <1>: Auto-set. (line 88) +* FILENAME variable: Reading Files. (line 6) +* FILENAME variable, getline, setting with: Getline Notes. (line 19) +* filenames, assignments as: Ignoring Assigns. (line 6) +* files, .mo: Explaining gettext. (line 39) +* files, .mo, converting from .po: I18N Example. (line 62) +* files, .mo, specifying directory of <1>: Programmer i18n. (line 45) +* files, .mo, specifying directory of: Explaining gettext. (line 51) +* files, .po <1>: Translator i18n. (line 6) +* files, .po: Explaining gettext. (line 36) +* files, .po, converting to .mo: I18N Example. (line 62) +* files, /dev/... special files: Special FD. (line 41) +* files, /inet/ (gawk): TCP/IP Networking. (line 6) +* files, /p (gawk): Portal Files. (line 6) +* files, as single records: Records. (line 191) +* files, awk programs in: Long. (line 6) +* files, awkprof.out: Profiling. (line 10) +* files, awkvars.out: Options. (line 95) +* files, closing: I/O Functions. (line 10) +* files, descriptors, See file descriptors: Special FD. (line 6) +* files, for process information: Special Process. (line 6) +* files, group: Group Functions. (line 6) +* files, information about, retrieving: Sample Library. (line 6) +* files, initialization and cleanup: Filetrans Function. (line 6) +* files, input, See input files: Read Terminal. (line 17) +* files, log, timestamps in: Time Functions. (line 6) +* files, managing: Data File Management. + (line 6) +* files, managing, data file boundaries: Filetrans Function. (line 6) +* files, message object: Explaining gettext. (line 39) +* files, message object, converting from portable object files: I18N Example. + (line 62) +* files, message object, specifying directory of <1>: Programmer i18n. + (line 45) +* files, message object, specifying directory of: Explaining gettext. + (line 51) +* files, multiple passes over: Other Arguments. (line 49) +* files, multiple, duplicating output into: Tee Program. (line 6) +* files, output, See output files: Close Files And Pipes. + (line 6) +* files, password: Passwd Functions. (line 16) +* files, portable object <1>: Translator i18n. (line 6) +* files, portable object: Explaining gettext. (line 36) +* files, portable object, converting to message object files: I18N Example. + (line 62) +* files, portable object, generating: Options. (line 130) +* files, portal: Portal Files. (line 6) +* files, processing, ARGIND variable and: Auto-set. (line 47) +* files, reading: Rewind Function. (line 6) +* files, reading, multiline records: Multiple Line. (line 6) +* files, searching for regular expressions: Egrep Program. (line 6) +* files, skipping: File Checking. (line 6) +* files, source, search path for: Igawk Program. (line 358) +* files, splitting: Split Program. (line 6) +* files, Texinfo, extracting programs from: Extract Program. (line 6) +* Fish, Fred <1>: Bugs. (line 57) +* Fish, Fred: Contributors. (line 50) +* fixed-width data: Constant Size. (line 9) +* flag variables <1>: Tee Program. (line 20) +* flag variables: Boolean Ops. (line 67) +* floating-point: Unexpected Results. (line 6) +* floating-point, numbers: Basic Data Typing. (line 21) +* floating-point, numbers, AWKNUM internal type: Internals. (line 19) +* FNR variable <1>: Auto-set. (line 98) +* FNR variable: Records. (line 6) +* FNR variable, changing: Auto-set. (line 187) +* for statement: For Statement. (line 6) +* for statement, in arrays: Scanning an Array. (line 20) +* force_number internal function: Internals. (line 27) +* force_string internal function: Internals. (line 32) +* format specifiers, mixing regular with positional specifiers: Printf Ordering. + (line 57) +* format specifiers, printf statement: Control Letters. (line 6) +* format specifiers, strftime function (gawk): Time Functions. + (line 85) +* format strings: Basic Printf. (line 15) +* formats, numeric output: OFMT. (line 6) +* formatting output: Printf. (line 6) +* forward slash (/): Regexp. (line 10) +* forward slash (/), / operator: Precedence. (line 55) +* forward slash (/), /= operator <1>: Precedence. (line 96) +* forward slash (/), /= operator: Assignment Ops. (line 129) +* forward slash (/), /= operator, vs. /=.../ regexp constant: Assignment Ops. + (line 148) +* forward slash (/), patterns and: Expression Patterns. (line 24) +* Free Documentation License (FDL): GNU Free Documentation License. + (line 6) +* Free Software Foundation (FSF) <1>: Glossary. (line 284) +* Free Software Foundation (FSF) <2>: Getting. (line 10) +* Free Software Foundation (FSF): Manual History. (line 6) +* free_temp internal macro: Internals. (line 102) +* FreeBSD: Glossary. (line 582) +* FS variable <1>: User-modified. (line 43) +* FS variable: Field Separators. (line 13) +* FS variable, --field-separator option and: Options. (line 21) +* FS variable, as null string: Single Character Fields. + (line 20) +* FS variable, as TAB character: Options. (line 196) +* FS variable, changing value of <1>: Known Bugs. (line 6) +* FS variable, changing value of: Field Separators. (line 33) +* FS variable, running awk programs and: Cut Program. (line 66) +* FS variable, setting from command line: Command Line Field Separator. + (line 6) +* FSF (Free Software Foundation) <1>: Glossary. (line 284) +* FSF (Free Software Foundation) <2>: Getting. (line 10) +* FSF (Free Software Foundation): Manual History. (line 6) +* function calls: Function Calls. (line 6) +* functions, arrays as parameters to: Function Caveats. (line 55) +* functions, built-in <1>: Functions. (line 6) +* functions, built-in: Function Calls. (line 10) +* functions, built-in, adding to gawk: Dynamic Extensions. (line 10) +* functions, built-in, evaluation order: Calling Built-in. (line 30) +* functions, defining: Definition Syntax. (line 6) +* functions, library: Library Functions. (line 6) +* functions, library, assertions: Assert Function. (line 6) +* functions, library, associative arrays and: Library Names. (line 57) +* functions, library, C library: Getopt Function. (line 6) +* functions, library, character values as numbers: Ordinal Functions. + (line 6) +* functions, library, Cliff random numbers: Cliff Random Function. + (line 6) +* functions, library, command-line options: Getopt Function. (line 6) +* functions, library, example program for using: Igawk Program. + (line 6) +* functions, library, group database, reading: Group Functions. + (line 6) +* functions, library, managing data files: Data File Management. + (line 6) +* functions, library, managing time: Gettimeofday Function. + (line 6) +* functions, library, merging arrays into strings: Join Function. + (line 6) +* functions, library, nextfile statement: Nextfile Function. (line 6) +* functions, library, rounding numbers: Round Function. (line 6) +* functions, library, user database, reading: Passwd Functions. + (line 6) +* functions, names of <1>: Definition Syntax. (line 20) +* functions, names of: Arrays. (line 17) +* functions, recursive: Definition Syntax. (line 68) +* functions, return values, setting: Internals. (line 146) +* functions, string-translation: I18N Functions. (line 6) +* functions, undefined: Function Caveats. (line 79) +* functions, user-defined: User-defined. (line 6) +* functions, user-defined, calling: Function Caveats. (line 6) +* functions, user-defined, counts: Profiling. (line 135) +* functions, user-defined, library of: Library Functions. (line 6) +* functions, user-defined, next/nextfile statements and <1>: Nextfile Statement. + (line 39) +* functions, user-defined, next/nextfile statements and: Next Statement. + (line 39) +* G-d: Acknowledgments. (line 70) +* Garfinkle, Scott: Contributors. (line 37) +* gawk, awk and <1>: This Manual. (line 13) +* gawk, awk and: Preface. (line 22) +* gawk, bitwise operations in: Bitwise Functions. (line 39) +* gawk, break statement in: Break Statement. (line 47) +* gawk, built-in variables and: Built-in Variables. (line 14) +* gawk, character classes and: Character Lists. (line 92) +* gawk, coding style in: Adding Code. (line 32) +* gawk, command-line options: GNU Regexp Operators. + (line 62) +* gawk, comparison operators and: Comparison Operators. + (line 50) +* gawk, configuring: Configuration Philosophy. + (line 6) +* gawk, configuring, options: Additional Configuration Options. + (line 6) +* gawk, continue statement in: Continue Statement. (line 43) +* gawk, debugging: Known Bugs. (line 6) +* gawk, distribution: Distribution contents. + (line 6) +* gawk, escape sequences: Escape Sequences. (line 125) +* gawk, extensions, disabling: Options. (line 176) +* gawk, features, adding: Adding Code. (line 6) +* gawk, features, advanced: Advanced Features. (line 6) +* gawk, fflush function in: I/O Functions. (line 45) +* gawk, field separators and: User-modified. (line 63) +* gawk, FIELDWIDTHS variable in: User-modified. (line 39) +* gawk, file names in: Special Files. (line 6) +* gawk, format-control characters: Control Letters. (line 80) +* gawk, function arguments and: Calling Built-in. (line 16) +* gawk, functions, adding: Dynamic Extensions. (line 10) +* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) +* gawk, IGNORECASE variable in: User-modified. (line 79) +* gawk, implementation issues: Notes. (line 6) +* gawk, implementation issues, debugging: Compatibility Mode. (line 6) +* gawk, implementation issues, downward compatibility: Compatibility Mode. + (line 6) +* gawk, implementation issues, limits: Getline Notes. (line 14) +* gawk, implementation issues, pipes: Redirection. (line 132) +* gawk, installing: Installation. (line 6) +* gawk, internals: Internals. (line 6) +* gawk, internationalization and, See internationalization: Internationalization. + (line 13) +* gawk, interpreter, adding code to <1>: Future Extensions. (line 87) +* gawk, interpreter, adding code to: Using Internal File Ops. + (line 6) +* gawk, interval expressions and: Regexp Operators. (line 138) +* gawk, line continuation in: Conditional Exp. (line 34) +* gawk, LINT variable in: User-modified. (line 92) +* gawk, list of contributors to: Contributors. (line 6) +* gawk, MS-DOS version of: PC Using. (line 11) +* gawk, newlines in: Statements/Lines. (line 12) +* gawk, next file statement in: Nextfile Statement. (line 46) +* gawk, nextfile statement in <1>: Nextfile Function. (line 6) +* gawk, nextfile statement in: Nextfile Statement. (line 46) +* gawk, octal numbers and: Nondecimal-numbers. (line 42) +* gawk, OS/2 version of: PC Using. (line 11) +* gawk, regexp constants and: Using Constant Regexps. + (line 28) +* gawk, regular expressions, case sensitivity: Case-sensitivity. + (line 26) +* gawk, regular expressions, operators: GNU Regexp Operators. + (line 6) +* gawk, regular expressions, precedence: Regexp Operators. (line 154) +* gawk, See Also awk: Preface. (line 35) +* gawk, source code, obtaining: Getting. (line 6) +* gawk, splitting fields and: Constant Size. (line 87) +* gawk, string-translation functions: I18N Functions. (line 6) +* gawk, timestamps: Time Functions. (line 6) +* gawk, uses for: Preface. (line 35) +* gawk, versions of, information about, printing: Options. (line 244) +* gawk, word-boundary operator: GNU Regexp Operators. + (line 55) +* General Public License (GPL): Glossary. (line 293) +* General Public License, See GPL: Manual History. (line 11) +* gensub function (gawk) <1>: String Functions. (line 361) +* gensub function (gawk): Using Constant Regexps. + (line 44) +* gensub function (gawk), escape processing: Gory Details. (line 6) +* get_actual_argument internal function: Internals. (line 126) +* get_argument internal function: Internals. (line 121) +* get_array_argument internal macro: Internals. (line 141) +* get_curfunc_arg_count internal function: Internals. (line 37) +* get_record input method: Internals. (line 178) +* get_scalar_argument internal macro: Internals. (line 136) +* getgrent function (C library): Group Functions. (line 6) +* getgrent user-defined function: Group Functions. (line 6) +* getgrgid function (C library): Group Functions. (line 180) +* getgrgid user-defined function: Group Functions. (line 183) +* getgrnam function (C library): Group Functions. (line 168) +* getgrnam user-defined function: Group Functions. (line 172) +* getgruser function (C library): Group Functions. (line 191) +* getgruser function, user-defined: Group Functions. (line 194) +* getline command: Reading Files. (line 20) +* getline command, _gr_init user-defined function: Group Functions. + (line 80) +* getline command, _pw_init function: Passwd Functions. (line 136) +* getline command, coprocesses, using from <1>: Close Files And Pipes. + (line 6) +* getline command, coprocesses, using from: Getline/Coprocess. + (line 6) +* getline command, deadlock and: Two-way I/O. (line 71) +* getline command, explicit input with: Getline. (line 6) +* getline command, FILENAME variable and: Getline Notes. (line 19) +* getline command, return values: Getline. (line 19) +* getline command, variants: Getline Summary. (line 6) +* getopt function (C library): Getopt Function. (line 15) +* getopt user-defined function: Getopt Function. (line 106) +* getpwent function (C library): Passwd Functions. (line 16) +* getpwent user-defined function: Passwd Functions. (line 16) +* getpwnam function (C library): Passwd Functions. (line 156) +* getpwnam user-defined function: Passwd Functions. (line 160) +* getpwuid function (C library): Passwd Functions. (line 168) +* getpwuid user-defined function: Passwd Functions. (line 172) +* getservbyname function (C library): TCP/IP Networking. (line 34) +* gettext function (C library): Explaining gettext. (line 60) +* gettext library: Explaining gettext. (line 6) +* gettext library, locale categories: Explaining gettext. (line 78) +* gettimeofday user-defined function: Gettimeofday Function. + (line 16) +* GNITS mailing list: Acknowledgments. (line 49) +* GNU awk, See gawk: Preface. (line 48) +* GNU Free Documentation License: GNU Free Documentation License. + (line 6) +* GNU General Public License: Glossary. (line 293) +* GNU Lesser General Public License: Glossary. (line 373) +* GNU long options <1>: Options. (line 6) +* GNU long options: Command Line. (line 13) +* GNU long options, printing list of: Options. (line 139) +* GNU Project <1>: Glossary. (line 302) +* GNU Project: Manual History. (line 11) +* GNU/Linux <1>: Glossary. (line 582) +* GNU/Linux <2>: Atari Compiling. (line 16) +* GNU/Linux <3>: I18N Example. (line 55) +* GNU/Linux: Manual History. (line 28) +* GPL (General Public License) <1>: Glossary. (line 293) +* GPL (General Public License): Manual History. (line 11) +* GPL (General Public License), printing: Options. (line 87) +* grcat program: Group Functions. (line 15) +* Grigera, Juan <1>: Bugs. (line 59) +* Grigera, Juan: Contributors. (line 54) +* group database, reading: Group Functions. (line 6) +* group file: Group Functions. (line 6) +* groups, information about: Group Functions. (line 6) +* gsub function <1>: String Functions. (line 345) +* gsub function: Using Constant Regexps. + (line 44) +* gsub function, arguments of: String Functions. (line 325) +* gsub function, escape processing: Gory Details. (line 6) +* Hankerson, Darrel <1>: Bugs. (line 58) +* Hankerson, Darrel <2>: Contributors. (line 56) +* Hankerson, Darrel: Acknowledgments. (line 53) +* Hartholz, Elaine: Acknowledgments. (line 35) +* Hartholz, Marshall: Acknowledgments. (line 35) +* Hasegawa, Isamu <1>: Contributors. (line 83) +* Hasegawa, Isamu: Acknowledgments. (line 53) +* hexadecimal numbers: Nondecimal-numbers. (line 6) +* hexadecimal values, enabling interpretation of: Options. (line 168) +* histsort.awk program: History Sorting. (line 25) +* Hughes, Phil: Acknowledgments. (line 40) +* HUP signal: Profiling. (line 207) +* hyphen (-), - operator: Precedence. (line 52) +* hyphen (-), -- (decrement/increment) operators: Precedence. (line 46) +* hyphen (-), -- operator: Increment Ops. (line 48) +* hyphen (-), -= operator <1>: Precedence. (line 96) +* hyphen (-), -= operator: Assignment Ops. (line 129) +* hyphen (-), filenames beginning with: Options. (line 67) +* hyphen (-), in character lists: Character Lists. (line 17) +* id utility: Id Program. (line 6) +* id.awk program: Id Program. (line 30) +* if statement <1>: If Statement. (line 6) +* if statement: Regexp Usage. (line 19) +* if statement, actions, changing: Ranges. (line 25) +* igawk.sh program: Igawk Program. (line 118) +* IGNORECASE variable <1>: User-modified. (line 68) +* IGNORECASE variable: Case-sensitivity. (line 26) +* IGNORECASE variable, array sorting and: Array Sorting. (line 86) +* IGNORECASE variable, array subscripts and: Array Intro. (line 87) +* IGNORECASE variable, in example programs: Library Functions. + (line 43) +* implementation issues, gawk: Notes. (line 6) +* implementation issues, gawk, debugging: Compatibility Mode. (line 6) +* implementation issues, gawk, limits <1>: Redirection. (line 132) +* implementation issues, gawk, limits: Getline Notes. (line 14) +* in operator <1>: Id Program. (line 93) +* in operator <2>: For Statement. (line 74) +* in operator <3>: Precedence. (line 84) +* in operator: Comparison Operators. + (line 11) +* in operator, arrays and <1>: Scanning an Array. (line 17) +* in operator, arrays and: Reference to Elements. + (line 25) +* increment operators: Increment Ops. (line 6) +* index function: String Functions. (line 60) +* indexing arrays: Array Intro. (line 45) +* initialization, automatic: More Complex. (line 38) +* input files: Reading Files. (line 6) +* input files, closing: Close Files And Pipes. + (line 6) +* input files, counting elements in: Wc Program. (line 6) +* input files, examples: Sample Data Files. (line 6) +* input files, reading: Reading Files. (line 6) +* input files, running awk without: Read Terminal. (line 6) +* input files, skipping: Nextfile Function. (line 6) +* input files, variable assignments and: Other Arguments. (line 19) +* input pipeline: Getline/Pipe. (line 6) +* input redirection: Getline/File. (line 6) +* input, data, nondecimal: Nondecimal Data. (line 6) +* input, explicit: Getline. (line 6) +* input, files, See input files: Multiple Line. (line 6) +* input, multiline records: Multiple Line. (line 6) +* input, splitting into records: Records. (line 6) +* input, standard <1>: Special FD. (line 6) +* input, standard: Read Terminal. (line 6) +* input/output, binary: User-modified. (line 10) +* input/output, from BEGIN and END: I/O And BEGIN/END. (line 6) +* input/output, two-way: Two-way I/O. (line 44) +* insomnia, cure for: Alarm Program. (line 6) +* installation, amiga: Amiga Installation. (line 6) +* installation, atari: Atari Installation. (line 9) +* installation, beos: BeOS Installation. (line 6) +* installation, tandem: Tandem Installation. (line 6) +* installation, vms: VMS Installation. (line 6) +* installing gawk: Installation. (line 6) +* int function: Numeric Functions. (line 11) +* INT signal (MS-DOS): Profiling. (line 210) +* integers: Basic Data Typing. (line 21) +* integers, unsigned: Basic Data Typing. (line 28) +* interacting with other programs: I/O Functions. (line 63) +* internationalization <1>: I18N and L10N. (line 6) +* internationalization: I18N Functions. (line 6) +* internationalization, localization <1>: Internationalization. + (line 13) +* internationalization, localization: User-modified. (line 138) +* internationalization, localization, character classes: Character Lists. + (line 92) +* internationalization, localization, gawk and: Internationalization. + (line 13) +* internationalization, localization, locale categories: Explaining gettext. + (line 78) +* internationalization, localization, marked strings: Programmer i18n. + (line 14) +* internationalization, localization, portability and: I18N Portability. + (line 6) +* internationalizing a program: Explaining gettext. (line 6) +* interpreted programs <1>: Glossary. (line 342) +* interpreted programs: Basic High Level. (line 14) +* interval expressions: Regexp Operators. (line 115) +* inventory-shipped file: Sample Data Files. (line 32) +* IOBUF internal structure: Internals. (line 178) +* iop_alloc internal function: Internals. (line 178) +* ISO: Glossary. (line 353) +* ISO 8859-1: Glossary. (line 138) +* ISO Latin-1: Glossary. (line 138) +* Jacobs, Andrew: Passwd Functions. (line 76) +* Jaegermann, Michal <1>: Contributors. (line 45) +* Jaegermann, Michal: Acknowledgments. (line 53) +* Java implementation of awk: Other Versions. (line 105) +* jawk: Other Versions. (line 105) +* Jedi knights: Undocumented. (line 6) +* join user-defined function: Join Function. (line 18) +* Kahrs, Ju"rgen <1>: Contributors. (line 64) +* Kahrs, Ju"rgen: Acknowledgments. (line 53) +* Kenobi, Obi-Wan: Undocumented. (line 6) +* Kernighan, Brian <1>: Basic Data Typing. (line 71) +* Kernighan, Brian <2>: Other Versions. (line 13) +* Kernighan, Brian <3>: Contributors. (line 12) +* Kernighan, Brian <4>: BTL. (line 6) +* Kernighan, Brian <5>: Concatenation. (line 6) +* Kernighan, Brian <6>: Acknowledgments. (line 60) +* Kernighan, Brian <7>: Conventions. (line 33) +* Kernighan, Brian: History. (line 17) +* kill command, dynamic profiling: Profiling. (line 185) +* Knights, jedi: Undocumented. (line 6) +* Kwok, Conrad: Contributors. (line 37) +* labels.awk program: Labels Program. (line 48) +* languages, data-driven: Basic High Level. (line 83) +* LC_ALL locale category: Explaining gettext. (line 116) +* LC_COLLATE locale category: Explaining gettext. (line 89) +* LC_CTYPE locale category: Explaining gettext. (line 93) +* LC_MESSAGES locale category: Explaining gettext. (line 83) +* LC_MESSAGES locale category, bindtextdomain function (gawk): Programmer i18n. + (line 86) +* LC_MONETARY locale category: Explaining gettext. (line 99) +* LC_NUMERIC locale category: Explaining gettext. (line 103) +* LC_RESPONSE locale category: Explaining gettext. (line 107) +* LC_TIME locale category: Explaining gettext. (line 111) +* left angle bracket (<), < operator <1>: Precedence. (line 65) +* left angle bracket (<), < operator: Comparison Operators. + (line 11) +* left angle bracket (<), < operator (I/O): Getline/File. (line 6) +* left angle bracket (<), <= operator <1>: Precedence. (line 65) +* left angle bracket (<), <= operator: Comparison Operators. + (line 11) +* left shift, bitwise: Bitwise Functions. (line 32) +* leftmost longest match: Multiple Line. (line 26) +* length function: String Functions. (line 71) +* Lesser General Public License (LGPL): Glossary. (line 373) +* LGPL (Lesser General Public License): Glossary. (line 373) +* libraries of awk functions: Library Functions. (line 6) +* libraries of awk functions, assertions: Assert Function. (line 6) +* libraries of awk functions, associative arrays and: Library Names. + (line 57) +* libraries of awk functions, character values as numbers: Ordinal Functions. + (line 6) +* libraries of awk functions, command-line options: Getopt Function. + (line 6) +* libraries of awk functions, example program for using: Igawk Program. + (line 6) +* libraries of awk functions, group database, reading: Group Functions. + (line 6) +* libraries of awk functions, managing, data files: Data File Management. + (line 6) +* libraries of awk functions, managing, time: Gettimeofday Function. + (line 6) +* libraries of awk functions, merging arrays into strings: Join Function. + (line 6) +* libraries of awk functions, nextfile statement: Nextfile Function. + (line 6) +* libraries of awk functions, rounding numbers: Round Function. + (line 6) +* libraries of awk functions, user database, reading: Passwd Functions. + (line 6) +* line breaks: Statements/Lines. (line 6) +* line continuations: Boolean Ops. (line 62) +* line continuations, gawk: Conditional Exp. (line 34) +* line continuations, in print statement: Print Examples. (line 76) +* line continuations, with C shell: More Complex. (line 30) +* lines, blank, printing: Print. (line 22) +* lines, counting: Wc Program. (line 6) +* lines, duplicate, removing: History Sorting. (line 6) +* lines, matching ranges of: Ranges. (line 6) +* lines, skipping between markers: Ranges. (line 43) +* lint checking: User-modified. (line 83) +* lint checking, array elements: Delete. (line 34) +* lint checking, array subscripts: Uninitialized Subscripts. + (line 42) +* lint checking, empty programs: Command Line. (line 16) +* lint checking, issuing warnings: Options. (line 144) +* lint checking, POSIXLY_CORRECT environment variable: Options. + (line 282) +* lint checking, undefined functions: Function Caveats. (line 96) +* LINT variable: User-modified. (line 83) +* Linux <1>: Glossary. (line 582) +* Linux <2>: Atari Compiling. (line 16) +* Linux <3>: I18N Example. (line 55) +* Linux: Manual History. (line 28) +* locale categories: Explaining gettext. (line 78) +* locale decimal point character: Options. (line 200) +* locale, definition of: Locales. (line 6) +* localization: I18N and L10N. (line 6) +* localization, See internationalization, localization: I18N and L10N. + (line 6) +* log files, timestamps in: Time Functions. (line 6) +* log function: Numeric Functions. (line 27) +* logical false/true: Truth Values. (line 6) +* logical operators, See Boolean expressions: Boolean Ops. (line 6) +* login information: Passwd Functions. (line 16) +* long options: Command Line. (line 13) +* loops: While Statement. (line 6) +* loops, continue statements and: For Statement. (line 63) +* loops, count for header: Profiling. (line 129) +* loops, exiting: Break Statement. (line 6) +* loops, See Also while statement: While Statement. (line 6) +* Lost In Space: Dynamic Extensions. (line 6) +* ls utility: More Complex. (line 15) +* lshift function (gawk): Bitwise Functions. (line 45) +* lvalues/rvalues: Assignment Ops. (line 32) +* mailing labels, printing: Labels Program. (line 6) +* mailing list, GNITS: Acknowledgments. (line 49) +* make_builtin internal function: Internals. (line 107) +* make_number internal function: Internals. (line 82) +* make_string internal function: Internals. (line 77) +* mark parity: Ordinal Functions. (line 44) +* marked string extraction (internationalization): String Extraction. + (line 6) +* marked strings, extracting: String Extraction. (line 6) +* Marx, Groucho: Increment Ops. (line 61) +* match function: String Functions. (line 98) +* match function, RSTART/RLENGTH variables: String Functions. (line 115) +* matching, expressions, See comparison expressions: Typing and Comparison. + (line 9) +* matching, leftmost longest: Multiple Line. (line 26) +* matching, null strings: Gory Details. (line 160) +* mawk program: Other Versions. (line 33) +* McPhee, Patrick: Contributors. (line 89) +* memory, releasing: Internals. (line 102) +* memory, setting limits: Options. (line 45) +* message object files: Explaining gettext. (line 39) +* message object files, converting from portable object files: I18N Example. + (line 62) +* message object files, specifying directory of <1>: Programmer i18n. + (line 45) +* message object files, specifying directory of: Explaining gettext. + (line 51) +* metacharacters, escape sequences for: Escape Sequences. (line 132) +* mktime function (gawk): Time Functions. (line 30) +* modifiers, in format specifiers: Format Modifiers. (line 6) +* monetary information, localization: Explaining gettext. (line 99) +* msgfmt utility: I18N Example. (line 62) +* names, arrays/variables <1>: Library Names. (line 6) +* names, arrays/variables: Arrays. (line 17) +* names, functions <1>: Library Names. (line 6) +* names, functions: Definition Syntax. (line 20) +* namespace issues <1>: Library Names. (line 6) +* namespace issues: Arrays. (line 17) +* namespace issues, functions: Definition Syntax. (line 20) +* nawk utility: Names. (line 17) +* negative zero: Unexpected Results. (line 28) +* NetBSD: Glossary. (line 582) +* networks, programming: TCP/IP Networking. (line 6) +* networks, support for: Special Network. (line 6) +* newlines <1>: Options. (line 183) +* newlines <2>: Boolean Ops. (line 67) +* newlines: Statements/Lines. (line 6) +* newlines, as field separators: Field Separators. (line 63) +* newlines, as record separators: Records. (line 20) +* newlines, in dynamic regexps: Computed Regexps. (line 59) +* newlines, in regexp constants: Computed Regexps. (line 69) +* newlines, printing: Print Examples. (line 12) +* newlines, separating statements in actions <1>: Statements. (line 10) +* newlines, separating statements in actions: Action Overview. + (line 19) +* next file statement: POSIX/GNU. (line 155) +* next file statement, deprecated: Obsolete. (line 11) +* next file statement, in gawk: Nextfile Statement. (line 46) +* next statement <1>: Next Statement. (line 6) +* next statement: Boolean Ops. (line 85) +* next statement, BEGIN/END patterns and: I/O And BEGIN/END. (line 36) +* next statement, user-defined functions and: Next Statement. (line 39) +* nextfile statement: Nextfile Statement. (line 6) +* nextfile statement, BEGIN/END patterns and: I/O And BEGIN/END. + (line 36) +* nextfile statement, implementing: Nextfile Function. (line 6) +* nextfile statement, in gawk: Nextfile Statement. (line 46) +* nextfile statement, next file statement and: Obsolete. (line 11) +* nextfile statement, user-defined functions and: Nextfile Statement. + (line 39) +* nextfile user-defined function: Nextfile Function. (line 38) +* NF variable <1>: Auto-set. (line 103) +* NF variable: Fields. (line 33) +* NF variable, decrementing: Changing Fields. (line 107) +* noassign.awk program: Ignoring Assigns. (line 15) +* NODE internal type: Internals. (line 23) +* nodes, duplicating: Internals. (line 97) +* not Boolean-logic operator: Boolean Ops. (line 6) +* NR variable <1>: Auto-set. (line 114) +* NR variable: Records. (line 6) +* NR variable, changing: Auto-set. (line 187) +* null strings <1>: Basic Data Typing. (line 47) +* null strings <2>: Truth Values. (line 6) +* null strings <3>: Regexp Field Splitting. + (line 43) +* null strings: Records. (line 102) +* null strings, array elements and: Delete. (line 27) +* null strings, as array subscripts: Uninitialized Subscripts. + (line 42) +* null strings, converting numbers to strings: Conversion. (line 21) +* null strings, matching: Gory Details. (line 160) +* null strings, quoting and: Quoting. (line 58) +* number sign (#), #! (executable scripts): Executable Scripts. + (line 6) +* number sign (#), #! (executable scripts), portability issues with: Executable Scripts. + (line 6) +* number sign (#), commenting: Comments. (line 6) +* numbers: Internals. (line 82) +* numbers, as array subscripts: Numeric Array Subscripts. + (line 6) +* numbers, as values of characters: Ordinal Functions. (line 6) +* numbers, Cliff random: Cliff Random Function. + (line 6) +* numbers, converting: Conversion. (line 6) +* numbers, converting, to strings <1>: Bitwise Functions. (line 99) +* numbers, converting, to strings: User-modified. (line 26) +* numbers, floating-point: Basic Data Typing. (line 21) +* numbers, floating-point, AWKNUM internal type: Internals. (line 19) +* numbers, hexadecimal: Nondecimal-numbers. (line 6) +* numbers, NODE internal type: Internals. (line 23) +* numbers, octal: Nondecimal-numbers. (line 6) +* numbers, random: Numeric Functions. (line 70) +* numbers, rounding: Round Function. (line 6) +* numeric, constants: Scalar Constants. (line 6) +* numeric, output format: OFMT. (line 6) +* numeric, strings: Variable Typing. (line 6) +* numeric, values: Internals. (line 27) +* oawk utility: Names. (line 17) +* obsolete features: Obsolete. (line 6) +* octal numbers: Nondecimal-numbers. (line 6) +* octal values, enabling interpretation of: Options. (line 168) +* OFMT variable <1>: User-modified. (line 100) +* OFMT variable <2>: Conversion. (line 54) +* OFMT variable: OFMT. (line 15) +* OFMT variable, POSIX awk and: OFMT. (line 27) +* OFS variable <1>: User-modified. (line 109) +* OFS variable <2>: Output Separators. (line 6) +* OFS variable: Changing Fields. (line 64) +* OpenBSD: Glossary. (line 582) +* OpenSolaris: Other Versions. (line 96) +* operating systems, BSD-based <1>: Portal Files. (line 6) +* operating systems, BSD-based: Manual History. (line 28) +* operating systems, PC, gawk on: PC Using. (line 6) +* operating systems, PC, gawk on, installing: PC Installation. + (line 6) +* operating systems, porting gawk to: New Ports. (line 6) +* operating systems, See Also GNU/Linux, PC operating systems, Unix: Installation. + (line 6) +* operations, bitwise: Bitwise Functions. (line 6) +* operators, arithmetic: Arithmetic Ops. (line 6) +* operators, assignment: Assignment Ops. (line 6) +* operators, assignment, evaluation order: Assignment Ops. (line 111) +* operators, Boolean, See Boolean expressions: Boolean Ops. (line 6) +* operators, decrement/increment: Increment Ops. (line 6) +* operators, GNU-specific: GNU Regexp Operators. + (line 6) +* operators, input/output <1>: Precedence. (line 65) +* operators, input/output <2>: Redirection. (line 19) +* operators, input/output <3>: Getline/Coprocess. (line 6) +* operators, input/output <4>: Getline/Pipe. (line 6) +* operators, input/output: Getline/File. (line 6) +* operators, logical, See Boolean expressions: Boolean Ops. (line 6) +* operators, precedence <1>: Precedence. (line 6) +* operators, precedence: Increment Ops. (line 61) +* operators, relational, See operators, comparison: Typing and Comparison. + (line 9) +* operators, short-circuit: Boolean Ops. (line 57) +* operators, string: Concatenation. (line 9) +* operators, string-matching: Regexp Usage. (line 19) +* operators, string-matching, for buffers: GNU Regexp Operators. + (line 40) +* operators, word-boundary (gawk): GNU Regexp Operators. + (line 55) +* options, command-line <1>: Options. (line 6) +* options, command-line <2>: Command Line Field Separator. + (line 6) +* options, command-line: Long. (line 12) +* options, command-line, end of: Options. (line 62) +* options, command-line, invoking awk: Command Line. (line 6) +* options, command-line, processing: Getopt Function. (line 6) +* options, deprecated: Obsolete. (line 6) +* options, long <1>: Options. (line 6) +* options, long: Command Line. (line 13) +* options, printing list of: Options. (line 139) +* OR bitwise operation: Bitwise Functions. (line 6) +* or Boolean-logic operator: Boolean Ops. (line 6) +* or function (gawk): Bitwise Functions. (line 39) +* ord user-defined function: Ordinal Functions. (line 16) +* order of evaluation, concatenation: Concatenation. (line 42) +* ORS variable <1>: User-modified. (line 114) +* ORS variable: Output Separators. (line 20) +* output field separator, See OFS variable: Changing Fields. (line 64) +* output record separator, See ORS variable: Output Separators. + (line 20) +* output redirection: Redirection. (line 6) +* output, buffering: I/O Functions. (line 29) +* output, duplicating into files: Tee Program. (line 6) +* output, files, closing: Close Files And Pipes. + (line 6) +* output, format specifier, OFMT: OFMT. (line 15) +* output, formatted: Printf. (line 6) +* output, pipes: Redirection. (line 54) +* output, printing, See printing: Printing. (line 6) +* output, records: Output Separators. (line 20) +* output, standard: Special FD. (line 6) +* P1003.2 POSIX standard: Glossary. (line 426) +* param_cnt internal variable: Internals. (line 46) +* parameters, number of: Internals. (line 46) +* parentheses (): Regexp Operators. (line 78) +* parentheses (), pgawk program: Profiling. (line 144) +* password file: Passwd Functions. (line 16) +* patterns: Patterns and Actions. + (line 6) +* patterns, comparison expressions as: Expression Patterns. (line 14) +* patterns, counts: Profiling. (line 116) +* patterns, default: Very Simple. (line 34) +* patterns, empty: Empty. (line 6) +* patterns, expressions as: Regexp Patterns. (line 6) +* patterns, ranges in: Ranges. (line 6) +* patterns, regexp constants as: Expression Patterns. (line 36) +* patterns, types of: Pattern Overview. (line 14) +* pawk profiling Bell Labs awk: Other Versions. (line 88) +* PC operating systems, gawk on: PC Using. (line 6) +* PC operating systems, gawk on, installing: PC Installation. (line 6) +* percent sign (%), % operator: Precedence. (line 55) +* percent sign (%), %= operator <1>: Precedence. (line 96) +* percent sign (%), %= operator: Assignment Ops. (line 129) +* period (.): Regexp Operators. (line 43) +* PERL: Future Extensions. (line 6) +* Peters, Arno: Contributors. (line 74) +* Peterson, Hal: Contributors. (line 40) +* pgawk program: Profiling. (line 6) +* pgawk program, awkprof.out file: Profiling. (line 10) +* pgawk program, dynamic profiling: Profiling. (line 177) +* pipes, closing: Close Files And Pipes. + (line 6) +* pipes, input: Getline/Pipe. (line 6) +* pipes, output: Redirection. (line 54) +* plus sign (+): Regexp Operators. (line 101) +* plus sign (+), + operator: Precedence. (line 52) +* plus sign (+), ++ operator <1>: Precedence. (line 46) +* plus sign (+), ++ operator: Increment Ops. (line 40) +* plus sign (+), += operator <1>: Precedence. (line 96) +* plus sign (+), += operator: Assignment Ops. (line 82) +* plus sign (+), decrement/increment operators: Increment Ops. + (line 11) +* portability: Escape Sequences. (line 94) +* portability, #! (executable scripts): Executable Scripts. (line 34) +* portability, ** operator and: Arithmetic Ops. (line 81) +* portability, **= operator and: Assignment Ops. (line 142) +* portability, ARGV variable: Executable Scripts. (line 43) +* portability, backslash continuation and: Statements/Lines. (line 30) +* portability, backslash in escape sequences: Escape Sequences. + (line 113) +* portability, close function and: Close Files And Pipes. + (line 81) +* portability, data files as single record: Records. (line 170) +* portability, deleting array elements: Delete. (line 51) +* portability, example programs: Library Functions. (line 31) +* portability, fflush function and: I/O Functions. (line 29) +* portability, functions, defining: Definition Syntax. (line 88) +* portability, gawk: New Ports. (line 6) +* portability, gettext library and: Explaining gettext. (line 10) +* portability, internationalization and: I18N Portability. (line 6) +* portability, length function: String Functions. (line 80) +* portability, new awk vs. old awk: Conversion. (line 54) +* portability, next statement in user-defined functions: Function Caveats. + (line 99) +* portability, NF variable, decrementing: Changing Fields. (line 115) +* portability, operators: Increment Ops. (line 61) +* portability, operators, not in POSIX awk: Precedence. (line 100) +* portability, POSIXLY_CORRECT environment variable: Options. (line 300) +* portability, substr function: String Functions. (line 443) +* portable object files <1>: Translator i18n. (line 6) +* portable object files: Explaining gettext. (line 36) +* portable object files, converting to message object files: I18N Example. + (line 62) +* portable object files, generating: Options. (line 130) +* portal files: Portal Files. (line 6) +* porting gawk: New Ports. (line 6) +* positional specifiers, printf statement <1>: Printf Ordering. + (line 6) +* positional specifiers, printf statement: Format Modifiers. (line 13) +* positional specifiers, printf statement, mixing with regular formats: Printf Ordering. + (line 57) +* positive zero: Unexpected Results. (line 28) +* POSIX awk <1>: Assignment Ops. (line 136) +* POSIX awk: This Manual. (line 13) +* POSIX awk, **= operator and: Assignment Ops. (line 142) +* POSIX awk, < operator and: Getline/File. (line 26) +* POSIX awk, arithmetic operators and: Arithmetic Ops. (line 36) +* POSIX awk, backslashes in string constants: Escape Sequences. + (line 113) +* POSIX awk, BEGIN/END patterns: I/O And BEGIN/END. (line 16) +* POSIX awk, break statement and: Break Statement. (line 47) +* POSIX awk, changes in awk versions: POSIX. (line 6) +* POSIX awk, character lists and: Character Lists. (line 24) +* POSIX awk, character lists and, character classes: Character Lists. + (line 30) +* POSIX awk, continue statement and: Continue Statement. (line 43) +* POSIX awk, CONVFMT variable and: User-modified. (line 26) +* POSIX awk, date utility and: Time Functions. (line 259) +* POSIX awk, field separators and <1>: Field Splitting Summary. + (line 41) +* POSIX awk, field separators and: Fields. (line 6) +* POSIX awk, FS variable and: User-modified. (line 52) +* POSIX awk, function keyword in: Definition Syntax. (line 73) +* POSIX awk, functions and, gsub/sub: Gory Details. (line 53) +* POSIX awk, functions and, length: String Functions. (line 80) +* POSIX awk, GNU long options and: Options. (line 15) +* POSIX awk, interval expressions in: Regexp Operators. (line 134) +* POSIX awk, next/nextfile statements and: Next Statement. (line 39) +* POSIX awk, numeric strings and: Variable Typing. (line 6) +* POSIX awk, OFMT variable and <1>: Conversion. (line 54) +* POSIX awk, OFMT variable and: OFMT. (line 27) +* POSIX awk, period (.), using: Regexp Operators. (line 50) +* POSIX awk, printf format strings and: Format Modifiers. (line 159) +* POSIX awk, regular expressions and: Regexp Operators. (line 154) +* POSIX awk, timestamps and: Time Functions. (line 6) +* POSIX awk, | I/O operator and: Getline/Pipe. (line 52) +* POSIX mode: Options. (line 176) +* POSIX, awk and: Preface. (line 22) +* POSIX, gawk extensions not included in: POSIX/GNU. (line 6) +* POSIX, programs, implementing in awk: Clones. (line 6) +* POSIXLY_CORRECT environment variable: Options. (line 282) +* precedence <1>: Precedence. (line 6) +* precedence: Increment Ops. (line 61) +* precedence, regexp operators: Regexp Operators. (line 149) +* print statement: Printing. (line 16) +* print statement, BEGIN/END patterns and: I/O And BEGIN/END. (line 16) +* print statement, commas, omitting: Print Examples. (line 31) +* print statement, I/O operators in: Precedence. (line 72) +* print statement, line continuations and: Print Examples. (line 76) +* print statement, OFMT variable and: User-modified. (line 109) +* print statement, See Also redirection, of output: Redirection. + (line 14) +* print statement, sprintf function and: Round Function. (line 6) +* printf statement <1>: Printf. (line 6) +* printf statement: Printing. (line 16) +* printf statement, columns, aligning: Print Examples. (line 70) +* printf statement, format-control characters: Control Letters. + (line 6) +* printf statement, I/O operators in: Precedence. (line 72) +* printf statement, modifiers: Format Modifiers. (line 6) +* printf statement, positional specifiers <1>: Printf Ordering. + (line 6) +* printf statement, positional specifiers: Format Modifiers. (line 13) +* printf statement, positional specifiers, mixing with regular formats: Printf Ordering. + (line 57) +* printf statement, See Also redirection, of output: Redirection. + (line 14) +* printf statement, sprintf function and: Round Function. (line 6) +* printf statement, syntax of: Basic Printf. (line 6) +* printing: Printing. (line 6) +* printing, list of options: Options. (line 139) +* printing, mailing labels: Labels Program. (line 6) +* printing, unduplicated lines of text: Uniq Program. (line 6) +* printing, user information: Id Program. (line 6) +* private variables: Library Names. (line 11) +* process information, files for: Special Process. (line 6) +* processes, two-way communications with: Two-way I/O. (line 23) +* processing data: Basic High Level. (line 6) +* PROCINFO array <1>: Group Functions. (line 6) +* PROCINFO array <2>: Passwd Functions. (line 6) +* PROCINFO array <3>: Auto-set. (line 119) +* PROCINFO array: Special Caveats. (line 12) +* PROCINFO variable: Internals. (line 165) +* profiling awk programs: Profiling. (line 6) +* profiling awk programs, dynamically: Profiling. (line 177) +* profiling gawk, See pgawk program: Profiling. (line 6) +* program, definition of: Getting Started. (line 21) +* programmers, attractiveness of: Two-way I/O. (line 6) +* programming conventions, --non-decimal-data option: Nondecimal Data. + (line 36) +* programming conventions, ARGC/ARGV variables: Auto-set. (line 31) +* programming conventions, exit statement: Exit Statement. (line 36) +* programming conventions, function parameters: Return Statement. + (line 39) +* programming conventions, functions, calling: Calling Built-in. + (line 10) +* programming conventions, functions, writing: Definition Syntax. + (line 50) +* programming conventions, gawk internals: Internal File Ops. (line 33) +* programming conventions, nextfile statement: Nextfile Function. + (line 20) +* programming conventions, private variable names: Library Names. + (line 23) +* programming language, recipe for: History. (line 6) +* programming languages, data-driven vs. procedural: Getting Started. + (line 12) +* programming, basic steps: Basic High Level. (line 19) +* programming, concepts: Basic Concepts. (line 6) +* pwcat program: Passwd Functions. (line 23) +* question mark (?) <1>: GNU Regexp Operators. + (line 51) +* question mark (?): Regexp Operators. (line 110) +* question mark (?), ?: operator: Precedence. (line 93) +* QUIT signal (MS-DOS): Profiling. (line 210) +* quoting <1>: Comments. (line 27) +* quoting <2>: Long. (line 26) +* quoting: Read Terminal. (line 25) +* quoting, rules for: Quoting. (line 6) +* quoting, tricks for: Quoting. (line 67) +* Rakitzis, Byron: History Sorting. (line 25) +* rand function: Numeric Functions. (line 40) +* random numbers, Cliff: Cliff Random Function. + (line 6) +* random numbers, rand/srand functions: Numeric Functions. (line 40) +* random numbers, seed of: Numeric Functions. (line 70) +* range expressions: Character Lists. (line 6) +* range patterns: Ranges. (line 6) +* Rankin, Pat <1>: Bugs. (line 64) +* Rankin, Pat <2>: Contributors. (line 35) +* Rankin, Pat <3>: Assignment Ops. (line 100) +* Rankin, Pat: Acknowledgments. (line 53) +* raw sockets: TCP/IP Networking. (line 30) +* readable data files, checking: File Checking. (line 6) +* readable.awk program: File Checking. (line 11) +* recipe for a programming language: History. (line 6) +* record separators <1>: User-modified. (line 119) +* record separators: Records. (line 14) +* record separators, changing: Records. (line 81) +* record separators, regular expressions as: Records. (line 112) +* record separators, with multiline records: Multiple Line. (line 10) +* records <1>: Basic High Level. (line 71) +* records: Reading Files. (line 14) +* records, multiline: Multiple Line. (line 6) +* records, printing: Print. (line 22) +* records, splitting input into: Records. (line 6) +* records, terminating: Records. (line 112) +* records, treating files as: Records. (line 191) +* recursive functions: Definition Syntax. (line 68) +* redirection of input: Getline/File. (line 6) +* redirection of output: Redirection. (line 6) +* reference counting, sorting arrays: Array Sorting. (line 79) +* regexp constants <1>: Comparison Operators. + (line 102) +* regexp constants <2>: Regexp Constants. (line 6) +* regexp constants: Regexp Usage. (line 58) +* regexp constants, /=.../, /= operator and: Assignment Ops. (line 148) +* regexp constants, as patterns: Expression Patterns. (line 36) +* regexp constants, in gawk: Using Constant Regexps. + (line 28) +* regexp constants, slashes vs. quotes: Computed Regexps. (line 28) +* regexp constants, vs. string constants: Computed Regexps. (line 38) +* regexp, See regular expressions: Regexp. (line 6) +* register_deferred_variable internal function: Internals. (line 165) +* register_open_hook internal function: Internals. (line 178) +* regular expressions: Regexp. (line 6) +* regular expressions as field separators: Field Separators. (line 49) +* regular expressions, anchors in: Regexp Operators. (line 22) +* regular expressions, as field separators: Regexp Field Splitting. + (line 6) +* regular expressions, as patterns <1>: Regexp Patterns. (line 6) +* regular expressions, as patterns: Regexp Usage. (line 6) +* regular expressions, as record separators: Records. (line 112) +* regular expressions, case sensitivity <1>: User-modified. (line 68) +* regular expressions, case sensitivity: Case-sensitivity. (line 6) +* regular expressions, computed: Computed Regexps. (line 6) +* regular expressions, constants, See regexp constants: Regexp Usage. + (line 58) +* regular expressions, dynamic: Computed Regexps. (line 6) +* regular expressions, dynamic, with embedded newlines: Computed Regexps. + (line 59) +* regular expressions, gawk, command-line options: GNU Regexp Operators. + (line 62) +* regular expressions, interval expressions and: Options. (line 224) +* regular expressions, leftmost longest match: Leftmost Longest. + (line 6) +* regular expressions, operators <1>: Regexp Operators. (line 6) +* regular expressions, operators: Regexp Usage. (line 19) +* regular expressions, operators, for buffers: GNU Regexp Operators. + (line 40) +* regular expressions, operators, for words: GNU Regexp Operators. + (line 6) +* regular expressions, operators, gawk: GNU Regexp Operators. + (line 6) +* regular expressions, operators, precedence of: Regexp Operators. + (line 149) +* regular expressions, searching for: Egrep Program. (line 6) +* relational operators, See comparison operators: Typing and Comparison. + (line 9) +* return statement, user-defined functions: Return Statement. (line 6) +* return values, close function: Close Files And Pipes. + (line 130) +* rev user-defined function: Function Example. (line 52) +* rewind user-defined function: Rewind Function. (line 16) +* right angle bracket (>), > operator <1>: Precedence. (line 65) +* right angle bracket (>), > operator: Comparison Operators. + (line 11) +* right angle bracket (>), > operator (I/O): Redirection. (line 19) +* right angle bracket (>), >= operator <1>: Precedence. (line 65) +* right angle bracket (>), >= operator: Comparison Operators. + (line 11) +* right angle bracket (>), >> operator (I/O) <1>: Precedence. (line 65) +* right angle bracket (>), >> operator (I/O): Redirection. (line 47) +* right shift, bitwise: Bitwise Functions. (line 32) +* Ritchie, Dennis: Basic Data Typing. (line 71) +* RLENGTH variable: Auto-set. (line 163) +* RLENGTH variable, match function and: String Functions. (line 115) +* Robbins, Arnold <1>: Future Extensions. (line 6) +* Robbins, Arnold <2>: Bugs. (line 29) +* Robbins, Arnold <3>: Contributors. (line 92) +* Robbins, Arnold <4>: Alarm Program. (line 6) +* Robbins, Arnold <5>: Passwd Functions. (line 76) +* Robbins, Arnold <6>: Getline/Pipe. (line 36) +* Robbins, Arnold: Command Line Field Separator. + (line 80) +* Robbins, Bill: Getline/Pipe. (line 36) +* Robbins, Harry: Acknowledgments. (line 70) +* Robbins, Jean: Acknowledgments. (line 70) +* Robbins, Miriam <1>: Passwd Functions. (line 76) +* Robbins, Miriam <2>: Getline/Pipe. (line 36) +* Robbins, Miriam: Acknowledgments. (line 70) +* Robinson, Will: Dynamic Extensions. (line 6) +* robot, the: Dynamic Extensions. (line 6) +* Rommel, Kai Uwe <1>: Contributors. (line 42) +* Rommel, Kai Uwe: Acknowledgments. (line 53) +* round user-defined function: Round Function. (line 16) +* rounding: Round Function. (line 6) +* rounding numbers: Round Function. (line 6) +* RS variable <1>: User-modified. (line 119) +* RS variable: Records. (line 20) +* RS variable, multiline records and: Multiple Line. (line 17) +* rshift function (gawk): Bitwise Functions. (line 46) +* RSTART variable: Auto-set. (line 169) +* RSTART variable, match function and: String Functions. (line 115) +* RT variable <1>: Auto-set. (line 176) +* RT variable <2>: Multiple Line. (line 129) +* RT variable: Records. (line 112) +* Rubin, Paul <1>: Contributors. (line 16) +* Rubin, Paul: History. (line 30) +* rule, definition of: Getting Started. (line 21) +* rvalues/lvalues: Assignment Ops. (line 32) +* scalar values: Basic Data Typing. (line 13) +* Schreiber, Bert: Acknowledgments. (line 35) +* Schreiber, Rita: Acknowledgments. (line 35) +* search paths <1>: VMS Running. (line 28) +* search paths: PC Using. (line 11) +* search paths, for source files <1>: VMS Running. (line 28) +* search paths, for source files <2>: Igawk Program. (line 358) +* search paths, for source files: AWKPATH Variable. (line 6) +* searching: String Functions. (line 60) +* searching, files for regular expressions: Egrep Program. (line 6) +* searching, for words: Dupword Program. (line 6) +* sed utility <1>: Glossary. (line 12) +* sed utility <2>: Simple Sed. (line 6) +* sed utility: Field Splitting Summary. + (line 47) +* semicolon (;): Statements/Lines. (line 90) +* semicolon (;), AWKPATH variable and: PC Using. (line 11) +* semicolon (;), separating statements in actions <1>: Statements. + (line 10) +* semicolon (;), separating statements in actions: Action Overview. + (line 19) +* separators, field: User-modified. (line 43) +* separators, field, FIELDWIDTHS variable and: User-modified. (line 33) +* separators, field, POSIX and: Fields. (line 6) +* separators, for records: Records. (line 14) +* separators, for records, regular expressions as: Records. (line 112) +* separators, for statements in actions: Action Overview. (line 19) +* separators, record: User-modified. (line 119) +* separators, subscript: User-modified. (line 132) +* set_value internal function: Internals. (line 146) +* shells, piping commands into: Redirection. (line 140) +* shells, quoting: Using Shell Variables. + (line 12) +* shells, quoting, rules for: Quoting. (line 14) +* shells, scripts: One-shot. (line 22) +* shells, variables: Using Shell Variables. + (line 6) +* shift, bitwise: Bitwise Functions. (line 32) +* short-circuit operators: Boolean Ops. (line 57) +* side effects <1>: Increment Ops. (line 11) +* side effects: Concatenation. (line 42) +* side effects, array indexing: Reference to Elements. + (line 30) +* side effects, asort function: Array Sorting. (line 25) +* side effects, assignment expressions: Assignment Ops. (line 23) +* side effects, Boolean operators: Boolean Ops. (line 30) +* side effects, conditional expressions: Conditional Exp. (line 22) +* side effects, decrement/increment operators: Increment Ops. (line 11) +* side effects, FILENAME variable: Getline Notes. (line 19) +* side effects, function calls: Function Calls. (line 49) +* side effects, statements: Action Overview. (line 32) +* signals, HUP/SIGHUP: Profiling. (line 207) +* signals, INT/SIGINT (MS-DOS): Profiling. (line 210) +* signals, QUIT/SIGQUIT (MS-DOS): Profiling. (line 210) +* signals, USR1/SIGUSR1: Profiling. (line 185) +* sin function: Numeric Functions. (line 31) +* single quote (') <1>: Quoting. (line 27) +* single quote (') <2>: Long. (line 33) +* single quote ('): One-shot. (line 15) +* single quote ('), vs. apostrophe: Comments. (line 27) +* single quote ('), with double quotes: Quoting. (line 49) +* single-character fields: Single Character Fields. + (line 6) +* single-precision floating-point: Basic Data Typing. (line 33) +* Skywalker, Luke: Undocumented. (line 6) +* sleep utility: Alarm Program. (line 102) +* sockets: TCP/IP Networking. (line 30) +* Solaris, POSIX compliant awk: Other Versions. (line 96) +* sort function, arrays, sorting: Array Sorting. (line 6) +* sort utility: Word Sorting. (line 54) +* sort utility, coprocesses and: Two-way I/O. (line 84) +* sorting characters in different languages: Explaining gettext. + (line 89) +* source code, awka: Other Versions. (line 76) +* source code, Bell Laboratories awk: Other Versions. (line 13) +* source code, gawk: Gawk Distribution. (line 6) +* source code, mawk: Other Versions. (line 33) +* source code, mixing: Options. (line 231) +* source files, search path for: Igawk Program. (line 358) +* sparse arrays: Array Intro. (line 66) +* Spencer, Henry: Glossary. (line 12) +* split function: String Functions. (line 186) +* split function, array elements, deleting: Delete. (line 56) +* split utility: Split Program. (line 6) +* split.awk program: Split Program. (line 30) +* sprintf function <1>: String Functions. (line 239) +* sprintf function: OFMT. (line 15) +* sprintf function, OFMT variable and: User-modified. (line 109) +* sprintf function, print/printf statements and: Round Function. + (line 6) +* sqrt function: Numeric Functions. (line 18) +* square brackets ([]): Regexp Operators. (line 55) +* srand function: Numeric Functions. (line 80) +* Stallman, Richard <1>: Glossary. (line 284) +* Stallman, Richard <2>: Contributors. (line 24) +* Stallman, Richard <3>: Acknowledgments. (line 18) +* Stallman, Richard: Manual History. (line 6) +* standard input <1>: Special FD. (line 6) +* standard input: Read Terminal. (line 6) +* standard output: Special FD. (line 6) +* stat function, implementing in gawk: Sample Library. (line 6) +* statements, compound, control statements and: Statements. (line 10) +* statements, control, in actions: Statements. (line 6) +* statements, multiple: Statements/Lines. (line 90) +* stlen internal variable: Internals. (line 50) +* stptr internal variable: Internals. (line 50) +* stream editors <1>: Simple Sed. (line 6) +* stream editors: Field Splitting Summary. + (line 47) +* strftime function (gawk): Time Functions. (line 53) +* string constants: Scalar Constants. (line 15) +* string constants, vs. regexp constants: Computed Regexps. (line 38) +* string extraction (internationalization): String Extraction. + (line 6) +* string operators: Concatenation. (line 9) +* string-matching operators: Regexp Usage. (line 19) +* strings: Internals. (line 77) +* strings, converting: Conversion. (line 6) +* strings, converting, numbers to <1>: Bitwise Functions. (line 99) +* strings, converting, numbers to: User-modified. (line 26) +* strings, empty, See null strings: Records. (line 102) +* strings, extracting: String Extraction. (line 6) +* strings, for localization: Programmer i18n. (line 14) +* strings, length of: Scalar Constants. (line 20) +* strings, merging arrays into: Join Function. (line 6) +* strings, NODE internal type: Internals. (line 23) +* strings, null: Regexp Field Splitting. + (line 43) +* strings, numeric: Variable Typing. (line 6) +* strings, splitting: String Functions. (line 200) +* strtonum function (gawk): String Functions. (line 247) +* strtonum function (gawk), --non-decimal-data option and: Nondecimal Data. + (line 36) +* sub function <1>: String Functions. (line 268) +* sub function: Using Constant Regexps. + (line 44) +* sub function, arguments of: String Functions. (line 325) +* sub function, escape processing: Gory Details. (line 6) +* subscript separators: User-modified. (line 132) +* subscripts in arrays, multidimensional: Multi-dimensional. (line 6) +* subscripts in arrays, multidimensional, scanning: Multi-scanning. + (line 11) +* subscripts in arrays, numbers as: Numeric Array Subscripts. + (line 6) +* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts. + (line 6) +* SUBSEP variable: User-modified. (line 132) +* SUBSEP variable, multidimensional arrays: Multi-dimensional. + (line 12) +* substr function: String Functions. (line 412) +* Sumner, Andrew: Other Versions. (line 76) +* switch statement: Switch Statement. (line 6) +* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. + (line 148) +* system function: I/O Functions. (line 63) +* systime function (gawk): Time Functions. (line 24) +* tandem: Tandem Installation. (line 6) +* Tcl: Library Names. (line 57) +* TCP/IP: TCP/IP Networking. (line 6) +* TCP/IP, support for: Special Network. (line 6) +* tee utility: Tee Program. (line 6) +* tee.awk program: Tee Program. (line 26) +* terminating records: Records. (line 112) +* testbits.awk program: Bitwise Functions. (line 60) +* Texinfo <1>: Adding Code. (line 99) +* Texinfo <2>: Distribution contents. + (line 68) +* Texinfo <3>: Extract Program. (line 12) +* Texinfo <4>: Dupword Program. (line 17) +* Texinfo <5>: Library Functions. (line 22) +* Texinfo <6>: Sample Data Files. (line 66) +* Texinfo: Conventions. (line 6) +* Texinfo, chapter beginnings in files: Regexp Operators. (line 22) +* Texinfo, extracting programs from source files: Extract Program. + (line 6) +* text, printing: Print. (line 22) +* text, printing, unduplicated lines of: Uniq Program. (line 6) +* textdomain function (C library): Explaining gettext. (line 27) +* TEXTDOMAIN variable <1>: Programmer i18n. (line 9) +* TEXTDOMAIN variable: User-modified. (line 138) +* TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 58) +* TEXTDOMAIN variable, portability and: I18N Portability. (line 20) +* tilde (~), ~ operator <1>: Expression Patterns. (line 24) +* tilde (~), ~ operator <2>: Precedence. (line 81) +* tilde (~), ~ operator <3>: Comparison Operators. + (line 11) +* tilde (~), ~ operator <4>: Regexp Constants. (line 6) +* tilde (~), ~ operator <5>: Computed Regexps. (line 6) +* tilde (~), ~ operator <6>: Case-sensitivity. (line 26) +* tilde (~), ~ operator: Regexp Usage. (line 19) +* time, alarm clock example program: Alarm Program. (line 9) +* time, localization and: Explaining gettext. (line 111) +* time, managing: Gettimeofday Function. + (line 6) +* time, retrieving: Time Functions. (line 17) +* timestamps: Time Functions. (line 6) +* timestamps, converting dates to: Time Functions. (line 72) +* timestamps, formatted: Gettimeofday Function. + (line 6) +* tmp_number internal function: Internals. (line 92) +* tmp_string internal function: Internals. (line 87) +* tolower function: String Functions. (line 454) +* toupper function: String Functions. (line 460) +* tr utility: Translate Program. (line 6) +* translate.awk program: Translate Program. (line 55) +* troubleshooting, --non-decimal-data option: Options. (line 171) +* troubleshooting, -F option: Known Bugs. (line 6) +* troubleshooting, == operator: Comparison Operators. + (line 37) +* troubleshooting, awk uses FS not IFS: Field Separators. (line 28) +* troubleshooting, backslash before nonspecial character: Escape Sequences. + (line 113) +* troubleshooting, division: Arithmetic Ops. (line 44) +* troubleshooting, fatal errors, field widths, specifying: Constant Size. + (line 22) +* troubleshooting, fatal errors, printf format strings: Format Modifiers. + (line 159) +* troubleshooting, fflush function: I/O Functions. (line 51) +* troubleshooting, function call syntax: Function Calls. (line 28) +* troubleshooting, gawk <1>: Compatibility Mode. (line 6) +* troubleshooting, gawk: Known Bugs. (line 6) +* troubleshooting, gawk, bug reports: Bugs. (line 9) +* troubleshooting, gawk, fatal errors, function arguments: Calling Built-in. + (line 16) +* troubleshooting, getline function: File Checking. (line 24) +* troubleshooting, gsub/sub functions: String Functions. (line 335) +* troubleshooting, match function: String Functions. (line 181) +* troubleshooting, print statement, omitting commas: Print Examples. + (line 31) +* troubleshooting, printing: Redirection. (line 115) +* troubleshooting, quotes with file names: Special FD. (line 63) +* troubleshooting, readable data files: File Checking. (line 6) +* troubleshooting, regexp constants vs. string constants: Computed Regexps. + (line 38) +* troubleshooting, string concatenation: Concatenation. (line 27) +* troubleshooting, substr function: String Functions. (line 430) +* troubleshooting, system function: I/O Functions. (line 87) +* troubleshooting, typographical errors, global variables: Options. + (line 101) +* true, logical: Truth Values. (line 6) +* Trueman, David <1>: Contributors. (line 31) +* Trueman, David <2>: Acknowledgments. (line 44) +* Trueman, David: History. (line 30) +* trunc-mod operation: Arithmetic Ops. (line 66) +* truth values: Truth Values. (line 6) +* type conversion: Conversion. (line 21) +* type internal variable: Internals. (line 58) +* undefined functions: Function Caveats. (line 79) +* underscore (_), _ C macro: Explaining gettext. (line 68) +* underscore (_), in names of private variables: Library Names. + (line 29) +* underscore (_), translatable string: Programmer i18n. (line 67) +* undocumented features: Undocumented. (line 6) +* uninitialized variables, as array subscripts: Uninitialized Subscripts. + (line 6) +* uniq utility: Uniq Program. (line 6) +* uniq.awk program: Uniq Program. (line 65) +* Unix: Glossary. (line 582) +* Unix awk, backslashes in escape sequences: Escape Sequences. + (line 125) +* Unix awk, close function and: Close Files And Pipes. + (line 130) +* Unix awk, password files, field separators and: Command Line Field Separator. + (line 72) +* Unix, awk scripts and: Executable Scripts. (line 6) +* unsigned integers: Basic Data Typing. (line 28) +* update_ERRNO internal function: Internals. (line 152) +* update_ERRNO_saved internal function: Internals. (line 157) +* user database, reading: Passwd Functions. (line 6) +* user-defined, functions: User-defined. (line 6) +* user-defined, functions, counts: Profiling. (line 135) +* user-defined, variables: Variables. (line 6) +* user-modifiable variables: User-modified. (line 6) +* users, information about, printing: Id Program. (line 6) +* users, information about, retrieving: Passwd Functions. (line 16) +* USR1 signal: Profiling. (line 185) +* values, numeric: Basic Data Typing. (line 13) +* values, string: Basic Data Typing. (line 13) +* variable typing: Typing and Comparison. + (line 9) +* variables <1>: Basic Data Typing. (line 6) +* variables: Other Features. (line 6) +* variables, assigning on command line: Assignment Options. (line 6) +* variables, built-in <1>: Built-in Variables. (line 6) +* variables, built-in: Using Variables. (line 17) +* variables, built-in, -v option, setting with: Options. (line 38) +* variables, built-in, conveying information: Auto-set. (line 6) +* variables, flag: Boolean Ops. (line 67) +* variables, getline command into, using <1>: Getline/Variable/Coprocess. + (line 6) +* variables, getline command into, using <2>: Getline/Variable/Pipe. + (line 6) +* variables, getline command into, using <3>: Getline/Variable/File. + (line 6) +* variables, getline command into, using: Getline/Variable. (line 6) +* variables, global, for library functions: Library Names. (line 11) +* variables, global, printing list of: Options. (line 95) +* variables, initializing: Using Variables. (line 17) +* variables, names of: Arrays. (line 17) +* variables, private: Library Names. (line 11) +* variables, setting: Options. (line 30) +* variables, shadowing: Definition Syntax. (line 56) +* variables, types of: Assignment Ops. (line 40) +* variables, types of, comparison expressions and: Typing and Comparison. + (line 9) +* variables, uninitialized, as array subscripts: Uninitialized Subscripts. + (line 6) +* variables, user-defined: Variables. (line 6) +* vertical bar (|): Regexp Operators. (line 68) +* vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) +* vertical bar (|), | operator (I/O): Getline/Pipe. (line 6) +* vertical bar (|), |& I/O operator (I/O): Two-way I/O. (line 44) +* vertical bar (|), |& operator (I/O) <1>: Precedence. (line 65) +* vertical bar (|), |& operator (I/O): Getline/Coprocess. (line 6) +* vertical bar (|), |& operator (I/O), two-way communications: Portal Files. + (line 10) +* vertical bar (|), || operator <1>: Precedence. (line 90) +* vertical bar (|), || operator: Boolean Ops. (line 57) +* vname internal variable: Internals. (line 62) +* w utility: Constant Size. (line 22) +* Wall, Larry: Future Extensions. (line 6) +* warnings, issuing: Options. (line 144) +* wc utility: Wc Program. (line 6) +* wc.awk program: Wc Program. (line 45) +* Weinberger, Peter <1>: Contributors. (line 12) +* Weinberger, Peter: History. (line 17) +* while statement <1>: While Statement. (line 6) +* while statement: Regexp Usage. (line 19) +* whitespace, as field separators: Field Separators. (line 63) +* whitespace, functions, calling: Calling Built-in. (line 10) +* whitespace, newlines as: Options. (line 183) +* Williams, Kent: Contributors. (line 37) +* Woods, John: Contributors. (line 28) +* word boundaries, matching: GNU Regexp Operators. + (line 30) +* word, regexp definition of: GNU Regexp Operators. + (line 6) +* word-boundary operator (gawk): GNU Regexp Operators. + (line 55) +* wordfreq.awk program: Word Sorting. (line 60) +* words, counting: Wc Program. (line 6) +* words, duplicate, searching for: Dupword Program. (line 6) +* words, usage counts, generating: Word Sorting. (line 6) +* xgettext utility: String Extraction. (line 13) +* XML: Internals. (line 178) +* XOR bitwise operation: Bitwise Functions. (line 6) +* xor function (gawk): Bitwise Functions. (line 41) +* Zaretskii, Eli: Acknowledgments. (line 53) +* zero, negative vs. positive: Unexpected Results. (line 28) +* zerofile.awk program: Empty Files. (line 21) +* Zoulas, Christos: Contributors. (line 61) +* {} (braces), actions and: Action Overview. (line 19) +* {} (braces), pgawk program: Profiling. (line 140) +* {} (braces), statements, grouping: Statements. (line 10) +* | (vertical bar): Regexp Operators. (line 68) +* | (vertical bar), | operator (I/O) <1>: Precedence. (line 65) +* | (vertical bar), | operator (I/O) <2>: Redirection. (line 54) +* | (vertical bar), | operator (I/O): Getline/Pipe. (line 6) +* | (vertical bar), |& operator (I/O) <1>: Two-way I/O. (line 44) +* | (vertical bar), |& operator (I/O) <2>: Precedence. (line 65) +* | (vertical bar), |& operator (I/O) <3>: Redirection. (line 99) +* | (vertical bar), |& operator (I/O): Getline/Coprocess. (line 6) +* | (vertical bar), |& operator (I/O), pipes, closing: Close Files And Pipes. + (line 117) +* | (vertical bar), |& operator (I/O), two-way communications: Portal Files. + (line 10) +* | (vertical bar), || operator <1>: Precedence. (line 90) +* | (vertical bar), || operator: Boolean Ops. (line 57) +* ~ (tilde), ~ operator <1>: Expression Patterns. (line 24) +* ~ (tilde), ~ operator <2>: Precedence. (line 81) +* ~ (tilde), ~ operator <3>: Comparison Operators. + (line 11) +* ~ (tilde), ~ operator <4>: Regexp Constants. (line 6) +* ~ (tilde), ~ operator <5>: Computed Regexps. (line 6) +* ~ (tilde), ~ operator: Case-sensitivity. (line 26) + + + +Tag Table: +Node: Top1336 +Node: Foreword27371 +Node: Preface31692 +Ref: Preface-Footnote-134571 +Node: History34803 +Node: Names37019 +Ref: Names-Footnote-138491 +Node: This Manual38563 +Ref: This Manual-Footnote-143318 +Node: Conventions43418 +Node: Manual History45292 +Ref: Manual History-Footnote-148745 +Ref: Manual History-Footnote-248786 +Node: How To Contribute48860 +Node: Acknowledgments49458 +Node: Getting Started53260 +Node: Running gawk55632 +Node: One-shot56818 +Node: Read Terminal58043 +Ref: Read Terminal-Footnote-159701 +Node: Long59872 +Node: Executable Scripts61248 +Ref: Executable Scripts-Footnote-163144 +Ref: Executable Scripts-Footnote-263295 +Node: Comments63746 +Node: Quoting66114 +Node: Sample Data Files70615 +Node: Very Simple73647 +Node: Two Rules78252 +Node: More Complex80399 +Ref: More Complex-Footnote-183322 +Ref: More Complex-Footnote-283770 +Node: Statements/Lines83853 +Ref: Statements/Lines-Footnote-188235 +Node: Other Features88500 +Node: When89352 +Ref: When-Footnote-191591 +Node: Regexp91676 +Node: Regexp Usage93130 +Node: Escape Sequences95182 +Node: Regexp Operators100921 +Ref: Regexp Operators-Footnote-1108028 +Ref: Regexp Operators-Footnote-2108175 +Node: Character Lists108273 +Ref: table-char-classes110230 +Node: GNU Regexp Operators112855 +Node: Case-sensitivity116499 +Ref: Case-sensitivity-Footnote-1119672 +Node: Leftmost Longest119907 +Node: Computed Regexps121098 +Node: Locales124479 +Node: Reading Files126745 +Node: Records128502 +Ref: Records-Footnote-1137060 +Node: Fields137097 +Ref: Fields-Footnote-1140127 +Node: Nonconstant Fields140213 +Node: Changing Fields142415 +Node: Field Separators147696 +Node: Regexp Field Splitting151187 +Node: Single Character Fields153652 +Node: Command Line Field Separator154703 +Node: Field Splitting Summary158142 +Ref: Field Splitting Summary-Footnote-1161328 +Node: Constant Size161429 +Node: Multiple Line165906 +Ref: Multiple Line-Footnote-1171637 +Node: Getline171816 +Node: Plain Getline173884 +Node: Getline/Variable175901 +Node: Getline/File177042 +Node: Getline/Variable/File178366 +Node: Getline/Pipe179925 +Node: Getline/Variable/Pipe182522 +Node: Getline/Coprocess183629 +Node: Getline/Variable/Coprocess184872 +Node: Getline Notes185586 +Node: Getline Summary187229 +Ref: table-getline-variants187513 +Node: Printing188079 +Node: Print189708 +Node: Print Examples191034 +Node: Output Separators193829 +Node: OFMT195590 +Node: Printf196945 +Node: Basic Printf197864 +Node: Control Letters199399 +Node: Format Modifiers202617 +Node: Printf Examples208635 +Node: Redirection211352 +Node: Special Files218249 +Node: Special FD218883 +Node: Special Process221909 +Node: Special Network224144 +Node: Special Caveats224986 +Ref: Special Caveats-Footnote-1226184 +Node: Close Files And Pipes226567 +Ref: Close Files And Pipes-Footnote-1233488 +Ref: Close Files And Pipes-Footnote-2233636 +Node: Expressions233784 +Node: Constants235973 +Node: Scalar Constants236654 +Ref: Scalar Constants-Footnote-1237509 +Node: Nondecimal-numbers237691 +Node: Regexp Constants240749 +Node: Using Constant Regexps241222 +Node: Variables244305 +Node: Using Variables244961 +Node: Assignment Options246471 +Node: Conversion248348 +Ref: table-locale-affects253780 +Ref: Conversion-Footnote-1254404 +Node: Arithmetic Ops254513 +Node: Concatenation257025 +Ref: Concatenation-Footnote-1259807 +Node: Assignment Ops259898 +Ref: table-assign-ops264876 +Node: Increment Ops266277 +Node: Truth Values269770 +Node: Typing and Comparison270820 +Node: Variable Typing271523 +Ref: Variable Typing-Footnote-1275198 +Node: Comparison Operators275342 +Ref: table-relational-ops275718 +Node: Boolean Ops279267 +Ref: Boolean Ops-Footnote-1283327 +Node: Conditional Exp283418 +Node: Function Calls285155 +Node: Precedence288437 +Node: Patterns and Actions292093 +Node: Pattern Overview293147 +Node: Regexp Patterns294584 +Node: Expression Patterns295127 +Node: Ranges298677 +Node: BEGIN/END301766 +Node: Using BEGIN/END302516 +Ref: Using BEGIN/END-Footnote-1305248 +Node: I/O And BEGIN/END305362 +Node: Empty307629 +Node: Using Shell Variables307937 +Node: Action Overview310218 +Node: Statements312576 +Node: If Statement314432 +Node: While Statement315931 +Node: Do Statement317963 +Node: For Statement319112 +Node: Switch Statement322252 +Node: Break Statement324528 +Node: Continue Statement326585 +Node: Next Statement328489 +Node: Nextfile Statement330769 +Node: Exit Statement333366 +Node: Built-in Variables335437 +Node: User-modified336532 +Ref: User-modified-Footnote-1343775 +Node: Auto-set343837 +Ref: Auto-set-Footnote-1352177 +Node: ARGC and ARGV352382 +Node: Arrays356094 +Node: Array Intro358002 +Node: Reference to Elements362199 +Node: Assigning Elements364066 +Node: Array Example364533 +Node: Scanning an Array366255 +Node: Delete368522 +Ref: Delete-Footnote-1370904 +Node: Numeric Array Subscripts370961 +Node: Uninitialized Subscripts373148 +Node: Multi-dimensional374754 +Node: Multi-scanning377767 +Node: Array Sorting379382 +Node: Functions383045 +Node: Built-in383780 +Node: Calling Built-in384750 +Node: Numeric Functions386717 +Ref: Numeric Functions-Footnote-1390459 +Ref: Numeric Functions-Footnote-2390785 +Node: String Functions391054 +Ref: String Functions-Footnote-1410916 +Ref: String Functions-Footnote-2411045 +Ref: String Functions-Footnote-3411293 +Node: Gory Details411380 +Ref: table-sub-escapes413015 +Ref: table-sub-posix-92414350 +Ref: table-sub-proposed415689 +Ref: table-posix-2001-sub417041 +Ref: table-gensub-escapes418378 +Ref: Gory Details-Footnote-1419564 +Node: I/O Functions419615 +Ref: I/O Functions-Footnote-1426189 +Node: Time Functions426280 +Ref: Time Functions-Footnote-1437072 +Ref: Time Functions-Footnote-2437140 +Ref: Time Functions-Footnote-3437298 +Ref: Time Functions-Footnote-4437409 +Ref: Time Functions-Footnote-5437534 +Ref: Time Functions-Footnote-6437761 +Node: Bitwise Functions438023 +Ref: table-bitwise-ops438601 +Ref: Bitwise Functions-Footnote-1442835 +Node: I18N Functions443019 +Node: User-defined444740 +Node: Definition Syntax445521 +Node: Function Example449880 +Node: Function Caveats452460 +Node: Return Statement456385 +Node: Dynamic Typing459042 +Node: Internationalization459779 +Node: I18N and L10N461198 +Node: Explaining gettext461882 +Ref: Explaining gettext-Footnote-1466789 +Ref: Explaining gettext-Footnote-2467028 +Node: Programmer i18n467197 +Node: Translator i18n471420 +Node: String Extraction472210 +Ref: String Extraction-Footnote-1473160 +Node: Printf Ordering473286 +Ref: Printf Ordering-Footnote-1476064 +Node: I18N Portability476128 +Ref: I18N Portability-Footnote-1478556 +Node: I18N Example478619 +Ref: I18N Example-Footnote-1481231 +Node: Gawk I18N481303 +Node: Advanced Features481885 +Node: Nondecimal Data483284 +Node: Two-way I/O484843 +Ref: Two-way I/O-Footnote-1490324 +Node: TCP/IP Networking490401 +Node: Portal Files492830 +Node: Profiling493474 +Node: Invoking Gawk500930 +Node: Command Line502110 +Node: Options502895 +Ref: Options-Footnote-1515735 +Node: Other Arguments515760 +Node: AWKPATH Variable518441 +Ref: AWKPATH Variable-Footnote-1521213 +Node: Obsolete521473 +Node: Undocumented522473 +Node: Known Bugs522735 +Node: Library Functions523337 +Ref: Library Functions-Footnote-1526318 +Node: Library Names526489 +Ref: Library Names-Footnote-1529962 +Ref: Library Names-Footnote-2530181 +Node: General Functions530267 +Node: Nextfile Function531326 +Node: Strtonum Function535690 +Node: Assert Function538625 +Node: Round Function541929 +Node: Cliff Random Function543436 +Ref: Cliff Random Function-Footnote-1544425 +Node: Ordinal Functions544496 +Ref: Ordinal Functions-Footnote-1547556 +Node: Join Function547772 +Ref: Join Function-Footnote-1549532 +Node: Gettimeofday Function549732 +Node: Data File Management553435 +Node: Filetrans Function554067 +Node: Rewind Function557493 +Node: File Checking558939 +Node: Empty Files559991 +Node: Ignoring Assigns562216 +Node: Getopt Function563764 +Ref: Getopt Function-Footnote-1575042 +Node: Passwd Functions575243 +Ref: Passwd Functions-Footnote-1583904 +Node: Group Functions583992 +Node: Sample Programs591990 +Node: Running Examples592667 +Node: Clones593395 +Node: Cut Program594527 +Node: Egrep Program604284 +Ref: Egrep Program-Footnote-1612034 +Node: Id Program612144 +Node: Split Program615751 +Node: Tee Program619215 +Node: Uniq Program621892 +Node: Wc Program629260 +Ref: Wc Program-Footnote-1633504 +Node: Miscellaneous Programs633700 +Node: Dupword Program634696 +Node: Alarm Program636727 +Node: Translate Program641267 +Ref: Translate Program-Footnote-1645513 +Ref: Translate Program-Footnote-2645750 +Node: Labels Program645884 +Ref: Labels Program-Footnote-1649175 +Node: Word Sorting649259 +Node: History Sorting653542 +Node: Extract Program655380 +Node: Simple Sed662732 +Node: Igawk Program665787 +Ref: Igawk Program-Footnote-1680492 +Ref: Igawk Program-Footnote-2680693 +Node: Language History680831 +Node: V7/SVR3.1682215 +Node: SVR4684479 +Node: POSIX685918 +Node: BTL687526 +Node: POSIX/GNU689051 +Node: Contributors696885 +Node: Installation700421 +Node: Gawk Distribution701392 +Node: Getting701876 +Node: Extracting703110 +Node: Distribution contents704498 +Node: Unix Installation709579 +Node: Quick Installation710170 +Node: Additional Configuration Options711872 +Node: Configuration Philosophy713734 +Node: Non-Unix Installation716098 +Node: Amiga Installation716685 +Node: BeOS Installation717781 +Node: PC Installation718934 +Node: PC Binary Installation720164 +Node: PC Compiling722007 +Node: PC Dynamic726559 +Node: PC Using728920 +Node: Cygwin733533 +Ref: Cygwin-Footnote-1734531 +Node: VMS Installation734563 +Node: VMS Compilation735167 +Node: VMS Installation Details736744 +Node: VMS Running738374 +Node: VMS POSIX739971 +Node: VMS Old Gawk741269 +Node: Unsupported741738 +Node: Atari Installation742141 +Node: Atari Compiling743430 +Node: Atari Using745315 +Node: Tandem Installation748160 +Node: Bugs749840 +Node: Other Versions753145 +Ref: Other Versions-Footnote-1757571 +Ref: Other Versions-Footnote-2757613 +Ref: Other Versions-Footnote-3757650 +Node: Notes757688 +Node: Compatibility Mode758380 +Node: Additions759174 +Node: Adding Code759924 +Node: New Ports765974 +Node: Dynamic Extensions770106 +Node: Internals771363 +Node: Sample Library782366 +Node: Internal File Description783025 +Node: Internal File Ops786718 +Ref: Internal File Ops-Footnote-1792044 +Node: Using Internal File Ops792192 +Node: Future Extensions794215 +Node: Basic Concepts798168 +Node: Basic High Level798925 +Ref: Basic High Level-Footnote-1802957 +Node: Basic Data Typing803151 +Node: Floating Point Issues807588 +Ref: Floating Point Issues-Footnote-1808674 +Node: String Conversion Precision808727 +Ref: String Conversion Precision-Footnote-1810421 +Node: Unexpected Results810530 +Node: POSIX Floating Point Problems812356 +Ref: POSIX Floating Point Problems-Footnote-1815830 +Node: Glossary815868 +Node: Copying839636 +Node: GNU Free Documentation License877193 +Node: Index899595 + +End Tag Table diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawkinet.info b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawkinet.info new file mode 100644 index 0000000..a496f6a --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/doc/gawkinet.info @@ -0,0 +1,4404 @@ +INFO-DIR-SECTION Network applications +START-INFO-DIR-ENTRY +This is gawkinet.info, produced by makeinfo version 4.11 from gawkinet.texi. + +* Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'. +END-INFO-DIR-ENTRY + + This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the +3.1.4 (or later) version of the GNU implementation of AWK. + + + Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "GNU General Public License", the Front-Cover +texts being (a) (see below), and with the Back-Cover Texts being (b) +(see below). A copy of the license is included in the section entitled +"GNU Free Documentation License". + + a. "A GNU Manual" + + b. "You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development." + + This file documents the networking features in GNU `awk'. + + This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the +3.1.4 (or later) version of the GNU implementation of AWK. + + + Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "GNU General Public License", the Front-Cover +texts being (a) (see below), and with the Back-Cover Texts being (b) +(see below). A copy of the license is included in the section entitled +"GNU Free Documentation License". + + a. "A GNU Manual" + + b. "You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development." + + +File: gawkinet.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir) + +General Introduction +******************** + +This file documents the networking features in GNU Awk (`gawk') version +3.1 and later. + + This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the +3.1.4 (or later) version of the GNU implementation of AWK. + + + Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "GNU General Public License", the Front-Cover +texts being (a) (see below), and with the Back-Cover Texts being (b) +(see below). A copy of the license is included in the section entitled +"GNU Free Documentation License". + + a. "A GNU Manual" + + b. "You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development." + +* Menu: + +* Preface:: About this document. +* Introduction:: About networking. +* Using Networking:: Some examples. +* Some Applications and Techniques:: More extended examples. +* Links:: Where to find the stuff mentioned in this + document. +* GNU Free Documentation License:: The license for this document. +* Index:: The index. + +* Stream Communications:: Sending data streams. +* Datagram Communications:: Sending self-contained messages. +* The TCP/IP Protocols:: How these models work in the Internet. +* Basic Protocols:: The basic protocols. +* Ports:: The idea behind ports. +* Making Connections:: Making TCP/IP connections. +* Gawk Special Files:: How to do `gawk' networking. +* Special File Fields:: The fields in the special file name. +* Comparing Protocols:: Differences between the protocols. +* File /inet/tcp:: The TCP special file. +* File /inet/udp:: The UDP special file. +* File /inet/raw:: The RAW special file. +* TCP Connecting:: Making a TCP connection. +* Troubleshooting:: Troubleshooting TCP/IP connections. +* Interacting:: Interacting with a service. +* Setting Up:: Setting up a service. +* Email:: Reading email. +* Web page:: Reading a Web page. +* Primitive Service:: A primitive Web service. +* Interacting Service:: A Web service with interaction. +* CGI Lib:: A simple CGI library. +* Simple Server:: A simple Web server. +* Caveats:: Network programming caveats. +* Challenges:: Where to go from here. +* PANIC:: An Emergency Web Server. +* GETURL:: Retrieving Web Pages. +* REMCONF:: Remote Configuration Of Embedded Systems. +* URLCHK:: Look For Changed Web Pages. +* WEBGRAB:: Extract Links From A Page. +* STATIST:: Graphing A Statistical Distribution. +* MAZE:: Walking Through A Maze In Virtual Reality. +* MOBAGWHO:: A Simple Mobile Agent. +* STOXPRED:: Stock Market Prediction As A Service. +* PROTBASE:: Searching Through A Protein Database. + + +File: gawkinet.info, Node: Preface, Next: Introduction, Prev: Top, Up: Top + +Preface +******* + +In May of 1997, Ju"rgen Kahrs felt the need for network access from +`awk', and, with a little help from me, set about adding features to do +this for `gawk'. At that time, he wrote the bulk of this Info file. + + The code and documentation were added to the `gawk' 3.1 development +tree, and languished somewhat until I could finally get down to some +serious work on that version of `gawk'. This finally happened in the +middle of 2000. + + Meantime, Ju"rgen wrote an article about the Internet special files +and `|&' operator for `Linux Journal', and made a networking patch for +the production versions of `gawk' available from his home page. In +August of 2000 (for `gawk' 3.0.6), this patch also made it to the main +GNU `ftp' distribution site. + + For release with `gawk', I edited Ju"rgen's prose for English +grammar and style, as he is not a native English speaker. I also +rearranged the material somewhat for what I felt was a better order of +presentation, and (re)wrote some of the introductory material. + + The majority of this document and the code are his work, and the +high quality and interesting ideas speak for themselves. It is my hope +that these features will be of significant value to the `awk' community. + + +Arnold Robbins +Nof Ayalon, ISRAEL +March, 2001 + + +File: gawkinet.info, Node: Introduction, Next: Using Networking, Prev: Preface, Up: Top + +1 Networking Concepts +********************* + +This major node provides a (necessarily) brief introduction to computer +networking concepts. For many applications of `gawk' to TCP/IP +networking, we hope that this is enough. For more advanced tasks, you +will need deeper background, and it may be necessary to switch to +lower-level programming in C or C++. + + There are two real-life models for the way computers send messages +to each other over a network. While the analogies are not perfect, +they are close enough to convey the major concepts. These two models +are the phone system (reliable byte-stream communications), and the +postal system (best-effort datagrams). + +* Menu: + +* Stream Communications:: Sending data streams. +* Datagram Communications:: Sending self-contained messages. +* The TCP/IP Protocols:: How these models work in the Internet. +* Making Connections:: Making TCP/IP connections. + + +File: gawkinet.info, Node: Stream Communications, Next: Datagram Communications, Prev: Introduction, Up: Introduction + +1.1 Reliable Byte-streams (Phone Calls) +======================================= + +When you make a phone call, the following steps occur: + + 1. You dial a number. + + 2. The phone system connects to the called party, telling them there + is an incoming call. (Their phone rings.) + + 3. The other party answers the call, or, in the case of a computer + network, refuses to answer the call. + + 4. Assuming the other party answers, the connection between you is + now a "duplex" (two-way), "reliable" (no data lost), sequenced + (data comes out in the order sent) data stream. + + 5. You and your friend may now talk freely, with the phone system + moving the data (your voices) from one end to the other. From + your point of view, you have a direct end-to-end connection with + the person on the other end. + + The same steps occur in a duplex reliable computer networking +connection. There is considerably more overhead in setting up the +communications, but once it's done, data moves in both directions, +reliably, in sequence. + + +File: gawkinet.info, Node: Datagram Communications, Next: The TCP/IP Protocols, Prev: Stream Communications, Up: Introduction + +1.2 Best-effort Datagrams (Mailed Letters) +========================================== + +Suppose you mail three different documents to your office on the other +side of the country on two different days. Doing so entails the +following. + + 1. Each document travels in its own envelope. + + 2. Each envelope contains both the sender and the recipient address. + + 3. Each envelope may travel a different route to its destination. + + 4. The envelopes may arrive in a different order from the one in + which they were sent. + + 5. One or more may get lost in the mail. (Although, fortunately, + this does not occur very often.) + + 6. In a computer network, one or more "packets" may also arrive + multiple times. (This doesn't happen with the postal system!) + + + The important characteristics of datagram communications, like those +of the postal system are thus: + + * Delivery is "best effort;" the data may never get there. + + * Each message is self-contained, including the source and + destination addresses. + + * Delivery is _not_ sequenced; packets may arrive out of order, + and/or multiple times. + + * Unlike the phone system, overhead is considerably lower. It is + not necessary to set up the call first. + + The price the user pays for the lower overhead of datagram +communications is exactly the lower reliability; it is often necessary +for user-level protocols that use datagram communications to add their +own reliability features on top of the basic communications. + + +File: gawkinet.info, Node: The TCP/IP Protocols, Next: Making Connections, Prev: Datagram Communications, Up: Introduction + +1.3 The Internet Protocols +========================== + +The Internet Protocol Suite (usually referred to as just TCP/IP)(1) +consists of a number of different protocols at different levels or +"layers." For our purposes, three protocols provide the fundamental +communications mechanisms. All other defined protocols are referred to +as user-level protocols (e.g., HTTP, used later in this Info file). + +* Menu: + +* Basic Protocols:: The basic protocols. +* Ports:: The idea behind ports. + + ---------- Footnotes ---------- + + (1) It should be noted that although the Internet seems to have +conquered the world, there are other networking protocol suites in +existence and in use. + + +File: gawkinet.info, Node: Basic Protocols, Next: Ports, Prev: The TCP/IP Protocols, Up: The TCP/IP Protocols + +1.3.1 The Basic Internet Protocols +---------------------------------- + +IP + The Internet Protocol. This protocol is almost never used + directly by applications. It provides the basic packet delivery + and routing infrastructure of the Internet. Much like the phone + company's switching centers or the Post Office's trucks, it is not + of much day-to-day interest to the regular user (or programmer). + It happens to be a best effort datagram protocol. + +UDP + The User Datagram Protocol. This is a best effort datagram + protocol. It provides a small amount of extra reliability over + IP, and adds the notion of "ports", described in *note TCP and UDP + Ports: Ports. + +TCP + The Transmission Control Protocol. This is a duplex, reliable, + sequenced byte-stream protocol, again layered on top of IP, and + also providing the notion of ports. This is the protocol that you + will most likely use when using `gawk' for network programming. + + All other user-level protocols use either TCP or UDP to do their +basic communications. Examples are SMTP (Simple Mail Transfer +Protocol), FTP (File Transfer Protocol), and HTTP (HyperText Transfer +Protocol). + + +File: gawkinet.info, Node: Ports, Prev: Basic Protocols, Up: The TCP/IP Protocols + +1.3.2 TCP and UDP Ports +----------------------- + +In the postal system, the address on an envelope indicates a physical +location, such as a residence or office building. But there may be +more than one person at a location; thus you have to further quantify +the recipient by putting a person or company name on the envelope. + + In the phone system, one phone number may represent an entire +company, in which case you need a person's extension number in order to +reach that individual directly. Or, when you call a home, you have to +say, "May I please speak to ..." before talking to the person directly. + + IP networking provides the concept of addressing. An IP address +represents a particular computer, but no more. In order to reach the +mail service on a system, or the FTP or WWW service on a system, you +must have some way to further specify which service you want. In the +Internet Protocol suite, this is done with "port numbers", which +represent the services, much like an extension number used with a phone +number. + + Port numbers are 16-bit integers. Unix and Unix-like systems +reserve ports below 1024 for "well known" services, such as SMTP, FTP, +and HTTP. Numbers 1024 and above may be used by any application, +although there is no promise made that a particular port number is +always available. + + +File: gawkinet.info, Node: Making Connections, Prev: The TCP/IP Protocols, Up: Introduction + +1.4 Making TCP/IP Connections (And Some Terminology) +==================================================== + +Two terms come up repeatedly when discussing networking: "client" and +"server". For now, we'll discuss these terms at the "connection +level", when first establishing connections between two processes on +different systems over a network. (Once the connection is established, +the higher level, or "application level" protocols, such as HTTP or +FTP, determine who is the client and who is the server. Often, it +turns out that the client and server are the same in both roles.) + + The "server" is the system providing the service, such as the web +server or email server. It is the "host" (system) which is _connected +to_ in a transaction. For this to work though, the server must be +expecting connections. Much as there has to be someone at the office +building to answer the phone(1), the server process (usually) has to be +started first and be waiting for a connection. + + The "client" is the system requesting the service. It is the system +_initiating the connection_ in a transaction. (Just as when you pick +up the phone to call an office or store.) + + In the TCP/IP framework, each end of a connection is represented by +a pair of (ADDRESS, PORT) pairs. For the duration of the connection, +the ports in use at each end are unique, and cannot be used +simultaneously by other processes on the same system. (Only after +closing a connection can a new one be built up on the same port. This +is contrary to the usual behavior of fully developed web servers which +have to avoid situations in which they are not reachable. We have to +pay this price in order to enjoy the benefits of a simple communication +paradigm in `gawk'.) + + Furthermore, once the connection is established, communications are +"synchronous".(2) I.e., each end waits on the other to finish +transmitting, before replying. This is much like two people in a phone +conversation. While both could talk simultaneously, doing so usually +doesn't work too well. + + In the case of TCP, the synchronicity is enforced by the protocol +when sending data. Data writes "block" until the data have been +received on the other end. For both TCP and UDP, data reads block +until there is incoming data waiting to be read. This is summarized in +the following table, where an "X" indicates that the given action +blocks. + +TCP X X +UDP X +RAW X + + ---------- Footnotes ---------- + + (1) In the days before voice mail systems! + + (2) For the technically savvy, data reads block--if there's no +incoming data, the program is made to wait until there is, instead of +receiving a "there's no data" error return. + + +File: gawkinet.info, Node: Using Networking, Next: Some Applications and Techniques, Prev: Introduction, Up: Top + +2 Networking With `gawk' +************************ + +The `awk' programming language was originally developed as a +pattern-matching language for writing short programs to perform data +manipulation tasks. `awk''s strength is the manipulation of textual +data that is stored in files. It was never meant to be used for +networking purposes. To exploit its features in a networking context, +it's necessary to use an access mode for network connections that +resembles the access of files as closely as possible. + + `awk' is also meant to be a prototyping language. It is used to +demonstrate feasibility and to play with features and user interfaces. +This can be done with file-like handling of network connections. +`gawk' trades the lack of many of the advanced features of the TCP/IP +family of protocols for the convenience of simple connection handling. +The advanced features are available when programming in C or Perl. In +fact, the network programming in this major node is very similar to +what is described in books such as `Internet Programming with Python', +`Advanced Perl Programming', or `Web Client Programming with Perl'. + + However, you can do the programming here without first having to +learn object-oriented ideology; underlying languages such as Tcl/Tk, +Perl, Python; or all of the libraries necessary to extend these +languages before they are ready for the Internet. + + This major node demonstrates how to use the TCP protocol. The other +protocols are much less important for most users (UDP) or even +untractable (RAW). + +* Menu: + +* Gawk Special Files:: How to do `gawk' networking. +* TCP Connecting:: Making a TCP connection. +* Troubleshooting:: Troubleshooting TCP/IP connections. +* Interacting:: Interacting with a service. +* Setting Up:: Setting up a service. +* Email:: Reading email. +* Web page:: Reading a Web page. +* Primitive Service:: A primitive Web service. +* Interacting Service:: A Web service with interaction. +* Simple Server:: A simple Web server. +* Caveats:: Network programming caveats. +* Challenges:: Where to go from here. + + +File: gawkinet.info, Node: Gawk Special Files, Next: TCP Connecting, Prev: Using Networking, Up: Using Networking + +2.1 `gawk''s Networking Mechanisms +================================== + +The `|&' operator introduced in `gawk' 3.1 for use in communicating +with a "coprocess" is described in *note Two-way Communications With +Another Process: (gawk)Two-way I/O. It shows how to do two-way I/O to a +separate process, sending it data with `print' or `printf' and reading +data with `getline'. If you haven't read it already, you should detour +there to do so. + + `gawk' transparently extends the two-way I/O mechanism to simple +networking through the use of special file names. When a "coprocess" +that matches the special files we are about to describe is started, +`gawk' creates the appropriate network connection, and then two-way I/O +proceeds as usual. + + At the C, C++, and Perl level, networking is accomplished via +"sockets", an Application Programming Interface (API) originally +developed at the University of California at Berkeley that is now used +almost universally for TCP/IP networking. Socket level programming, +while fairly straightforward, requires paying attention to a number of +details, as well as using binary data. It is not well-suited for use +from a high-level language like `awk'. The special files provided in +`gawk' hide the details from the programmer, making things much simpler +and easier to use. + + The special file name for network access is made up of several +fields, all of which are mandatory: + + /inet/PROTOCOL/LOCALPORT/HOSTNAME/REMOTEPORT + + The `/inet/' field is, of course, constant when accessing the +network. The LOCALPORT and REMOTEPORT fields do not have a meaning +when used with `/inet/raw' because "ports" only apply to TCP and UDP. +So, when using `/inet/raw', the port fields always have to be `0'. + +* Menu: + +* Special File Fields:: The fields in the special file name. +* Comparing Protocols:: Differences between the protocols. + + +File: gawkinet.info, Node: Special File Fields, Next: Comparing Protocols, Prev: Gawk Special Files, Up: Gawk Special Files + +2.1.1 The Fields of the Special File Name +----------------------------------------- + +This node explains the meaning of all the other fields, as well as the +range of values and the defaults. All of the fields are mandatory. To +let the system pick a value, or if the field doesn't apply to the +protocol, specify it as `0': + +PROTOCOL + Determines which member of the TCP/IP family of protocols is + selected to transport the data across the network. There are three + possible values (always written in lowercase): `tcp', `udp', and + `raw'. The exact meaning of each is explained later in this node. + +LOCALPORT + Determines which port on the local machine is used to communicate + across the network. It has no meaning with `/inet/raw' and must + therefore be `0'. Application-level clients usually use `0' to + indicate they do not care which local port is used--instead they + specify a remote port to connect to. It is vital for + application-level servers to use a number different from `0' here + because their service has to be available at a specific publicly + known port number. It is possible to use a name from + `/etc/services' here. + +HOSTNAME + Determines which remote host is to be at the other end of the + connection. Application-level servers must fill this field with a + `0' to indicate their being open for all other hosts to connect to + them and enforce connection level server behavior this way. It is + not possible for an application-level server to restrict its + availability to one remote host by entering a host name here. + Application-level clients must enter a name different from `0'. + The name can be either symbolic (e.g., `jpl-devvax.jpl.nasa.gov') + or numeric (e.g., `128.149.1.143'). + +REMOTEPORT + Determines which port on the remote machine is used to communicate + across the network. It has no meaning with `/inet/raw' and must + therefore be 0. For `/inet/tcp' and `/inet/udp', + application-level clients _must_ use a number other than `0' to + indicate to which port on the remote machine they want to connect. + Application-level servers must not fill this field with a `0'. + Instead they specify a local port to which clients connect. It is + possible to use a name from `/etc/services' here. + + Experts in network programming will notice that the usual +client/server asymmetry found at the level of the socket API is not +visible here. This is for the sake of simplicity of the high-level +concept. If this asymmetry is necessary for your application, use +another language. For `gawk', it is more important to enable users to +write a client program with a minimum of code. What happens when first +accessing a network connection is seen in the following pseudocode: + + if ((name of remote host given) && (other side accepts connection)) { + rendez-vous successful; transmit with getline or print + } else { + if ((other side did not accept) && (localport == 0)) + exit unsuccessful + if (TCP) { + set up a server accepting connections + this means waiting for the client on the other side to connect + } else + ready + } + + The exact behavior of this algorithm depends on the values of the +fields of the special file name. When in doubt, *note +table-inet-components:: gives you the combinations of values and their +meaning. If this table is too complicated, focus on the three lines +printed in *bold*. All the examples in *note Networking With `gawk': +Using Networking, use only the patterns printed in bold letters. + +PROTOCOL LOCAL PORT HOST NAME REMOTE RESULTING CONNECTION-LEVEL + PORT BEHAVIOR +------------------------------------------------------------------------------ +*tcp* *0* *x* *x* *Dedicated client, fails if + immediately connecting to a + server on the + other side fails* +udp 0 x x Dedicated client +raw 0 x 0 Dedicated client, works only + as `root' +*tcp, udp* *x* *x* *x* *Client, switches to + dedicated server if + necessary* +*tcp, udp* *x* *0* *0* *Dedicated server* +raw 0 0 0 Dedicated server, works only + as `root' +tcp, udp, x x 0 Invalid +raw +tcp, udp, 0 0 x Invalid +raw +tcp, udp, x 0 x Invalid +raw +tcp, udp 0 0 0 Invalid +tcp, udp 0 x 0 Invalid +raw x 0 0 Invalid +raw 0 x x Invalid +raw x x x Invalid + +Table 2.1: /inet Special File Components + + In general, TCP is the preferred mechanism to use. It is the +simplest protocol to understand and to use. Use the others only if +circumstances demand low-overhead. + + +File: gawkinet.info, Node: Comparing Protocols, Prev: Special File Fields, Up: Gawk Special Files + +2.1.2 Comparing Protocols +------------------------- + +This node develops a pair of programs (sender and receiver) that do +nothing but send a timestamp from one machine to another. The sender +and the receiver are implemented with each of the three protocols +available and demonstrate the differences between them. + +* Menu: + +* File /inet/tcp:: The TCP special file. +* File /inet/udp:: The UDP special file. +* File /inet/raw:: The RAW special file. + + +File: gawkinet.info, Node: File /inet/tcp, Next: File /inet/udp, Prev: Comparing Protocols, Up: Comparing Protocols + +2.1.2.1 `/inet/tcp' +................... + +Once again, always use TCP. (Use UDP when low overhead is a necessity, +and use RAW for network experimentation.) The first example is the +sender program: + + # Server + BEGIN { + print strftime() |& "/inet/tcp/8888/0/0" + close("/inet/tcp/8888/0/0") + } + + The receiver is very simple: + + # Client + BEGIN { + "/inet/tcp/0/localhost/8888" |& getline + print $0 + close("/inet/tcp/0/localhost/8888") + } + + TCP guarantees that the bytes arrive at the receiving end in exactly +the same order that they were sent. No byte is lost (except for broken +connections), doubled, or out of order. Some overhead is necessary to +accomplish this, but this is the price to pay for a reliable service. +It does matter which side starts first. The sender/server has to be +started first, and it waits for the receiver to read a line. + + +File: gawkinet.info, Node: File /inet/udp, Next: File /inet/raw, Prev: File /inet/tcp, Up: Comparing Protocols + +2.1.2.2 `/inet/udp' +................... + +The server and client programs that use UDP are almost identical to +their TCP counterparts; only the PROTOCOL has changed. As before, it +does matter which side starts first. The receiving side blocks and +waits for the sender. In this case, the receiver/client has to be +started first: + + # Server + BEGIN { + print strftime() |& "/inet/udp/8888/0/0" + close("/inet/udp/8888/0/0") + } + + The receiver is almost identical to the TCP receiver: + + # Client + BEGIN { + "/inet/udp/0/localhost/8888" |& getline + print $0 + close("/inet/udp/0/localhost/8888") + } + + UDP cannot guarantee that the datagrams at the receiving end will +arrive in exactly the same order they were sent. Some datagrams could be +lost, some doubled, and some out of order. But no overhead is necessary +to accomplish this. This unreliable behavior is good enough for tasks +such as data acquisition, logging, and even stateless services like NFS. + + +File: gawkinet.info, Node: File /inet/raw, Prev: File /inet/udp, Up: Comparing Protocols + +2.1.2.3 `/inet/raw' +................... + +This is an IP-level protocol. Only `root' is allowed to access this +special file. It is meant to be the basis for implementing and +experimenting with transport-level protocols.(1) In the most general +case, the sender has to supply the encapsulating header bytes in front +of the packet and the receiver has to strip the additional bytes from +the message. + + RAW receivers cannot receive packets sent with TCP or UDP because the +operating system does not deliver the packets to a RAW receiver. The +operating system knows about some of the protocols on top of IP and +decides on its own which packet to deliver to which process. (d.c.) +Therefore, the UDP receiver must be used for receiving UDP datagrams +sent with the RAW sender. This is a dark corner, not only of `gawk', +but also of TCP/IP. + + For extended experimentation with protocols, look into the approach +implemented in a tool called SPAK. This tool reflects the hierarchical +layering of protocols (encapsulation) in the way data streams are piped +out of one program into the next one. It shows which protocol is based +on which other (lower-level) protocol by looking at the command-line +ordering of the program calls. Cleverly thought out, SPAK is much +better than `gawk''s `/inet' for learning the meaning of each and every +bit in the protocol headers. + + The next example uses the RAW protocol to emulate the behavior of +UDP. The sender program is the same as above, but with some additional +bytes that fill the places of the UDP fields: + + BEGIN { + Message = "Hello world\n" + SourcePort = 0 + DestinationPort = 8888 + MessageLength = length(Message)+8 + RawService = "/inet/raw/0/localhost/0" + printf("%c%c%c%c%c%c%c%c%s", + SourcePort/256, SourcePort%256, + DestinationPort/256, DestinationPort%256, + MessageLength/256, MessageLength%256, + 0, 0, Message) |& RawService + fflush(RawService) + close(RawService) + } + + Since this program tries to emulate the behavior of UDP, it checks if +the RAW sender is understood by the UDP receiver but not if the RAW +receiver can understand the UDP sender. In a real network, the RAW +receiver is hardly of any use because it gets every IP packet that +comes across the network. There are usually so many packets that `gawk' +would be too slow for processing them. Only on a network with little +traffic can the IP-level receiver program be tested. Programs for +analyzing IP traffic on modem or ISDN channels should be possible. + + Port numbers do not have a meaning when using `/inet/raw'. Their +fields have to be `0'. Only TCP and UDP use ports. Receiving data from +`/inet/raw' is difficult, not only because of processing speed but also +because data is usually binary and not restricted to ASCII. This +implies that line separation with `RS' does not work as usual. + + ---------- Footnotes ---------- + + (1) This special file is reserved, but not otherwise currently +implemented. + + +File: gawkinet.info, Node: TCP Connecting, Next: Troubleshooting, Prev: Gawk Special Files, Up: Using Networking + +2.2 Establishing a TCP Connection +================================= + +Let's observe a network connection at work. Type in the following +program and watch the output. Within a second, it connects via TCP +(`/inet/tcp') to the machine it is running on (`localhost') and asks +the service `daytime' on the machine what time it is: + + BEGIN { + "/inet/tcp/0/localhost/daytime" |& getline + print $0 + close("/inet/tcp/0/localhost/daytime") + } + + Even experienced `awk' users will find the second line strange in two +respects: + + * A special file is used as a shell command that pipes its output + into `getline'. One would rather expect to see the special file + being read like any other file (`getline < + "/inet/tcp/0/localhost/daytime")'. + + * The operator `|&' has not been part of any `awk' implementation + (until now). It is actually the only extension of the `awk' + language needed (apart from the special files) to introduce + network access. + + The `|&' operator was introduced in `gawk' 3.1 in order to overcome +the crucial restriction that access to files and pipes in `awk' is +always unidirectional. It was formerly impossible to use both access +modes on the same file or pipe. Instead of changing the whole concept +of file access, the `|&' operator behaves exactly like the usual pipe +operator except for two additions: + + * Normal shell commands connected to their `gawk' program with a `|&' + pipe can be accessed bidirectionally. The `|&' turns out to be a + quite general, useful, and natural extension of `awk'. + + * Pipes that consist of a special file name for network connections + are not executed as shell commands. Instead, they can be read and + written to, just like a full-duplex network connection. + + In the earlier example, the `|&' operator tells `getline' to read a +line from the special file `/inet/tcp/0/localhost/daytime'. We could +also have printed a line into the special file. But instead we just +read a line with the time, printed it, and closed the connection. +(While we could just let `gawk' close the connection by finishing the +program, in this Info file we are pedantic and always explicitly close +the connections.) + + +File: gawkinet.info, Node: Troubleshooting, Next: Interacting, Prev: TCP Connecting, Up: Using Networking + +2.3 Troubleshooting Connection Problems +======================================= + +It may well be that for some reason the program shown in the previous +example does not run on your machine. When looking at possible reasons +for this, you will learn much about typical problems that arise in +network programming. First of all, your implementation of `gawk' may +not support network access because it is a pre-3.1 version or you do +not have a network interface in your machine. Perhaps your machine +uses some other protocol, such as DECnet or Novell's IPX. For the rest +of this major node, we will assume you work on a Unix machine that +supports TCP/IP. If the previous example program does not run on your +machine, it may help to replace the name `localhost' with the name of +your machine or its IP address. If it does, you could replace +`localhost' with the name of another machine in your vicinity--this +way, the program connects to another machine. Now you should see the +date and time being printed by the program, otherwise your machine may +not support the `daytime' service. Try changing the service to +`chargen' or `ftp'. This way, the program connects to other services +that should give you some response. If you are curious, you should have +a look at your `/etc/services' file. It could look like this: + + # /etc/services: + # + # Network services, Internet style + # + # Name Number/Protcol Alternate name # Comments + + echo 7/tcp + echo 7/udp + discard 9/tcp sink null + discard 9/udp sink null + daytime 13/tcp + daytime 13/udp + chargen 19/tcp ttytst source + chargen 19/udp ttytst source + ftp 21/tcp + telnet 23/tcp + smtp 25/tcp mail + finger 79/tcp + www 80/tcp http # WorldWideWeb HTTP + www 80/udp # HyperText Transfer Protocol + pop-2 109/tcp postoffice # POP version 2 + pop-2 109/udp + pop-3 110/tcp # POP version 3 + pop-3 110/udp + nntp 119/tcp readnews untp # USENET News + irc 194/tcp # Internet Relay Chat + irc 194/udp + ... + + Here, you find a list of services that traditional Unix machines +usually support. If your GNU/Linux machine does not do so, it may be +that these services are switched off in some startup script. Systems +running some flavor of Microsoft Windows usually do _not_ support these +services. Nevertheless, it _is_ possible to do networking with `gawk' +on Microsoft Windows.(1) The first column of the file gives the name of +the service, and the second column gives a unique number and the +protocol that one can use to connect to this service. The rest of the +line is treated as a comment. You see that some services (`echo') +support TCP as well as UDP. + + ---------- Footnotes ---------- + + (1) Microsoft preferred to ignore the TCP/IP family of protocols +until 1995. Then came the rise of the Netscape browser as a landmark +"killer application." Microsoft added TCP/IP support and their own +browser to Microsoft Windows 95 at the last minute. They even +back-ported their TCP/IP implementation to Microsoft Windows for +Workgroups 3.11, but it was a rather rudimentary and half-hearted +implementation. Nevertheless, the equivalent of `/etc/services' resides +under `C:\WINNT\system32\drivers\etc\services' on Microsoft Windows +2000. + + +File: gawkinet.info, Node: Interacting, Next: Setting Up, Prev: Troubleshooting, Up: Using Networking + +2.4 Interacting with a Network Service +====================================== + +The next program makes use of the possibility to really interact with a +network service by printing something into the special file. It asks the +so-called `finger' service if a user of the machine is logged in. When +testing this program, try to change `localhost' to some other machine +name in your local network: + + BEGIN { + NetService = "/inet/tcp/0/localhost/finger" + print "NAME" |& NetService + while ((NetService |& getline) > 0) + print $0 + close(NetService) + } + + After telling the service on the machine which user to look for, the +program repeatedly reads lines that come as a reply. When no more lines +are coming (because the service has closed the connection), the program +also closes the connection. Try replacing `"NAME"' with your login name +(or the name of someone else logged in). For a list of all users +currently logged in, replace NAME with an empty string (`""'). + + The final `close' command could be safely deleted from the above +script, because the operating system closes any open connection by +default when a script reaches the end of execution. In order to avoid +portability problems, it is best to always close connections explicitly. +With the Linux kernel, for example, proper closing results in flushing +of buffers. Letting the close happen by default may result in +discarding buffers. + + When looking at `/etc/services' you may have noticed that the +`daytime' service is also available with `udp'. In the earlier example, +change `tcp' to `udp', and change `finger' to `daytime'. After +starting the modified program, you see the expected day and time +message. The program then hangs, because it waits for more lines +coming from the service. However, they never come. This behavior is a +consequence of the differences between TCP and UDP. When using UDP, +neither party is automatically informed about the other closing the +connection. Continuing to experiment this way reveals many other subtle +differences between TCP and UDP. To avoid such trouble, one should +always remember the advice Douglas E. Comer and David Stevens give in +Volume III of their series `Internetworking With TCP' (page 14): + + When designing client-server applications, beginners are strongly + advised to use TCP because it provides reliable, + connection-oriented communication. Programs only use UDP if the + application protocol handles reliability, the application requires + hardware broadcast or multicast, or the application cannot + tolerate virtual circuit overhead. + + +File: gawkinet.info, Node: Setting Up, Next: Email, Prev: Interacting, Up: Using Networking + +2.5 Setting Up a Service +======================== + +The preceding programs behaved as clients that connect to a server +somewhere on the Internet and request a particular service. Now we set +up such a service to mimic the behavior of the `daytime' service. Such +a server does not know in advance who is going to connect to it over +the network. Therefore, we cannot insert a name for the host to connect +to in our special file name. + + Start the following program in one window. Notice that the service +does not have the name `daytime', but the number `8888'. From looking +at `/etc/services', you know that names like `daytime' are just +mnemonics for predetermined 16-bit integers. Only the system +administrator (`root') could enter our new service into `/etc/services' +with an appropriate name. Also notice that the service name has to be +entered into a different field of the special file name because we are +setting up a server, not a client: + + BEGIN { + print strftime() |& "/inet/tcp/8888/0/0" + close("/inet/tcp/8888/0/0") + } + + Now open another window on the same machine. Copy the client +program given as the first example (*note Establishing a TCP +Connection: TCP Connecting.) to a new file and edit it, changing the +name `daytime' to `8888'. Then start the modified client. You should +get a reply like this: + + Sat Sep 27 19:08:16 CEST 1997 + +Both programs explicitly close the connection. + + Now we will intentionally make a mistake to see what happens when +the name `8888' (the so-called port) is already used by another service. +Start the server program in both windows. The first one works, but the +second one complains that it could not open the connection. Each port +on a single machine can only be used by one server program at a time. +Now terminate the server program and change the name `8888' to `echo'. +After restarting it, the server program does not run any more, and you +know why: there is already an `echo' service running on your machine. +But even if this isn't true, you would not get your own `echo' server +running on a Unix machine, because the ports with numbers smaller than +1024 (`echo' is at port 7) are reserved for `root'. On machines +running some flavor of Microsoft Windows, there is no restriction that +reserves ports 1 to 1024 for a privileged user; hence, you can start an +`echo' server there. + + Turning this short server program into something really useful is +simple. Imagine a server that first reads a file name from the client +through the network connection, then does something with the file and +sends a result back to the client. The server-side processing could be: + + BEGIN { + NetService = "/inet/tcp/8888/0/0" + NetService |& getline + CatPipe = ("cat " $1) # sets $0 and the fields + while ((CatPipe | getline) > 0) + print $0 |& NetService + close(NetService) + } + +and we would have a remote copying facility. Such a server reads the +name of a file from any client that connects to it and transmits the +contents of the named file across the net. The server-side processing +could also be the execution of a command that is transmitted across the +network. From this example, you can see how simple it is to open up a +security hole on your machine. If you allow clients to connect to your +machine and execute arbitrary commands, anyone would be free to do `rm +-rf *'. + + +File: gawkinet.info, Node: Email, Next: Web page, Prev: Setting Up, Up: Using Networking + +2.6 Reading Email +================= + +The distribution of email is usually done by dedicated email servers +that communicate with your machine using special protocols. To receive +email, we will use the Post Office Protocol (POP). Sending can be done +with the much older Simple Mail Transfer Protocol (SMTP). + + When you type in the following program, replace the EMAILHOST by the +name of your local email server. Ask your administrator if the server +has a POP service, and then use its name or number in the program below. +Now the program is ready to connect to your email server, but it will +not succeed in retrieving your mail because it does not yet know your +login name or password. Replace them in the program and it shows you +the first email the server has in store: + + BEGIN { + POPService = "/inet/tcp/0/EMAILHOST/pop3" + RS = ORS = "\r\n" + print "user NAME" |& POPService + POPService |& getline + print "pass PASSWORD" |& POPService + POPService |& getline + print "retr 1" |& POPService + POPService |& getline + if ($1 != "+OK") exit + print "quit" |& POPService + RS = "\r\n\\.\r\n" + POPService |& getline + print $0 + close(POPService) + } + + The record separators `RS' and `ORS' are redefined because the +protocol (POP) requires CR-LF to separate lines. After identifying +yourself to the email service, the command `retr 1' instructs the +service to send the first of all your email messages in line. If the +service replies with something other than `+OK', the program exits; +maybe there is no email. Otherwise, the program first announces that it +intends to finish reading email, and then redefines `RS' in order to +read the entire email as multiline input in one record. From the POP +RFC, we know that the body of the email always ends with a single line +containing a single dot. The program looks for this using `RS = +"\r\n\\.\r\n"'. When it finds this sequence in the mail message, it +quits. You can invoke this program as often as you like; it does not +delete the message it reads, but instead leaves it on the server. + + +File: gawkinet.info, Node: Web page, Next: Primitive Service, Prev: Email, Up: Using Networking + +2.7 Reading a Web Page +====================== + +Retrieving a web page from a web server is as simple as retrieving +email from an email server. We only have to use a similar, but not +identical, protocol and a different port. The name of the protocol is +HyperText Transfer Protocol (HTTP) and the port number is usually 80. +As in the preceding node, ask your administrator about the name of your +local web server or proxy web server and its port number for HTTP +requests. + + The following program employs a rather crude approach toward +retrieving a web page. It uses the prehistoric syntax of HTTP 0.9, +which almost all web servers still support. The most noticeable thing +about it is that the program directs the request to the local proxy +server whose name you insert in the special file name (which in turn +calls `www.yahoo.com'): + + BEGIN { + RS = ORS = "\r\n" + HttpService = "/inet/tcp/0/PROXY/80" + print "GET http://www.yahoo.com" |& HttpService + while ((HttpService |& getline) > 0) + print $0 + close(HttpService) + } + + Again, lines are separated by a redefined `RS' and `ORS'. The `GET' +request that we send to the server is the only kind of HTTP request +that existed when the web was created in the early 1990s. HTTP calls +this `GET' request a "method," which tells the service to transmit a +web page (here the home page of the Yahoo! search engine). Version 1.0 +added the request methods `HEAD' and `POST'. The current version of +HTTP is 1.1,(1) and knows the additional request methods `OPTIONS', +`PUT', `DELETE', and `TRACE'. You can fill in any valid web address, +and the program prints the HTML code of that page to your screen. + + Notice the similarity between the responses of the POP and HTTP +services. First, you get a header that is terminated by an empty line, +and then you get the body of the page in HTML. The lines of the +headers also have the same form as in POP. There is the name of a +parameter, then a colon, and finally the value of that parameter. + + Images (`.png' or `.gif' files) can also be retrieved this way, but +then you get binary data that should be redirected into a file. Another +application is calling a CGI (Common Gateway Interface) script on some +server. CGI scripts are used when the contents of a web page are not +constant, but generated instantly at the moment you send a request for +the page. For example, to get a detailed report about the current +quotes of Motorola stock shares, call a CGI script at Yahoo! with the +following: + + get = "GET http://quote.yahoo.com/q?s=MOT&d=t" + print get |& HttpService + + You can also request weather reports this way. + + ---------- Footnotes ---------- + + (1) Version 1.0 of HTTP was defined in RFC 1945. HTTP 1.1 was +initially specified in RFC 2068. In June 1999, RFC 2068 was made +obsolete by RFC 2616, an update without any substantial changes. + + +File: gawkinet.info, Node: Primitive Service, Next: Interacting Service, Prev: Web page, Up: Using Networking + +2.8 A Primitive Web Service +=========================== + +Now we know enough about HTTP to set up a primitive web service that +just says `"Hello, world"' when someone connects to it with a browser. +Compared to the situation in the preceding node, our program changes +the role. It tries to behave just like the server we have observed. +Since we are setting up a server here, we have to insert the port +number in the `localport' field of the special file name. The other two +fields (HOSTNAME and REMOTEPORT) have to contain a `0' because we do +not know in advance which host will connect to our service. + + In the early 1990s, all a server had to do was send an HTML document +and close the connection. Here, we adhere to the modern syntax of HTTP. +The steps are as follows: + + 1. Send a status line telling the web browser that everything is okay. + + 2. Send a line to tell the browser how many bytes follow in the body + of the message. This was not necessary earlier because both + parties knew that the document ended when the connection closed. + Nowadays it is possible to stay connected after the transmission + of one web page. This is to avoid the network traffic necessary + for repeatedly establishing TCP connections for requesting several + images. Thus, there is the need to tell the receiving party how + many bytes will be sent. The header is terminated as usual with an + empty line. + + 3. Send the `"Hello, world"' body in HTML. The useless `while' loop + swallows the request of the browser. We could actually omit the + loop, and on most machines the program would still work. First, + start the following program: + + BEGIN { + RS = ORS = "\r\n" + HttpService = "/inet/tcp/8080/0/0" + Hello = "" \ + "A Famous Greeting" \ + "

Hello, world

" + Len = length(Hello) + length(ORS) + print "HTTP/1.0 200 OK" |& HttpService + print "Content-Length: " Len ORS |& HttpService + print Hello |& HttpService + while ((HttpService |& getline) > 0) + continue; + close(HttpService) + } + + Now, on the same machine, start your favorite browser and let it +point to `http://localhost:8080' (the browser needs to know on which +port our server is listening for requests). If this does not work, the +browser probably tries to connect to a proxy server that does not know +your machine. If so, change the browser's configuration so that the +browser does not try to use a proxy to connect to your machine. + + +File: gawkinet.info, Node: Interacting Service, Next: Simple Server, Prev: Primitive Service, Up: Using Networking + +2.9 A Web Service with Interaction +================================== + +This node shows how to set up a simple web server. The subnode is a +library file that we will use with all the examples in *note Some +Applications and Techniques::. + +* Menu: + +* CGI Lib:: A simple CGI library. + + Setting up a web service that allows user interaction is more +difficult and shows us the limits of network access in `gawk'. In this +node, we develop a main program (a `BEGIN' pattern and its action) +that will become the core of event-driven execution controlled by a +graphical user interface (GUI). Each HTTP event that the user triggers +by some action within the browser is received in this central +procedure. Parameters and menu choices are extracted from this request, +and an appropriate measure is taken according to the user's choice. +For example: + + BEGIN { + if (MyHost == "") { + "uname -n" | getline MyHost + close("uname -n") + } + if (MyPort == 0) MyPort = 8080 + HttpService = "/inet/tcp/" MyPort "/0/0" + MyPrefix = "http://" MyHost ":" MyPort + SetUpServer() + while ("awk" != "complex") { + # header lines are terminated this way + RS = ORS = "\r\n" + Status = 200 # this means OK + Reason = "OK" + Header = TopHeader + Document = TopDoc + Footer = TopFooter + if (GETARG["Method"] == "GET") { + HandleGET() + } else if (GETARG["Method"] == "HEAD") { + # not yet implemented + } else if (GETARG["Method"] != "") { + print "bad method", GETARG["Method"] + } + Prompt = Header Document Footer + print "HTTP/1.0", Status, Reason |& HttpService + print "Connection: Close" |& HttpService + print "Pragma: no-cache" |& HttpService + len = length(Prompt) + length(ORS) + print "Content-length:", len |& HttpService + print ORS Prompt |& HttpService + # ignore all the header lines + while ((HttpService |& getline) > 0) + ; + # stop talking to this client + close(HttpService) + # wait for new client request + HttpService |& getline + # do some logging + print systime(), strftime(), $0 + # read request parameters + CGI_setup($1, $2, $3) + } + } + + This web server presents menu choices in the form of HTML links. +Therefore, it has to tell the browser the name of the host it is +residing on. When starting the server, the user may supply the name of +the host from the command line with `gawk -v MyHost="Rumpelstilzchen"'. +If the user does not do this, the server looks up the name of the host +it is running on for later use as a web address in HTML documents. The +same applies to the port number. These values are inserted later into +the HTML content of the web pages to refer to the home system. + + Each server that is built around this core has to initialize some +application-dependent variables (such as the default home page) in a +procedure `SetUpServer', which is called immediately before entering the +infinite loop of the server. For now, we will write an instance that +initiates a trivial interaction. With this home page, the client user +can click on two possible choices, and receive the current date either +in human-readable format or in seconds since 1970: + + function SetUpServer() { + TopHeader = "" + TopHeader = TopHeader \ + "My name is GAWK, GNU AWK" + TopDoc = "

\ + Do you prefer your date human or \ + POSIXed?

" ORS ORS + TopFooter = "" + } + + On the first run through the main loop, the default line terminators +are set and the default home page is copied to the actual home page. +Since this is the first run, `GETARG["Method"]' is not initialized yet, +hence the case selection over the method does nothing. Now that the +home page is initialized, the server can start communicating to a +client browser. + + It does so by printing the HTTP header into the network connection +(`print ... |& HttpService'). This command blocks execution of the +server script until a client connects. If this server script is +compared with the primitive one we wrote before, you will notice two +additional lines in the header. The first instructs the browser to +close the connection after each request. The second tells the browser +that it should never try to _remember_ earlier requests that had +identical web addresses (no caching). Otherwise, it could happen that +the browser retrieves the time of day in the previous example just once, +and later it takes the web page from the cache, always displaying the +same time of day although time advances each second. + + Having supplied the initial home page to the browser with a valid +document stored in the parameter `Prompt', it closes the connection and +waits for the next request. When the request comes, a log line is +printed that allows us to see which request the server receives. The +final step in the loop is to call the function `CGI_setup', which reads +all the lines of the request (coming from the browser), processes them, +and stores the transmitted parameters in the array `PARAM'. The complete +text of these application-independent functions can be found in *note A +Simple CGI Library: CGI Lib. For now, we use a simplified version of +`CGI_setup': + + function CGI_setup( method, uri, version, i) { + delete GETARG; delete MENU; delete PARAM + GETARG["Method"] = $1 + GETARG["URI"] = $2 + GETARG["Version"] = $3 + i = index($2, "?") + # is there a "?" indicating a CGI request? + if (i > 0) { + split(substr($2, 1, i-1), MENU, "[/:]") + split(substr($2, i+1), PARAM, "&") + for (i in PARAM) { + j = index(PARAM[i], "=") + GETARG[substr(PARAM[i], 1, j-1)] = \ + substr(PARAM[i], j+1) + } + } else { # there is no "?", no need for splitting PARAMs + split($2, MENU, "[/:]") + } + } + + At first, the function clears all variables used for global storage +of request parameters. The rest of the function serves the purpose of +filling the global parameters with the extracted new values. To +accomplish this, the name of the requested resource is split into parts +and stored for later evaluation. If the request contains a `?', then +the request has CGI variables seamlessly appended to the web address. +Everything in front of the `?' is split up into menu items, and +everything behind the `?' is a list of `VARIABLE=VALUE' pairs +(separated by `&') that also need splitting. This way, CGI variables are +isolated and stored. This procedure lacks recognition of special +characters that are transmitted in coded form(1). Here, any optional +request header and body parts are ignored. We do not need header +parameters and the request body. However, when refining our approach or +working with the `POST' and `PUT' methods, reading the header and body +becomes inevitable. Header parameters should then be stored in a global +array as well as the body. + + On each subsequent run through the main loop, one request from a +browser is received, evaluated, and answered according to the user's +choice. This can be done by letting the value of the HTTP method guide +the main loop into execution of the procedure `HandleGET', which +evaluates the user's choice. In this case, we have only one +hierarchical level of menus, but in the general case, menus are nested. +The menu choices at each level are separated by `/', just as in file +names. Notice how simple it is to construct menus of arbitrary depth: + + function HandleGET() { + if ( MENU[2] == "human") { + Footer = strftime() TopFooter + } else if (MENU[2] == "POSIX") { + Footer = systime() TopFooter + } + } + + The disadvantage of this approach is that our server is slow and can +handle only one request at a time. Its main advantage, however, is that +the server consists of just one `gawk' program. No need for installing +an `httpd', and no need for static separate HTML files, CGI scripts, or +`root' privileges. This is rapid prototyping. This program can be +started on the same host that runs your browser. Then let your browser +point to `http://localhost:8080'. + + It is also possible to include images into the HTML pages. Most +browsers support the not very well-known `.xbm' format, which may +contain only monochrome pictures but is an ASCII format. Binary images +are possible but not so easy to handle. Another way of including images +is to generate them with a tool such as GNUPlot, by calling the tool +with the `system' function or through a pipe. + + ---------- Footnotes ---------- + + (1) As defined in RFC 2068. + + +File: gawkinet.info, Node: CGI Lib, Prev: Interacting Service, Up: Interacting Service + +2.9.1 A Simple CGI Library +-------------------------- + + HTTP is like being married: you have to be able to handle whatever + you're given, while being very careful what you send back. + Phil Smith III, + `http://www.netfunny.com/rhf/jokes/99/Mar/http.html' + + In *note A Web Service with Interaction: Interacting Service, we saw +the function `CGI_setup' as part of the web server "core logic" +framework. The code presented there handles almost everything necessary +for CGI requests. One thing it doesn't do is handle encoded characters +in the requests. For example, an `&' is encoded as a percent sign +followed by the hexadecimal value: `%26'. These encoded values should +be decoded. Following is a simple library to perform these tasks. +This code is used for all web server examples used throughout the rest +of this Info file. If you want to use it for your own web server, +store the source code into a file named `inetlib.awk'. Then you can +include these functions into your code by placing the following +statement into your program (on the first line of your script): + + @include inetlib.awk + +But beware, this mechanism is only possible if you invoke your web +server script with `igawk' instead of the usual `awk' or `gawk'. Here +is the code: + + # CGI Library and core of a web server + # Global arrays + # GETARG --- arguments to CGI GET command + # MENU --- menu items (path names) + # PARAM --- parameters of form x=y + + # Optional variable MyHost contains host address + # Optional variable MyPort contains port number + # Needs TopHeader, TopDoc, TopFooter + # Sets MyPrefix, HttpService, Status, Reason + + BEGIN { + if (MyHost == "") { + "uname -n" | getline MyHost + close("uname -n") + } + if (MyPort == 0) MyPort = 8080 + HttpService = "/inet/tcp/" MyPort "/0/0" + MyPrefix = "http://" MyHost ":" MyPort + SetUpServer() + while ("awk" != "complex") { + # header lines are terminated this way + RS = ORS = "\r\n" + Status = 200 # this means OK + Reason = "OK" + Header = TopHeader + Document = TopDoc + Footer = TopFooter + if (GETARG["Method"] == "GET") { + HandleGET() + } else if (GETARG["Method"] == "HEAD") { + # not yet implemented + } else if (GETARG["Method"] != "") { + print "bad method", GETARG["Method"] + } + Prompt = Header Document Footer + print "HTTP/1.0", Status, Reason |& HttpService + print "Connection: Close" |& HttpService + print "Pragma: no-cache" |& HttpService + len = length(Prompt) + length(ORS) + print "Content-length:", len |& HttpService + print ORS Prompt |& HttpService + # ignore all the header lines + while ((HttpService |& getline) > 0) + continue + # stop talking to this client + close(HttpService) + # wait for new client request + HttpService |& getline + # do some logging + print systime(), strftime(), $0 + CGI_setup($1, $2, $3) + } + } + + function CGI_setup( method, uri, version, i) + { + delete GETARG + delete MENU + delete PARAM + GETARG["Method"] = method + GETARG["URI"] = uri + GETARG["Version"] = version + + i = index(uri, "?") + if (i > 0) { # is there a "?" indicating a CGI request? + split(substr(uri, 1, i-1), MENU, "[/:]") + split(substr(uri, i+1), PARAM, "&") + for (i in PARAM) { + PARAM[i] = _CGI_decode(PARAM[i]) + j = index(PARAM[i], "=") + GETARG[substr(PARAM[i], 1, j-1)] = \ + substr(PARAM[i], j+1) + } + } else { # there is no "?", no need for splitting PARAMs + split(uri, MENU, "[/:]") + } + for (i in MENU) # decode characters in path + if (i > 4) # but not those in host name + MENU[i] = _CGI_decode(MENU[i]) + } + + This isolates details in a single function, `CGI_setup'. Decoding +of encoded characters is pushed off to a helper function, +`_CGI_decode'. The use of the leading underscore (`_') in the function +name is intended to indicate that it is an "internal" function, +although there is nothing to enforce this: + + function _CGI_decode(str, hexdigs, i, pre, code1, code2, + val, result) + { + hexdigs = "123456789abcdef" + + i = index(str, "%") + if (i == 0) # no work to do + return str + + do { + pre = substr(str, 1, i-1) # part before %xx + code1 = substr(str, i+1, 1) # first hex digit + code2 = substr(str, i+2, 1) # second hex digit + str = substr(str, i+3) # rest of string + + code1 = tolower(code1) + code2 = tolower(code2) + val = index(hexdigs, code1) * 16 \ + + index(hexdigs, code2) + + result = result pre sprintf("%c", val) + i = index(str, "%") + } while (i != 0) + if (length(str) > 0) + result = result str + return result + } + + This works by splitting the string apart around an encoded character. +The two digits are converted to lowercase characters and looked up in a +string of hex digits. Note that `0' is not in the string on purpose; +`index' returns zero when it's not found, automatically giving the +correct value! Once the hexadecimal value is converted from characters +in a string into a numerical value, `sprintf' converts the value back +into a real character. The following is a simple test harness for the +above functions: + + BEGIN { + CGI_setup("GET", + "http://www.gnu.org/cgi-bin/foo?p1=stuff&p2=stuff%26junk" \ + "&percent=a %25 sign", + "1.0") + for (i in MENU) + printf "MENU[\"%s\"] = %s\n", i, MENU[i] + for (i in PARAM) + printf "PARAM[\"%s\"] = %s\n", i, PARAM[i] + for (i in GETARG) + printf "GETARG[\"%s\"] = %s\n", i, GETARG[i] + } + + And this is the result when we run it: + + $ gawk -f testserv.awk + -| MENU["4"] = www.gnu.org + -| MENU["5"] = cgi-bin + -| MENU["6"] = foo + -| MENU["1"] = http + -| MENU["2"] = + -| MENU["3"] = + -| PARAM["1"] = p1=stuff + -| PARAM["2"] = p2=stuff&junk + -| PARAM["3"] = percent=a % sign + -| GETARG["p1"] = stuff + -| GETARG["percent"] = a % sign + -| GETARG["p2"] = stuff&junk + -| GETARG["Method"] = GET + -| GETARG["Version"] = 1.0 + -| GETARG["URI"] = http://www.gnu.org/cgi-bin/foo?p1=stuff& + p2=stuff%26junk&percent=a %25 sign + + +File: gawkinet.info, Node: Simple Server, Next: Caveats, Prev: Interacting Service, Up: Using Networking + +2.10 A Simple Web Server +======================== + +In the preceding node, we built the core logic for event-driven GUIs. +In this node, we finally extend the core to a real application. No one +would actually write a commercial web server in `gawk', but it is +instructive to see that it is feasible in principle. + + The application is ELIZA, the famous program by Joseph Weizenbaum +that mimics the behavior of a professional psychotherapist when talking +to you. Weizenbaum would certainly object to this description, but +this is part of the legend around ELIZA. Take the site-independent +core logic and append the following code: + + function SetUpServer() { + SetUpEliza() + TopHeader = \ + "An HTTP-based System with GAWK\ + \ + " + TopDoc = "\ +

Please choose one of the following actions:

\ +
" + TopFooter = "" + } + + `SetUpServer' is similar to the previous example, except for calling +another function, `SetUpEliza'. This approach can be used to implement +other kinds of servers. The only changes needed to do so are hidden in +the functions `SetUpServer' and `HandleGET'. Perhaps it might be +necessary to implement other HTTP methods. The `igawk' program that +comes with `gawk' may be useful for this process. + + When extending this example to a complete application, the first +thing to do is to implement the function `SetUpServer' to initialize +the HTML pages and some variables. These initializations determine the +way your HTML pages look (colors, titles, menu items, etc.). + + The function `HandleGET' is a nested case selection that decides +which page the user wants to see next. Each nesting level refers to a +menu level of the GUI. Each case implements a certain action of the +menu. On the deepest level of case selection, the handler essentially +knows what the user wants and stores the answer into the variable that +holds the HTML page contents: + + function HandleGET() { + # A real HTTP server would treat some parts of the URI as a file name. + # We take parts of the URI as menu choices and go on accordingly. + if(MENU[2] == "AboutServer") { + Document = "This is not a CGI script.\ + This is an httpd, an HTML file, and a CGI script all \ + in one GAWK script. It needs no separate www-server, \ + no installation, and no root privileges.\ +

To run it, do this:

    \ +
  • start this script with \"gawk -f httpserver.awk\",
  • \ +
  • and on the same host let your www browser open location\ + \"http://localhost:8080\"
  • \ +
\

\ Details of HTTP come from:

    \ +
  • Hethmon: Illustrated Guide to HTTP

    \ +
  • RFC 2068

JK 14.9.1997

" + } else if (MENU[2] == "AboutELIZA") { + Document = "This is an implementation of the famous ELIZA\ + program by Joseph Weizenbaum. It is written in GAWK and\ + /bin/sh: expad: command not found + } else if (MENU[2] == "StartELIZA") { + gsub(/\+/, " ", GETARG["YouSay"]) + # Here we also have to substitute coded special characters + Document = "
" \ + "

" ElizaSays(GETARG["YouSay"]) "

\ +

\ +

" + } + } + + Now we are down to the heart of ELIZA, so you can see how it works. +Initially the user does not say anything; then ELIZA resets its money +counter and asks the user to tell what comes to mind open heartedly. +The subsequent answers are converted to uppercase characters and stored +for later comparison. ELIZA presents the bill when being confronted with +a sentence that contains the phrase "shut up." Otherwise, it looks for +keywords in the sentence, conjugates the rest of the sentence, remembers +the keyword for later use, and finally selects an answer from the set of +possible answers: + + function ElizaSays(YouSay) { + if (YouSay == "") { + cost = 0 + answer = "HI, IM ELIZA, TELL ME YOUR PROBLEM" + } else { + q = toupper(YouSay) + gsub("'", "", q) + if(q == qold) { + answer = "PLEASE DONT REPEAT YOURSELF !" + } else { + if (index(q, "SHUT UP") > 0) { + answer = "WELL, PLEASE PAY YOUR BILL. ITS EXACTLY ... $"\ + int(100*rand()+30+cost/100) + } else { + qold = q + w = "-" # no keyword recognized yet + for (i in k) { # search for keywords + if (index(q, i) > 0) { + w = i + break + } + } + if (w == "-") { # no keyword, take old subject + w = wold + subj = subjold + } else { # find subject + subj = substr(q, index(q, w) + length(w)+1) + wold = w + subjold = subj # remember keyword and subject + } + for (i in conj) + gsub(i, conj[i], q) # conjugation + # from all answers to this keyword, select one randomly + answer = r[indices[int(split(k[w], indices) * rand()) + 1]] + # insert subject into answer + gsub("_", subj, answer) + } + } + } + cost += length(answer) # for later payment : 1 cent per character + return answer + } + + In the long but simple function `SetUpEliza', you can see tables for +conjugation, keywords, and answers.(1) The associative array `k' +contains indices into the array of answers `r'. To choose an answer, +ELIZA just picks an index randomly: + + function SetUpEliza() { + srand() + wold = "-" + subjold = " " + + # table for conjugation + conj[" ARE " ] = " AM " + conj["WERE " ] = "WAS " + conj[" YOU " ] = " I " + conj["YOUR " ] = "MY " + conj[" IVE " ] =\ + conj[" I HAVE " ] = " YOU HAVE " + conj[" YOUVE " ] =\ + conj[" YOU HAVE "] = " I HAVE " + conj[" IM " ] =\ + conj[" I AM " ] = " YOU ARE " + conj[" YOURE " ] =\ + conj[" YOU ARE " ] = " I AM " + + # table of all answers + r[1] = "DONT YOU BELIEVE THAT I CAN _" + r[2] = "PERHAPS YOU WOULD LIKE TO BE ABLE TO _ ?" + ... + + # table for looking up answers that + # fit to a certain keyword + k["CAN YOU"] = "1 2 3" + k["CAN I"] = "4 5" + k["YOU ARE"] =\ + k["YOURE"] = "6 7 8 9" + ... + + } + + Some interesting remarks and details (including the original source +code of ELIZA) are found on Mark Humphrys' home page. Yahoo! also has +a page with a collection of ELIZA-like programs. Many of them are +written in Java, some of them disclosing the Java source code, and a +few even explain how to modify the Java source code. + + ---------- Footnotes ---------- + + (1) The version shown here is abbreviated. The full version comes +with the `gawk' distribution. + + +File: gawkinet.info, Node: Caveats, Next: Challenges, Prev: Simple Server, Up: Using Networking + +2.11 Network Programming Caveats +================================ + +By now it should be clear that debugging a networked application is more +complicated than debugging a single-process single-hosted application. +The behavior of a networked application sometimes looks noncausal +because it is not reproducible in a strong sense. Whether a network +application works or not sometimes depends on the following: + + * How crowded the underlying network is + + * If the party at the other end is running or not + + * The state of the party at the other end + + The most difficult problems for a beginner arise from the hidden +states of the underlying network. After closing a TCP connection, it's +often necessary to wait a short while before reopening the connection. +Even more difficult is the establishment of a connection that +previously ended with a "broken pipe." Those connections have to "time +out" for a minute or so before they can reopen. Check this with the +command `netstat -a', which provides a list of still "active" +connections. + + +File: gawkinet.info, Node: Challenges, Prev: Caveats, Up: Using Networking + +2.12 Where To Go From Here +========================== + +Now, you have learned enough to build your own application. You could, +for example, take part in the Loebner Contest to win $100,000. The +Loebner Prize is the first formal instantiation of a Turing Test. Hugh +Loebner agreed with The Cambridge Center for Behavioral Studies to +underwrite a contest designed to implement the Turing Test. Dr. +Loebner pledged a Grand Prize of $100,000 for the first computer whose +responses were indistinguishable from a human's. Each year an annual +prize of $2000 and a bronze medal is awarded to the _most_ human +computer. The winner of the annual contest is the best entry relative +to other entries that year, irrespective of how good it is in an +absolute sense. Here is an example of a conversation with the winning +program of 1997: + + (c)1997 Cambridge Center For Behavioral Studies all rights reserved [CONVERSE] + [Intelligent Research Ltd.] Start at: [1997/04/29 08:59:40] + PROGRAM[10:39:20]Hi, my name is Catherine, what's yours? + JUDGE02[10:39:36]My name is Nathan. + PROGRAM[10:39:37]Well, it's nice to meet you, Nathan. + PROGRAM[10:39:45]Did you see that story on CNN last night about the lesbian + PROGRAM[10:40:03]couple who came out at a White House party on Sunday? + JUDGE02[10:40:45]No. I'm sorry I missed that. How did the Prez take it? + PROGRAM[10:40:47]Ellen Degeneres was one of them - she was kissing her lover + PROGRAM[10:41:08]in front of Bill Clinton. Do you think he was very + PROGRAM[10:41:21]embarrassed? + JUDGE02[10:41:37]You tell me. I didn't see it. + PROGRAM[10:41:38]Are you still a Friend of Bill Clinton? + JUDGE02[10:42:22]Yes. I would like to talk about something else. Do you know anything about sculpture. + PROGRAM[10:42:24]Well, I suppose he's doing his best like most of us, but he + PROGRAM[10:42:35]does seem to attract an UNUSUAL amount of bad publicity, + PROGRAM[10:42:51]wouldnt you say--can it all be bad luck? + JUDGE02[10:43:20]I asked you if you knew anything about sculpture. + PROGRAM[10:43:21]OK, but what happens now--does it all drift on, with + PROGRAM[10:43:36]everyone waiting to see how much his friends have said about + PROGRAM[10:43:47]him under threat of lots and lots of jail-or will something + PROGRAM[10:44:01]dramatic actually happen? + JUDGE02[10:44:19]Do you know what sculpture is? + PROGRAM[10:44:20]Well, youre more a fan of his than I am I guess---though I + PROGRAM[10:44:34]cant SWEAR what Id have done in that locked hotel room, I + PROGRAM[10:44:51]must say. + JUDGE02[10:45:26]Have you ever been to the Salmagundi Club? + PROGRAM[10:45:29]Never. to go back to the original discussion Time to get + PROGRAM[10:45:43]off this one I think and onto something more down to earth! + JUDGE02[10:46:20]What is more down to earth than art? + PROGRAM[10:46:21]I don't know what -- to be honest. - + PROGRAM[10:46:30]I suppose it depends on where you're coming from, but as the + PROGRAM[10:46:46]song goes in My Fair Lady, "Why can't a woman be more like a + PROGRAM[10:47:03]man? " + JUDGE02[10:47:52]I liked that song but I prefer "Why can't children be more like we are" + JUDGE02[10:48:10]from another play the name of which I cannot remember. + PROGRAM[10:48:12]What, if anything, do you enjoy about being a man? + JUDGE02[10:49:01]I would enjoy all aspects of life no matter what my gender. + PROGRAM[10:49:02]Do you think of yourself as being attractive? + + This program insists on always speaking about the same story around +Bill Clinton. You see, even a program with a rather narrow mind can +behave so much like a human being that it can win this prize. It is +quite common to let these programs talk to each other via network +connections. But during the competition itself, the program and its +computer have to be present at the place the competition is held. We +all would love to see a `gawk' program win in such an event. Maybe it +is up to you to accomplish this? + + Some other ideas for useful networked applications: + * Read the file `doc/awkforai.txt' in the `gawk' distribution. It + was written by Ronald P. Loui (Associate Professor of Computer + Science, at Washington University in St. Louis, + ) and summarizes why he teaches `gawk' to + students of Artificial Intelligence. Here are some passages from + the text: + + The GAWK manual can be consumed in a single lab session and + the language can be mastered by the next morning by the + average student. GAWK's automatic initialization, implicit + coercion, I/O support and lack of pointers forgive many of + the mistakes that young programmers are likely to make. + Those who have seen C but not mastered it are happy to see + that GAWK retains some of the same sensibilities while adding + what must be regarded as spoonsful of syntactic sugar. + ... + There are further simple answers. Probably the best is the + fact that increasingly, undergraduate AI programming is + involving the Web. Oren Etzioni (University of Washington, + Seattle) has for a while been arguing that the "softbot" is + replacing the mechanical engineers' robot as the most + glamorous AI testbed. If the artifact whose behavior needs + to be controlled in an intelligent way is the software agent, + then a language that is well-suited to controlling the + software environment is the appropriate language. That would + imply a scripting language. If the robot is KAREL, then the + right language is "turn left; turn right." If the robot is + Netscape, then the right language is something that can + generate `netscape -remote + 'openURL(http://cs.wustl.edu/~loui)'' with elan. + ... + AI programming requires high-level thinking. There have + always been a few gifted programmers who can write high-level + programs in assembly language. Most however need the ambient + abstraction to have a higher floor. + ... + Second, inference is merely the expansion of notation. No + matter whether the logic that underlies an AI program is + fuzzy, probabilistic, deontic, defeasible, or deductive, the + logic merely defines how strings can be transformed into + other strings. A language that provides the best support for + string processing in the end provides the best support for + logic, for the exploration of various logics, and for most + forms of symbolic processing that AI might choose to call + "reasoning" instead of "logic." The implication is that + PROLOG, which saves the AI programmer from having to write a + unifier, saves perhaps two dozen lines of GAWK code at the + expense of strongly biasing the logic and representational + expressiveness of any approach. + + Now that `gawk' itself can connect to the Internet, it should be + obvious that it is suitable for writing intelligent web agents. + + * `awk' is strong at pattern recognition and string processing. So, + it is well suited to the classic problem of language translation. + A first try could be a program that knows the 100 most frequent + English words and their counterparts in German or French. The + service could be implemented by regularly reading email with the + program above, replacing each word by its translation and sending + the translation back via SMTP. Users would send English email to + their translation service and get back a translated email message + in return. As soon as this works, more effort can be spent on a + real translation program. + + * Another dialogue-oriented application (on the verge of ridicule) + is the email "support service." Troubled customers write an email + to an automatic `gawk' service that reads the email. It looks for + keywords in the mail and assembles a reply email accordingly. By + carefully investigating the email header, and repeating these + keywords through the reply email, it is rather simple to give the + customer a feeling that someone cares. Ideally, such a service + would search a database of previous cases for solutions. If none + exists, the database could, for example, consist of all the + newsgroups, mailing lists and FAQs on the Internet. + + +File: gawkinet.info, Node: Some Applications and Techniques, Next: Links, Prev: Using Networking, Up: Top + +3 Some Applications and Techniques +********************************** + +In this major node, we look at a number of self-contained scripts, with +an emphasis on concise networking. Along the way, we work towards +creating building blocks that encapsulate often needed functions of the +networking world, show new techniques that broaden the scope of +problems that can be solved with `gawk', and explore leading edge +technology that may shape the future of networking. + + We often refer to the site-independent core of the server that we +built in *note A Simple Web Server: Simple Server. When building new +and nontrivial servers, we always copy this building block and append +new instances of the two functions `SetUpServer' and `HandleGET'. + + This makes a lot of sense, since this scheme of event-driven +execution provides `gawk' with an interface to the most widely accepted +standard for GUIs: the web browser. Now, `gawk' can rival even Tcl/Tk. + + Tcl and `gawk' have much in common. Both are simple scripting +languages that allow us to quickly solve problems with short programs. +But Tcl has Tk on top of it, and `gawk' had nothing comparable up to +now. While Tcl needs a large and ever-changing library (Tk, which was +bound to the X Window System until recently), `gawk' needs just the +networking interface and some kind of browser on the client's side. +Besides better portability, the most important advantage of this +approach (embracing well-established standards such HTTP and HTML) is +that _we do not need to change the language_. We let others do the work +of fighting over protocols and standards. We can use HTML, JavaScript, +VRML, or whatever else comes along to do our work. + +* Menu: + +* PANIC:: An Emergency Web Server. +* GETURL:: Retrieving Web Pages. +* REMCONF:: Remote Configuration Of Embedded Systems. +* URLCHK:: Look For Changed Web Pages. +* WEBGRAB:: Extract Links From A Page. +* STATIST:: Graphing A Statistical Distribution. +* MAZE:: Walking Through A Maze In Virtual Reality. +* MOBAGWHO:: A Simple Mobile Agent. +* STOXPRED:: Stock Market Prediction As A Service. +* PROTBASE:: Searching Through A Protein Database. + + +File: gawkinet.info, Node: PANIC, Next: GETURL, Prev: Some Applications and Techniques, Up: Some Applications and Techniques + +3.1 PANIC: An Emergency Web Server +================================== + +At first glance, the `"Hello, world"' example in *note A Primitive Web +Service: Primitive Service, seems useless. By adding just a few lines, +we can turn it into something useful. + + The PANIC program tells everyone who connects that the local site is +not working. When a web server breaks down, it makes a difference if +customers get a strange "network unreachable" message, or a short +message telling them that the server has a problem. In such an +emergency, the hard disk and everything on it (including the regular +web service) may be unavailable. Rebooting the web server off a +diskette makes sense in this setting. + + To use the PANIC program as an emergency web server, all you need +are the `gawk' executable and the program below on a diskette. By +default, it connects to port 8080. A different value may be supplied on +the command line: + + BEGIN { + RS = ORS = "\r\n" + if (MyPort == 0) MyPort = 8080 + HttpService = "/inet/tcp/" MyPort "/0/0" + Hello = "Out Of Service" \ + "

" \ + "This site is temporarily out of service." \ + "

" + Len = length(Hello) + length(ORS) + while ("awk" != "complex") { + print "HTTP/1.0 200 OK" |& HttpService + print "Content-Length: " Len ORS |& HttpService + print Hello |& HttpService + while ((HttpService |& getline) > 0) + continue; + close(HttpService) + } + } + + +File: gawkinet.info, Node: GETURL, Next: REMCONF, Prev: PANIC, Up: Some Applications and Techniques + +3.2 GETURL: Retrieving Web Pages +================================ + +GETURL is a versatile building block for shell scripts that need to +retrieve files from the Internet. It takes a web address as a +command-line parameter and tries to retrieve the contents of this +address. The contents are printed to standard output, while the header +is printed to `/dev/stderr'. A surrounding shell script could analyze +the contents and extract the text or the links. An ASCII browser could +be written around GETURL. But more interestingly, web robots are +straightforward to write on top of GETURL. On the Internet, you can find +several programs of the same name that do the same job. They are usually +much more complex internally and at least 10 times longer. + + At first, GETURL checks if it was called with exactly one web +address. Then, it checks if the user chose to use a special proxy +server whose name is handed over in a variable. By default, it is +assumed that the local machine serves as proxy. GETURL uses the `GET' +method by default to access the web page. By handing over the name of a +different method (such as `HEAD'), it is possible to choose a different +behavior. With the `HEAD' method, the user does not receive the body of +the page content, but does receive the header: + + BEGIN { + if (ARGC != 2) { + print "GETURL - retrieve Web page via HTTP 1.0" + print "IN:\n the URL as a command-line parameter" + print "PARAM(S):\n -v Proxy=MyProxy" + print "OUT:\n the page content on stdout" + print " the page header on stderr" + print "JK 16.05.1997" + print "ADR 13.08.2000" + exit + } + URL = ARGV[1]; ARGV[1] = "" + if (Proxy == "") Proxy = "127.0.0.1" + if (ProxyPort == 0) ProxyPort = 80 + if (Method == "") Method = "GET" + HttpService = "/inet/tcp/0/" Proxy "/" ProxyPort + ORS = RS = "\r\n\r\n" + print Method " " URL " HTTP/1.0" |& HttpService + HttpService |& getline Header + print Header > "/dev/stderr" + while ((HttpService |& getline) > 0) + printf "%s", $0 + close(HttpService) + } + + This program can be changed as needed, but be careful with the last +lines. Make sure transmission of binary data is not corrupted by +additional line breaks. Even as it is now, the byte sequence +`"\r\n\r\n"' would disappear if it were contained in binary data. Don't +get caught in a trap when trying a quick fix on this one. + + +File: gawkinet.info, Node: REMCONF, Next: URLCHK, Prev: GETURL, Up: Some Applications and Techniques + +3.3 REMCONF: Remote Configuration of Embedded Systems +===================================================== + +Today, you often find powerful processors in embedded systems. +Dedicated network routers and controllers for all kinds of machinery +are examples of embedded systems. Processors like the Intel 80x86 or +the AMD Elan are able to run multitasking operating systems, such as +XINU or GNU/Linux in embedded PCs. These systems are small and usually +do not have a keyboard or a display. Therefore it is difficult to set +up their configuration. There are several widespread ways to set them +up: + + * DIP switches + + * Read Only Memories such as EPROMs + + * Serial lines or some kind of keyboard + + * Network connections via `telnet' or SNMP + + * HTTP connections with HTML GUIs + + In this node, we look at a solution that uses HTTP connections to +control variables of an embedded system that are stored in a file. +Since embedded systems have tight limits on resources like memory, it +is difficult to employ advanced techniques such as SNMP and HTTP +servers. `gawk' fits in quite nicely with its single executable which +needs just a short script to start working. The following program +stores the variables in a file, and a concurrent process in the +embedded system may read the file. The program uses the +site-independent part of the simple web server that we developed in +*note A Web Service with Interaction: Interacting Service. As +mentioned there, all we have to do is to write two new procedures +`SetUpServer' and `HandleGET': + + function SetUpServer() { + TopHeader = "Remote Configuration" + TopDoc = "\ +

Please choose one of the following actions:

\ + " + TopFooter = "" + if (ConfigFile == "") ConfigFile = "config.asc" + } + + The function `SetUpServer' initializes the top level HTML texts as +usual. It also initializes the name of the file that contains the +configuration parameters and their values. In case the user supplies a +name from the command line, that name is used. The file is expected to +contain one parameter per line, with the name of the parameter in +column one and the value in column two. + + The function `HandleGET' reflects the structure of the menu tree as +usual. The first menu choice tells the user what this is all about. The +second choice reads the configuration file line by line and stores the +parameters and their values. Notice that the record separator for this +file is `"\n"', in contrast to the record separator for HTTP. The third +menu choice builds an HTML table to show the contents of the +configuration file just read. The fourth choice does the real work of +changing parameters, and the last one just saves the configuration into +a file: + + function HandleGET() { + if(MENU[2] == "AboutServer") { + Document = "This is a GUI for remote configuration of an\ + embedded system. It is is implemented as one GAWK script." + } else if (MENU[2] == "ReadConfig") { + RS = "\n" + while ((getline < ConfigFile) > 0) + config[$1] = $2; + close(ConfigFile) + RS = "\r\n" + Document = "Configuration has been read." + } else if (MENU[2] == "CheckConfig") { + Document = "" + for (i in config) + Document = Document "" \ + "" + Document = Document "
" i "" config[i] "
" + } else if (MENU[2] == "ChangeConfig") { + if ("Param" in GETARG) { # any parameter to set? + if (GETARG["Param"] in config) { # is parameter valid? + config[GETARG["Param"]] = GETARG["Value"] + Document = (GETARG["Param"] " = " GETARG["Value"] ".") + } else { + Document = "Parameter " GETARG["Param"] " is invalid." + } + } else { + Document = "

Change one parameter

\ + \ + \ + \ + \ +
ParameterValue
" + } + } else if (MENU[2] == "SaveConfig") { + for (i in config) + printf("%s %s\n", i, config[i]) > ConfigFile + close(ConfigFile) + Document = "Configuration has been saved." + } + } + + We could also view the configuration file as a database. From this +point of view, the previous program acts like a primitive database +server. Real SQL database systems also make a service available by +providing a TCP port that clients can connect to. But the application +level protocols they use are usually proprietary and also change from +time to time. This is also true for the protocol that MiniSQL uses. + + +File: gawkinet.info, Node: URLCHK, Next: WEBGRAB, Prev: REMCONF, Up: Some Applications and Techniques + +3.4 URLCHK: Look for Changed Web Pages +====================================== + +Most people who make heavy use of Internet resources have a large +bookmark file with pointers to interesting web sites. It is impossible +to regularly check by hand if any of these sites have changed. A program +is needed to automatically look at the headers of web pages and tell +which ones have changed. URLCHK does the comparison after using GETURL +with the `HEAD' method to retrieve the header. + + Like GETURL, this program first checks that it is called with exactly +one command-line parameter. URLCHK also takes the same command-line +variables `Proxy' and `ProxyPort' as GETURL, because these variables +are handed over to GETURL for each URL that gets checked. The one and +only parameter is the name of a file that contains one line for each +URL. In the first column, we find the URL, and the second and third +columns hold the length of the URL's body when checked for the two last +times. Now, we follow this plan: + + 1. Read the URLs from the file and remember their most recent lengths + + 2. Delete the contents of the file + + 3. For each URL, check its new length and write it into the file + + 4. If the most recent and the new length differ, tell the user + + It may seem a bit peculiar to read the URLs from a file together +with their two most recent lengths, but this approach has several +advantages. You can call the program again and again with the same +file. After running the program, you can regenerate the changed URLs by +extracting those lines that differ in their second and third columns: + + BEGIN { + if (ARGC != 2) { + print "URLCHK - check if URLs have changed" + print "IN:\n the file with URLs as a command-line parameter" + print " file contains URL, old length, new length" + print "PARAMS:\n -v Proxy=MyProxy -v ProxyPort=8080" + print "OUT:\n same as file with URLs" + print "JK 02.03.1998" + exit + } + URLfile = ARGV[1]; ARGV[1] = "" + if (Proxy != "") Proxy = " -v Proxy=" Proxy + if (ProxyPort != "") ProxyPort = " -v ProxyPort=" ProxyPort + while ((getline < URLfile) > 0) + Length[$1] = $3 + 0 + close(URLfile) # now, URLfile is read in and can be updated + GetHeader = "gawk " Proxy ProxyPort " -v Method=\"HEAD\" -f geturl.awk " + for (i in Length) { + GetThisHeader = GetHeader i " 2>&1" + while ((GetThisHeader | getline) > 0) + if (toupper($0) ~ /CONTENT-LENGTH/) NewLength = $2 + 0 + close(GetThisHeader) + print i, Length[i], NewLength > URLfile + if (Length[i] != NewLength) # report only changed URLs + print i, Length[i], NewLength + } + close(URLfile) + } + + Another thing that may look strange is the way GETURL is called. +Before calling GETURL, we have to check if the proxy variables need to +be passed on. If so, we prepare strings that will become part of the +command line later. In `GetHeader', we store these strings together +with the longest part of the command line. Later, in the loop over the +URLs, `GetHeader' is appended with the URL and a redirection operator +to form the command that reads the URL's header over the Internet. +GETURL always produces the headers over `/dev/stderr'. That is the +reason why we need the redirection operator to have the header piped in. + + This program is not perfect because it assumes that changing URLs +results in changed lengths, which is not necessarily true. A more +advanced approach is to look at some other header line that holds time +information. But, as always when things get a bit more complicated, +this is left as an exercise to the reader. + + +File: gawkinet.info, Node: WEBGRAB, Next: STATIST, Prev: URLCHK, Up: Some Applications and Techniques + +3.5 WEBGRAB: Extract Links from a Page +====================================== + +Sometimes it is necessary to extract links from web pages. Browsers do +it, web robots do it, and sometimes even humans do it. Since we have a +tool like GETURL at hand, we can solve this problem with some help from +the Bourne shell: + + BEGIN { RS = "http://[#%&\\+\\-\\./0-9\\:;\\?A-Z_a-z\\~]*" } + RT != "" { + command = ("gawk -v Proxy=MyProxy -f geturl.awk " RT \ + " > doc" NR ".html") + print command + } + + Notice that the regular expression for URLs is rather crude. A +precise regular expression is much more complex. But this one works +rather well. One problem is that it is unable to find internal links of +an HTML document. Another problem is that `ftp', `telnet', `news', +`mailto', and other kinds of links are missing in the regular +expression. However, it is straightforward to add them, if doing so is +necessary for other tasks. + + This program reads an HTML file and prints all the HTTP links that +it finds. It relies on `gawk''s ability to use regular expressions as +record separators. With `RS' set to a regular expression that matches +links, the second action is executed each time a non-empty link is +found. We can find the matching link itself in `RT'. + + The action could use the `system' function to let another GETURL +retrieve the page, but here we use a different approach. This simple +program prints shell commands that can be piped into `sh' for +execution. This way it is possible to first extract the links, wrap +shell commands around them, and pipe all the shell commands into a +file. After editing the file, execution of the file retrieves exactly +those files that we really need. In case we do not want to edit, we can +retrieve all the pages like this: + + gawk -f geturl.awk http://www.suse.de | gawk -f webgrab.awk | sh + + After this, you will find the contents of all referenced documents in +files named `doc*.html' even if they do not contain HTML code. The +most annoying thing is that we always have to pass the proxy to GETURL. +If you do not like to see the headers of the web pages appear on the +screen, you can redirect them to `/dev/null'. Watching the headers +appear can be quite interesting, because it reveals interesting details +such as which web server the companies use. Now, it is clear how the +clever marketing people use web robots to determine the market shares +of Microsoft and Netscape in the web server market. + + Port 80 of any web server is like a small hole in a repellent +firewall. After attaching a browser to port 80, we usually catch a +glimpse of the bright side of the server (its home page). With a tool +like GETURL at hand, we are able to discover some of the more concealed +or even "indecent" services (i.e., lacking conformity to standards of +quality). It can be exciting to see the fancy CGI scripts that lie +there, revealing the inner workings of the server, ready to be called: + + * With a command such as: + + gawk -f geturl.awk http://any.host.on.the.net/cgi-bin/ + + some servers give you a directory listing of the CGI files. + Knowing the names, you can try to call some of them and watch for + useful results. Sometimes there are executables in such directories + (such as Perl interpreters) that you may call remotely. If there + are subdirectories with configuration data of the web server, this + can also be quite interesting to read. + + * The well-known Apache web server usually has its CGI files in the + directory `/cgi-bin'. There you can often find the scripts + `test-cgi' and `printenv'. Both tell you some things about the + current connection and the installation of the web server. Just + call: + + gawk -f geturl.awk http://any.host.on.the.net/cgi-bin/test-cgi + gawk -f geturl.awk http://any.host.on.the.net/cgi-bin/printenv + + * Sometimes it is even possible to retrieve system files like the web + server's log file--possibly containing customer data--or even the + file `/etc/passwd'. (We don't recommend this!) + + *Caution:* Although this may sound funny or simply irrelevant, we +are talking about severe security holes. Try to explore your own system +this way and make sure that none of the above reveals too much +information about your system. + + +File: gawkinet.info, Node: STATIST, Next: MAZE, Prev: WEBGRAB, Up: Some Applications and Techniques + +3.6 STATIST: Graphing a Statistical Distribution +================================================ + +In the HTTP server examples we've shown thus far, we never present an +image to the browser and its user. Presenting images is one task. +Generating images that reflect some user input and presenting these +dynamically generated images is another. In this node, we use GNUPlot +for generating `.png', `.ps', or `.gif' files.(1) + + The program we develop takes the statistical parameters of two +samples and computes the t-test statistics. As a result, we get the +probabilities that the means and the variances of both samples are the +same. In order to let the user check plausibility, the program presents +an image of the distributions. The statistical computation follows +`Numerical Recipes in C: The Art of Scientific Computing' by William H. +Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. +Since `gawk' does not have a built-in function for the computation of +the beta function, we use the `ibeta' function of GNUPlot. As a side +effect, we learn how to use GNUPlot as a sophisticated calculator. The +comparison of means is done as in `tutest', paragraph 14.2, page 613, +and the comparison of variances is done as in `ftest', page 611 in +`Numerical Recipes'. + + As usual, we take the site-independent code for servers and append +our own functions `SetUpServer' and `HandleGET': + + function SetUpServer() { + TopHeader = "Statistics with GAWK" + TopDoc = "\ +

Please choose one of the following actions:

\ + " + TopFooter = "" + GnuPlot = "gnuplot 2>&1" + m1=m2=0; v1=v2=1; n1=n2=10 + } + + Here, you see the menu structure that the user sees. Later, we will +see how the program structure of the `HandleGET' function reflects the +menu structure. What is missing here is the link for the image we +generate. In an event-driven environment, request, generation, and +delivery of images are separated. + + Notice the way we initialize the `GnuPlot' command string for the +pipe. By default, GNUPlot outputs the generated image via standard +output, as well as the results of `print'(ed) calculations via standard +error. The redirection causes standard error to be mixed into standard +output, enabling us to read results of calculations with `getline'. By +initializing the statistical parameters with some meaningful defaults, +we make sure the user gets an image the first time he uses the program. + + Following is the rather long function `HandleGET', which implements +the contents of this service by reacting to the different kinds of +requests from the browser. Before you start playing with this script, +make sure that your browser supports JavaScript and that it also has +this option switched on. The script uses a short snippet of JavaScript +code for delayed opening of a window with an image. A more detailed +explanation follows: + + function HandleGET() { + if(MENU[2] == "AboutServer") { + Document = "This is a GUI for a statistical computation.\ + It compares means and variances of two distributions.\ + It is implemented as one GAWK script and uses GNUPLOT." + } else if (MENU[2] == "EnterParameters") { + Document = "" + if ("m1" in GETARG) { # are there parameters to compare? + Document = Document "" + m1 = GETARG["m1"]; v1 = GETARG["v1"]; n1 = GETARG["n1"] + m2 = GETARG["m2"]; v2 = GETARG["v2"]; n2 = GETARG["n2"] + t = (m1-m2)/sqrt(v1/n1+v2/n2) + df = (v1/n1+v2/n2)*(v1/n1+v2/n2)/((v1/n1)*(v1/n1)/(n1-1) \ + + (v2/n2)*(v2/n2) /(n2-1)) + if (v1>v2) { + f = v1/v2 + df1 = n1 - 1 + df2 = n2 - 1 + } else { + f = v2/v1 + df1 = n2 - 1 + df2 = n1 - 1 + } + print "pt=ibeta(" df/2 ",0.5," df/(df+t*t) ")" |& GnuPlot + print "pF=2.0*ibeta(" df2/2 "," df1/2 "," \ + df2/(df2+df1*f) ")" |& GnuPlot + print "print pt, pF" |& GnuPlot + RS="\n"; GnuPlot |& getline; RS="\r\n" # $1 is pt, $2 is pF + print "invsqrt2pi=1.0/sqrt(2.0*pi)" |& GnuPlot + print "nd(x)=invsqrt2pi/sd*exp(-0.5*((x-mu)/sd)**2)" |& GnuPlot + print "set term png small color" |& GnuPlot + #print "set term postscript color" |& GnuPlot + #print "set term gif medium size 320,240" |& GnuPlot + print "set yrange[-0.3:]" |& GnuPlot + print "set label 'p(m1=m2) =" $1 "' at 0,-0.1 left" |& GnuPlot + print "set label 'p(v1=v2) =" $2 "' at 0,-0.2 left" |& GnuPlot + print "plot mu=" m1 ",sd=" sqrt(v1) ", nd(x) title 'sample 1',\ + mu=" m2 ",sd=" sqrt(v2) ", nd(x) title 'sample 2'" |& GnuPlot + print "quit" |& GnuPlot + GnuPlot |& getline Image + while ((GnuPlot |& getline) > 0) + Image = Image RS $0 + close(GnuPlot) + } + Document = Document "\ +

Do these samples have the same Gaussian distribution?

\ +
\ + \ + + \ + + \ + + \ + \ + + \ + + \ + + \ + \ +
1. Mean 1. Variance1. Count
2. Mean 2. Variance2. Count

" + } else if (MENU[2] ~ "Image") { + Reason = "OK" ORS "Content-type: image/png" + #Reason = "OK" ORS "Content-type: application/x-postscript" + #Reason = "OK" ORS "Content-type: image/gif" + Header = Footer = "" + Document = Image + } + } + + As usual, we give a short description of the service in the first +menu choice. The third menu choice shows us that generation and +presentation of an image are two separate actions. While the latter +takes place quite instantly in the third menu choice, the former takes +place in the much longer second choice. Image data passes from the +generating action to the presenting action via the variable `Image' +that contains a complete `.png' image, which is otherwise stored in a +file. If you prefer `.ps' or `.gif' images over the default `.png' +images, you may select these options by uncommenting the appropriate +lines. But remember to do so in two places: when telling GNUPlot which +kind of images to generate, and when transmitting the image at the end +of the program. + + Looking at the end of the program, the way we pass the +`Content-type' to the browser is a bit unusual. It is appended to the +`OK' of the first header line to make sure the type information becomes +part of the header. The other variables that get transmitted across +the network are made empty, because in this case we do not have an HTML +document to transmit, but rather raw image data to contain in the body. + + Most of the work is done in the second menu choice. It starts with a +strange JavaScript code snippet. When first implementing this server, +we used a short `""' here. But then +browsers got smarter and tried to improve on speed by requesting the +image and the HTML code at the same time. When doing this, the browser +tries to build up a connection for the image request while the request +for the HTML text is not yet completed. The browser tries to connect to +the `gawk' server on port 8080 while port 8080 is still in use for +transmission of the HTML text. The connection for the image cannot be +built up, so the image appears as "broken" in the browser window. We +solved this problem by telling the browser to open a separate window +for the image, but only after a delay of 1000 milliseconds. By this +time, the server should be ready for serving the next request. + + But there is one more subtlety in the JavaScript code. Each time +the JavaScript code opens a window for the image, the name of the image +is appended with a timestamp (`systime'). Why this constant change of +name for the image? Initially, we always named the image `Image', but +then the Netscape browser noticed the name had _not_ changed since the +previous request and displayed the previous image (caching behavior). +The server core is implemented so that browsers are told _not_ to cache +anything. Obviously HTTP requests do not always work as expected. One +way to circumvent the cache of such overly smart browsers is to change +the name of the image with each request. These three lines of JavaScript +caused us a lot of trouble. + + The rest can be broken down into two phases. At first, we check if +there are statistical parameters. When the program is first started, +there usually are no parameters because it enters the page coming from +the top menu. Then, we only have to present the user a form that he +can use to change statistical parameters and submit them. Subsequently, +the submission of the form causes the execution of the first phase +because _now_ there _are_ parameters to handle. + + Now that we have parameters, we know there will be an image +available. Therefore we insert the JavaScript code here to initiate +the opening of the image in a separate window. Then, we prepare some +variables that will be passed to GNUPlot for calculation of the +probabilities. Prior to reading the results, we must temporarily change +`RS' because GNUPlot separates lines with newlines. After instructing +GNUPlot to generate a `.png' (or `.ps' or `.gif') image, we initiate +the insertion of some text, explaining the resulting probabilities. The +final `plot' command actually generates the image data. This raw binary +has to be read in carefully without adding, changing, or deleting a +single byte. Hence the unusual initialization of `Image' and completion +with a `while' loop. + + When using this server, it soon becomes clear that it is far from +being perfect. It mixes source code of six scripting languages or +protocols: + + * GNU `awk' implements a server for the protocol: + + * HTTP which transmits: + + * HTML text which contains a short piece of: + + * JavaScript code opening a separate window. + + * A Bourne shell script is used for piping commands into: + + * GNUPlot to generate the image to be opened. + + After all this work, the GNUPlot image opens in the JavaScript window +where it can be viewed by the user. + + It is probably better not to mix up so many different languages. +The result is not very readable. Furthermore, the statistical part of +the server does not take care of invalid input. Among others, using +negative variances will cause invalid results. + + ---------- Footnotes ---------- + + (1) Due to licensing problems, the default installation of GNUPlot +disables the generation of `.gif' files. If your installed version +does not accept `set term gif', just download and install the most +recent version of GNUPlot and the GD library +(http://www.boutell.com/gd/) by Thomas Boutell. Otherwise you still +have the chance to generate some ASCII-art style images with GNUPlot by +using `set term dumb'. (We tried it and it worked.) + + +File: gawkinet.info, Node: MAZE, Next: MOBAGWHO, Prev: STATIST, Up: Some Applications and Techniques + +3.7 MAZE: Walking Through a Maze In Virtual Reality +=================================================== + + In the long run, every program becomes rococo, and then rubble. + Alan Perlis + + By now, we know how to present arbitrary `Content-type's to a +browser. In this node, our server will present a 3D world to our +browser. The 3D world is described in a scene description language +(VRML, Virtual Reality Modeling Language) that allows us to travel +through a perspective view of a 2D maze with our browser. Browsers with +a VRML plugin enable exploration of this technology. We could do one of +those boring `Hello world' examples here, that are usually presented +when introducing novices to VRML. If you have never written any VRML +code, have a look at the VRML FAQ. Presenting a static VRML scene is a +bit trivial; in order to expose `gawk''s new capabilities, we will +present a dynamically generated VRML scene. The function `SetUpServer' +is very simple because it only sets the default HTML page and +initializes the random number generator. As usual, the surrounding +server lets you browse the maze. + + function SetUpServer() { + TopHeader = "Walk through a maze" + TopDoc = "\ +

Please choose one of the following actions:

\ + " + TopFooter = "" + srand() + } + + The function `HandleGET' is a bit longer because it first computes +the maze and afterwards generates the VRML code that is sent across the +network. As shown in the STATIST example (*note STATIST::), we set the +type of the content to VRML and then store the VRML representation of +the maze as the page content. We assume that the maze is stored in a 2D +array. Initially, the maze consists of walls only. Then, we add an +entry and an exit to the maze and let the rest of the work be done by +the function `MakeMaze'. Now, only the wall fields are left in the +maze. By iterating over the these fields, we generate one line of VRML +code for each wall field. + + function HandleGET() { + if (MENU[2] == "AboutServer") { + Document = "If your browser has a VRML 2 plugin,\ + this server shows you a simple VRML scene." + } else if (MENU[2] == "VRMLtest") { + XSIZE = YSIZE = 11 # initially, everything is wall + for (y = 0; y < YSIZE; y++) + for (x = 0; x < XSIZE; x++) + Maze[x, y] = "#" + delete Maze[0, 1] # entry is not wall + delete Maze[XSIZE-1, YSIZE-2] # exit is not wall + MakeMaze(1, 1) + Document = "\ + #VRML V2.0 utf8\n\ + Group {\n\ + children [\n\ + PointLight {\n\ + ambientIntensity 0.2\n\ + color 0.7 0.7 0.7\n\ + location 0.0 8.0 10.0\n\ + }\n\ + DEF B1 Background {\n\ + skyColor [0 0 0, 1.0 1.0 1.0 ]\n\ + skyAngle 1.6\n\ + groundColor [1 1 1, 0.8 0.8 0.8, 0.2 0.2 0.2 ]\n\ + groundAngle [ 1.2 1.57 ]\n\ + }\n\ + DEF Wall Shape {\n\ + geometry Box {size 1 1 1}\n\ + appearance Appearance { material Material { diffuseColor 0 0 1 } }\n\ + }\n\ + DEF Entry Viewpoint {\n\ + position 0.5 1.0 5.0\n\ + orientation 0.0 0.0 -1.0 0.52\n\ + }\n" + for (i in Maze) { + split(i, t, SUBSEP) + Document = Document " Transform { translation " + Document = Document t[1] " 0 -" t[2] " children USE Wall }\n" + } + Document = Document " ] # end of group for world\n}" + Reason = "OK" ORS "Content-type: model/vrml" + Header = Footer = "" + } + } + + Finally, we have a look at `MakeMaze', the function that generates +the `Maze' array. When entered, this function assumes that the array +has been initialized so that each element represents a wall element and +the maze is initially full of wall elements. Only the entrance and the +exit of the maze should have been left free. The parameters of the +function tell us which element must be marked as not being a wall. +After this, we take a look at the four neighbouring elements and +remember which we have already treated. Of all the neighbouring +elements, we take one at random and walk in that direction. Therefore, +the wall element in that direction has to be removed and then, we call +the function recursively for that element. The maze is only completed +if we iterate the above procedure for _all_ neighbouring elements (in +random order) and for our present element by recursively calling the +function for the present element. This last iteration could have been +done in a loop, but it is done much simpler recursively. + + Notice that elements with coordinates that are both odd are assumed +to be on our way through the maze and the generating process cannot +terminate as long as there is such an element not being `delete'd. All +other elements are potentially part of the wall. + + function MakeMaze(x, y) { + delete Maze[x, y] # here we are, we have no wall here + p = 0 # count unvisited fields in all directions + if (x-2 SUBSEP y in Maze) d[p++] = "-x" + if (x SUBSEP y-2 in Maze) d[p++] = "-y" + if (x+2 SUBSEP y in Maze) d[p++] = "+x" + if (x SUBSEP y+2 in Maze) d[p++] = "+y" + if (p>0) { # if there are univisited fields, go there + p = int(p*rand()) # choose one unvisited field at random + if (d[p] == "-x") { delete Maze[x - 1, y]; MakeMaze(x - 2, y) + } else if (d[p] == "-y") { delete Maze[x, y - 1]; MakeMaze(x, y - 2) + } else if (d[p] == "+x") { delete Maze[x + 1, y]; MakeMaze(x + 2, y) + } else if (d[p] == "+y") { delete Maze[x, y + 1]; MakeMaze(x, y + 2) + } # we are back from recursion + MakeMaze(x, y); # try again while there are unvisited fields + } + } + + +File: gawkinet.info, Node: MOBAGWHO, Next: STOXPRED, Prev: MAZE, Up: Some Applications and Techniques + +3.8 MOBAGWHO: a Simple Mobile Agent +=================================== + + There are two ways of constructing a software design: One way is to + make it so simple that there are obviously no deficiencies, and the + other way is to make it so complicated that there are no obvious + deficiencies. + C. A. R. Hoare + + A "mobile agent" is a program that can be dispatched from a computer +and transported to a remote server for execution. This is called +"migration", which means that a process on another system is started +that is independent from its originator. Ideally, it wanders through a +network while working for its creator or owner. In places like the UMBC +Agent Web, people are quite confident that (mobile) agents are a +software engineering paradigm that enables us to significantly increase +the efficiency of our work. Mobile agents could become the mediators +between users and the networking world. For an unbiased view at this +technology, see the remarkable paper `Mobile Agents: Are they a good +idea?'.(1) + + When trying to migrate a process from one system to another, a +server process is needed on the receiving side. Depending on the kind +of server process, several ways of implementation come to mind. How +the process is implemented depends upon the kind of server process: + + * HTTP can be used as the protocol for delivery of the migrating + process. In this case, we use a common web server as the receiving + server process. A universal CGI script mediates between migrating + process and web server. Each server willing to accept migrating + agents makes this universal service available. HTTP supplies the + `POST' method to transfer some data to a file on the web server. + When a CGI script is called remotely with the `POST' method + instead of the usual `GET' method, data is transmitted from the + client process to the standard input of the server's CGI script. + So, to implement a mobile agent, we must not only write the agent + program to start on the client side, but also the CGI script to + receive the agent on the server side. + + * The `PUT' method can also be used for migration. HTTP does not + require a CGI script for migration via `PUT'. However, with common + web servers there is no advantage to this solution, because web + servers such as Apache require explicit activation of a special + `PUT' script. + + * `Agent Tcl' pursues a different course; it relies on a dedicated + server process with a dedicated protocol specialized for receiving + mobile agents. + + Our agent example abuses a common web server as a migration tool. +So, it needs a universal CGI script on the receiving side (the web +server). The receiving script is activated with a `POST' request when +placed into a location like `/httpd/cgi-bin/PostAgent.sh'. Make sure +that the server system uses a version of `gawk' that supports network +access (Version 3.1 or later; verify with `gawk --version'). + + #!/bin/sh + MobAg=/tmp/MobileAgent.$$ + # direct script to mobile agent file + cat > $MobAg + # execute agent concurrently + gawk -f $MobAg $MobAg > /dev/null & + # HTTP header, terminator and body + gawk 'BEGIN { print "\r\nAgent started" }' + rm $MobAg # delete script file of agent + + By making its process id (`$$') part of the unique file name, the +script avoids conflicts between concurrent instances of the script. +First, all lines from standard input (the mobile agent's source code) +are copied into this unique file. Then, the agent is started as a +concurrent process and a short message reporting this fact is sent to +the submitting client. Finally, the script file of the mobile agent is +removed because it is no longer needed. Although it is a short script, +there are several noteworthy points: + +Security + _There is none_. In fact, the CGI script should never be made + available on a server that is part of the Internet because everyone + would be allowed to execute arbitrary commands with it. This + behavior is acceptable only when performing rapid prototyping. + +Self-Reference + Each migrating instance of an agent is started in a way that + enables it to read its own source code from standard input and use + the code for subsequent migrations. This is necessary because it + needs to treat the agent's code as data to transmit. `gawk' is not + the ideal language for such a job. Lisp and Tcl are more suitable + because they do not make a distinction between program code and + data. + +Independence + After migration, the agent is not linked to its former home in any + way. By reporting `Agent started', it waves "Goodbye" to its + origin. The originator may choose to terminate or not. + + The originating agent itself is started just like any other +command-line script, and reports the results on standard output. By +letting the name of the original host migrate with the agent, the agent +that migrates to a host far away from its origin can report the result +back home. Having arrived at the end of the journey, the agent +establishes a connection and reports the results. This is the reason +for determining the name of the host with `uname -n' and storing it in +`MyOrigin' for later use. We may also set variables with the `-v' +option from the command line. This interactivity is only of importance +in the context of starting a mobile agent; therefore this `BEGIN' +pattern and its action do not take part in migration: + + BEGIN { + if (ARGC != 2) { + print "MOBAG - a simple mobile agent" + print "CALL:\n gawk -f mobag.awk mobag.awk" + print "IN:\n the name of this script as a command-line parameter" + print "PARAM:\n -v MyOrigin=myhost.com" + print "OUT:\n the result on stdout" + print "JK 29.03.1998 01.04.1998" + exit + } + if (MyOrigin == "") { + "uname -n" | getline MyOrigin + close("uname -n") + } + } + + Since `gawk' cannot manipulate and transmit parts of the program +directly, the source code is read and stored in strings. Therefore, +the program scans itself for the beginning and the ending of functions. +Each line in between is appended to the code string until the end of +the function has been reached. A special case is this part of the +program itself. It is not a function. Placing a similar framework +around it causes it to be treated like a function. Notice that this +mechanism works for all the functions of the source code, but it cannot +guarantee that the order of the functions is preserved during migration: + + #ReadMySelf + /^function / { FUNC = $2 } + /^END/ || /^#ReadMySelf/ { FUNC = $1 } + FUNC != "" { MOBFUN[FUNC] = MOBFUN[FUNC] RS $0 } + (FUNC != "") && (/^}/ || /^#EndOfMySelf/) \ + { FUNC = "" } + #EndOfMySelf + + The web server code in *note A Web Service with Interaction: +Interacting Service, was first developed as a site-independent core. +Likewise, the `gawk'-based mobile agent starts with an +agent-independent core, to which can be appended application-dependent +functions. What follows is the only application-independent function +needed for the mobile agent: + + function migrate(Destination, MobCode, Label) { + MOBVAR["Label"] = Label + MOBVAR["Destination"] = Destination + RS = ORS = "\r\n" + HttpService = "/inet/tcp/0/" Destination + for (i in MOBFUN) + MobCode = (MobCode "\n" MOBFUN[i]) + MobCode = MobCode "\n\nBEGIN {" + for (i in MOBVAR) + MobCode = (MobCode "\n MOBVAR[\"" i "\"] = \"" MOBVAR[i] "\"") + MobCode = MobCode "\n}\n" + print "POST /cgi-bin/PostAgent.sh HTTP/1.0" |& HttpService + print "Content-length:", length(MobCode) ORS |& HttpService + printf "%s", MobCode |& HttpService + while ((HttpService |& getline) > 0) + print $0 + close(HttpService) + } + + The `migrate' function prepares the aforementioned strings +containing the program code and transmits them to a server. A +consequence of this modular approach is that the `migrate' function +takes some parameters that aren't needed in this application, but that +will be in future ones. Its mandatory parameter `Destination' holds the +name (or IP address) of the server that the agent wants as a host for +its code. The optional parameter `MobCode' may contain some `gawk' code +that is inserted during migration in front of all other code. The +optional parameter `Label' may contain a string that tells the agent +what to do in program execution after arrival at its new home site. One +of the serious obstacles in implementing a framework for mobile agents +is that it does not suffice to migrate the code. It is also necessary +to migrate the state of execution of the agent. In contrast to `Agent +Tcl', this program does not try to migrate the complete set of +variables. The following conventions are used: + + * Each variable in an agent program is local to the current host and + does _not_ migrate. + + * The array `MOBFUN' shown above is an exception. It is handled by + the function `migrate' and does migrate with the application. + + * The other exception is the array `MOBVAR'. Each variable that + takes part in migration has to be an element of this array. + `migrate' also takes care of this. + + Now it's clear what happens to the `Label' parameter of the function +`migrate'. It is copied into `MOBVAR["Label"]' and travels alongside +the other data. Since travelling takes place via HTTP, records must be +separated with `"\r\n"' in `RS' and `ORS' as usual. The code assembly +for migration takes place in three steps: + + * Iterate over `MOBFUN' to collect all functions verbatim. + + * Prepare a `BEGIN' pattern and put assignments to mobile variables + into the action part. + + * Transmission itself resembles GETURL: the header with the request + and the `Content-length' is followed by the body. In case there is + any reply over the network, it is read completely and echoed to + standard output to avoid irritating the server. + + The application-independent framework is now almost complete. What +follows is the `END' pattern that is executed when the mobile agent has +finished reading its own code. First, it checks whether it is already +running on a remote host or not. In case initialization has not yet +taken place, it starts `MyInit'. Otherwise (later, on a remote host), it +starts `MyJob': + + END { + if (ARGC != 2) exit # stop when called with wrong parameters + if (MyOrigin != "") # is this the originating host? + MyInit() # if so, initialize the application + else # we are on a host with migrated data + MyJob() # so we do our job + } + + All that's left to extend the framework into a complete application +is to write two application-specific functions: `MyInit' and `MyJob'. +Keep in mind that the former is executed once on the originating host, +while the latter is executed after each migration: + + function MyInit() { + MOBVAR["MyOrigin"] = MyOrigin + MOBVAR["Machines"] = "localhost/80 max/80 moritz/80 castor/80" + split(MOBVAR["Machines"], Machines) # which host is the first? + migrate(Machines[1], "", "") # go to the first host + while (("/inet/tcp/8080/0/0" |& getline) > 0) # wait for result + print $0 # print result + close("/inet/tcp/8080/0/0") + } + + As mentioned earlier, this agent takes the name of its origin +(`MyOrigin') with it. Then, it takes the name of its first destination +and goes there for further work. Notice that this name has the port +number of the web server appended to the name of the server, because +the function `migrate' needs it this way to create the `HttpService' +variable. Finally, it waits for the result to arrive. The `MyJob' +function runs on the remote host: + + function MyJob() { + # forget this host + sub(MOBVAR["Destination"], "", MOBVAR["Machines"]) + MOBVAR["Result"]=MOBVAR["Result"] SUBSEP SUBSEP MOBVAR["Destination"] ":" + while (("who" | getline) > 0) # who is logged in? + MOBVAR["Result"] = MOBVAR["Result"] SUBSEP $0 + close("who") + if (index(MOBVAR["Machines"], "/") > 0) { # any more machines to visit? + split(MOBVAR["Machines"], Machines) # which host is next? + migrate(Machines[1], "", "") # go there + } else { # no more machines + gsub(SUBSEP, "\n", MOBVAR["Result"]) # send result to origin + print MOBVAR["Result"] |& "/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080" + close("/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080") + } + } + + After migrating, the first thing to do in `MyJob' is to delete the +name of the current host from the list of hosts to visit. Now, it is +time to start the real work by appending the host's name to the result +string, and reading line by line who is logged in on this host. A very +annoying circumstance is the fact that the elements of `MOBVAR' cannot +hold the newline character (`"\n"'). If they did, migration of this +string did not work because the string didn't obey the syntax rule for +a string in `gawk'. `SUBSEP' is used as a temporary replacement. If +the list of hosts to visit holds at least one more entry, the agent +migrates to that place to go on working there. Otherwise, we replace +the `SUBSEP's with a newline character in the resulting string, and +report it to the originating host, whose name is stored in +`MOBVAR["MyOrigin"]'. + + ---------- Footnotes ---------- + + (1) `http://www.research.ibm.com/massive/mobag.ps' + + +File: gawkinet.info, Node: STOXPRED, Next: PROTBASE, Prev: MOBAGWHO, Up: Some Applications and Techniques + +3.9 STOXPRED: Stock Market Prediction As A Service +================================================== + + Far out in the uncharted backwaters of the unfashionable end of + the Western Spiral arm of the Galaxy lies a small unregarded + yellow sun. + + Orbiting this at a distance of roughly ninety-two million miles is + an utterly insignificant little blue-green planet whose + ape-descendent life forms are so amazingly primitive that they + still think digital watches are a pretty neat idea. + + This planet has -- or rather had -- a problem, which was this: + most of the people living on it were unhappy for pretty much of + the time. Many solutions were suggested for this problem, but + most of these were largely concerned with the movements of small + green pieces of paper, which is odd because it wasn't the small + green pieces of paper that were unhappy. + Douglas Adams, `The Hitch Hiker's Guide to the Galaxy' + + Valuable services on the Internet are usually _not_ implemented as +mobile agents. There are much simpler ways of implementing services. +All Unix systems provide, for example, the `cron' service. Unix system +users can write a list of tasks to be done each day, each week, twice a +day, or just once. The list is entered into a file named `crontab'. +For example, to distribute a newsletter on a daily basis this way, use +`cron' for calling a script each day early in the morning. + + # run at 8 am on weekdays, distribute the newsletter + 0 8 * * 1-5 $HOME/bin/daily.job >> $HOME/log/newsletter 2>&1 + + The script first looks for interesting information on the Internet, +assembles it in a nice form and sends the results via email to the +customers. + + The following is an example of a primitive newsletter on stock +market prediction. It is a report which first tries to predict the +change of each share in the Dow Jones Industrial Index for the +particular day. Then it mentions some especially promising shares as +well as some shares which look remarkably bad on that day. The report +ends with the usual disclaimer which tells every child _not_ to try +this at home and hurt anybody. + + Good morning Uncle Scrooge, + + This is your daily stock market report for Monday, October 16, 2000. + Here are the predictions for today: + + AA neutral + GE up + JNJ down + MSFT neutral + ... + UTX up + DD down + IBM up + MO down + WMT up + DIS up + INTC up + MRK down + XOM down + EK down + IP down + + The most promising shares for today are these: + + INTC http://biz.yahoo.com/n/i/intc.html + + The stock shares to avoid today are these: + + EK http://biz.yahoo.com/n/e/ek.html + IP http://biz.yahoo.com/n/i/ip.html + DD http://biz.yahoo.com/n/d/dd.html + ... + + The script as a whole is rather long. In order to ease the pain of +studying other people's source code, we have broken the script up into +meaningful parts which are invoked one after the other. The basic +structure of the script is as follows: + + BEGIN { + Init() + ReadQuotes() + CleanUp() + Prediction() + Report() + SendMail() + } + + The earlier parts store data into variables and arrays which are +subsequently used by later parts of the script. The `Init' function +first checks if the script is invoked correctly (without any +parameters). If not, it informs the user of the correct usage. What +follows are preparations for the retrieval of the historical quote +data. The names of the 30 stock shares are stored in an array `name' +along with the current date in `day', `month', and `year'. + + All users who are separated from the Internet by a firewall and have +to direct their Internet accesses to a proxy must supply the name of +the proxy to this script with the `-v Proxy=NAME' option. For most +users, the default proxy and port number should suffice. + + function Init() { + if (ARGC != 1) { + print "STOXPRED - daily stock share prediction" + print "IN:\n no parameters, nothing on stdin" + print "PARAM:\n -v Proxy=MyProxy -v ProxyPort=80" + print "OUT:\n commented predictions as email" + print "JK 09.10.2000" + exit + } + # Remember ticker symbols from Dow Jones Industrial Index + StockCount = split("AA GE JNJ MSFT AXP GM JPM PG BA HD KO \ + SBC C HON MCD T CAT HWP MMM UTX DD IBM MO WMT DIS INTC \ + MRK XOM EK IP", name); + # Remember the current date as the end of the time series + day = strftime("%d") + month = strftime("%m") + year = strftime("%Y") + if (Proxy == "") Proxy = "chart.yahoo.com" + if (ProxyPort == 0) ProxyPort = 80 + YahooData = "/inet/tcp/0/" Proxy "/" ProxyPort + } + + There are two really interesting parts in the script. One is the +function which reads the historical stock quotes from an Internet +server. The other is the one that does the actual prediction. In the +following function we see how the quotes are read from the Yahoo +server. The data which comes from the server is in CSV format +(comma-separated values): + + Date,Open,High,Low,Close,Volume + 9-Oct-00,22.75,22.75,21.375,22.375,7888500 + 6-Oct-00,23.8125,24.9375,21.5625,22,10701100 + 5-Oct-00,24.4375,24.625,23.125,23.50,5810300 + + Lines contain values of the same time instant, whereas columns are +separated by commas and contain the kind of data that is described in +the header (first) line. At first, `gawk' is instructed to separate +columns by commas (`FS = ","'). In the loop that follows, a connection +to the Yahoo server is first opened, then a download takes place, and +finally the connection is closed. All this happens once for each ticker +symbol. In the body of this loop, an Internet address is built up as a +string according to the rules of the Yahoo server. The starting and +ending date are chosen to be exactly the same, but one year apart in +the past. All the action is initiated within the `printf' command which +transmits the request for data to the Yahoo server. + + In the inner loop, the server's data is first read and then scanned +line by line. Only lines which have six columns and the name of a month +in the first column contain relevant data. This data is stored in the +two-dimensional array `quote'; one dimension being time, the other +being the ticker symbol. During retrieval of the first stock's data, +the calendar names of the time instances are stored in the array `day' +because we need them later. + + function ReadQuotes() { + # Retrieve historical data for each ticker symbol + FS = "," + for (stock = 1; stock <= StockCount; stock++) { + URL = "http://chart.yahoo.com/table.csv?s=" name[stock] \ + "&a=" month "&b=" day "&c=" year-1 \ + "&d=" month "&e=" day "&f=" year \ + "g=d&q=q&y=0&z=" name[stock] "&x=.csv" + printf("GET " URL " HTTP/1.0\r\n\r\n") |& YahooData + while ((YahooData |& getline) > 0) { + if (NF == 6 && $1 ~ /Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/) { + if (stock == 1) + days[++daycount] = $1; + quote[$1, stock] = $5 + } + } + close(YahooData) + } + FS = " " + } + + Now that we _have_ the data, it can be checked once again to make +sure that no individual stock is missing or invalid, and that all the +stock quotes are aligned correctly. Furthermore, we renumber the time +instances. The most recent day gets day number 1 and all other days get +consecutive numbers. All quotes are rounded toward the nearest whole +number in US Dollars. + + function CleanUp() { + # clean up time series; eliminate incomplete data sets + for (d = 1; d <= daycount; d++) { + for (stock = 1; stock <= StockCount; stock++) + if (! ((days[d], stock) in quote)) + stock = StockCount + 10 + if (stock > StockCount + 1) + continue + datacount++ + for (stock = 1; stock <= StockCount; stock++) + data[datacount, stock] = int(0.5 + quote[days[d], stock]) + } + delete quote + delete days + } + + Now we have arrived at the second really interesting part of the +whole affair. What we present here is a very primitive prediction +algorithm: _If a stock fell yesterday, assume it will also fall today; +if it rose yesterday, assume it will rise today_. (Feel free to +replace this algorithm with a smarter one.) If a stock changed in the +same direction on two consecutive days, this is an indication which +should be highlighted. Two-day advances are stored in `hot' and +two-day declines in `avoid'. + + The rest of the function is a sanity check. It counts the number of +correct predictions in relation to the total number of predictions one +could have made in the year before. + + function Prediction() { + # Predict each ticker symbol by prolonging yesterday's trend + for (stock = 1; stock <= StockCount; stock++) { + if (data[1, stock] > data[2, stock]) { + predict[stock] = "up" + } else if (data[1, stock] < data[2, stock]) { + predict[stock] = "down" + } else { + predict[stock] = "neutral" + } + if ((data[1, stock] > data[2, stock]) && (data[2, stock] > data[3, stock])) + hot[stock] = 1 + if ((data[1, stock] < data[2, stock]) && (data[2, stock] < data[3, stock])) + avoid[stock] = 1 + } + # Do a plausibility check: how many predictions proved correct? + for (s = 1; s <= StockCount; s++) { + for (d = 1; d <= datacount-2; d++) { + if (data[d+1, s] > data[d+2, s]) { + UpCount++ + } else if (data[d+1, s] < data[d+2, s]) { + DownCount++ + } else { + NeutralCount++ + } + if (((data[d, s] > data[d+1, s]) && (data[d+1, s] > data[d+2, s])) || + ((data[d, s] < data[d+1, s]) && (data[d+1, s] < data[d+2, s])) || + ((data[d, s] == data[d+1, s]) && (data[d+1, s] == data[d+2, s]))) + CorrectCount++ + } + } + } + + At this point the hard work has been done: the array `predict' +contains the predictions for all the ticker symbols. It is up to the +function `Report' to find some nice words to introduce the desired +information. + + function Report() { + # Generate report + report = "\nThis is your daily " + report = report "stock market report for "strftime("%A, %B %d, %Y")".\n" + report = report "Here are the predictions for today:\n\n" + for (stock = 1; stock <= StockCount; stock++) + report = report "\t" name[stock] "\t" predict[stock] "\n" + for (stock in hot) { + if (HotCount++ == 0) + report = report "\nThe most promising shares for today are these:\n\n" + report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \ + tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n" + } + for (stock in avoid) { + if (AvoidCount++ == 0) + report = report "\nThe stock shares to avoid today are these:\n\n" + report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \ + tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n" + } + report = report "\nThis sums up to " HotCount+0 " winners and " AvoidCount+0 + report = report " losers. When using this kind\nof prediction scheme for" + report = report " the 12 months which lie behind us,\nwe get " UpCount + report = report " 'ups' and " DownCount " 'downs' and " NeutralCount + report = report " 'neutrals'. Of all\nthese " UpCount+DownCount+NeutralCount + report = report " predictions " CorrectCount " proved correct next day.\n" + report = report "A success rate of "\ + int(100*CorrectCount/(UpCount+DownCount+NeutralCount)) "%.\n" + report = report "Random choice would have produced a 33% success rate.\n" + report = report "Disclaimer: Like every other prediction of the stock\n" + report = report "market, this report is, of course, complete nonsense.\n" + report = report "If you are stupid enough to believe these predictions\n" + report = report "you should visit a doctor who can treat your ailment." + } + + The function `SendMail' goes through the list of customers and opens +a pipe to the `mail' command for each of them. Each one receives an +email message with a proper subject heading and is addressed with his +full name. + + function SendMail() { + # send report to customers + customer["uncle.scrooge@ducktown.gov"] = "Uncle Scrooge" + customer["more@utopia.org" ] = "Sir Thomas More" + customer["spinoza@denhaag.nl" ] = "Baruch de Spinoza" + customer["marx@highgate.uk" ] = "Karl Marx" + customer["keynes@the.long.run" ] = "John Maynard Keynes" + customer["bierce@devil.hell.org" ] = "Ambrose Bierce" + customer["laplace@paris.fr" ] = "Pierre Simon de Laplace" + for (c in customer) { + MailPipe = "mail -s 'Daily Stock Prediction Newsletter'" c + print "Good morning " customer[c] "," | MailPipe + print report "\n.\n" | MailPipe + close(MailPipe) + } + } + + Be patient when running the script by hand. Retrieving the data for +all the ticker symbols and sending the emails may take several minutes +to complete, depending upon network traffic and the speed of the +available Internet link. The quality of the prediction algorithm is +likely to be disappointing. Try to find a better one. Should you find +one with a success rate of more than 50%, please tell us about it! It +is only for the sake of curiosity, of course. `:-)' + + +File: gawkinet.info, Node: PROTBASE, Prev: STOXPRED, Up: Some Applications and Techniques + +3.10 PROTBASE: Searching Through A Protein Database +=================================================== + + Hoare's Law of Large Problems: Inside every large problem is a + small problem struggling to get out. + + Yahoo's database of stock market data is just one among the many +large databases on the Internet. Another one is located at NCBI +(National Center for Biotechnology Information). Established in 1988 as +a national resource for molecular biology information, NCBI creates +public databases, conducts research in computational biology, develops +software tools for analyzing genome data, and disseminates biomedical +information. In this section, we look at one of NCBI's public services, +which is called BLAST (Basic Local Alignment Search Tool). + + You probably know that the information necessary for reproducing +living cells is encoded in the genetic material of the cells. The +genetic material is a very long chain of four base nucleotides. It is +the order of appearance (the sequence) of nucleotides which contains +the information about the substance to be produced. Scientists in +biotechnology often find a specific fragment, determine the nucleotide +sequence, and need to know where the sequence at hand comes from. This +is where the large databases enter the game. At NCBI, databases store +the knowledge about which sequences have ever been found and where they +have been found. When the scientist sends his sequence to the BLAST +service, the server looks for regions of genetic material in its +database which look the most similar to the delivered nucleotide +sequence. After a search time of some seconds or minutes the server +sends an answer to the scientist. In order to make access simple, NCBI +chose to offer their database service through popular Internet +protocols. There are four basic ways to use the so-called BLAST +services: + + * The easiest way to use BLAST is through the web. Users may simply + point their browsers at the NCBI home page and link to the BLAST + pages. NCBI provides a stable URL that may be used to perform + BLAST searches without interactive use of a web browser. This is + what we will do later in this section. A demonstration client and + a `README' file demonstrate how to access this URL. + + * Currently, `blastcl3' is the standard network BLAST client. You + can download `blastcl3' from the anonymous FTP location. + + * BLAST 2.0 can be run locally as a full executable and can be used + to run BLAST searches against private local databases, or + downloaded copies of the NCBI databases. BLAST 2.0 executables may + be found on the NCBI anonymous FTP server. + + * The NCBI BLAST Email server is the best option for people without + convenient access to the web. A similarity search can be performed + by sending a properly formatted mail message containing the + nucleotide or protein query sequence to . + The query sequence is compared against the specified database + using the BLAST algorithm and the results are returned in an email + message. For more information on formulating email BLAST searches, + you can send a message consisting of the word "HELP" to the same + address, . + + Our starting point is the demonstration client mentioned in the +first option. The `README' file that comes along with the client +explains the whole process in a nutshell. In the rest of this section, +we first show what such requests look like. Then we show how to use +`gawk' to implement a client in about 10 lines of code. Finally, we +show how to interpret the result returned from the service. + + Sequences are expected to be represented in the standard IUB/IUPAC +amino acid and nucleic acid codes, with these exceptions: lower-case +letters are accepted and are mapped into upper-case; a single hyphen or +dash can be used to represent a gap of indeterminate length; and in +amino acid sequences, `U' and `*' are acceptable letters (see below). +Before submitting a request, any numerical digits in the query sequence +should either be removed or replaced by appropriate letter codes (e.g., +`N' for unknown nucleic acid residue or `X' for unknown amino acid +residue). The nucleic acid codes supported are: + + A --> adenosine M --> A C (amino) + C --> cytidine S --> G C (strong) + G --> guanine W --> A T (weak) + T --> thymidine B --> G T C + U --> uridine D --> G A T + R --> G A (purine) H --> A C T + Y --> T C (pyrimidine) V --> G C A + K --> G T (keto) N --> A G C T (any) + - gap of indeterminate length + + Now you know the alphabet of nucleotide sequences. The last two lines +of the following example query show you such a sequence, which is +obviously made up only of elements of the alphabet just described. +Store this example query into a file named `protbase.request'. You are +now ready to send it to the server with the demonstration client. + + PROGRAM blastn + DATALIB month + EXPECT 0.75 + BEGIN + >GAWK310 the gawking gene GNU AWK + tgcttggctgaggagccataggacgagagcttcctggtgaagtgtgtttcttgaaatcat + caccaccatggacagcaaa + + The actual search request begins with the mandatory parameter +`PROGRAM' in the first column followed by the value `blastn' (the name +of the program) for searching nucleic acids. The next line contains +the mandatory search parameter `DATALIB' with the value `month' for the +newest nucleic acid sequences. The third line contains an optional +`EXPECT' parameter and the value desired for it. The fourth line +contains the mandatory `BEGIN' directive, followed by the query +sequence in FASTA/Pearson format. Each line of information must be +less than 80 characters in length. + + The "month" database contains all new or revised sequences released +in the last 30 days and is useful for searching against new sequences. +There are five different blast programs, `blastn' being the one that +compares a nucleotide query sequence against a nucleotide sequence +database. + + The last server directive that must appear in every request is the +`BEGIN' directive. The query sequence should immediately follow the +`BEGIN' directive and must appear in FASTA/Pearson format. A sequence +in FASTA/Pearson format begins with a single-line description. The +description line, which is required, is distinguished from the lines of +sequence data that follow it by having a greater-than (`>') symbol in +the first column. For the purposes of the BLAST server, the text of +the description is arbitrary. + + If you prefer to use a client written in `gawk', just store the +following 10 lines of code into a file named `protbase.awk' and use +this client instead. Invoke it with `gawk -f protbase.awk +protbase.request'. Then wait a minute and watch the result coming in. +In order to replicate the demonstration client's behaviour as closely +as possible, this client does not use a proxy server. We could also +have extended the client program in *note Retrieving Web Pages: GETURL, +to implement the client request from `protbase.awk' as a special case. + + { request = request "\n" $0 } + + END { + BLASTService = "/inet/tcp/0/www.ncbi.nlm.nih.gov/80" + printf "POST /cgi-bin/BLAST/nph-blast_report HTTP/1.0\n" |& BLASTService + printf "Content-Length: " length(request) "\n\n" |& BLASTService + printf request |& BLASTService + while ((BLASTService |& getline) > 0) + print $0 + close(BLASTService) + } + + The demonstration client from NCBI is 214 lines long (written in C) +and it is not immediately obvious what it does. Our client is so short +that it _is_ obvious what it does. First it loops over all lines of the +query and stores the whole query into a variable. Then the script +establishes an Internet connection to the NCBI server and transmits the +query by framing it with a proper HTTP request. Finally it receives and +prints the complete result coming from the server. + + Now, let us look at the result. It begins with an HTTP header, which +you can ignore. Then there are some comments about the query having been +filtered to avoid spuriously high scores. After this, there is a +reference to the paper that describes the software being used for +searching the data base. After a repetition of the original query's +description we find the list of significant alignments: + + Sequences producing significant alignments: (bits) Value + + gb|AC021182.14|AC021182 Homo sapiens chromosome 7 clone RP11-733... 38 0.20 + gb|AC021056.12|AC021056 Homo sapiens chromosome 3 clone RP11-115... 38 0.20 + emb|AL160278.10|AL160278 Homo sapiens chromosome 9 clone RP11-57... 38 0.20 + emb|AL391139.11|AL391139 Homo sapiens chromosome X clone RP11-35... 38 0.20 + emb|AL365192.6|AL365192 Homo sapiens chromosome 6 clone RP3-421H... 38 0.20 + emb|AL138812.9|AL138812 Homo sapiens chromosome 11 clone RP1-276... 38 0.20 + gb|AC073881.3|AC073881 Homo sapiens chromosome 15 clone CTD-2169... 38 0.20 + + This means that the query sequence was found in seven human +chromosomes. But the value 0.20 (20%) means that the probability of an +accidental match is rather high (20%) in all cases and should be taken +into account. You may wonder what the first column means. It is a key +to the specific database in which this occurrence was found. The +unique sequence identifiers reported in the search results can be used +as sequence retrieval keys via the NCBI server. The syntax of sequence +header lines used by the NCBI BLAST server depends on the database from +which each sequence was obtained. The table below lists the +identifiers for the databases from which the sequences were derived. + + Database Name Identifier Syntax + ============================ ======================== + GenBank gb|accession|locus + EMBL Data Library emb|accession|locus + DDBJ, DNA Database of Japan dbj|accession|locus + NBRF PIR pir||entry + Protein Research Foundation prf||name + SWISS-PROT sp|accession|entry name + Brookhaven Protein Data Bank pdb|entry|chain + Kabat's Sequences of Immuno... gnl|kabat|identifier + Patents pat|country|number + GenInfo Backbone Id bbs|number + + For example, an identifier might be `gb|AC021182.14|AC021182', where +the `gb' tag indicates that the identifier refers to a GenBank sequence, +`AC021182.14' is its GenBank ACCESSION, and `AC021182' is the GenBank +LOCUS. The identifier contains no spaces, so that a space indicates +the end of the identifier. + + Let us continue in the result listing. Each of the seven alignments +mentioned above is subsequently described in detail. We will have a +closer look at the first of them. + + >gb|AC021182.14|AC021182 Homo sapiens chromosome 7 clone RP11-733N23, WORKING DRAFT SEQUENCE, 4 + unordered pieces + Length = 176383 + + Score = 38.2 bits (19), Expect = 0.20 + Identities = 19/19 (100%) + Strand = Plus / Plus + + Query: 35 tggtgaagtgtgtttcttg 53 + ||||||||||||||||||| + Sbjct: 69786 tggtgaagtgtgtttcttg 69804 + + This alignment was located on the human chromosome 7. The fragment +on which part of the query was found had a total length of 176383. Only +19 of the nucleotides matched and the matching sequence ran from +character 35 to 53 in the query sequence and from 69786 to 69804 in the +fragment on chromosome 7. If you are still reading at this point, you +are probably interested in finding out more about Computational Biology +and you might appreciate the following hints. + + 1. There is a book called `Introduction to Computational Biology' by + Michael S. Waterman, which is worth reading if you are seriously + interested. You can find a good book review on the Internet. + + 2. While Waterman's book can explain to you the algorithms employed + internally in the database search engines, most practitioners + prefer to approach the subject differently. The applied side of + Computational Biology is called Bioinformatics, and emphasizes the + tools available for day-to-day work as well as how to actually + _use_ them. One of the very few affordable books on Bioinformatics + is `Developing Bioinformatics Computer Skills'. + + 3. The sequences _gawk_ and _gnuawk_ are in widespread use in the + genetic material of virtually every earthly living being. Let us + take this as a clear indication that the divine creator has + intended `gawk' to prevail over other scripting languages such as + `perl', `tcl', or `python' which are not even proper sequences. + (:-) + + +File: gawkinet.info, Node: Links, Next: GNU Free Documentation License, Prev: Some Applications and Techniques, Up: Top + +4 Related Links +*************** + +This section lists the URLs for various items discussed in this major +node. They are presented in the order in which they appear. + +`Internet Programming with Python' + `http://www.fsbassociates.com/books/python.htm' + +`Advanced Perl Programming' + `http://www.oreilly.com/catalog/advperl' + +`Web Client Programming with Perl' + `http://www.oreilly.com/catalog/webclient' + +Richard Stevens's home page and book + `http://www.kohala.com/~rstevens' + +The SPAK home page + `http://www.userfriendly.net/linux/RPM/contrib/libc6/i386/spak-0.6b-1.i386.html' + +Volume III of `Internetworking with TCP/IP', by Comer and Stevens + `http://www.cs.purdue.edu/homes/dec/tcpip3s.cont.html' + +XBM Graphics File Format + `http://www.wotsit.org/download.asp?f=xbm' + +GNUPlot + `http://www.cs.dartmouth.edu/gnuplot_info.html' + +Mark Humphrys' Eliza page + `http://www.compapp.dcu.ie/~humphrys/eliza.html' + +Yahoo! Eliza Information + `http://dir.yahoo.com/Recreation/Games/Computer_Games/Internet_Games/Web_Games/Artificial_Intelligence' + +Java versions of Eliza + `http://www.tjhsst.edu/Psych/ch1/eliza.html' + +Java versions of Eliza with source code + `http://home.adelphia.net/~lifeisgood/eliza/eliza.htm' + +Eliza Programs with Explanations + `http://chayden.net/chayden/eliza/Eliza.shtml' + +Loebner Contest + `http://acm.org/~loebner/loebner-prize.htmlx' + +Tck/Tk Information + `http://www.scriptics.com/' + +Intel 80x86 Processors + `http://developer.intel.com/design/platform/embedpc/what_is.htm' + +AMD Elan Processors + `http://www.amd.com/products/epd/processors/4.32bitcont/32bitcont/index.html' + +XINU + `http://willow.canberra.edu.au/~chrisc/xinu.html' + +GNU/Linux + `http://uclinux.lineo.com/' + +Embedded PCs + `http://dir.yahoo.com/Business_and_Economy/Business_to_Business/Computers/Hardware/Embedded_Control/' + +MiniSQL + `http://www.hughes.com.au/library/' + +Market Share Surveys + `http://www.netcraft.com/survey' + +`Numerical Recipes in C: The Art of Scientific Computing' + `http://www.nr.com' + +VRML + `http://www.vrml.org' + +The VRML FAQ + `http://www.vrml.org/technicalinfo/specifications/specifications.htm#FAQ' + +The UMBC Agent Web + `http://www.cs.umbc.edu/agents' + +Apache Web Server + `http://www.apache.org' + +National Center for Biotechnology Information (NCBI) + `http://www.ncbi.nlm.nih.gov' + +Basic Local Alignment Search Tool (BLAST) + `http://www.ncbi.nlm.nih.gov/BLAST/blast_overview.html' + +NCBI Home Page + `http://www.ncbi.nlm.nih.gov' + +BLAST Pages + `http://www.ncbi.nlm.nih.gov/BLAST' + +BLAST Demonstration Client + `ftp://ncbi.nlm.nih.gov/blast/blasturl/' + +BLAST anonymous FTP location + `ftp://ncbi.nlm.nih.gov/blast/network/netblast/' + +BLAST 2.0 Executables + `ftp://ncbi.nlm.nih.gov/blast/executables/' + +IUB/IUPAC Amino Acid and Nucleic Acid Codes + `http://www.uthscsa.edu/geninfo/blastmail.html#item6' + +FASTA/Pearson Format + `http://www.ncbi.nlm.nih.gov/BLAST/fasta.html' + +Fasta/Pearson Sequence in Java + `http://www.kazusa.or.jp/java/codon_table_java/' + +Book Review of `Introduction to Computational Biology' + `http://www.acm.org/crossroads/xrds5-1/introcb.html' + +`Developing Bioinformatics Computer Skills' + `http://www.oreilly.com/catalog/bioskills/' + + + +File: gawkinet.info, Node: GNU Free Documentation License, Next: Index, Prev: Links, Up: Top + +GNU Free Documentation License +****************************** + + Version 1.2, November 2002 + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it + can be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You + accept the license if you copy, modify or distribute the work in a + way requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. If a section does not fit the above definition of + Secondary then it is not allowed to be designated as Invariant. + The Document may contain zero Invariant Sections. If the Document + does not identify any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup, or absence of + markup, has been arranged to thwart or discourage subsequent + modification by readers is not Transparent. An image format is + not Transparent if used for any substantial amount of text. A + copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML, PostScript or PDF designed for + human modification. Examples of transparent image formats include + PNG, XCF and JPG. Opaque formats include proprietary formats that + can be read and edited only by proprietary word processors, SGML or + XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML, PostScript or PDF + produced by some word processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a computer-network location from + which the general network-using public has access to download + using public-standard network protocols a complete Transparent + copy of the Document, free of added material. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of + previous versions (which should, if there were any, be listed + in the History section of the Document). You may use the + same title as a previous version if the original publisher of + that version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on + the Title Page. If there is no section Entitled "History" in + the Document, create one stating the title, year, authors, + and publisher of the Document as given on its Title Page, + then add an item describing the Modified Version as stated in + the previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in + the "History" section. You may omit a network location for a + work that was published at least four years before the + Document itself, or if the original publisher of the version + it refers to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the + section all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section + titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + `http://www.gnu.org/copyleft/'. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: gawkinet.info, Node: Index, Prev: GNU Free Documentation License, Up: Top + +Index +***** + +[index] +* Menu: + +* /inet/ files (gawk): Gawk Special Files. (line 34) +* /inet/raw special files (gawk): File /inet/raw. (line 6) +* /inet/tcp special files (gawk): File /inet/tcp. (line 6) +* /inet/udp special files (gawk): File /inet/udp. (line 6) +* advanced features, network connections: Troubleshooting. (line 6) +* agent <1>: MOBAGWHO. (line 6) +* agent: Challenges. (line 76) +* AI: Challenges. (line 76) +* apache <1>: MOBAGWHO. (line 42) +* apache: WEBGRAB. (line 72) +* Bioinformatics: PROTBASE. (line 227) +* BLAST, Basic Local Alignment Search Tool: PROTBASE. (line 6) +* blocking: Making Connections. (line 35) +* Boutell, Thomas: STATIST. (line 6) +* CGI (Common Gateway Interface): MOBAGWHO. (line 42) +* CGI (Common Gateway Interface), dynamic web pages and: Web page. + (line 46) +* CGI (Common Gateway Interface), library: CGI Lib. (line 11) +* clients: Making Connections. (line 21) +* Clinton, Bill: Challenges. (line 59) +* Common Gateway Interface, See CGI: Web page. (line 46) +* Computational Biology: PROTBASE. (line 227) +* contest: Challenges. (line 6) +* cron utility: STOXPRED. (line 23) +* CSV format: STOXPRED. (line 128) +* dark corner, RAW protocol: File /inet/raw. (line 13) +* Dow Jones Industrial Index: STOXPRED. (line 44) +* ELIZA program: Simple Server. (line 11) +* email: Email. (line 11) +* FASTA/Pearson format: PROTBASE. (line 102) +* FDL (Free Documentation License): GNU Free Documentation License. + (line 6) +* filenames, for network access: Gawk Special Files. (line 29) +* files, /inet/ (gawk): Gawk Special Files. (line 34) +* files, /inet/raw (gawk): File /inet/raw. (line 6) +* files, /inet/tcp (gawk): File /inet/tcp. (line 6) +* files, /inet/udp (gawk): File /inet/udp. (line 6) +* finger utility: Setting Up. (line 22) +* Free Documentation License (FDL): GNU Free Documentation License. + (line 6) +* FTP (File Transfer Protocol): Basic Protocols. (line 29) +* gawk, networking: Using Networking. (line 6) +* gawk, networking, connections <1>: TCP Connecting. (line 6) +* gawk, networking, connections: Special File Fields. (line 49) +* gawk, networking, filenames: Gawk Special Files. (line 29) +* gawk, networking, See Also email: Email. (line 6) +* gawk, networking, service, establishing: Setting Up. (line 6) +* gawk, networking, troubleshooting: Caveats. (line 6) +* gawk, web and, See web service: Interacting Service. (line 6) +* getline command: TCP Connecting. (line 11) +* GETURL program: GETURL. (line 6) +* GIF image format <1>: STATIST. (line 6) +* GIF image format: Web page. (line 46) +* GNU Free Documentation License: GNU Free Documentation License. + (line 6) +* GNU/Linux <1>: REMCONF. (line 6) +* GNU/Linux <2>: Interacting. (line 27) +* GNU/Linux: Troubleshooting. (line 54) +* GNUPlot utility <1>: STATIST. (line 6) +* GNUPlot utility: Interacting Service. (line 189) +* Hoare, C.A.R. <1>: PROTBASE. (line 6) +* Hoare, C.A.R.: MOBAGWHO. (line 6) +* hostname field: Special File Fields. (line 29) +* HTML (Hypertext Markup Language): Web page. (line 30) +* HTTP (Hypertext Transfer Protocol) <1>: Web page. (line 6) +* HTTP (Hypertext Transfer Protocol): Basic Protocols. (line 29) +* HTTP (Hypertext Transfer Protocol), record separators and: Web page. + (line 30) +* HTTP server, core logic: Interacting Service. (line 6) +* Humphrys, Mark: Simple Server. (line 179) +* Hypertext Markup Language (HTML): Web page. (line 30) +* Hypertext Transfer Protocol, See HTTP: Web page. (line 6) +* image format: STATIST. (line 6) +* images, in web pages: Interacting Service. (line 189) +* images, retrieving over networks: Web page. (line 46) +* input/output, two-way, See Also gawk, networking: Gawk Special Files. + (line 19) +* Internet, See networks: Interacting. (line 48) +* JavaScript: STATIST. (line 56) +* Linux <1>: REMCONF. (line 6) +* Linux <2>: Interacting. (line 27) +* Linux: Troubleshooting. (line 54) +* Lisp: MOBAGWHO. (line 98) +* localport field: Gawk Special Files. (line 34) +* Loebner, Hugh: Challenges. (line 6) +* Loui, Ronald: Challenges. (line 76) +* MAZE: MAZE. (line 6) +* Microsoft Windows: WEBGRAB. (line 43) +* Microsoft Windows, networking: Troubleshooting. (line 54) +* Microsoft Windows, networking, ports: Setting Up. (line 37) +* MiniSQL: REMCONF. (line 111) +* MOBAGWHO program: MOBAGWHO. (line 6) +* NCBI, National Center for Biotechnology Information: PROTBASE. + (line 6) +* networks, gawk and: Using Networking. (line 6) +* networks, gawk and, connections <1>: TCP Connecting. (line 6) +* networks, gawk and, connections: Special File Fields. (line 49) +* networks, gawk and, filenames: Gawk Special Files. (line 29) +* networks, gawk and, See Also email: Email. (line 6) +* networks, gawk and, service, establishing: Setting Up. (line 6) +* networks, gawk and, troubleshooting: Caveats. (line 6) +* networks, ports, reserved: Setting Up. (line 37) +* networks, ports, specifying: Special File Fields. (line 18) +* networks, See Also web pages: PANIC. (line 6) +* Numerical Recipes: STATIST. (line 24) +* ORS variable, HTTP and: Web page. (line 30) +* ORS variable, POP and: Email. (line 36) +* PANIC program: PANIC. (line 6) +* Perl: Using Networking. (line 14) +* Perl, gawk networking and: Using Networking. (line 24) +* Perlis, Alan: MAZE. (line 6) +* pipes, networking and: TCP Connecting. (line 30) +* PNG image format <1>: STATIST. (line 6) +* PNG image format: Web page. (line 46) +* POP (Post Office Protocol): Email. (line 6) +* Post Office Protocol (POP): Email. (line 6) +* PostScript: STATIST. (line 138) +* PROLOG: Challenges. (line 76) +* PROTBASE: PROTBASE. (line 6) +* protocol field: Special File Fields. (line 11) +* PS image format: STATIST. (line 6) +* Python: Using Networking. (line 14) +* Python, gawk networking and: Using Networking. (line 24) +* RAW protocol: File /inet/raw. (line 6) +* record separators, HTTP and: Web page. (line 30) +* record separators, POP and: Email. (line 36) +* REMCONF program: REMCONF. (line 6) +* remoteport field: Gawk Special Files. (line 34) +* robot <1>: WEBGRAB. (line 6) +* robot: Challenges. (line 85) +* RS variable, HTTP and: Web page. (line 30) +* RS variable, POP and: Email. (line 36) +* servers <1>: Setting Up. (line 22) +* servers: Making Connections. (line 14) +* servers, as hosts: Special File Fields. (line 29) +* servers, HTTP: Interacting Service. (line 6) +* servers, web: Simple Server. (line 6) +* Simple Mail Transfer Protocol (SMTP): Email. (line 6) +* SMTP (Simple Mail Transfer Protocol) <1>: Email. (line 6) +* SMTP (Simple Mail Transfer Protocol): Basic Protocols. (line 29) +* SPAK utility: File /inet/raw. (line 21) +* STATIST program: STATIST. (line 6) +* STOXPRED program: STOXPRED. (line 6) +* synchronous communications: Making Connections. (line 35) +* Tcl/Tk: Using Networking. (line 14) +* Tcl/Tk, gawk and <1>: Some Applications and Techniques. + (line 22) +* Tcl/Tk, gawk and: Using Networking. (line 24) +* TCP (Transmission Control Protocol) <1>: File /inet/tcp. (line 6) +* TCP (Transmission Control Protocol): Using Networking. (line 29) +* TCP (Transmission Control Protocol), connection, establishing: TCP Connecting. + (line 6) +* TCP (Transmission Control Protocol), UDP and: Interacting. (line 48) +* TCP/IP, protocols, selecting: Special File Fields. (line 11) +* TCP/IP, sockets and: Gawk Special Files. (line 19) +* Transmission Control Protocol, See TCP: Using Networking. (line 29) +* troubleshooting, gawk, networks: Caveats. (line 6) +* troubleshooting, networks, connections: Troubleshooting. (line 6) +* troubleshooting, networks, timeouts: Caveats. (line 18) +* UDP (User Datagram Protocol): File /inet/udp. (line 6) +* UDP (User Datagram Protocol), TCP and: Interacting. (line 48) +* Unix, network ports and: Setting Up. (line 37) +* URLCHK program: URLCHK. (line 6) +* User Datagram Protocol, See UDP: File /inet/udp. (line 6) +* vertical bar (|), |& operator (I/O): TCP Connecting. (line 25) +* VRML: MAZE. (line 6) +* web browsers, See web service: Interacting Service. (line 6) +* web pages: Web page. (line 6) +* web pages, images in: Interacting Service. (line 189) +* web pages, retrieving: GETURL. (line 6) +* web servers: Simple Server. (line 6) +* web service <1>: PANIC. (line 6) +* web service: Primitive Service. (line 6) +* WEBGRAB program: WEBGRAB. (line 6) +* Weizenbaum, Joseph: Simple Server. (line 11) +* XBM image format: Interacting Service. (line 189) +* Yahoo! <1>: STOXPRED. (line 6) +* Yahoo!: REMCONF. (line 6) +* | (vertical bar), |& operator (I/O): TCP Connecting. (line 25) + + + +Tag Table: +Node: Top2007 +Node: Preface5697 +Node: Introduction7072 +Node: Stream Communications8098 +Node: Datagram Communications9271 +Node: The TCP/IP Protocols10902 +Ref: The TCP/IP Protocols-Footnote-111586 +Node: Basic Protocols11743 +Node: Ports13065 +Node: Making Connections14470 +Ref: Making Connections-Footnote-117051 +Ref: Making Connections-Footnote-217098 +Node: Using Networking17279 +Node: Gawk Special Files19633 +Node: Special File Fields21637 +Ref: table-inet-components25387 +Node: Comparing Protocols27299 +Node: File /inet/tcp27888 +Node: File /inet/udp28914 +Node: File /inet/raw30035 +Ref: File /inet/raw-Footnote-133068 +Node: TCP Connecting33148 +Node: Troubleshooting35486 +Ref: Troubleshooting-Footnote-138537 +Node: Interacting39081 +Node: Setting Up41811 +Node: Email45305 +Node: Web page47631 +Ref: Web page-Footnote-150436 +Node: Primitive Service50633 +Node: Interacting Service53367 +Ref: Interacting Service-Footnote-162496 +Node: CGI Lib62528 +Node: Simple Server69489 +Ref: Simple Server-Footnote-177219 +Node: Caveats77320 +Node: Challenges78463 +Node: Some Applications and Techniques87130 +Node: PANIC89587 +Node: GETURL91305 +Node: REMCONF93928 +Node: URLCHK99404 +Node: WEBGRAB103239 +Node: STATIST107689 +Ref: STATIST-Footnote-1119397 +Node: MAZE119842 +Node: MOBAGWHO126030 +Ref: MOBAGWHO-Footnote-1139974 +Node: STOXPRED140029 +Node: PROTBASE154284 +Node: Links167366 +Node: GNU Free Documentation License170800 +Node: Index193204 + +End Tag Table diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/missing_d/README b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/missing_d/README new file mode 100644 index 0000000..735889d --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/missing_d/README @@ -0,0 +1,14 @@ +Fri Aug 25 13:23:06 IDT 2006 +============================ + +The files memmove.c, mktime.c, snprintf.c, strerror.c, strftime.c, +strncasecmp.c, and system.c are copyright by the Free Software +Foundation. They are licensed under the GPL or the LGPL. See the +COPYING.LIB file in this directory and the COPYING file in the parent +directory for licensing information. + +All other files are public domain. + +Arnold Robbins +arnold@skeeve.com + diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/test/README b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/test/README new file mode 100644 index 0000000..2343be2 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/test/README @@ -0,0 +1,18 @@ +Mon Jan 22 13:08:58 EST 1996 + +This directory contains the tests for gawk. The tests use the +following conventions. + +Given some aspect of gawk named `foo', there will be one or more +of the following files: + +foo.awk --- actual code for the test if not inline in the Makefile +foo.in --- the data for the test, if it needs data +foo.ok --- the expected results +_foo --- the actual results; generated at run time + +The _foo file will be left around if a test fails, allowing you to +compare actual and expected results, in case they differ. + +If they do differ (other than strftime.ok and _strftime!), send in a +bug report. See the manual for the bug report procedure. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/unsupported/atari/README.1st b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/unsupported/atari/README.1st new file mode 100644 index 0000000..a158cda --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6-src/unsupported/atari/README.1st @@ -0,0 +1,5 @@ +Tue Nov 7 14:19:41 2000 + +The atari port is no longer supported. If you have an atari, +you are welcome to try and use the port here, but we no longer have +the hardware to test gawk on. diff --git a/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6/check.log b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6/check.log new file mode 100644 index 0000000..1baa05e --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/gawk/3.1.6/gawk-3.1.6/check.log @@ -0,0 +1,1296 @@ +Making check in . +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6' wordt binnengegaan +make 'CFLAGS=-Wall -Wpointer-arith -pedantic -O3 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -march=i386 -ffast-math -Wstrict-prototypes ' 'LDFLAGS=-Wl,-s -Wl,--force-exe-suffix -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition -Wl,--enable-stdcall-fixup -LD:/Progra~1/GnuWin32/lib -Wl,--major-image-version=3 -Wl,--minor-image-version=1 ' check-local +make[2]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6' wordt binnengegaan +make[2]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6' wordt verlaten +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6' wordt verlaten +Making check in awklib +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/awklib' wordt binnengegaan +make[1]: Er is niets te doen voor 'check'. +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/awklib' wordt verlaten +Making check in doc +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/doc' wordt binnengegaan +make[1]: Er is niets te doen voor 'check'. +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/doc' wordt verlaten +Making check in po +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/po' wordt binnengegaan +make[1]: Er is niets te doen voor 'check'. +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/po' wordt verlaten +Making check in test +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/test' wordt binnengegaan + +Any output from "diff.exe --text" is bad news, although some differences +in floating point values are probably benign -- in particular, +some systems may omit a leading zero and the floating point +precision may lead to slightly different output in a few cases. + +Locale environment: + LC_ALL="C" LANG="C" + +======== Starting basic tests ======== +addcomma +1c1,15 +< 0 0.00 +--- +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> ,,, ... 0 0.00 +make[1]: [addcomma] Fout 1 (genegeerd) +anchgsub +1c1 +< This is a test, this is only a test. +--- +> This is a test, this is only a test. +make[1]: [anchgsub] Fout 1 (genegeerd) +argarray +arrayparm +arrayref +arrymem1 +arrayprm2 +arrayprm3 +arryref2 +arryref3 +arryref4 +arryref5 +arynasty +arynocls +aryprm1 +aryprm2 +aryprm3 +aryprm4 +aryprm5 +aryprm6 +aryprm7 +aryprm8 +arysubnm +asgext +awkpath +back89 +backgsub +childin +clobber +clsflnam +compare +compare2 +concat1 +concat2 +concat3 +concat4 +convfmt +datanonl +1c1 +< bleble@foo1.bh.pl deny +--- +> 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ bleble@foo1.bh.pl deny +make[1]: [datanonl] Fout 1 (genegeerd) +defref +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [defref] Fout 1 (genegeerd) +delarprm +delarpm2 +delfunc +dynlj +eofsplit +exitval1 +exitval2 +1c1,2 +< foo +--- +> read wordt niet herkend als een interne +> of externe opdracht, programma of batchbestand. +make[1]: [exitval2] Fout 1 (genegeerd) +fldchg +fldchgnf +fmtspcl +1,9c1,15 +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:10: warning: sqrt: called with negative argument -1 +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value NaN is out of range for `%x' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value NaN is out of range for `%d' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value NaN is out of range for `%x' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value NaN is out of range for `%d' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value Infinity is out of range for `%x' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value Infinity is out of range for `%d' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value Infinity is out of range for `%x' format +< gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value Infinity is out of range for `%d' format +--- +> gawk: warning: `BINMODE' is a gawk extension +> gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:10: warning: sqrt: called with negative argument -1 +> sprintf(%x,NaN) = 8000000000000000 (!= NaN) +> sprintf(%d,NaN) = -NaN (!= NaN) +> sprintf(%x,NaN) = 8000000000000000 (!= NaN) +> sprintf(%d,NaN) = -NaN (!= NaN) +> gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value 1.#INF is out of range for `%x' format +> gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value 1.#INF is out of range for `%d' format +> sprintf(%f,Infinity) = Infinity (!= -Infinity) +> sprintf(%s,Infinity) = Infinity (!= -Infinity) +> sprintf(%g,Infinity) = Infinity (!= -Infinity) +> gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value -1.#INF is out of range for `%x' format +> sprintf(%x,Infinity) = Infinity (!= -Infinity) +> gawk: ../../gawk-3.1.6-src/test/fmtspcl.awk:6: warning: [s]printf: value -1.#INF is out of range for `%d' format +> sprintf(%d,Infinity) = Infinity (!= -Infinity) +make[1]: [fmtspcl] Fout 1 (genegeerd) +fmttest +fnamedat +fnarray +fnarray2 +2a3 +> errcount: 1 +make[1]: [fnarray2] Fout 1 (genegeerd) +fnarydel +fnaryscl +fnasgnm +fnmisc +2a3 +> errcount: 2 +make[1]: [fnmisc] Fout 1 (genegeerd) +fnparydl +fordel +forsimp +fsbs +1c1 +< 1 2 +--- +> \\\ \\\ \\\ 1 2 +make[1]: [fsbs] Fout 1 (genegeerd) +fsspcoln +1c1 +< b +--- +> ::: ::: ::: b +make[1]: [fsspcoln] Fout 1 (genegeerd) +fsrs +1c1,10 +< a b +--- +> +> +> +> +> +> +> +> +> +> a b +make[1]: [fsrs] Fout 1 (genegeerd) +fstabplus +funsemnl +funsmnam +funstack +0a1,21 +> SsS ssS TtT ttT RrR rrR IiI iiI NnN nnN GgG ggG PpP ppP RrR rrR EeE eeE AaA aaA MmM mmM BbB bbB LlL llL EeE eeE AaA aaA RrR rrR TtT ttT IiI iiI CcC ccC LlL llL EeE eeE {{{ === === """ ??? ??? {{{ === """ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> ((( ))) ::: ,,, ;;; ... /// --- >>> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> >>> $$$ $$$ $$$ $$$ $$$ $$$ $$$ AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> +\ Geen witregel na einde bestand +make[1]: [funstack] Fout 1 (genegeerd) +getline +getline2 +getline3 +getlnbuf +getnr2tb +getnr2tm +gsubasgn +4a5 +> errcount: 2 +make[1]: [gsubasgn] Fout 1 (genegeerd) +gsubtest +gsubtst2 +gsubtst3 +gsubtst4 +gsubtst5 +1c1,3 +< ThisIsaTitleMyTitle +--- +> """ ### $$$ %%% &&& ((( ))) *** ,,, ... /// +> (hard_LC_COLLATE) +> \\\ ::: ;;; [[[ ]]] @@@ ??? ... ,,, $$$ ThisIsaTitleMyTitle +make[1]: [gsubtst5] Fout 1 (genegeerd) +hex +hsprint +2c2 +< %0|00045|00055|0002d|0012.68|001.27e+01|0000012.68| +--- +> %0|00045|00055|0002d| 12.68| 1.27e+01| 12.68| +4c4 +< %#0|00045|00055|0x02d|0012.68|001.27e+01|0000012.68| +--- +> %#0|00045|00055|0x02d| 12.68| 1.27e+01| 12.68| +6c6 +< % 0| 0045|00055|0002d| 012.68| 01.27e+01| 000012.68| +--- +> % 0| 0045|00055|0002d| 12.68| 1.27e+01| 12.68| +8c8 +< % #0| 0045|00055|0x02d| 012.68| 01.27e+01| 000012.68| +--- +> % #0| 0045|00055|0x02d| 12.68| 1.27e+01| 12.68| +10c10 +< %+0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68| +--- +> %+0|+0045|00055|0002d| +12.68| +1.27e+01| +12.68| +12c12 +< %+#0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68| +--- +> %+#0|+0045|00055|0x02d| +12.68| +1.27e+01| +12.68| +14c14 +< %+ 0|+0045|00055|0002d|+012.68|+01.27e+01|+000012.68| +--- +> %+ 0|+0045|00055|0002d| +12.68| +1.27e+01| +12.68| +16c16 +< %+ #0|+0045|00055|0x02d|+012.68|+01.27e+01|+000012.68| +--- +> %+ #0|+0045|00055|0x02d| +12.68| +1.27e+01| +12.68| +35c35 +< %0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| +--- +> %0|00zap|0000*| -3| -3.46| -3.46e+00| -3.457| +37c37 +< %#0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| +--- +> %#0|00zap|0000*| -3.| -3.46| -3.46e+00| -3.457| +39c39 +< % 0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| +--- +> % 0|00zap|0000*| -3| -3.46| -3.46e+00| -3.457| +41c41 +< % #0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| +--- +> % #0|00zap|0000*| -3.| -3.46| -3.46e+00| -3.457| +43c43 +< %+0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| +--- +> %+0|00zap|0000*| -3| -3.46| -3.46e+00| -3.457| +45c45 +< %+#0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| +--- +> %+#0|00zap|0000*| -3.| -3.46| -3.46e+00| -3.457| +47c47 +< %+ 0|00zap|0000*|-000003|-003.46|-03.46e+00|-00003.457| +--- +> %+ 0|00zap|0000*| -3| -3.46| -3.46e+00| -3.457| +49c49 +< %+ #0|00zap|0000*|-00003.|-003.46|-03.46e+00|-00003.457| +--- +> %+ #0|00zap|0000*| -3.| -3.46| -3.46e+00| -3.457| +make[1]: [hsprint] Fout 1 (genegeerd) +inputred +intest +intformat +intprec +iobug1 +leaddig +leadnl +1c1,10 +< Name is: Jane Doe +--- +> +> +> +> +> +> +> +> +> +> Name is: Jane Doe +make[1]: [leadnl] Fout 1 (genegeerd) +litoct +gawk: warning: `BINMODE' is a gawk extension +1c1 +< no match +--- +> no match +make[1]: [litoct] Fout 1 (genegeerd) +longsub +longwrds +1,21c1,4 +< 20 long words +< compatibility +< concatenated +< consistency +< definitions +< description +< distributing +< fistatements +< gawk-options +< gnu-specific +< identically +< implementation +< implementations +< information +< non-portable +< pattern-action +< pre-defined +< program-file +< program-text +< programming +< restrictions +--- +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> LC_ALL wordt niet herkend als een interne +> of externe opdracht, programma of batchbestand. +make[1]: [longwrds] Fout 1 (genegeerd) +manglprm +math +membug1 +messages +minusstr +mmap8k +mtchi18n +nasty +1,2c1,5 +< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +< X +--- +> gawk: nasty.awk:79: fatal error: internal error +> +> This application has requested the Runtime to terminate it in an unusual way. +> Please contact the application's support team for more information. +> EXIT CODE: 3 +make[1]: [nasty] Fout 1 (genegeerd) +nasty2 +1,2c1,5 +< a = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, f() = X +< 123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123 +--- +> gawk: nasty2.awk:20: fatal error: internal error +> +> This application has requested the Runtime to terminate it in an unusual way. +> Please contact the application's support team for more information. +> EXIT CODE: 3 +make[1]: [nasty2] Fout 1 (genegeerd) +negexp +nested +nfldstr +nfneg +nfset +nlfldsep +nlinstr +1c1,10 +< ok +--- +> +> +> +> +> +> +> +> +> +> ok +make[1]: [nlinstr] Fout 1 (genegeerd) +nlstrina +noeffect +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [noeffect] Fout 1 (genegeerd) +nofile +nofmtch +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [nofmtch] Fout 1 (genegeerd) +noloop1 +0a1 +> ''' +\ Geen witregel na einde bestand +make[1]: [noloop1] Fout 1 (genegeerd) +noloop2 +0a1 +> ''' +\ Geen witregel na einde bestand +make[1]: [noloop2] Fout 1 (genegeerd) +nonl +make[1]: [nonl] Fout 2 (genegeerd) +0a1 +> gawk: warning: `BINMODE' is a gawk extension +1a3 +> gawk: nonl.awk:1: fatal: cannot open file `/dev/null' for reading (No such file or directory) +make[1]: [nonl] Fout 1 (genegeerd) +noparms +4a5 +> errcount: 3 +make[1]: [noparms] Fout 1 (genegeerd) +nors +nulrsend +1c1,10 +< 1 +--- +> +> +> +> +> +> +> +> +> +> 1 +2a12,21 +> +> +> +> +> +> +> +> +> +> +\ Geen witregel na einde bestand +make[1]: [nulrsend] Fout 1 (genegeerd) +numindex +numsubstr +octsub +ofmt +0a1,2 +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +make[1]: [ofmt] Fout 1 (genegeerd) +ofmtbig +0a1,4 +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ ¼¼¼ ½½½ ¾¾¾ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +make[1]: [ofmtbig] Fout 1 (genegeerd) +ofmtfidl +ofmts +onlynl +0a1,10 +> +> +> +> +> +> +> +> +> +> +\ Geen witregel na einde bestand +make[1]: [onlynl] Fout 1 (genegeerd) +opasnidx +opasnslf +ovrflow1 +paramdup +2a3 +> errcount: 1 +make[1]: [paramdup] Fout 1 (genegeerd) +paramtyp +parse1 +parsefld +parseme +pcntplus +prdupval +prec +printf0 +1c1,2 +< X +--- +> gawk: warning: `BINMODE' is a gawk extension +> X +make[1]: [printf0] Fout 1 (genegeerd) +printf1 +prmarscl +prmreuse +prt1eval +1c1,5 +< 1 +--- +> gawk: prt1eval.awk:4: fatal error: internal error +> +> This application has requested the Runtime to terminate it in an unusual way. +> Please contact the application's support team for more information. +> EXIT CODE: 3 +make[1]: [prt1eval] Fout 1 (genegeerd) +prtoeval +2c2,6 +< partial line: 'A STRING' +--- +> gawk: prtoeval.awk:1: fatal error: internal error +> +> This application has requested the Runtime to terminate it in an unusual way. +> Please contact the application's support team for more information. +> EXIT CODE: 3 +make[1]: [prtoeval] Fout 1 (genegeerd) +psx96sub +rand +rebt8b1 +1c1 +< [an]*n bANas ANd ANases iAN cAN +--- +> aaA nnN aaA nnN úúÚ aaA úúÚ aaA nnN aaA úúÚ aaA nnN úúÚ aaA nnN aaA úúÚ aaA nnN úúÚ aaA nnN aaA úúÚ aaA nnN úúÚ [an]*n bANas ANd ANases iAN cAN +make[1]: [rebt8b1] Fout 1 (genegeerd) +rebt8b2 +1,18c1,18 +< [an\000]*n bANas ANd ANases iAN cAN +< match +< [an\001]*n bANas ANd ANases iAN cAN +< match +< [an\002]*n bANas ANd ANases iAN cAN +< match +< [an\003]*n bANas ANd ANases iAN cAN +< match +< [an\004]*n bANas ANd ANases iAN cAN +< match +< [an\005]*n bANas ANd ANases iAN cAN +< match +< [an\006]*n bANas ANd ANases iAN cAN +< match +< [an\007]*n bANas ANd ANases iAN cAN +< match +< [an\010]*n bANas ANd ANases iAN cAN +< match +--- +> aaA nnN [an\000]*n bANas ANd ANases iAN cAN +> aaA nnN match +> aaA nnN  [an\001]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\002]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\003]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\004]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\005]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\006]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\007]*n bANas ANd ANases iAN cAN +> aaA nnN  match +> aaA nnN  [an\010]*n bANas ANd ANases iAN cAN +> aaA nnN  match +make[1]: [rebt8b2] Fout 1 (genegeerd) +redfilnm +regeq +reindops +0a1,2 +> 222 333 444 555 666 777 888 999 ²²² ³³³ +> (hard_LC_COLLATE) +make[1]: [reindops] Fout 1 (genegeerd) +reparse +resplit +rs +1c1,10 +< a b +--- +> +> +> +> +> +> +> +> +> +> a b +make[1]: [rs] Fout 1 (genegeerd) +rsnul1nl +1c1,10 +< This is... +--- +> +> +> +> +> +> +> +> +> +> This is... +make[1]: [rsnul1nl] Fout 1 (genegeerd) +rsnulbig +1c1,5 +< 16386 +--- +> aaA +> +> +> abcdefgh123456 +> 16395 +make[1]: [rsnulbig] Fout 1 (genegeerd) +rsnulbig2 +1c1,5 +< 2 +--- +> aaA +> +> +> abc +> 11 +make[1]: [rsnulbig2] Fout 1 (genegeerd) +rstest1 +1c1,19 +< 3 +--- +> +> +> +> +> +> +> +> +> +> ::: +> +> +> ::: +> +> +> ::: +> +> +> 3 +make[1]: [rstest1] Fout 1 (genegeerd) +rstest2 +1c1,19 +< a +--- +> +> +> +> +> +> +> +> +> +> \\\ +> +> +> \\\ +> +> +> \\\ +> +> +> a +make[1]: [rstest2] Fout 1 (genegeerd) +rstest3 +0a1,10 +> +> +> +> +> +> +> +> +> +> +\ Geen witregel na einde bestand +make[1]: [rstest3] Fout 1 (genegeerd) +rstest4 +1c1,10 +< y = +--- +> +> +> +> +> +> +> +> +> +> y = <"a> +make[1]: [rstest4] Fout 1 (genegeerd) +rstest5 +1,3c1,12 +< foo +< baz +< bar +--- +> +> +> +> +> +> +> +> +> +> 'foo +> 'foo +> 'bar +make[1]: [rstest5] Fout 1 (genegeerd) +rswhite +1c1,10 +< < a b +--- +> +> +> +> +> +> +> +> +> +> < a b +make[1]: [rswhite] Fout 1 (genegeerd) +scalar +sclforin +sclifin +sortempty +splitargv +splitarr +splitdef +splitvar +splitwht +sprintfc +strcat1 +strtod +strnum1 +subamp +0a1,2 +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +make[1]: [subamp] Fout 1 (genegeerd) +subi18n +1c1 +< "directory" version="1.0" +--- +> === """ "directory" version="1.0" +make[1]: [subi18n] Fout 1 (genegeerd) +subsepnm +subslash +substr +swaplns +synerr1 +2a3 +> errcount: 1 +make[1]: [synerr1] Fout 1 (genegeerd) +synerr2 +2a3 +> errcount: 1 +make[1]: [synerr2] Fout 1 (genegeerd) +tradanch +gawk: warning: `BINMODE' is a gawk extension +tweakfld +uninit2 +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [uninit2] Fout 1 (genegeerd) +uninit3 +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [uninit3] Fout 1 (genegeerd) +uninit4 +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [uninit4] Fout 1 (genegeerd) +uninitialized +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [uninitialized] Fout 1 (genegeerd) +unterm +wideidx +wideidx2 +widesub +1c1 +< "directory" version="1.0" +--- +> === """ "directory" version="1.0" +make[1]: [widesub] Fout 1 (genegeerd) +widesub2 +widesub3 +widesub4 +wjposer1 +1c1,10 +< %IH:exertion +--- +> +> +> +> +> +> +> +> +> +> %IH:exertion +make[1]: [wjposer1] Fout 1 (genegeerd) +zeroe0 +zeroflag +zero2 +======== Done with basic tests ======== +======== Starting Unix tests ======== +fflush +getlnhd +1,2c1 +< select * from user +< where Name = 'O\'Donell' +--- +> << niet verwacht op dit moment. +make[1]: [getlnhd] Fout 1 (genegeerd) +localenl +1,5c1,105 +< LC_ALL=C passed +< LC_ALL=UNKNOWN passed +< LC_ALL=POSIX passed +< LC_ALL=en_US.ISO-8859-1 passed +< LC_ALL=en_US.UTF-8 passed +--- +> 222 +> +> +> 333 +> +> +> 444 +> +> +> 555 666 +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 888 +> +> +> 999 +> +> +> LC_ALL=C passed +> 222 +> +> +> 333 +> +> +> 444 +> +> +> 555 666 +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 888 +> +> +> 999 +> +> +> LC_ALL=UNKNOWN passed +> 222 +> +> +> 333 +> +> +> 444 +> +> +> 555 666 +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 888 +> +> +> 999 +> +> +> LC_ALL=POSIX passed +> 222 +> +> +> 333 +> +> +> 444 +> +> +> 555 666 +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 888 +> +> +> 999 +> +> +> LC_ALL=en_US.ISO-8859-1 passed +> 222 +> +> +> 333 +> +> +> 444 +> +> +> 555 666 +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> 888 +> +> +> 999 +> +> +> LC_ALL=en_US.UTF-8 passed +make[1]: [localenl] Fout 1 (genegeerd) +pid +1,2c1,2 +< PID ok +< PPID ok +--- +> Bad pid 4076, wanted 2852 +> Bad ppid 0, wanted 248 +make[1]: [pid] Fout 1 (genegeerd) +pipeio1 +pipeio2 +2c2 +< January .... +--- +> January .... +4c4 +< S M Tu W Th F S +--- +> S M Tu W Th F S +6c6 +< . . . . +--- +> . . . . +8c8 +< . . . . . .. .. +--- +> . . . . . .. .. +10c10 +< .. .. .. .. .. .. .. +--- +> .. .. .. .. .. .. .. +12c12 +< .. .. .. .. .. .. .. +--- +> .. .. .. .. .. .. .. +14c14 +< .. .. .. .. .. .. +--- +> .. .. .. .. .. .. +make[1]: [pipeio2] Fout 1 (genegeerd) +poundbang +space +strftlng +======== Done with Unix tests ======== +======== Starting gawk extension tests ======== +argtest +asort +asorti +backw +badargs +binmode1 +clos1way +1,26c1,2 +< got a +< got b +< got c +< got d +< got e +< got f +< got g +< got h +< got i +< got j +< got k +< got l +< got m +< got n +< got o +< got p +< got q +< got r +< got s +< got t +< got u +< got v +< got w +< got x +< got y +< got z +--- +> gawk: clos1way.awk:7: fatal: `|&' not supported +> EXIT CODE: 2 +make[1]: [clos1way] Fout 1 (genegeerd) +devfd +1,2c1,2 +< file on fd 4 +< file on fd 5 +--- +> gawk: cmd. line:1: fatal: can't stat fd 4 (Bad file descriptor) +> EXIT CODE: 2 +make[1]: [devfd] Fout 1 (genegeerd) +devfd1 +1,40c1,2 +< this is file f1, line 1 +< this is file f2, line 1 +< this is file f1, line 2 +< this is file f2, line 2 +< this is file f1, line 3 +< this is file f2, line 3 +< this is file f1, line 4 +< this is file f2, line 4 +< this is file f1, line 5 +< this is file f2, line 5 +< this is file f1, line 6 +< this is file f2, line 6 +< this is file f1, line 7 +< this is file f2, line 7 +< this is file f1, line 8 +< this is file f2, line 8 +< this is file f1, line 9 +< this is file f2, line 9 +< this is file f1, line 10 +< this is file f2, line 10 +< this is file f1, line 11 +< this is file f2, line 11 +< this is file f1, line 12 +< this is file f2, line 12 +< this is file f1, line 13 +< this is file f2, line 13 +< this is file f1, line 14 +< this is file f2, line 14 +< this is file f1, line 15 +< this is file f2, line 15 +< this is file f1, line 16 +< this is file f2, line 16 +< this is file f1, line 17 +< this is file f2, line 17 +< this is file f1, line 18 +< this is file f2, line 18 +< this is file f1, line 19 +< this is file f2, line 19 +< this is file f1, line 20 +< this is file f2, line 20 +--- +> gawk: ../../gawk-3.1.6-src/test/devfd1.awk:5: fatal: can't stat fd 4 (Bad file descriptor) +> EXIT CODE: 2 +make[1]: [devfd1] Fout 1 (genegeerd) +devfd2 +1,40c1,2 +< this is file f1, line 1 +< this is file f1, line 2 +< this is file f1, line 3 +< this is file f1, line 4 +< this is file f1, line 5 +< this is file f1, line 6 +< this is file f1, line 7 +< this is file f1, line 8 +< this is file f1, line 9 +< this is file f1, line 10 +< this is file f1, line 11 +< this is file f1, line 12 +< this is file f1, line 13 +< this is file f1, line 14 +< this is file f1, line 15 +< this is file f1, line 16 +< this is file f1, line 17 +< this is file f1, line 18 +< this is file f1, line 19 +< this is file f1, line 20 +< this is file f2, line 1 +< this is file f2, line 2 +< this is file f2, line 3 +< this is file f2, line 4 +< this is file f2, line 5 +< this is file f2, line 6 +< this is file f2, line 7 +< this is file f2, line 8 +< this is file f2, line 9 +< this is file f2, line 10 +< this is file f2, line 11 +< this is file f2, line 12 +< this is file f2, line 13 +< this is file f2, line 14 +< this is file f2, line 15 +< this is file f2, line 16 +< this is file f2, line 17 +< this is file f2, line 18 +< this is file f2, line 19 +< this is file f2, line 20 +--- +> gawk: cmd. line:1: fatal: can't stat fd 4 (Bad file descriptor) +> EXIT CODE: 2 +make[1]: [devfd2] Fout 1 (genegeerd) +double1 +double2 +fieldwdth +fsfwfs +fwtest +fwtest2 +gensub +gensub2 +gnuops2 +gnuops3 +gnureops +icasefs +1c1 +< aCa +--- +> ccC ccC ccC aCa +5,6c5,6 +< aCa +< aCa +--- +> xxX yyY aCa +> xxX yyY aCa +make[1]: [icasefs] Fout 1 (genegeerd) +icasers +1c1,10 +< 1111 +--- +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ ŠšŠ ŒœŒ ŽžŽ ŸÿŸ ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ ŠšŠ ŒœŒ ŽžŽ ŸÿŸ ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ +> +> +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ ŠšŠ ŒœŒ ŽžŽ ŸÿŸ ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ +> +> +> 1111 +make[1]: [icasers] Fout 1 (genegeerd) +igncdym +1c1 +< 0 bar:This is foo +--- +> bbB aaA rrR 0 bar:This is foo +3c3 +< 9 bar:This is bar +--- +> bbB aaA rrR 9 bar:This is bar +make[1]: [igncdym] Fout 1 (genegeerd) +igncfs +0a1,6 +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ +> (hard_LC_COLLATE) +> AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ªªª ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ +> (hard_LC_COLLATE) +make[1]: [igncfs] Fout 1 (genegeerd) +ignrcase +1c1 +< xz +--- +> yyY xz +make[1]: [ignrcase] Fout 1 (genegeerd) +ignrcas2 +1c1 +< OK +--- +> 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ 000 111 222 333 444 555 666 777 888 999 AaA BbB CcC DdD EeE FfF GgG HhH IiI JjJ KkK LlL MmM NnN OoO PpP QqQ RrR SsS TtT UuU VvV WwW XxX YyY ZzZ aaA bbB ccC ddD eeE ffF ggG hhH iiI jjJ kkK llL mmM nnN ooO ppP qqQ rrR ssS ttT uuU vvV wwW xxX yyY zzZ ƒƒƒ ŠšŠ ŒœŒ ŽžŽ ššŠ œœŒ žžŽ ŸÿŸ ªªª ²²² ³³³ µµµ ¹¹¹ ººº ÀàÀ ÁáÁ Ââ Ããà ÄäÄ ÅåÅ ÆæÆ ÇçÇ ÈèÈ ÉéÉ ÊêÊ ËëË ÌìÌ ÍíÍ ÎîÎ ÏïÏ ÐðÐ ÑñÑ ÒòÒ ÓóÓ ÔôÔ ÕõÕ ÖöÖ ØøØ ÙùÙ ÚúÚ ÛûÛ ÜüÜ ÝýÝ ÞþÞ ßßß ààÀ ááÁ ââ ããà ääÄ ååÅ ææÆ ççÇ èèÈ ééÉ êêÊ ëëË ììÌ ííÍ îîÎ ïïÏ ððÐ ññÑ òòÒ óóÓ ôôÔ õõÕ ööÖ øøØ ùùÙ úúÚ ûûÛ üüÜ ýýÝ þþÞ ÿÿŸ OK +make[1]: [ignrcas2] Fout 1 (genegeerd) +lint +lintold +16c16 +< done +--- +> aaA bbB done +make[1]: [lintold] Fout 1 (genegeerd) +match1 +match2 +manyfiles +nondec +nondec2 +posix +procinfs +printfbad1 +regx8bit +rebuf +1c1 +< 1 0 +--- +> ttT iiI ddD wwW vvV 1 0 +make[1]: [rebuf] Fout 1 (genegeerd) +reint +reint2 +1c1,4 +< 1 2 3 +--- +> 000 111 222 333 444 555 666 777 888 999 ²²² ³³³ ¹¹¹ +> +> +>     1 2 3 +make[1]: [reint2] Fout 1 (genegeerd) +rsstart1 +1c1 +< 2 +--- +> AaA 2 +make[1]: [rsstart1] Fout 1 (genegeerd) +rsstart2 +1c1 +< 2 +--- +> AaA xxX 2 +make[1]: [rsstart2] Fout 1 (genegeerd) +rsstart3 +1c1 +< 2 +--- +> AaA xxX 2 +make[1]: [rsstart3] Fout 1 (genegeerd) +rstest6 +1c1 +< ABCD +--- +> XxX YyY ZzZ ABCD +make[1]: [rstest6] Fout 1 (genegeerd) +shadow +0a1 +> gawk: warning: `BINMODE' is a gawk extension +make[1]: [shadow] Fout 1 (genegeerd) +sort1 +strtonum +This test could fail on slow machines or on a minute boundary, +so if it does, double check the actual results: +strftime +whiny +======== Done with gawk extension tests ======== +make[2]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/test' wordt binnengegaan +80 TESTS FAILED +make[2]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/test' wordt verlaten +make[1]: Map '/cygdrive/j/Lang/gawk/3.1.6/gawk-3.1.6/test' wordt verlaten diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin.README b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin.README new file mode 100644 index 0000000..9965591 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin.README @@ -0,0 +1,59 @@ +* sed-4.2.1 for Windows * +========================= + +What is it? +----------- +sed: stream editor + +Description +----------- +Sed (streams editor) isn't really a true text editor or text processor. Instead, it is used to filter text, i.e., it takes text input and performs some operation (or set of operations) on it and outputs the modified text. Sed is typically used for extracting part of a file using pattern matching or substituting multiple occurances of a string within a file. Version 1.4 is the fast, small sed originally distributed in the GNU toolkit and still distributed with Minix -- but it's still better for some uses (in particular, faster and less memory-intensive). More information can be found in the docs provided with the package, and in - IBM Developer Works Common Threads: Sed by Example: - Part 1 - Part 2 - Part 3 - Sed FAQ - Grymoire Sed Tutorial - Sed and Regular Expressions - Sourceforge project Sed - SedSed - Sed specification - Regular expressions specification - Sed Tutorial - Sed Users Mailing List + +Homepage +-------- +http://www.gnu.org/software/sed/sed.html +Sources: http://ftp.gnu.org/gnu/sed/sed-4.2.1.tar.gz + +System +------ +- Win32, i.e. MS-Windows NT / 2000 / XP / 2003 / Vista / 2008 / 7 + +Notes +----- +- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net + +Package Availability +-------------------- +- in: http://gnuwin32.sourceforge.net + +Binaries +-------- +- + +Developer files +--------------- +- +Installation +------------ +The GnuWin port of Sed has an additional option -b (--binary) for input and output in MS-Windows binary mode. The default is input and output in binary mode, so that all characters are copied verbatim; this is useful, for example, when editing files with Unicode characters or with embedded Ctl-Z symbols. + + +Documentation +------------- +- + +Sources +------- +- sed-4.2.1-src.zip + +Compilation +----------- +The package has been compiled with GNU auto-tools, GNU make, and Mingw +(GCC for MS-Windows). Any differences from the original sources are given +in sed-4.2.1-GnuWin.diffs in sed-4.2.1-src.zip. Libraries needed +for compilation can be found at the lines starting with 'LIBS = ' in the +Makefiles. Usually, these are standard libraries provided with Mingw, or +libraries from the package itself; 'gw32c' refers to the libgw32c package, +which provides MS-Windows substitutes or stubs for functions normally found in +Unix. For more information, see: http://gnuwin32.sourceforge.net/compile.html +and http://gnuwin32.sourceforge.net/packages/libgw32c.htm. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin32.README b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin32.README new file mode 100644 index 0000000..ec956ba --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1-GnuWin32.README @@ -0,0 +1,59 @@ +* sed-4.2.1 for Windows * +========================= + +What is it? +----------- +sed: stream editor + +Description +----------- +Sed (streams editor) isn't really a true text editor or text processor. Instead, it is used to filter text, i.e., it takes text input and performs some operation (or set of operations) on it and outputs the modified text. Sed is typically used for extracting part of a file using pattern matching or substituting multiple occurances of a string within a file. Version 1.4 is the fast, small sed originally distributed in the GNU toolkit and still distributed with Minix -- but it's still better for some uses (in particular, faster and less memory-intensive). More information can be found in the docs provided with the package, and in - IBM Developer Works Common Threads: Sed by Example: - Part 1 - Part 2 - Part 3 - Sed FAQ - Grymoire Sed Tutorial - Sed and Regular Expressions - Sourceforge project Sed - SedSed - Sed specification - Regular expressions specification - Sed Tutorial - Sed Users Mailing List + +Homepage +-------- +http://www.gnu.org/software/sed/sed.html +Sources: http://ftp.gnu.org/gnu/sed/sed-4.2.1.tar.gz + +System +------ +- Win32, i.e. MS-Windows NT / 2000 / XP / 2003 / Vista / 2008 / 7 + +Notes +----- +- Bugs and questions on this MS-Windows port: gnuwin32@users.sourceforge.net + +Package Availability +-------------------- +- in: http://gnuwin32.sourceforge.net + +Binaries +-------- +- + +Developer files +--------------- +- +Installation +------------ +The GnuWin port of Sed has an additional option -b (--binary) for input and output in MS-Windows binary mode. The default is input and output in binary mode, so that all characters are copied verbatim; this is useful, for example, when editing files with Unicode characters or with embedded Ctl-Z symbols. + + +Documentation +------------- +- + +Sources +------- +- sed-4.1.5-2-src.zip + +Compilation +----------- +The package has been compiled with GNU auto-tools, GNU make, and Mingw +(GCC for MS-Windows). Any differences from the original sources are given +in sed-4.2.1-GnuWin32.diffs in sed-4.2.1-src.zip. Libraries needed +for compilation can be found at the lines starting with 'LIBS = ' in the +Makefiles. Usually, these are standard libraries provided with Mingw, or +libraries from the package itself; 'gw32c' refers to the libgw32c package, +which provides MS-Windows substitutes or stubs for functions normally found in +Unix. For more information, see: http://gnuwin32.sourceforge.net/compile.html +and http://gnuwin32.sourceforge.net/packages/libgw32c.htm. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ABOUT-NLS b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ABOUT-NLS new file mode 100644 index 0000000..3575535 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ABOUT-NLS @@ -0,0 +1,1111 @@ +1 Notes on the Free Translation Project +*************************************** + +Free software is going international! The Free Translation Project is +a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +1.1 Quick configuration advice +============================== + +If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias, message inheritance, automatic +charset conversion or plural form handling) as the implementation here. +It is also not possible to offer this additional functionality on top +of a `catgets' implementation. Future versions of GNU `gettext' will +very likely convey even more functionality. So it might be a good idea +to change to GNU `gettext' as soon as possible. + + So you need _not_ provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +1.2 INSTALL Matters +=================== + +Some packages are "localizable" when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU `gettext'. Other packages have their own ways to +internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: + + ./configure --with-included-gettext + ./configure --disable-nls + +will, respectively, bypass any pre-existing `gettext' to use the +internationalizing routines provided within this package, or else, +_totally_ disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + The configuration process will not test for the `catgets' function +and therefore it will not be used. The reason is that even an +emulation of `gettext' on top of `catgets' could not provide all the +extensions of the GNU `gettext' library. + + Internationalized packages usually have many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +1.3 Using This Package +====================== + +As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, +and `CC' is an ISO 3166 two-letter country code. For example, let's +suppose that you speak German and live in Germany. At the shell +prompt, merely execute `setenv LANG de_DE' (in `csh'), +`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). +This can be done from your `.login' or `.profile' file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of `LL_CC', with `LL' denoting the +language and `CC' denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are +used, such as `LL' or `LL_CC.ENCODING'. You can get the list of +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' +for the purpose of message handling, but you still need to have `LANG' +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather +read translations in German than English for when Swedish is not +available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + + In the `LANGUAGE' environment variable, but not in the `LANG' +environment variable, `LL_CC' combinations can be abbreviated as `LL' +to denote the language's main dialect. For example, `de' is equivalent +to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' +(Portuguese as spoken in Portugal) in this context. + +1.4 Translating Teams +===================== + +For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" +area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +_actively_ in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +1.5 Available Packages +====================== + +Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of July +2006. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo + +----------------------------------------------------+ + GNUnet | [] | + a2ps | [] [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | [] | + ap-utils | | + aspell | [] [] [] [] | + bash | [] [] [] | + batchelor | [] | + bfd | | + bibshelf | [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | [] [] | + coreutils | [] [] [] [] | + cpio | | + cpplib | [] [] [] | + cryptonit | [] | + darkstat | [] () [] | + dialog | [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] | + findutils | [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] | + gip | [] | + gliv | [] | + glunarclock | [] | + gmult | [] [] | + gnubiff | () | + gnucash | () () [] | + gnucash-glossary | [] () | + gnuedu | | + gnulib | [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | | + gpe-edit | [] | + gpe-filemanager | | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-package | | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] | + gretl | | + gsasl | | + gss | | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | [] () | + gtkam | [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] | + id-utils | [] [] | + impost | | + indent | [] [] [] | + iso_3166 | [] [] | + iso_3166_1 | [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] | + iso_639 | [] [] | + jpilot | [] | + jtag | | + jwhois | | + kbd | [] [] [] [] | + keytouch | | + keytouch-editor | | + keytouch-keyboa... | | + latrine | () | + ld | [] | + leafpad | [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] | + libgpg-error | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libgsasl | | + libiconv | [] [] | + libidn | [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] | + make | [] [] | + man-db | [] () [] [] | + minicom | [] [] [] | + mysecretdiary | [] [] | + nano | [] [] () [] | + nano_1_0 | [] () [] [] | + opcodes | [] | + parted | | + pilot-qof | [] | + psmisc | [] | + pwdutils | | + python | | + qof | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] | + sharutils | [] [] [] [] [] [] | + shishi | | + silky | | + skencil | [] () | + sketch | [] () | + solfege | | + soundtracker | [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | () () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] | + xchat | [] [] [] [] [] | + xkeyboard-config | | + xpad | [] [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs cy da de el en en_GB eo + 11 0 1 2 8 21 1 42 43 2 62 99 18 1 16 16 + + es et eu fa fi fr ga gl gu he hi hr hu id is it + +--------------------------------------------------+ + GNUnet | | + a2ps | [] [] [] () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] [] | + aspell | [] [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + cflow | | + clisp | [] [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cpplib | [] [] | + cryptonit | [] | + darkstat | [] () [] [] [] | + dialog | [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gip | [] [] [] | + gliv | () | + glunarclock | [] [] [] | + gmult | [] [] [] | + gnubiff | () () | + gnucash | () () () | + gnucash-glossary | [] [] | + gnuedu | [] | + gnulib | [] [] [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] [] [] | + gpe-filemanager | [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | () () [] () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] [] | + gsasl | [] | + gss | [] | + gst-plugins | [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] [] | + gstreamer | [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] [] | + impost | [] [] | + indent | [] [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_1 | [] [] [] [] [] [] [] | + iso_3166_2 | [] | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] [] | + jpilot | [] [] | + jtag | [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] [] | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] [] [] | + libgpg-error | | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] | + libgsasl | [] [] | + libiconv | [] | + libidn | [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] [] | + lynx | [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] | + man-db | () | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] [] | + shishi | | + silky | [] | + skencil | [] [] | + sketch | [] [] | + solfege | [] | + soundtracker | [] [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + tp-robot | [] [] [] [] | + tuxpaint | [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + es et eu fa fi fr ga gl gu he hi hr hu id is it + 89 21 16 2 41 119 61 14 1 8 1 6 61 30 0 53 + + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + +--------------------------------------------------+ + GNUnet | | + a2ps | () [] [] () | + aegis | () | + ant-phone | [] | + anubis | [] [] [] | + ap-utils | [] | + aspell | [] [] | + bash | [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | | + bison | [] [] [] | + bison-runtime | [] [] [] | + bluez-pin | [] [] [] | + cflow | | + clisp | [] | + console-tools | | + coreutils | [] | + cpio | | + cpplib | [] | + cryptonit | [] | + darkstat | [] [] | + dialog | [] [] | + diffutils | [] [] [] | + doodle | | + e2fsprogs | [] | + enscript | [] | + error | [] | + fetchmail | [] [] | + fileutils | [] [] | + findutils | [] | + flex | [] [] | + fslint | [] [] | + gas | | + gawk | [] [] | + gbiff | [] | + gcal | | + gcc | | + gettext-examples | [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] | + gip | [] [] | + gliv | [] | + glunarclock | [] [] | + gmult | [] [] | + gnubiff | | + gnucash | () () | + gnucash-glossary | [] | + gnuedu | | + gnulib | [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-filemanager | [] | + gpe-go | [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | [] [] | + gprof | | + gpsdrive | () () () | + gramadoir | () | + grep | [] [] [] | + gretl | | + gsasl | [] | + gss | | + gst-plugins | [] | + gst-plugins-base | | + gst-plugins-good | [] | + gstreamer | [] | + gtick | [] | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] | + gutenprint | | + hello | [] [] [] [] [] [] [] [] | + id-utils | [] | + impost | | + indent | [] [] | + iso_3166 | [] | + iso_3166_1 | [] [] | + iso_3166_2 | [] | + iso_3166_3 | [] | + iso_4217 | [] [] [] | + iso_639 | [] [] | + jpilot | () () () | + jtag | | + jwhois | [] | + kbd | [] | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | | + latrine | [] | + ld | | + leafpad | [] [] | + libc | [] [] [] [] [] | + libexif | | + libextractor | | + libgpewidget | [] | + libgpg-error | | + libgphoto2 | [] | + libgphoto2_port | [] | + libgsasl | [] | + libiconv | | + libidn | [] [] | + lifelines | [] | + lilypond | | + lingoteach | [] | + lynx | [] [] | + m4 | [] [] | + mailutils | | + make | [] [] [] | + man-db | () | + minicom | [] | + mysecretdiary | [] | + nano | [] [] [] | + nano_1_0 | [] [] [] | + opcodes | [] | + parted | [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | | + radius | | + recode | [] | + rpm | [] [] | + screem | [] | + scrollkeeper | [] [] [] [] | + sed | [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] [] [] | + sharutils | [] [] | + shishi | | + silky | [] | + skencil | | + sketch | | + solfege | | + soundtracker | | + sp | () | + stardict | [] [] | + system-tools-ba... | [] [] [] [] | + tar | [] [] [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | | + tp-robot | [] | + tuxpaint | [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] | + vorbis-tools | [] | + wastesedge | [] | + wdiff | [] [] | + wget | [] [] | + xchat | [] [] [] [] | + xkeyboard-config | [] | + xpad | [] [] [] | + +--------------------------------------------------+ + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + 40 24 2 1 1 3 1 2 3 21 0 15 1 101 5 3 + + nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + +------------------------------------------------------+ + GNUnet | | + a2ps | () [] [] [] [] [] [] | + aegis | () () | + ant-phone | [] [] | + anubis | [] [] [] | + ap-utils | () | + aspell | [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | [] [] | + bison | [] [] [] [] [] | + bison-runtime | [] [] [] [] | + bluez-pin | [] [] [] [] [] [] [] [] [] | + cflow | [] | + clisp | [] | + console-tools | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + cpplib | [] | + cryptonit | [] [] | + darkstat | [] [] [] [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] [] | + fileutils | [] [] [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] [] | + fslint | [] [] [] [] | + gas | | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] [] | + gimp-print | [] [] | + gip | [] [] [] [] | + gliv | [] [] [] [] | + glunarclock | [] [] [] [] [] [] | + gmult | [] [] [] [] | + gnubiff | () | + gnucash | () [] | + gnucash-glossary | [] [] [] | + gnuedu | | + gnulib | [] [] [] [] [] | + gnunet-gtk | [] | + gnutls | [] [] | + gpe-aerial | [] [] [] [] [] [] [] | + gpe-beam | [] [] [] [] [] [] [] | + gpe-calendar | [] [] [] [] [] [] [] [] | + gpe-clock | [] [] [] [] [] [] [] [] | + gpe-conf | [] [] [] [] [] [] [] | + gpe-contacts | [] [] [] [] [] | + gpe-edit | [] [] [] [] [] [] [] [] | + gpe-filemanager | [] [] | + gpe-go | [] [] [] [] [] [] | + gpe-login | [] [] [] [] [] [] [] [] | + gpe-ownerinfo | [] [] [] [] [] [] [] [] | + gpe-package | [] [] | + gpe-sketchbook | [] [] [] [] [] [] [] [] | + gpe-su | [] [] [] [] [] [] [] [] | + gpe-taskmanager | [] [] [] [] [] [] [] [] | + gpe-timesheet | [] [] [] [] [] [] [] [] | + gpe-today | [] [] [] [] [] [] [] [] | + gpe-todo | [] [] [] [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] | + gpsdrive | [] [] [] | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] | + gretl | [] | + gsasl | [] [] | + gss | [] [] [] | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] | + gst-plugins-good | [] [] [] [] | + gstreamer | [] [] [] | + gtick | [] [] [] | + gtkam | [] [] [] [] | + gtkorphan | [] | + gtkspell | [] [] [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] | + impost | [] | + indent | [] [] [] [] [] [] | + iso_3166 | [] [] [] [] [] [] | + iso_3166_1 | [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] [] [] [] | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] | + jpilot | | + jtag | [] | + jwhois | [] [] [] [] | + kbd | [] [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] | + ld | [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] [] | + libgpewidget | [] [] [] [] [] [] [] | + libgpg-error | [] [] | + libgphoto2 | [] | + libgphoto2_port | [] [] [] | + libgsasl | [] [] [] [] | + libiconv | | + libidn | [] [] () | + lifelines | [] [] | + lilypond | | + lingoteach | [] | + lynx | [] [] [] | + m4 | [] [] [] [] [] | + mailutils | [] [] [] [] | + make | [] [] [] [] | + man-db | [] [] | + minicom | [] [] [] [] [] | + mysecretdiary | [] [] [] [] | + nano | [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] | + parted | [] | + pilot-qof | [] | + psmisc | [] [] | + pwdutils | [] [] | + python | | + qof | [] | + radius | [] [] | + recode | [] [] [] [] [] [] [] | + rpm | [] [] [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] | + sed | [] [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] | + shared-mime-info | [] [] [] [] [] | + sharutils | [] [] [] [] | + shishi | [] | + silky | [] | + skencil | [] [] [] | + sketch | [] [] [] | + solfege | [] | + soundtracker | [] [] | + sp | | + stardict | [] [] [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] | + tin | () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | | + wdiff | [] [] [] [] [] [] | + wget | [] [] [] [] | + xchat | [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + xpad | [] [] [] | + +------------------------------------------------------+ + nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta + 0 2 3 58 31 53 5 76 72 5 42 48 12 51 130 2 + + tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + +---------------------------------------------------+ + GNUnet | [] | 2 + a2ps | [] [] [] | 19 + aegis | | 0 + ant-phone | [] [] | 6 + anubis | [] [] [] | 11 + ap-utils | () [] | 4 + aspell | [] [] [] | 14 + bash | [] | 11 + batchelor | [] [] | 9 + bfd | | 1 + bibshelf | [] | 7 + binutils | [] [] [] | 9 + bison | [] [] [] | 19 + bison-runtime | [] [] [] | 16 + bluez-pin | [] [] [] [] [] [] | 28 + cflow | [] [] | 4 + clisp | | 6 + console-tools | [] [] | 5 + coreutils | [] [] | 17 + cpio | [] [] [] | 9 + cpplib | [] [] [] [] | 11 + cryptonit | | 5 + darkstat | [] () () | 15 + dialog | [] [] [] [] [] | 30 + diffutils | [] [] [] [] | 28 + doodle | [] | 6 + e2fsprogs | [] [] | 10 + enscript | [] [] [] | 16 + error | [] [] [] [] | 18 + fetchmail | [] [] | 12 + fileutils | [] [] [] | 18 + findutils | [] [] [] | 17 + flex | [] [] | 15 + fslint | [] | 9 + gas | [] | 3 + gawk | [] [] | 15 + gbiff | [] | 5 + gcal | [] | 5 + gcc | [] [] [] | 6 + gettext-examples | [] [] [] [] [] [] | 26 + gettext-runtime | [] [] [] [] [] [] | 28 + gettext-tools | [] [] [] [] [] | 19 + gimp-print | [] [] | 12 + gip | [] [] | 12 + gliv | [] [] | 8 + glunarclock | [] [] [] | 15 + gmult | [] [] [] [] | 15 + gnubiff | [] | 1 + gnucash | () | 2 + gnucash-glossary | [] [] | 9 + gnuedu | [] | 2 + gnulib | [] [] [] [] [] | 28 + gnunet-gtk | | 1 + gnutls | | 2 + gpe-aerial | [] [] | 14 + gpe-beam | [] [] | 14 + gpe-calendar | [] [] [] [] | 19 + gpe-clock | [] [] [] [] | 20 + gpe-conf | [] [] | 14 + gpe-contacts | [] [] | 10 + gpe-edit | [] [] [] [] | 19 + gpe-filemanager | [] | 5 + gpe-go | [] [] | 14 + gpe-login | [] [] [] [] [] | 20 + gpe-ownerinfo | [] [] [] [] | 20 + gpe-package | [] | 5 + gpe-sketchbook | [] [] | 16 + gpe-su | [] [] [] | 19 + gpe-taskmanager | [] [] [] | 19 + gpe-timesheet | [] [] [] [] | 18 + gpe-today | [] [] [] [] [] | 20 + gpe-todo | [] | 6 + gphoto2 | [] [] [] [] | 20 + gprof | [] [] | 11 + gpsdrive | | 4 + gramadoir | [] | 7 + grep | [] [] [] [] | 33 + gretl | | 4 + gsasl | [] [] | 6 + gss | [] | 5 + gst-plugins | [] [] [] | 15 + gst-plugins-base | [] [] [] | 9 + gst-plugins-good | [] [] [] | 18 + gstreamer | [] [] [] | 17 + gtick | [] | 11 + gtkam | [] | 13 + gtkorphan | [] | 7 + gtkspell | [] [] [] [] [] [] | 26 + gutenprint | | 3 + hello | [] [] [] [] [] | 39 + id-utils | [] [] | 14 + impost | [] | 4 + indent | [] [] [] [] | 25 + iso_3166 | [] [] [] | 15 + iso_3166_1 | [] [] | 20 + iso_3166_2 | | 2 + iso_3166_3 | [] [] | 9 + iso_4217 | [] [] | 14 + iso_639 | [] | 14 + jpilot | [] [] [] [] | 7 + jtag | [] | 3 + jwhois | [] [] [] | 13 + kbd | [] [] | 12 + keytouch | [] | 4 + keytouch-editor | | 2 + keytouch-keyboa... | | 2 + latrine | [] [] | 8 + ld | [] [] [] [] | 8 + leafpad | [] [] [] [] | 23 + libc | [] [] [] | 23 + libexif | [] | 4 + libextractor | [] | 5 + libgpewidget | [] [] [] | 19 + libgpg-error | [] | 4 + libgphoto2 | [] | 8 + libgphoto2_port | [] [] [] | 11 + libgsasl | [] | 8 + libiconv | [] | 4 + libidn | [] [] | 10 + lifelines | | 4 + lilypond | | 2 + lingoteach | [] | 6 + lynx | [] [] [] | 15 + m4 | [] [] [] | 18 + mailutils | [] | 8 + make | [] [] [] | 20 + man-db | [] | 6 + minicom | [] | 14 + mysecretdiary | [] [] | 12 + nano | [] [] | 15 + nano_1_0 | [] [] [] | 18 + opcodes | [] [] | 10 + parted | [] [] [] | 10 + pilot-qof | [] | 3 + psmisc | [] | 10 + pwdutils | [] | 3 + python | | 0 + qof | [] | 2 + radius | [] | 6 + recode | [] [] [] | 25 + rpm | [] [] [] [] | 14 + screem | [] | 2 + scrollkeeper | [] [] [] [] | 26 + sed | [] [] [] | 22 + sh-utils | [] | 15 + shared-mime-info | [] [] [] [] | 23 + sharutils | [] [] [] | 23 + shishi | | 1 + silky | [] | 4 + skencil | [] | 7 + sketch | | 6 + solfege | | 2 + soundtracker | [] [] | 9 + sp | [] | 3 + stardict | [] [] [] [] | 11 + system-tools-ba... | [] [] [] [] [] [] [] | 37 + tar | [] [] [] [] | 19 + texinfo | [] [] [] | 15 + textutils | [] [] [] | 17 + tin | | 1 + tp-robot | [] [] [] | 10 + tuxpaint | [] [] [] | 16 + unicode-han-tra... | | 0 + unicode-transla... | | 2 + util-linux | [] [] [] | 20 + vorbis-tools | [] [] | 11 + wastesedge | | 1 + wdiff | [] [] | 22 + wget | [] [] [] | 19 + xchat | [] [] [] [] | 28 + xkeyboard-config | [] [] [] [] | 11 + xpad | [] [] [] | 14 + +---------------------------------------------------+ + 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu + 172 domains 0 1 1 78 39 0 135 13 1 50 3 54 0 2054 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If July 2006 seems to be old, you may fetch a more recent copy of +this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date +matrix with full percentage details can be found at +`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. + +1.6 Using `gettext' in new packages +=================================== + +If you are writing a freely available program and want to +internationalize it you are welcome to use GNU `gettext' in your +package. Of course you have to respect the GNU Library General Public +License which covers the use of the GNU `gettext' library. This means +in particular that even non-free programs can use `libintl' as a shared +library, whereas only free software can use `libintl' as a static +library or use modified versions of `libintl'. + + Once the sources are changed appropriately and the setup can handle +the use of `gettext' the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +`translation@iro.umontreal.ca' to make the `.pot' files available to +the translation teams. + diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/AUTHORS b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/AUTHORS new file mode 100644 index 0000000..4474df9 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/AUTHORS @@ -0,0 +1,5 @@ +GNU Sed was first authored by Jay Fenlason (hack@gnu.org) +and later modified by Tom Lord (lord@gnu.org). + +It is currently being maintained by Ken Pizzini (ken@gnu.org) +and Paolo Bonzini (bonzini@gnu.org). diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/BUGS b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/BUGS new file mode 100644 index 0000000..138f3cd --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/BUGS @@ -0,0 +1,133 @@ +* ABOUT BUGS + +Before reporting a bug, please check the list of known bugs +and the list of oft-reported non-bugs (below). + +Bugs and comments may be sent to bonzini@gnu.org; please +include in the Subject: header the first line of the output of +``sed --version''. + +Please do not send a bug report like this: + + [while building frobme-1.3.4] + $ configure + sed: file sedscr line 1: Unknown option to 's' + +If sed doesn't configure your favorite package, take a few extra +minutes to identify the specific problem and make a stand-alone test +case. + +A stand-alone test case includes all the data necessary to perform the +test, and the specific invocation of sed that causes the problem. The +smaller a stand-alone test case is, the better. A test case should +not involve something as far removed from sed as ``try to configure +frobme-1.3.4''. Yes, that is in principle enough information to look +for the bug, but that is not a very practical prospect. + + + +* NON-BUGS + +`N' command on the last line + + Most versions of sed exit without printing anything when the `N' + command is issued on the last line of a file. GNU sed instead + prints pattern space before exiting unless of course the `-n' + command switch has been specified. More information on the reason + behind this choice can be found in the Info manual. + + +regex syntax clashes (problems with backslashes) + + sed uses the Posix basic regular expression syntax. According to + the standard, the meaning of some escape sequences is undefined in + this syntax; notable in the case of GNU sed are `\|', `\+', `\?', + `\`', `\'', `\<', `\>', `\b', `\B', `\w', and `\W'. + + As in all GNU programs that use Posix basic regular expressions, sed + interprets these escape sequences as meta-characters. So, `x\+' + matches one or more occurrences of `x'. `abc\|def' matches either + `abc' or `def'. + + This syntax may cause problems when running scripts written for other + seds. Some sed programs have been written with the assumption that + `\|' and `\+' match the literal characters `|' and `+'. Such scripts + must be modified by removing the spurious backslashes if they are to + be used with recent versions of sed (not only GNU sed). + + On the other hand, some scripts use `s|abc\|def||g' to remove occurrences + of _either_ `abc' or `def'. While this worked until sed 4.0.x, newer + versions interpret this as removing the string `abc|def'. This is + again undefined behavior according to POSIX, but this interpretation + is arguably more robust: the older one, for example, required that + the regex matcher parsed `\/' as `/' in the common case of escaping + a slash, which is again undefined behavior; the new behavior avoids + this, and this is good because the regex matcher is only partially + under our control. + + In addition, GNU sed supports several escape characters (some of + which are multi-character) to insert non-printable characters + in scripts (`\a', `\c', `\d', `\o', `\r', `\t', `\v', `\x'). These + can cause similar problems with scripts written for other seds. + + +-i clobbers read-only files + + In short, `sed d -i' will let one delete the contents of + a read-only file, and in general the `-i' option will let + one clobber protected files. This is not a bug, but rather a + consequence of how the Unix filesystem works. + + The permissions on a file say what can happen to the data + in that file, while the permissions on a directory say what can + happen to the list of files in that directory. `sed -i' + will not ever open for writing a file that is already on disk, + rather, it will work on a temporary file that is finally renamed + to the original name: if you rename or delete files, you're actually + modifying the contents of the directory, so the operation depends on + the permissions of the directory, not of the file). For this same + reason, sed will not let one use `-i' on a writeable file in a + read-only directory, and will break hard or symbolic links when + `-i' is used on such a file. + + +`0a' does not work (gives an error) + + There is no line 0. 0 is a special address that is only used to treat + addresses like `0,/RE/' as active when the script starts: if you + write `1,/abc/d' and the first line includes the word `abc', then + that match would be ignored because address ranges must span at least + two lines (barring the end of the file); but what you probably wanted is + to delete every line up to the first one including `abc', and this + is obtained with `0,/abc/d'. + + +`[a-z]' is case insensitive +`s/.*//' does not clear pattern space + + You are encountering problems with locales. POSIX mandates that `[a-z]' + uses the current locale's collation order -- in C parlance, that means + strcoll(3) instead of strcmp(3). Some locales have a case insensitive + strcoll, others don't. + + Another problem is that [a-z] tries to use collation symbols. This + only happens if you are on the GNU system, using GNU libc's regular + expression matcher instead of compiling the one supplied with GNU sed. + In a Danish locale, for example, the regular expression `^[a-z]$' + matches the string `aa', because `aa' is a single collating symbol that + comes after `a' and before `b'; `ll' behaves similarly in Spanish + locales, or `ij' in Dutch locales. + + Another common localization-related problem happens if your input stream + includes invalid multibyte sequences. POSIX mandates that such + sequences are _not_ matched by `.', so that `s/.*//' will not clear + pattern space as you would expect. In fact, there is no way to clear + sed's buffers in the middle of the script in most multibyte locales + (including UTF-8 locales). For this reason, GNU sed provides a `z' + command (for `zap') as an extension. + + However, to work around both of these problems, which may cause bugs + in shell scripts, you can set the LC_ALL environment variable to `C', + or set the locale on a more fine-grained basis with the other LC_* + environment variables. + diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/COPYING b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/COPYING new file mode 100644 index 0000000..4432540 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/COPYING @@ -0,0 +1,676 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ChangeLog b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ChangeLog new file mode 100644 index 0000000..dcfb5f5 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/ChangeLog @@ -0,0 +1,3185 @@ +2009-06-27 Paolo Bonzini + + * configure.ac: Bump version. + * NEWS: Bump version. + * gnulib: Update. + * doc/sed.1: Regenerate. + +2009-06-25 Paolo Bonzini + + * autoboot.conf: Add selinux-h. + * execute.c: Copy over file creation context before creating a new file. + +2009-06-25 Paolo Bonzini + + * execute.c: Do not copy ACLs until the file is copied. + * utils.c (ck_mkstemp): Set a restrictive umask on temporary files. + +2009-06-26 Paolo Bonzini + + * autoboot: Do not use GIT_CONFIG_LOCAL. + +2009-06-15 Paolo Bonzini + + * autoboot.conf: Add memchr again. + * gnulib: Update. + +2009-06-11 Sergey Farbotka (tiny change) + + * sed/execute.c (open_next_file): Fix off-by-one causing problems + under Cygwin. + +2009-05-11 Paolo Bonzini + + * sed/compile.c (snarf_char_class): Fix logic bug with [[[ in regular + expressions (and a possibly uninitialized use of variable delim stemming + from the bug). Uninitialized variable bug reported by Zhongxing Xu. + * testsuite/brackets.good: New. + * testsuite/brackets.inp: New. + * testsuite/brackets.sed: New. + * testsuite/Makefile.am: Add test. + * testsuite/Makefile.tests: Add test. + +2009-05-11 Paolo Bonzini + + * configure.ac: Define COPYRIGHT_YEAR. + * Makefile.am (dist-hook): Test it. + * sed/mbcs.c: Fix copyright years. + * sed/sed.c: Fix copyright years. Change COPYRIGHT_NOTICE to + COPYRIGHT_YEAR. + * sed/utils.c: Fix copyright years. + * testsuite/version.gin: Use COPYRIGHT_YEAR. + +2009-04-30 Paolo Bonzini + + * sed/compile.c: Declare bool arguments as int instead to please AIX XLC. + * sed/execute.c: Declare bool arguments as int instead to please AIX XLC. + * sed/utils.c: Declare bool arguments as int instead to please AIX XLC. + * sed/utils.h: Declare bool arguments as int instead to please AIX XLC. + +2009-04-27 Paolo Bonzini + + * configure.ac: Bump version number. + * configure: Regenerate. + +2009-04-27 Paolo Bonzini + + * configure.ac: Do not create homonymous links from builddir to srcdir. + * testsuite/Makefile.tests: Create readin.in2 here. + * testsuite/Makefile.am: Do not distribute it. + +2009-04-27 Paolo Bonzini + + * autoboot.conf: Add rename. + * gnulib: Update. + +2009-04-27 Paolo Bonzini + + * configure.ac: XFAIL UTF-8 tests where appropriate. + +2009-04-27 Paolo Bonzini + + * testsuite/Makefile.tests: Handle CRLF endings for mingw. + +2009-04-27 Paolo Bonzini + + * configure.ac: Link readin.in2 into builddir. + * configure: Regenerate. + * doc/Makefile.am: Do not distribute sed.html. Do not update + sed.texi if the output does not change. + * sed/Makefile.am: Order libraries according to their dependencies. + * sed/compile.c (get_openfile): Declare FAIL as int. + * sed/sed.c: Avoid printf ("") if REG_PERL is not defined. + * testsuite/eval.in2: Do not include in the repository. + * testsuite/Makefile.am: Clean always eval.in2 and never readin.in2. + * testsuite/Makefile.tests: Provide a default empty definition of TIME + and remove rules for readin.in2. + +2009-03-31 Paolo Bonzini + + * bootstrap.sh.in: Add __bool_true_false_are_defined. + * bootstrap.sh: Regenerate. + * basicdefs.h: Do not provide bool definitions for BOOTSTRAP at all. + +2009-03-31 Paolo Bonzini + + * sed/sed.c (contact): New. + (usage): From here. + (main): Use it for `sed --version' too. + + * configure.ac: Point to GNU project mailing lists. + * sed/sed.c (contact): Use PACKAGE_BUGREPORT. + * testsuite/version.gin: Likewise. + * testsuite/version.good: Regenerate. + * doc/sed.1: Regenerate. + + * bootstrap.sh.in (PACKAGE_BUGREPORT): New. + * bootstrap.sh: Regenerate. + +2009-03-31 Paolo Bonzini + + * testsuite/Makefile.am: Distribute utf8-3 and utf8-4 test files. + +2009-02-17 Paolo Bonzini + + * testsuite/Makefile.tests: Rewrite rule for utf8-[1234]. + Reported by Ralf Wildenhues. + +2009-02-17 Paolo Bonzini + + * sed/sed.c (usage): Print homepage URL. + * testsuite/version.gin: Update. + +2009-01-28 Paolo Bonzini + + * sed/sed.c (usage): Only print the bug report address for `sed --help'. + (main): Print it for `sed --version' too. + * testsuite/version.gin: Adapt. + * testsuite/Makefile.tests: Refine help message test. + +2009-01-23 Paolo Bonzini + Hideo AOKI + + * sed/compile.c (match_slash): Fix MBCS behavior. + * sed/sed.h (MBSINIT): New. + +2009-01-20 Paolo Bonzini + + * autoboot.conf, bootstrap.sh.in: Remove memchr, memcmp, memmove + compatibility code. + * gnulib: Update. + +2009-01-09 Paolo Bonzini + + * tests/SPENCER.tests: Add testcases for glibc bugzilla 697. + * gnulib: Update. + +2009-01-05 Paolo Bonzini + + * execute.c (read_pattern_space): Reset hold space at end-of-file + if input->reset_at_next_file. + +2008-12-31 Ralf Wildenhues + + Let --posix turn off more GNU extensions. + * sed/compile.c (mark_subst_opts): Turn off subst options i, I, + s, S, x, X, m, and M in --posix mode. + (compile_address): Disallow address modifiers, `FIRST~STEP', + `ADDR1,+N', and `ADDR1,~N' in --posix mode. + (compile_program): In --posix mode, do not accept e or z commands; + do not accept text between an a, c, or i command and the following + backslash; do not accept an argument to the l command. + +2008-12-22 Paolo Bonzini + + * autoboot.conf: Request modules emulating mb functions. + * configure.ac: Do not look for mb functions here. + +2008-10-03 Paolo Bonzini + Jim Meyering + + * autoboot.conf: Add localcharset. + * Makefile.am: Remove intl subdir. Require Automake 1.10. + * configure.ac: Remove useless macros, switch to external gettext. + * lib/Makefile.am: Remove intl subdir from CPPFLAGS. + * sed/Makefile.am: Remove intl subdir from CPPFLAGS. + +2008-10-02 Paolo Bonzini + + * autoboot: Sync with gnulib's build-aux/bootstrap. + +2008-09-29 Paolo Bonzini + + * autoboot: Sync with gnulib's build-aux/bootstrap. + +2008-09-29 Paolo Bonzini + + * testsuite/Makefile.am: Add the utf8-{1,2,3,4} tests. + * testsuite/Makefile.tests: Add the utf8-{1,2,3,4} tests. + * testsuite/runtest: Support skipping tests. + * testsuite/utf8-1.good: New. + * testsuite/utf8-1.inp: New. + * testsuite/utf8-1.sed: New. + * testsuite/utf8-2.good: New. + * testsuite/utf8-2.inp: New. + * testsuite/utf8-2.sed: New. + * testsuite/utf8-3.good: New. + * testsuite/utf8-3.inp: New. + * testsuite/utf8-3.sed: New. + * testsuite/utf8-4.good: New. + * testsuite/utf8-4.inp: New. + * testsuite/utf8-4.sed: New. + +2008-09-29 Paolo Bonzini + + * BUGS: Document s/.*.// behavior with invalid multibyte sequences. + * NEWS: Document `z' extension. + * doc/sed-in.texi: Document both things. + * sed/compile.c (compile_program): Recognize `z'. + * sed/execute.c (execute_program): Execute `z'. + * testsuite/Makefile.am: Add badenc test. + * testsuite/Makefile.tests: Add badenc test. + * testsuite/badenc.good: New. + * testsuite/badenc.inp: New. + * testsuite/badenc.sed: New. + +2008-09-28 Paolo Bonzini + + * basicdefs.h: Replace alloca cruft with alloca.h. + * bootstrap.sh.in: Update for new gnulib. + * bootstrap.sh: Update for new gnulib. + * configure.ac: Move gnulib macros earlier. + * sed/execute.c: Do not include acl.h when bootstrapping. + +2008-08-27 Paolo Bonzini + + * sed/execute.c (closedown): Close the input file! + +2008-08-20 Paolo Bonzini + + * configure.ac: Add gl_DISABLE_THREADS. + +2008-08-20 Ralf Wildenhues + + * sed/compile.c: Do not include strverscmp.c. + +2008-07-21 Paolo Bonzini + + * doc/sed-in.texi: Remove northpark.edu address for sed FAQ. + * doc/sed.texi: Regenerate. + +2008-07-10 Paolo Bonzini + + * doc/sed-in.texi: Make the description of ^ and $ more precise. + * doc/sed.texi: Regenerate. + +2008-06-04 Vladimir Marek + + * basicdefs.h: Don't hardcode usage of prototypes on SunStudio. + +2008-05-15 Paolo Bonzini + + * autoboot.conf: Update for newer gnulib. + +2008-05-15 Paolo Bonzini + + * bootstrap.sh.in: Define bool, true, false. Reported by + Jason Stover. Adjust for gnulib changes. + * bootstrap.sh: Regenerate. + +2008-04-24 Paul Eggert + + * sed/compile.c (match_slash): Treat 's&foo&\&&' compatibly with + traditional 'sed'. + * testsuite/bsd.sh: Add test case for this. + * testsuite/bsd.good: Add test case output. + +2008-04-24 Paolo Bonzini + + * sed/compile.c (setup_replacement): Fix bug with \& in POSIX mode. + +2008-01-16 Jim Meyering + + * sed/execute.c (open_next_file, get_backup_file_name): Avoid + warnings from gcc. + +2008-01-16 Jim Meyering + + * sed/compile.c (snarf_char_class): Reverse order of conjuncts + so that "delim" is not used uninitialized. + +2008-01-16 Jim Meyering + + * sed/utils.c (panic): Remove declaration of unused local, "fd". + +2008-01-16 Jim Meyering + + * sed/execute.c (open_next_file, get_backup_file_name): Avoid + warnings from gcc. Avoid shadowing global "pipe". + +2008-01-16 Jim Meyering + + * autoboot.conf (gnulib_modules): Add stat-macros and pathmax. + +2007-10-25 Paolo Bonzini + Mike Frysinger + + * doc/sed.x (q, Q): Document argument. + * configure.ac: Remove texi2html checks. + * doc/Makefile.am: Remove rules for sed.html, always distribute it. + +2007-08-14 Paolo Bonzini + + * sed/execute.c (open_next_file): Follow symlink here... + (closedown): ... not here. + +2007-06-29 Paolo Bonzini + + * sed/mbcs.c: Upgrade to GPLv3. + * sed/regexp.c: Upgrade to GPLv3. + * sed/sed.c: Upgrade to GPLv3. + * sed/sed.h: Upgrade to GPLv3. + * sed/utils.c: Upgrade to GPLv3. + * sed/utils.h: Upgrade to GPLv3. + * sed/compile.c: Upgrade to GPLv3. + * sed/execute.c: Upgrade to GPLv3. + * sed/fmt.c: Upgrade to GPLv3. + +2007-03-01 Masatake YAMATO (tiny change) + + * sed/compile.c (compile_program): Accept 0,/REGEXP/ address + specification only if --posix is not specified. + +2007-02-05 Paolo Bonzini + + * testsuite/bug-regex27.c, testsuite/bug-regex28.c: New, from + glibc (written by Jakub Jelinek). + +2007-01-26 Paolo Bonzini + + * sed/compile.c (check_final_program): Don't set text if the + pending_text is initialized but empty. + * sed/execute.c (output_line): Don't print text if it is NULL. + * testsuite/Makefile.am (TESTS): Add insert. + * testsuite/Makefile.tests (insert): New. + * testsuite/insert.good, testsuite/insert.sed, testsuite/insert.inp: New + testcase from Jonas Koelker. + +2006-12-29 Paolo Bonzini + + * sed/compile.c: Fix warnings. + * sed/execute.c: Fix warnings. + +2006-12-22 Bruno Haible + + * sed/utils.c: Include pathmax. + * sed/mbcs.c: Use local_charset. + * sed/execute.c: Copy with padding after the mbstate_t member. + +2006-12-21 Paolo Bonzini + + * sed/mbcs.c: Include string.h (reported by Henning Nielsen Lund). + * sed/fmt.c: Likewise. + * sed/regexp.c: Likewise. + +2006-12-18 Paolo Bonzini + + * sed/execute.c (closedown): Remove dead code. + +2006-12-17 Paolo Bonzini + + * sed/utils.c: Include limits.h. + +2006-12-16 Paolo Bonzini + + * doc/sed-in.texi: Document --follow-symlinks. + +2006-12-15 Paolo Bonzini + + * sed/regexp.c: Disable all extensions on --posix. + +2006-09-24 Paolo Bonzini + + * sed/execute.c: Support ACLs. + * lib/utils.c: Move... + * sed/utils.c: ... here, and remove xmalloc. + +2006-08-21 Paolo Bonzini + + * sed/regexp.c: Accept NUL bytes for `.'. Accept 'a\(b' in + POSIXLY_CORRECT/POSIXLY_BASIC posixicity. + +2006-08-03 Paolo Bonzini + + Revert this part of the previous change: + + 2006-08-03 Paolo Bonzini + + * sed/compile.c (get_openfile): Change second argument to char + and turn it into a string within the function. Adjust callers. + +2006-08-03 Paolo Bonzini + Corinna Vinschen + + * lib/getline.c (getline): Remove Windows special casing. + * lib/utils.c (register_open_file, ck_fdopen): New. + (ck_fopen, ck_mkstemp): Use register_open_file. + * lib/utils.h (ck_fdopen): New. + * sed/execute.c (open_next_file): Reopen stdin. + * sed/sed.h (read_mode): New. + * sed/sed.c (read_mode): New. + (main): Set it on --binary. + (usage): Document --binary. + * sed/compile.c (get_openfile): Change second argument to char + and turn it into a string within the function. Adjust callers. + * sed/execute.c (dump_append_queue, open_next_file): Use it + as mode for ck_fopen. + +2006-08-03 Paolo Bonzini + + * sed/execute.c (str_append): Use is_utf8 to skip useless work. + * sed/mbcs.c (initialize_mbcs): Look for a UTF-8 locale. + (is_utf8): New. + * sed/sed.h (is_utf8): New. + +2006-07-13 Paolo Bonzini + + * bootstrap.sh.in: Add a few autoconfy tests. + * Makefile.am: Update distributed bootstrap.sh. + +2006-05-15 Hans-Bernhard Broeker + + * sed/basicdefs.h (OB_MALLOC): Turn VCAST into void * cast. + +2006-02-03 Paolo Bonzini + + * sed/compile.c (compile_program) : Pass false to match_slash. + +2005-09-07 Paolo Bonzini + + * lib/regcomp.c: Update from upstream. + * lib/regex.c: Update from upstream. + * lib/regex_.h: Update from upstream. + * lib/regex_internal.c: Update from upstream. + * lib/regex_internal.h: Update from upstream. + * lib/regexec.c: Update from upstream. + +2005-08-30 Paolo Bonzini + + * sed/execute.c (reset_addresses): Never activate ADDR_IS_NUM_MOD + addresses. + * testsuite/modulo.good, testsuite/modulo.inp, testsuite/modulo.sed: + New. + * testsuite/Makefile.tests: Add new testcase. + * testsuite/Makefile.am: Add new testcase. + * testsuite/Makefile.in: Regenerate. + +2005-05-18 Maciej W. Rozycki + + * configure.ac: Use a cache variable for the libcP test. + * configure: Regenerate. + +2005-05-16 Eero Hakkinen + + * sed/compile.c (snarf_char_class): Fix handling of + [^]xyz]. + +2005-04-04 Paolo Bonzini + + * sed/execute.c (process_files): Do not add a default + command-line in in-place editing mode. + +2005-02-10 Paolo Bonzini + + * testsuite/Makefile.tests: Add new testcase. + * testsuite/Makefile.am: Add new testcase. + * testsuite/Makefile.in: Regenerate. + * testsuite/appquit.good, testsuite/appquit.inp, + testsuite/appquit.sed: New testcase. + * testsuite/readin.sed: Quit after the last r command. + * testsuite/readin.good: Adjust. + * sed/execute.c (execute_program): Dump the results of the + a/r/R commands just before quitting. + +2005-02-10 Paolo Bonzini + + * sed/regexp.c: Fix off-by-one error in the "invalid reference + to subexpression" message. Debian bug 294339. + +2005-02-08 Paolo Bonzini + + * lib/obstack.h: include config.h. + +2005-02-01 Paolo Bonzini + + * doc/Makefile.am: Don't enable MAKEINFO_HTML and TEXI2HTML_HTML + rules unless BUILD_HTML. + +2005-01-25 Paolo Bonzini + + * sed/regexp.c: Fix building on GCC 2.95 and earlier. + +2004-12-26 Paolo Bonzini + + Do not use leftmost-longest matching for addresses. + + * NEWS: Add a note about this. + * testsuite/recall2.good, testsuite/recall2.inp, + testsuite/recall2.sed: New test. + * testsuite/Makefile.am, testsuite/Makefile.tests: Add the + recall2 test. + * sed/sed.h (struct regex): New. + (struct addr, struct subst, compile_regex, match_regex, + release_regex): Use it instead of regex_t. + * sed/compile.c (compile_program): Update for new meaning of + the third parameter of compile_regex. + * sed/execute.c (do_subst): Pass less conservative value to + the regsize parameter of match_regex. + * sed/regexp.c (compile_regex_1): New, extracted out of + compile_regex. The third parameter, needed_sub, now includes + \0 (so 10 means that \0 .. \9 are needed). Pass RE_NO_SUB + if needed_sub is zero. + (compile_regex): Accept a struct regex instead of a regex_t. + Save the regular expression's text. + (match_regex): Accept a struct regex instead of a regex_t. + Recompile the pattern if it was compiled with RE_NO_SUB. + (release_regex): Accept a struct regex instead of a regex_t. + + * doc/Makefile.am: Generate sed.texi correctly when + building outside srcdir. + +2004-12-26 Paolo Bonzini + + * BUGS: Add section about [a-z] matching uppercase characters, + and other locale issues. + * doc/sed-in.texi [!PERL]: Likewise. + +2004-11-15 Paolo Bonzini + + * sed/execute.c (str_append_modified): Copy the first character + when using \l or \u in a multi-byte configuration. Use + WCRTOMB instead of wcrtomb. + * sed/sed.h (WCRTOMB): New. + +2004-11-11 Paolo Bonzini + + * tst-rxspecer.c: Do not mix instructions and + declarations. + * basicdefs.h: Include locale.h before #defining + gettext, to avoid breakage under Solaris. + * sed/sed.c: do not include locale.h. + +2004-11-03 Paolo Bonzini + + * bug-regex11.c: Improve portability. + * bug-regex12.c: Improve portability. + * bug-regex13.c: Improve portability. + * bug-regex14.c: Improve portability. + * bug-regex21.c: Improve portability. + * bug-regex9.c: Improve portability. + * tst-boost.c: Improve portability. + * tst-pcre.c: Improve portability. + * tst-regex.c: Improve portability. + * tst-rxspencer.c: Improve portability. + +2004-10-08 Paolo Bonzini + + * lib/utils.c (utils_id_s): Renamed to open_files. + (struct id): Renamed to struct open_file. + +2004-10-08 Jakub Jelinek + + * testsuite/Makefile.tests (bug-regex*, run-tests, + run-ptests): Use $(SED). + (version): Likewise; prepend $(SED) invocation with $(SEDENV). + +2004-08-16 Paolo Bonzini + + *** Version 4.1.2 released. + +2004-08-06 Paolo Bonzini + + * sed/compile.c (bad_command): Fix off-by-one error. + (snarf_char_class): Fix problem with [.....[] (i.e. + last char in class is a bracket. + +2004-06-30 Paolo Bonzini + + *** Version 4.1.1 released. + +2004-06-29 Paolo Bonzini + + * sed/compile.c (mark_subst_opts): Return int. + * sed/execute.c (open_next_file): Fix uninitialized + variable. + +2004-06-10 Paolo Bonzini + + *** Version 4.1 released. + +2004-03-25 Paolo Bonzini + + * lib/obstack.h: Get current version. + +2004-03-13 Paolo Bonzini + + Exit as soon as possible on an I/O error, and with + a better error message. + + * lib/utils.c (ck_mkstemp, ck_rename, ck_getline): New + functions. Save temporary files into utils_id_s. + (struct id): Add a field named temp. + (ck_fopen): Init the new temp field of struct id. + (panic): Unlink temporary files before exiting. + * sed/execute.c (read_file_line): Use ck_getline. + (closedown): Use ck_rename. + (open_next_file): Use ck_mkstemp. + +2004-01-20 Paolo Bonzini + + * sed/sed.h (enum addr_state): New definition. + (enum addr_type): Remove ADDR_IS_NUM2. + (struct sed_cmd): Replace a1_matched with range_state. + * sed/compile.c (next_cmd_entry): Use range_state. + (compile_program): Death to ADDR_IS_NUM2. Compile + N,Mp as Np if N>=M. + * sed/execute.c (match_address_p): Rewritten. Handle + ADDR_IS_NUM here. + (match_an_address_p): Suit to new match_address_p. + (execute_program): Adjust to use range_state in `c'. + Handle addr_bang here. + (reset_addresses): Use range_state. + + (struct input): New field "reset_at_next_file". + (read_pattern_space): Use it instead of "separate_files". + (process_files): Initialize it. + +2004-01-17 Paolo Bonzini + + * sed/sed.h: Do not include wchar.h and wctype.h, and do + not include the alloca stuff. + * basicdefs.h: Move all that here. + +2004-01-15 Paolo Bonzini + + * sed/regexp.c [REG_PERL]: Use REG_STARTEND instead of regexec2. + +2004-01-09 Paul Eggert + Paolo Bonzini + + * sed/sed.h (posixicity): New variable, replaces POSIXLY_CORRECT. + * sed/sed.c (main): Set it. + * sed/compile.c: Use it instead of POSIXLY_CORRECT. + * sed/execute.c: Use it instead of POSIXLY_CORRECT. + * doc/sed-in.texi: Document it and --posix. + +2004-01-05 Paul Eggert + Paolo Bonzini + + * NEWS: Fix [\n] to match either backslash or n in POSIXLY_CORRECT mode. + * doc/sed-in.texi: Document this. Also, document regular expressions + a bit better overall, using terminology that's more similar to POSIX. + * sed/sed.h (enum text_types): New definition. + * sed/compile.c (normalize_text): Replace final parameter with one of + type normalize_text. If TEXT_REGEX and in POSIXLY_CORRECT mode, + grok character classes without replacing \n inside them. + +2004-01-03 Paolo Bonzini + + * sed/execute.c (execute_program): print final line + after executing N, if not POSIXLY_CORRECT. + +2003-12-28 Paolo Bonzini + + * sed/compile.c: fix "\\\n" in RHS of s command. + Reported by Mike Castle. + * testsuite/bkslashes.inp, testsuite/bkslashes.good, + testsuite/bkslashes.sed: New files. + * testsuite/Makefile.am, testsuite/Makefile.tests: Add + the bkslashes test. + +2003-12-16 Paolo Bonzini + + *** Version 4.0b released. + + * sed/mbcs.c: New file. + * sed/sed.h: Declare macros for mbcs.c. + * sed/compile.c: Use them. + (brlen): Moved to mbcs.c. + * sed/execute.c: Use them. + * sed/sed.c: call initialize_mbcs (). + +2003-12-14 Paolo Bonzini + + * sed/regex.c (match_regex): fix memory leak. + +2003-11-27 Paolo Bonzini + + * sed/execute.c (reset_addresses): leave addresses 0 + and 0~STEP enabled. + +2003-11-15 Jakub Jelinek + + * sed/regex.c: Use fastmap. + +2003-09-21 Paolo Bonzini + + *** Version 4.0a released. + + * sed/execute.c (struct line): Add mbstate field. + (str_append): Keep mbstate up to date. + (str_append_modified): Likewise, and use towupper/towlower. + (line_init): Initialize mbstate. + (line_copy): Copy mbstate. + (line_append): Copy mbstate. + +2003-07-15 Stepan Kasal + Paolo Bonzini + + Change the way we treat lines which are not terminated by a newline. + Such lines are printed without the terminating newline (as before) + but as soon as more text is sent to the same output stream, the + missing newline is printed, so that the two lines don't concatenate. + + * sed/execute.c (output_file): Is now struct output; users adjusted + to access the fp field, call output_missing_newline before, and + call flush_output afterwards. + (read_file_line): Set line.chomped FALSE each time we encounter a + line without the newline terminator, no matter whether this is the + last input file or not, and no matter whether we are in + POSIXLY_CORRECT mode or not. + (output_missing_newline): New function which prints the suppressed + newline, if necessary. + (flush_output): New function for a common pattern. + (output_line): Use struct output, set its flag accordingly. + (dump_append_queue): Use `ck_fwrite' instead of output_line. + (do_list): Flush the output stream at the end. + (closedown): The code ``if(separate_files) rewind_read_files();'' + (read_pattern_space): ... has been moved here. + (process_files): Don't do the default `p' at the end, ... + (execute_program): ... as this function is now responsible for it; + add the code to the end of the function and to the command `q'; + the commands `d', `D' and `Q' thus no longer have to forge an empty + line. + (execute_program): Commands `c' and `i' no longer call the + function output_line with chomped==FALSE; instead, they chomp + the text and call the function with chomped==TRUE. + (execute_program): Command `e' no longer uses output_line; it + calls ck_fwrite directly. Commands `e', `L' and `=' flush + the output stream at the end. + * sed/compile.c (special_files): Use `struct output' instead of the + file name. + (get_openfile): ... special files are no longer copied to file_read + or file_write. + (fp_list): Move to sed.h (users adjusted) and rename as... + * sed/sed.h (struct output): ...this. New flag missing_newline + associated to the output stream. + (struct sed_cmd, struct subst): Use `struct output *' instead of mere + `FILE *'; adjust compile.c and execute.c. + * testsuite/noeolw.sed, testsuite/noeolw.good, testsuite/noeolw.1good, + testsuite/noeolw.2good: New tests + +2003-07-15 Stepan Kasal + + * lib/utils.h, sed/sed.h: #include "basicdefs.h", + don't include it from various *.c files. + * sed/regex.c: Don't include regex.h as it's included via sed.h. + +2003-06-11 Paolo Bonzini + + * lib/getline.c: Don't realloc with first param = NULL. + +2003-05-07 Paolo Bonzini + + * sed/execute.c: Make treatment of ADDR_IS_NUM_MOD + simpler, and fix bugs in 0~5,+1 + * sed/compile.c: Complain about addresses like 0 + and 0,3 which are sources of misunderstandings. + Reported by Akim Demaille + +2003-03-25 Paolo Bonzini + + *** Version 4.0.7 released + + * sed/execute.c (append_replacement): Extract from + do_subst + (do_subst): Don't update count when a match was + skipped. + * testsuite/xbxcx3.good, testsuite/xbxcx3.sed, + testsuite/xbxcx3.inp: Regression tests + +2003-03-23 Paolo Bonzini + + * sed/execute.c (do_subst): Fix several bugs with + numbered matches + * testsuite/numsub2.good, testsuite/numsub2.inp, + testsuite/numsub2.sed, testsuite/numsub3.good, + testsuite/numsub3.inp, testsuite/numsub3.sed, + testsuite/numsub4.good, testsuite/numsub4.inp, + testsuite/numsub4.sed, testsuite/numsub5.good, + testsuite/numsub5.inp, testsuite/numsub5.sed: + regression tests for the bugs + +2003-03-15 Paolo Bonzini + + *** Version 4.0.6 released + + * lib/mkstemp.c: Include sys/file.h if available for the + benefit of Ultrix + +2003-03-14 Paolo Bonzini + + * sed/compile.c: Replace flagT with bool + * sed/execute.c: Replace flagT with bool + * sed/fmt.c: Replace flagT with bool + * sed/sed.c: Replace flagT with bool + * sed/regex.c: Replace flagT with bool + +2003-03-13 Paolo Bonzini + + * sed/compile.c (compile_program): Understand parameter + of `v'. + + * sed/sed.c (usage): Split help message into multiple + strings + (main): Don't understand -h and -V + +2003-03-12 Paolo Bonzini + + * sed/compile.c (match_slash, snarf_char_class): More + multibyte character support + (brlen): New function + * testsuite/classes.good, testsuite/classes.inp, + testsuite/classes.sed: New files + +2003-03-10 Paolo Bonzini + + * sed/compile.c (match_slash): Strip the \ in front of + slashes (so that the matcher sees x/ for s/x\///). Don't + match / and [ unless at the start of a character. + +2003-02-18 Paolo Bonzini + + * sed/regex.c (compile_regex): // matches the last regular + expression even in POSIXLY_CORRECT mode. + * sed/compile.c (normalize_text): Treat multibyte character + sets correctly + (read_text): Don't swallow backslash sequences, run text + through normalize_text + (compile_program): Ditto for y command + + * sed/compile.c (normalize_text): Add parameter that says + whether the text will be processed further to remove more + backslash escapes. Callers adjusted + (match_slash): Remove same parameter from here. Callers adjusted. + +2003-02-15 Paolo Bonzini + + * sed/sed.h: Fix prototype for match_regex, declare re_registers + if REG_PERL + * sed/execute.c (do_subst): Use re_registers + * sed/regex.c (copy_regs): New function + [REG_PERL]: Use re_registers + [!REG_PERL]: Avoid using internal entry points, support pre-glibc + 2.3 regex for the sake of --without-included-regex. + +2003-01-04 Paolo Bonzini + + * sed/sed.h: Move some stuff from here... + * sed/basicdefs.h: ...to here + * lib/utils.c (ck_fopen): Add FAIL parameter + * lib/utils.h: Adjust parameter + * sed/compile.c, sed/execute.c, sed/sed.c: Adjust callers + + * sed/basicdefs.h: Add TRUE/FALSE + * sed/compile.c, sed/execute.c, sed/sed.c: Use them + * sed/fmt.c: Do not redefine them + +2003-01-02 Paolo Bonzini + + * sed/sed.c: Bump copyright year + +2002-12-24 Paolo Bonzini + + * sed/sed.c: Use bindtextdomain + * sed/basicdefs.h [__EMX__]: Define initialize_main + * lib/getline.c [__EMX__]: Strip trailing CR + + * sed/regex.c: Don't use N_ on the lines that define + error messages, some compilers complain. + +2002-12-18 Paolo Bonzini + + *** Version 4.0.5 released + + * sed/compile.c: Don't use N_ on the lines that define + error messages, some compilers complain. + +2002-12-16 Paolo Bonzini + + * sed/compile.c: Improvements to some error messages; + `a', `i', `l', `L', `r' accept two addresses except in + POSIXLY_CORRECT mode. + +2002-12-14 Paolo Bonzini + + * lib/regex_internal.c: Fix problem on non-glibc + systems, from Jakub Jelinek + * lib/regex.c (RE_ENABLE_I18N): Conditionalize on + HAVE_MBRTOWC and HAVE_WCRTOMB. + * lib/getline.c: Fix compilation on non-glibc system + * lib/snprintf.c: Fix compilation on non-glibc system + * lib/basicdefs.h [P_]: Make more portable + +2002-12-12 Paolo Bonzini + + *** Version 4.0.4 released + +2002-11-21 Paolo Bonzini + + *** Version 4.0.3 released + +2002-11-19 Paolo Bonzini + + *** Version 4.0.2 released + +2002-11-05 Paolo Bonzini + + *** Version 4.0.1 released + +2002-10-23 Paolo Bonzini + + *** Version 4.0 released + +2002-10-28 Paolo Bonzini + + * lib/utils.c: Don't fail for EBADF in fflush + * src/sed.c: the_program is now a global + +2002-10-19 Paolo Bonzini + + * src/sed.c: Print GNU sed in --version for GNU sed, + and super-sed for super-sed (thanks to Bruno Haible) + +2002-10-17 Paolo Bonzini + + *** Version 3.96 released + +2002-10-16 Isamu Hasegawa + + * src/execute.c (execute_program): Multibyte 'y' + * src/compile.c (compile_program): Likewise + * src/sed.h: Likewise + +2002-10-08 Paolo Bonzini + + *** Version 3.95 released + +2002-07-15 Paolo Bonzini + + * src/sed.h: rfile --> fname, wfile --> fp + * src/compile.c (compile_command): Parse 'R' like 'w', use + separate lists for file read and file write + * src/compile.c (get_openfile): New name of get_writefile + * src/compile.c (rewind_read_files): New function + * src/sed.h: Declared here + * src/execute.c (closedown): And called here + * src/execute.c (append_queue): Added 'free' field + * src/execute.c (execute_program): Implement 'R' + +2002-06-09 Paolo Bonzini + + * src/execute.c (do_subst): Replaced flag was set on every + regexp match, while the first matches should not set it + for s///N. + +2002-06-08 Paolo Bonzini + + * src/compile.c (compile_file): Open the script in text mode + * lib/utils.c (utils_fp_name): Shorten the output + * lib/utils.c (ck_fread, ck_fwrite, ck_fflush): Clearerr + after printing an error. + * lib/utils.c (ck_fclose): Work on stdout as well if stream == NULL + and flush before closing to check for errors + +2002-05-30 Paolo Bonzini + + * src/compile.c (compile_program): Implement W + * src/execute.c (execute_program): Likewise + +2002-04-23 Paolo Bonzini + + * src/sed.c (usage, main): Parse -s + * src/sed.h (separate_files): New variable + * src/execute.c (separate_files): New variable + * src/execute.c (reset_addresses): New function to make range + addresses work separately on each file when using in-place + editing + * src/execute.c (execute_program): The `n' and `N' use test_eof + so that the script restarts at end of file, not at end of input + * src/execute.c (test_dollar_EOF): Make $ work separately + on each file when using -s; renamed to test_eof + +2002-02-28 Paolo Bonzini + + * src/sed.h (struct sed_cmd): exit_status -> int_arg + * src/compile.c: Likewise + * src/execute.c: Likewise + + * src/compile.c (compile_command): Parse `l' like + `q' and `Q'; default for int_arg is -1 + * src/execute.c (do_list): New argument, used instead + of lcmd_out_line_len + (execute_program): Interpret int_arg for the `l' command; + return 0 for `q' and `Q' if int_arg is -1 + + * src/fmt.c: New file, looted from GNU textutils + * src/compile.c: Parse `L' + * src/execute.c: Execute `L' + +2002-02-14 Paolo Bonzini + + * src/execute.c (str_append_modified): Fixed a stupid + bug (stop condition was *start == *end, meant to be + start == end) + +2002-02-05 Paolo Bonzini + + * lib/utils.c: Added directory parameter to + temp_file_template + * lib/utils.h: Adjusted + * src/execute.c: Adjusted + +2002-01-29 Paolo Bonzini + + * src/compile.c (mark_subst_opts): Signal an error if + there are multiple g or p options + * src/compile.c (compile_program): Raise appropriate + error if second string in y command is longer than + first (used to be "excess junk after command") + +2001-12-31 Paolo Bonzini + + * lib/getline.c: Strip the terminating \r under Windows + or MS-DOS. + + * testsuite/xemacs.sed, testsuite/xemacs.inp, + testsuite/xemacs.good: Submitted by John Fremlin + (john@fremlin.de) + +2001-12-27 Paolo Bonzini + + * sed/execute.c (do_subst): Flags in optimized s/^xx/ + commands were discarded (see the change below) + +2001-12-19 Paolo Bonzini + + * sed/execute.c (resize_line): Limit inactive space to two + thirds of a buffer + * sed/execute.c (line_init): Initialize buf->active + * sed/execute.c (str_append, str_append_modified, line_copy, + do_list, do_subst, execute_program, process_files): Operate + on active space + + * sed/execute.c (do_subst): Optimize s/^xx// by making a part + of the buffer inactive and s/xx$// by truncating it. + * sed/execute.c (execute_program): Optimize D by making a part + of the buffer inactive + + * testsuite/uniq.sed, testsuite/uniq.inp, testsuite/uniq.good: + added to test P and D commands. + * testsuite/fasts.sed, testsuite/fasts.inp, testsuite/fasts.good: + added to test the new optimization done on the `s' command. + +2001-12-17 Paolo Bonzini + + * testsuite/dc.inp: Also compute Easter of 2002 :-) + + * sed/execute.c [!HAVE_FCHMOD]: Don't chmod the output file + if working in-place + +2001-11-12 Paolo Bonzini + + * sed/sed.h (struct sed_cmd): a1 is a pointer too + * sed/compile.c: Likewise + * sed/execute.c: Likewise + + * sed/compile.c: Use obstacks + * sed/execute.c: Likewise + +2001-11-09 Paolo Bonzini + + * sed/compile.c (mark_subst_opts): Parse option `e', + preserve two occurrences of the `e' and `p' options. + * sed/execute.c (do_subst) [HAVE_POPEN]: Interpret option + `e' (evaluate, like Perl's but uses Bourne shell). + * sed/sed.h (struct subst): Add an `eval' flag. + + * sed/compile.c (compile_program): Compile command `e' + like `c'. + * sed/execute.c (execute_program): Execute command `e'. + +2001-09-25 Paolo Bonzini + + * sed/compile.c (get_writefile) [!POSIXLY_CORRECT]: + support /dev/stdout + * sed/execute.c (open_next_file, closedown): Support + in-place editing + * sed/execute.c (backup_file_name): New function to + support in-place editing + * sed/main.c (usage, main): Parse -i. + * sed/utils.c: Moved to lib directory + + * lib/utils.c (temp_file_template): New function. + * sed/utils.h: Declared temp_file_template. + +2001-09-05 Paolo Bonzini + + * sed/execute.c (do_subst): `baaac', if passed through + s/a*/x/g, gave `xbxxcx' rather than `xbxcx' (because an + empty string matched before the `c'. Fixed. + + * sed/execute.c: Removed mmap support, I/O is done using + getline (slower but more bug-proof). + * sed/utils.c: Likewise. + * lib/getline.c: New file + +2001-03-22 Paolo Bonzini + + * sed/compile.c (normalize_text) [POSIXLY_CORRECT]: Enable + escapes in modes other than BRE. + +2001-03-21 Paolo Bonzini + + * sed/compile.c (normalize_text): Support \XXX in Perl mode, + \oXXX in non-Perl mode. + +2001-03-18 Paolo Bonzini + + * sed/compile.c (compile_program): Fixed missing break when + compiling 'q' and 'Q'. + + * sed/compile.c (check_final_program): Removed now spurious + call to compile_regex + * sed/regex.c (compile_regex): Don't track the last compiled + regex + * sed/regex.c (execute_regex): Track here the last compiled + regex + +2001-03-02 Paolo Bonzini + + * sed/compile.c (setup_replacement): Support \[lLuUE] like + Perl and vi. + * sed/compile.c (new_replacement): Accept new parameter + to support \[lLUuE]. + * sed/sed.h (enum replacement_types): New declaration + * sed/execute.c (do_subst): Use new function str_append_modified + to apply the changes required via \[lLUuE]. + * sed/execute.c (str_append_modified): New function + +2001-03-02 Paolo Bonzini + + * sed/compile.c (setup_replacement): Count the number of backreferences + that the RHS needs + * sed/regex.c (compile_regex): Check if there is a sufficient number + of backreferences (new argument needed_sub replaces nosub) + * sed/compile.c (compile_address, compile_program, + check_final_program): Callers adjusted + +2001-02-08 Paolo Bonzini + + * sed/compile.c (compile_program): Added `Q' (quit without output) + * sed/execute.c (execute_program): Ditto + + * sed/compile.c (compile_program): Fill in exit_status for `q' and `Q' + * sed/execute.c (execute_program): Return -1 for `go on', 0..255 + to set the exit status + * sed/execute.c (process_files): Interpret new convention for + execute_program, return sed's exit code + * sed/sed.c (main): Return process_files's exit code + * sed/sed.h (struct sed_cmd): Declare exit_status + +2001-01-07 Paolo Bonzini + + * sed/compile.c (compile_program): Added `T' (branch if failed) + * sed/execute.c (shrink_program, execute_program): Ditto + +2001-01-04 Paolo Bonzini + + * testsuite/Makefile.am: Use automake's implementation + of `make check'. Removed the test targets + * testsuite/Makefile.tests: Moved the test targets here + (new file). + * testsuite/runtest: New file + + * testsuite/Makefile.tests: `khadafy' test uses EREs. + + * testsuite/spencer.inp: Removed the ^* test + + * testsuite/spencer.sh: Don't rely on awk; more comments too + +2001-01-03 Paolo Bonzini + + * sed/compile.c(snarf_char_class) [REG_PERL]: Don't parse + `\n' specially + * sed/compile.c(match_slash) [REG_PERL]: Ditto + + * sed/compile.c(read_text) [REG_PERL]: Support [xX] modifiers + * sed/compile.c(mark_subst_opts) [REG_PERL]: Ditto + +2000-12-21 Paolo Bonzini + + * lib/snprintf.c [BOOTSTRAP]: Don't include stdio.h + * lib/strerror.c [BOOTSTRAP]: Don't include stdio.h + * sed/execute.c [!HAVE_ISATTY]: Don't buffer stdin + +2000-12-11 Paolo Bonzini + + * sed/compile.c(mark_subst_opts): Support [mMsS] flags + * sed/compile.c(read_text): Support [MS] flags for + addresses + * sed/regex.c(compile_regex): Support arbitrary flags for + regncomp. + + * sed/regex.c(compile_regex) [REG_PERL]: Don't call + normalize_text. + +2000-12-08 Paolo Bonzini + + * basicdefs.h: Moved here from the `sed' subdirectory. + + * configure.in: Removed crap to pick a regex engine. + Added snprintf to the AC_REPLACE_FUNCS call. + + * lib/snprintf.c: New file. + + * sed/regex.c(compile_regex): Use regncomp + * sed/regex.c(match_regex): Use regexec2 + + * sed/compile.c(compile_program): Implemented the `v' command. + + * sed/sed.c(main): Implemented the `r' and `R' options + + * sed/sed.h: Replaced use_extended_syntax_t with + extended_regexp_flags to support Perl regular expressions. + + * sed/execute.c(open_next_file): Don't mmap stdin (because + we cannot seek into it, so a redirected stdin's contents + would not be "eaten" by sed) + +Mon Aug 30 23:40:08 PDT 1999 Ken Pizzini + + *** Version 3.02.80 released + + * sed/execute.c(do_subst): lib/regex.c(re_search_2) seems to + want one extra backreference register; humor it. + + * sed/regex.c(compile_regex): work around some odd assumptions + that lib/regex.c(re_compile_pattern) makes about our desired + RE syntax. + + * configure.in: tweaked version to 3.02.80; added new entries + to the ALL_LINGUAS definition. + + * doc/sed.1, doc/sed.texi, BUGS: explicitly request the output + of sed --version in bug-reporting instructions. + + * doc/sed.texi: the old "informal seders list" is dead; document + the new sed-users mailing list instead (under Other Resources). + + +Thu Aug 19 23:27:54 PDT 1999 Ken Pizzini + + * sed/sed.h: Add explicit #include of "regex-sed.h" (rather + than relying on parent file doing so); change the "cmd_regex" + member of sed_cmd: make it a pointer (instead of a struct), + and change its name to cmd_subst; add prototypes for newly + exported functions bad_prog(), normalize_text(), compile_regex(), + match_regex(), and release_regex(); drop rx_testing variable. + + * sed/compile.c: move the compile_regex() function to regex.c; + export bad_prog() and normalize_text() functions; eliminate the + rx_testing debris; rename the NOLEAKS symbol to more descriptive + DEBUG_LEAKS; make cmd_regex to cmd_subst fixes (see above); + make use of newly abstracted release_regex() function. + + * sed/execute.c: abstract out the regex matching to + regex.c:match_regex(); NOLEAKS to DEBUG_LEAKS change; + cmd_regex to cmd_subst structure member name change. + + * sed/execute.c(do_subst): use re_registers/regoff_t instead of + regmatch_t to hold the backreference registers, make "offset" + always be relative to the beginning of the string (rather than + a delta from "start"), defer some matching bookkeeping (e.g., + not_bol_p) to match_regex(). + + * sed/sed.c(main): loose rx_testing variable; NOLEAKS + (aka DEBUG_LEAKS) code attempting to release + _nl_current_default_domain is problematic, so omit it. + + * sed/regex.c: new file --- abstracts out the interface to the + regex engine so that less conditional code is required in + compile.c and execute.c, and so as to make a change of engine + easier; implements compile_regex() (which looks an awful lot + like the one that used to live in compile.c), match_regex(), + and (if DEBUG_LEAKS is set) release_regex(). + +Sun Apr 18 04:40:46 PDT 1999 Ken Pizzini + + * sed/sed.c(main): conditionalize calls to setlocale() and + textdomain() to only occur if their support is needed/wanted. + +Sun Apr 18 03:01:46 PDT 1999 Ken Pizzini + + * bootstrap.sh: "foo || bar && baz" was not grouping like I + expected ("foo || (bar && baz)") under at least one shell, + so change the test for a pre-existing config.h file to an + if statement. + + * bootstrap.sh: added -DUSE_REGEX_GNU_H option to the + compiler invocation, to ensure that we get a usable + regex library included. + +Sun Apr 18 02:59:42 PDT 1999 Ken Pizzini + + * sed/sed.h, sed/utils.c: conditionalized inclusion of + to occur only if ENABLE_NLS is defined. + +Sun Apr 18 01:48:45 PDT 1999 Ken Pizzini + + * sed/compile.c(xofa,normalize_text,convert_number): change + name of xofa() function to convert_number(); change semantics + to do all of the work of the text->number conversion. + + * sed/compile.c(normalize_text): add new \dDDD decimal + and \oOOO octal escapes. + +Sun Mar 28 21:05:07 PST 1999 Ken Pizzini + + * sed/sed.c(main): if NOLEAKS is set, free up a word that + the call to textdomain() allocated. + + * sed/execute.c(read_file_line): plug up (minor) memory leak: + if buffer.alloc==0 we may have malloc()'d 1 byte anyway, + so be sure to FREE(buffer.text) before calling line_init(); + +Fri Mar 26 16:52:10 PST 1999 Ken Pizzini + + * sed/compile.c(match_slash): somewhere between 3.02 + and 3.02a we lost the ability to use a newline as + the s/// delimiter; restore this ability. + + * sed/compile.c(compile_regex): forget about trying + to cache the compiled form of the last RE --- it + causes more problems than its worth. We now only + cache the source form. + + * testsuite/help.good: update to reflect output containing + new options. + +Sun Dec 6 00:51:23 PST 1998 Ken Pizzini + + * sed/utils.c(ck_fwrite): fix i18n bug of using a printf + fragment of "item%s" to handle plural text. + +Mon Nov 23 11:03:40 PST 1998 Ken Pizzini + + * doc/sed.1, doc/sed.texi: ran ispell over these + files to catch the more obvious typos... + +Sun Nov 1 00:09:07 PST 1998 Ken Pizzini + + * sed/execute.c(do_list): make a `lcmd_out_line_len' + (--line-length) of zero mean "infinite length", + i.e., "never wrap". + +Sat Oct 31 23:06:50 PST 1998 Ken Pizzini + + * execute.c(match_an_address_p,process_files), + compile.c(compile_program): back out the "zero-address" + changes of 1998-09-27. It was a neat idea, but there are + too many dark corners which don't work well. The + special code for handling line ranges starting at + address zero (from 1998-08-31) are still there though: + this seems to work fine with no surprises. + +Sat Oct 31 22:18:59 PST 1998 Ken Pizzini + + * sed/sed.c, sed/sed.h, sed/execute.c: added new + `lcmd_out_line_len' variable. (Idea suggested by + Carlos J. G. Duarte .) + Also added ATOI macro (which uses strtoul() if available, + with fall-back to atoi()). + * sed/sed.c(main): attempt to use COLS environment variable + to set a reasonable `lcmd_out_line_len'; added -l/--line-length + command-line options to set the new `lcmd_out_line_len' flag. + * sed/sed.c(usage): documented new -l/--line-length options. + * sed/execute.c(do_list): use `lcmd_out_line_len' variable + instead of `LCMD_OUT_LINE_LEN'. + * sed/execute.c: deleted now obsolete LCMD_OUT_LINE_LEN define. + * configure.in: added strtoul to the AC_CHECK_FUNCS call. + +Sat Oct 31 21:37:17 PST 1998 Ken Pizzini + + * sed/sed.c, sed/sed.h, sed/execute.c: added new `force_unbuffered' + flag. (Idea suggested by Frank Strauss .) + * sed/sed.c(main): added -u/--unbuffered command-line options + to set the new `force_unbuffered' flag. + * sed/sed.c(usage): documented new -u/--unbuffered options. + * sed/execute.c: changed the name of the `is_tty' flag in struct + input to a more generic `no_buffering'; also removed HAVE_ISATTY + conditional on this member. + * sed/execute.c(slow_getline): removed HAVE_ISATTY conditonal + compilation of this function. + * sed/execute.c(output_line): if force_unbuffered is set, + then force a fflush() even if writing to stdout. + * sed/execute.c(open_next_file): added handling of the + new `force_unbuffered' flag so that slow_getline() + will always be used for input. + * sed/execute.c(read_file_line): changed the (conditionally + compiled) test of `input->is_tty' to (unconditionally) + use the new spelling `input->no_buffering'. + +Thu Oct 15 12:08:09 PDT 1998 Ken Pizzini + + * configure.in: deleted AC_ARG_PROGRAM call; this is already + done for us by AM_INIT_AUTOMAKE, and we were winding up + with a doubled-transform. + +Sun Sep 27 01:42:42 PDT 1998 Ken Pizzini + + * compile.c(compile_program): remove special-case code for matching + address range with a `0' beginning. + + * compile.c(compile_address): change default addr_number to + be a pragmatically impossible countT value, instead of zero. + + * execute.c: spell macro REGNEXEC() unconditionally instead of + playing with conditional definition of regnexec() macro. + + * execute.c(match_an_address_p): added third argument (and changed + callers in match_address_p). Added special code to ignore + non-numeric matches when processing "line zero". + + * execute.c(process_files): added a "line zero" pass through the + commands script. + +Sun Sep 27 00:20:53 PDT 1998 Ken Pizzini + + * compile.c(xofa,normalize_text): new functions. + * compile.c(compile_regex): cache last_compiled_re (with its + associated flags); add POSIXLY_CORRECT behavior for empty RE. + Make use of the new normalize_text() function. + * compile.c(setup_replacement): Make use of the new normalize_text() + function. + +Sat Sep 26 22:59:13 PDT 1998 Ken Pizzini + + * lib/regex-gnu.h: added missing prototype for regncomp(). + +Mon Sep 14 20:47:23 PDT 1998 Ken Pizzini + + * sed/sed.c(main): use EXIT_SUCCESS instead of 0, in case + we are built on a system (such as VMS) where EXIT_SUCCESS + is distinct from 0. + +Wed Sep 9 22:17:28 PDT 1998 Ken Pizzini + + * sed/Makefile.am: added -I../intl the INCLUDES line; if we are + building in a directory outside the source tree and the system + we are building on does not have a header, then + the build was failing, because libintl.h is a build-time + constructed source file. + + * configure.in: tweaked version to be 3.02b. + +Wed Sep 9 19:28:14 PDT 1998 Ken Pizzini + + *** Version 3.02a released + + * sed/compile.c(mark_subst_opts,read_label,compile_program): + wherever we accept a ; as a command terminator, also allow a } or + a # to appear. (This allows for less cluttered-looking scripts, + such as: sed '/foo/{x;G}' (instead of: sed '/foo/{x;G;}').) + +Wed Sep 9 18:17:07 PDT 1998 Ken Pizzini + + * sed/compile.c(compile_regex): use regncomp() instead + of regcomp(), so that a script with NULs in its REs + will work in the expected manner. + + * sed/compile.c(ADDNUL,REGNCOMP): added support macros + for above. + + * lib/regex.c(regncomp,regcomp): added regncomp() and + made regcomp() a simple wrapper function. + +Mon Aug 31 21:48:30 PDT 1998 Ken Pizzini + + * sed/sed.c(compile_program): if the first address of + a range is the number 0 (or a 0~N sequence), start + out in the "a1_matched" state. This allows one + to match an initial chunk of a file without undue + convolutions for handling the case where the match + for the end of the sequence happens to be the first + line. + +Sun Aug 16 03:34:25 PDT 1998 Ken Pizzini + + * sed/compile.c(snarf_char_class,match_slash): simplify + handling of "premature newline" error. Also, get the + line number right in the error message if we encounter + a "premature newline" during char-class snarfing. + +Sun Aug 16 02:59:20 PDT 1998 Ken Pizzini + + * sed/compile.c: added N_() markers and corresponding gettext() + (er, _()) calls. + + * Merged in i18n contribution from Erick Branderhorst + . His ChangeLog entry + for the changes I've incorporated so far: + +1998-07-24 Erick Branderhorst + * configure.in (ALL_LINGUAS, AM_GNU_GETTEXT): nl + * sed/{sed.h,utils.c}: #include #define _(String) + gettext (String) + * sed/sed.c: #include + * po/POTFILES.in: sed/{compile,execute,sed,utils}.c + * run gettextize -f + * acconfig.h: #undef LOCALEDIR ENABLE_NLS HAVE_CATGETS + HAVE_GETTEXT HAVE_LC_MESSAGES HAVE_STPCPY + +Fri Aug 14 13:52:57 PDT 1998 Ken Pizzini + + * Merged code from 3.02 with a branched development + tree from late May; the following (out-of-order) + changelog entry is from the branched tree. + +Sat May 30 12:23:16 PDT 1998 Ken Pizzini + + * sed/compile.c, sed/execute.c: added (conditional on NOLEAKS macro) + code to free all dynamically allocated memory. + + * sed/sed.c, sed/compile.c, sed/execute.c: much shuffling + of code --- ordered functions such that no forward + declarations are necessary, and placed all static prototypes + immediately before the actual function definition. + This accomplished two things: first, I find the new ordering + a more natural way to read the code than the previous + ordering, and second, the new ordering give the compiler + a better opportunity to discover inlining possibilities. + (The odd "prototype declaration+old-style definition" + style is used because I feel it is the least ugly way + of supporting K&R1 C while still getting the benefit of + prototypes when they are available.) + + * sed/basicdefs.h: added MEMCPY() macro to hide the VCAST()s + that ought to be used with memcpy(). + + * sed/execute.c: Change calls to memcpy() to go through the + new MEMCPY() macro. Various prototypes: elide variable name + if it does not add any human-useful documentary information + to the bare type. + + * sed/sed.c(main): Updated calls to compile_string() to add third + (length) argument. Changed call to obsolete close_all_files() + to a call to the new finish_program(). + + * sed/sed.c(map_file): Attempt to clean-up how "size" gets + cast and tested; remove spurious S_ISREG test (just let + mmap() fail if it doesn't support the underlying file type). + + * sed/sed.c: Deleted old RX library stub declarations. + + * sed/sed.c(map_file,unmap_file): added VCAST()s to the + mmap()/munmap() calls. + + * sed/utils.c(ck_fclose): added support for ANSI C + functionality where passing a NULL argument means + to fclose() _all_ open streams. (Well, almost. + Only closes streams which were previously ck_fopen()ed, + as I don't care to figure out how to autoconf-detect + whether fclose(NULL) is properly supported on a given + platform.) + + * sed/sed.h: Renamed `struct text_buf' member `text_len' + to `text_length'. Abstracted out `enum addr_types' + from `struct addr'; added new enum types num2,step,step_mod; + renamed mod to num_mod. De-unionized the regex,number, + {modulo-offset/step} components of `struct addr', in + anticipation of new features. Changed type of `a2' member + of `struct sed_cmd': now a pointer to save space. + Abstracted out `struct replacement' from `struct subst'. + Cleaned up declaration of `x' union of `struct addr'. + Fixed prototype for compile_string(). Replaced prototype + for old close_all_files() with one for new finish_program(). + + * sed/sed.h, sed/compile.c, sed/execute.c: changed to + simplify the data structures used for branches and + command blocks: simplified `struct vector'; made + `struct label' local to compile.c; `struct sed_cmd' + was modified to support a simpler design for branches + and blocks. + + * sed/execute.c: Conditionally added ADDNUL() macro so that + the function call overhead is only incurred if nul_append() + _must_ be called. Made some commentary edits, including + typo fixes. + * sed/execute.c(resize_line): changed semantics of "len" argument + from "additional length" to "target length"; made + INITIAL_BUFFER_SIZE a minimum allocation length. + * sed/execute.c(str_append): adjusted to new resize_line() + semantics. + * sed/execute.c(line_copy): use FREE()+MALLOC() instead of + REALLOC() to avoid unnecessary copying of old text; add the + "try doubling first" allocation heuristic (just like + resize_line() does). + * sed/execute.c(line_exchange): new function. + * sed/execute.c(nul_append): make whole function (not just its + body) conditional on HAVE_REGNEXEC macro; adjust to new + resize_line() semantics. + * sed/execute.c(read_mem_line): use str_append() instead if + custom in-line code; compensate for new default of + "line.chomped = 0" in read_pattern_space() by setting + "line.chomped = 1" where appropriate. + * sed/execute.c(read_file_line): use different trigger to + determine that "buffer" is uninitialized, and do a full + initialization if required; use str_append() instead of custom + in-line code in two places; compensate for new default of + "line.chomped = 0" in read_pattern_space() by setting + "line.chomped = 1" where appropriate. + * sed/execute.c(output_line): don't bother calling ck_fwrite() + if length==0. + * sed/execute.c(release_append_queue): new function. + * sed/execute.c(dump_append_queue): use release_append_queue() + instead of in-line equivalent. + * sed/execute.c(read_pattern_space): conditionalize call to + dump_append_queue() for alleged performance reasons; changed + default "line.chomped" value to more common "1", and added an + assignment of "0" where this made a difference. + * sed/execute.c(match_an_address_p): deleted "is_addr2_p" + argument; reorder cases to match order in enum declaration; add + cases for new "addr_is_num2", "addr_is_step", and + "addr_is_step_mod" address types; alter nul_append() call to be + through ADDNUL() macro; fix to new struct member and enum + spellings in (formerly addr_is_mod); addr_is_num_mod case. + * sed/execute.c(match_address_p): remove oblsolete third argument + to calls to match_address_p(); alter references to sed_cmd + member a2 to reflect new pointer status; add new support for + a2->addr_type addr_is_step and addr_is_step_mod cases. + * sed/execute.c(do_subst): add NOLEAKS support logic; use + ADDNUL() wrapper to nul_append(); simplify replacement + expansion by using the new "struct replacement" data structure; + use line_exchange() function instead of custom in-line code. + * sed/execute.c(process_files): added NOLEAKS code. + * sed/execute.c(execute_program): updated implementations + of the `{', `}', `:', `b', and `t' commands; modified + `c' command gratuituosly; fixed potential memory + overrun in `D' command. Simplified how nonstandard + `loop increments' work. Use line_exchange() instead of + custom in-line code in 'x' case. + * sed/execute.c[EXPERIMENTAL_DASH_N_OPTIMIZATION conditional + code]: various modifications intended to keep this + code in sync with the new changes, but the code still + retains its previous bugs. + + * sed/compile.c: use "exit(EXIT_FAILURE) instead of "exit(1)", + just in case we get compiled under VMS. + * sed/compile.c: Change type of prog_info.base to decrease needs + for casting; then elimiated the casts in question ;-). + * sed/compile.c: Added struct sed_label (moved from sed.h, then + modified). + * sed/compile.c: Removed "readit_p" flag from struct fp_list. + * sed/compile.c: Added module-global "blocks" variable. + * sed/compile.c: Extracted more error-message constant strings + to named variables. + * sed/compile.c(check_final_program): updated to + reflect new data structures and use new fucntions. + Added call to compile_regex() to release unneeded + memory. + * sed/compile.c: deleted obsolete new_vector() function; + abstracted new read_label() function; abstracted new + release_label() function; added new `blocks' module-static + variable. + * sed/compile.c(compile_program): updated implementations + of the `{', `}', `:', `b', and `t' commands; modified + initialization from NULL vector. + * sed/compile.c(compile_regex): added mechanism to + release memory consumed by the cached `last' RE. + * sed/compile.c(setup_jump,setup_label): updated + name (from setup_jump to setup_label) and prototype; + changed body to reflect data structure changes. + * sed/compile.c: Add OPEN_BRACE and CLOSE_BRACE macros for better + "vi" editing behavior. + * sed/compile.c(compile_filename,read_filename,get_writefile): + Replaced function compile_filename() with more orthogonal functions + read_filename(), get_writefile(). + * sed/compile.c(compile_regex): Added ability to free the remembered + "last RE" in compile_regex (for benifit of "NOLEAKS" code). + * Made adjustments dictated by the change to struct sed_cmd which made + the a2 member a pointer-to-addr instead of an addr. + * sed/compile.c(setup_jump,read_label,setup_label,release_label): + Added functions read_label(), setup_label(), release_label(); deleted + function setup_jump(). + * sed/compile.c(new_replacement,setup_replacement,release_replacement): + new functions. + * sed/compile.c: Adjusted to new spelling of text_buf member + ("text_length" instead of "text_len"). + * sed/compile.c(new_vector): deleted function. (Due to new handling + of blocks, only one instance remained, and that one was just as + clear in-lined.) + * sed/compile.c(compile_string): Added third argument; it now + takes a counted string instead of a NUL-terminated string. + * sed/compile.c(compile_file): added variable "map_base" to + compensate for new type of prog_info.base. + * sed/compile.c(check_final_program): reflect new style of + handling blocks and struct sed_label. + * sed/compile.c(close_all_files,finish_program): replaced function + close_all_files() with more generic finish_program(). + * sed/compile.c(read_text): added new feature: if first non-blank + character after the {a,i,c} command character is not "\", then + use the trailing text on that line as the (first) line of text. + Also added code conditional on NO_INPUT_INDENT to support the + "feature" of stripping leading blanks from each input line; I + do not read POSIX as permitting this behavior, nor do I think + it is a good idea, so it is disabled by default, but some have + argued that this blank-stripping is the "correct" behavior, so + I offer them the option of building their sed that way. + * sed/compile.c(compile_address): added xxx,+n and xxx,~n addressing; + simplified code. + * sed/compile.c(compile_program): added BAD_PLUS error detection; + adjusted to new cur_cmd->a2 pointer status; added addr_is_num2 + detection; deleted pointless "a2->addr_number < a1.addr_number" + check (addr_is_num2 semantics handle this just fine); updated + code for '{', '}', ':', 'b', and 't' to reflect new design + of branch handling, including making use of new functions + related to the new design); added support for feature already + mentioned in read_text() where {a,i,c} commands are able to have + their text start on the same line as the command; changed some + error messages (hopefully for the better); localized variables + specific to individual commands (particularly 's' and 'y'); + made use of new setup_replacement() function in 's' command. + +Mon Aug 10 19:58:49 PDT 1998 Ken Pizzini + + * doc/sed.texi, doc/sed.1: sedtut10.txt is apparently dead. + Deleted references to it and added a pointer to + http://seders.icheme.org/tutorials/. (Pointed out by + Joerg Heitkoetter .) + +Sat Aug 8 18:11:57 PDT 1998 Ken Pizzini + + * djgpp/config.btm: per request by Michel de Ruiter + , added "%1" to "%9" parameters. + +Mon Aug 3 11:44:55 PDT 1998 Ken Pizzini + + * doc/sed.texi: fix a couple of typos. (Submitted by + Alan Modra .) + +Sat Aug 01 17:49:06 PDT 1998 Ken Pizzini + + *** Version 3.02 released + + * configure.in: Because of code change in 3.01a, bump the + minor revision number for the release (now 3.02). + +Sun Jul 26 16:07:55 PDT 1998 Ken Pizzini + + *** Version 3.01a released + + * sed/compile.c(snarf_char_class): the POSIX char-class + recognition loop forgot to update its concept of "prev" + as the loop progressed. + + * testsuite/Makefile.am: The dependency of version.good + on [testsuite/]Makefile introduced in the previous + release was botched -- it referred to "Makefile" + as "$(srcdir)/Makefile, which of course doesn't work + if you aren't building in the source tree. + + * djgpp/Makefile.am: add forgotten "config.btm" EXTRA_DIST + member. + + * configure.in: update version. + +Tue Jul 21 06:04:42 PDT 1998 Ken Pizzini + + *** Version 3.01 released + + * configure.in: mark as release version! + + * Makefile.am: add BUGS and THANKS to the EXTRA_DIST target. + + * testsuite/Makefile.am: add dependency of version.good + on [testsuite/]Makefile. + +Mon Jul 20 12:38:10 PDT 1998 Ken Pizzini + + * djgpp/config.btm: New file to support the 4DOS alternative + to command.com. (Sumitted by Eli Zaretskii on behalf of + an anonymous 4DOS user.) + +Fri Jul 17 00:36:34 PDT 1998 Ken Pizzini + + *** Version 3.01-beta18 released + + * djgpp/config.sed: my "tweak" in beta17 was too + hastily considered. Back it out. + + * configure.in: update to beta18. + +Wed Jul 15 01:02:15 PDT 1998 Ken Pizzini + + *** Version 3.01-beta17 released + + * djgpp/config.sed: tweak/simplify s,,, commands at end. + + * configure.in: update to beta17. + +1998-07-14 Eli Zaretskii + + * djgpp/config.sed: Edit all the occurences of = in the context of + --option=value, including in the help messages, into + --option:value, but leave DOS-style d:/foo/bar file names intact. + + * djgpp/config.bat: Use --srcdir:foo instead of --srcdir=foo. + + * testsuite/Makefile.am (help, version): Remove temporary files + explicitly, don't use shell wildcards, so it works under DOS 8+3 + limits. + +Thu Jul 9 13:06:00 PDT 1998 16:51:43 PDT 1998 Ken Pizzini + + *** Version 3.01-beta16 released + + * djgpp/config.sed: tweak the configure script to use : + instead of = for --with-foo=bar option parsing, to + work around problems with how command.com handles =s. + +Wed Jul 8 16:51:43 PDT 1998 Ken Pizzini + + * djgpp/config.bat: correct inappropriate behavior that I + introduced in the beta13 changes (if first argument is + a directory, it needs to be handled as the --srcdir). + + * testsuite/version.gin, testsuite/version.good, testsuite/Makefile.am: + Add target to automake to automatically update version.good + from (new file) version.gin, instead of hand-editing the version + number each release. + + * testsuite/Makefile.am: miscellaneous gratuitious tweakage -- + mainly adding $(RM) commands just because I didn't like + leaving the tmp* files from successful runs laying about. + Also some editorial comments. + + * configure.in: update to beta16. Added and commented out + experiment with AC_OUTPUT() for testsuite/version.good. + Added code to properly handle bare (without =xxx) + "--with-regex" option. + +Sun Jul 5 21:02:16 PDT 1998 Ken Pizzini + + *** Version 3.01-beta15 released + + * sed/utils.c(ck_fflush), sed/utils.h, sed/execute.c(output_line): + add and use new ck_fflush() function. + +Sun Jul 5 15:23:47 PDT 1998 Ken Pizzini + + * sed/compile.c(bad_prog): add more detail to error + messages about -e strings. + +Sun Jul 5 14:29:45 PDT 1998 Ken Pizzini + + * sed/compile.c(mark_subst_opts), sed/execute.c(do_subst): + Define better semantics for interaction of the `g' flag + with a numeric flag to the s/// command. It used to + be that the `g' command siezed control; now the first + (number-1) matches are skipped and then `g' gets control + after that. (It is not clear whether this is a feature + sneaking in during late beta, or a bug fix; the changes + involved were trivial, so I decided to treat it as a bug + fix.) + + * configure.in, testsuite/version.good: update to beta15. + +Sat Jul 4 09:54:45 PDT 1998 Ken Pizzini + + *** Version 3.01-beta14 released + + * sed/basicdefs.h, sed/compile.c, sed/execute.c: + per report by "Kaveh R. Ghazi" , + copied the ISXXX macros from lib/regex.c so that + silly machines which require isascii() to be true + before the other isXXX() macros are valid will + still work. + + * configure.in, testsuite/version.good: update to beta14. + +Thu Jul 2 23:46:13 PDT 1998 Ken Pizzini + + *** Version 3.01-beta13 released + + * configure.in, acconfig.h: set USE_REGEX_GNU_H symbol if we + are going to be using lib/regex.c. + + * lib/Makefile.am, lib/regex.h, lib/regex-gnu.h, lib/regex.c: + rename lib/regex.h to lib/regex-gnu.h, so that those who + choose to use a different regex implementation will not + pick-up lib/regex.h when doing "#include ". + + * sed/regex-sed.h, sed/Makefile.am, sed/compile.c, sed/execute.c, + sed/sed.c: create sed/regex-sed.h which acts as a switch + to choose either lib/regex.h or the user-supplied , + depending on the value passed to configure's --with-regex= + option. + +Thu Jul 2 17:22:31 PDT 1998 Ken Pizzini + + * configure.in: if an alternative --with-regex= is given, + do an AC_CHECK_FUNCS(regnexec regexec) to ensure that + at least one of these functions is available. Also, + parallel changes for the default case. + + * sed/execute.c, acconfig.h: retire use of the WITH_REGNEXEC + test macro in favor of HAVE_REGNEXEC test macro created + by above change. + + * djgpp/config.bat: Play games to handle "install-sh", + DOS filename restrictions, GNU makefile default rules, + and getting a correct run of "configure" (contributed + by Eli Zaretskii ). + + * djgpp/Makefile.am, testsuite/Makefile.am, testsuite/Makefile.in, + Makefile.am, configure.in: Various automake targets + (such as distcheck) failed with old configuration. + The simplest solution was to just add these .am + files. (The testsuite/Makefile.in was just renamed to + testsuite/Makefile.am, then various redundant defines and + targets were deleted.) (Reported by Erick Branderhorst + .) + + * testsuite/dc.good, testsuite/dc.inp: per suggestion from + Greg Ubben , use base 16 output to + exercise even more of the dc.sed script. + + * configure.in, testsuite/version.good: update to beta13. + +Sun Jun 28 16:21:02 PDT 1998 Ken Pizzini + + *** Version 3.01-beta12 released + + * doc/sed.texi: Avoid mixing @code and @samp markups together: + they look ugly in Info. Use @url and @email instead of @example. + Add indexes. (Basis of changes contributed by Eli Zaretskii.) + + * djgpp/*, Makefile.am: add support for the DJGPP compiler, + contributed by Eli Zaretskii . + + * dc.sed, testsuite/Makefile.in, testsuite/dc.inp, testsuite/dc.good: + added this remarkable script, written and contributed + by Greg Ubben , both as a work of + art for general admiration, and also for use in regression + testing. + + * configure.in, lib/Makefile.am: add --with-regex=regexlib + option, which overrides the use of lib/regex.c. + + * configure.in, testsuite/version.good: update to beta12. + +Fri Jun 12 16:41:48 PDT 1998 Ken Pizzini + + *** Version 3.01-beta11 released + + * sed/compile.c: add module-static variables first_script + (for #n change below) and pending_text (for a/c/i change + below). + + * sed/compile.c(compile_file), sed/compile.c(compile_program): + Instead of having #n trigger the -n option in *any file*, + have #n trigger the -n option only if they are the first + two bytes of the first script or script-file. + + * sed/compile.c(compile_string), sed/compile.c(compile_file): + clear the first_script variable at end of these functions. + + * sed/sed.h: tease out the struct text_buf declaration from + struct sed_cmd, so that a pointer to such can be passed + to new sed/compile.c(read_text) function. + + * sed/compile.c(compile_program), sed/compile.c(read_text): + Tease out handling of text to a/c/i commands to new + read_text() function. Handle (via aid of pending_text + variable) texts which span more than one script/script-file + option. In particular, restore the ability to have this + work: sed -e '1i\' -e 'foo' + + * sed/compile.c(check_final_program): close off any dangling + pending_text allocation. + +Thu Jun 11 11:17:46 PDT 1998 Ken Pizzini + + * sed/execute.c(do_subst): fixed two bugs: s/ */X/g was failing + to match the final empty string after the end of the pattern + space; and /^foo$/s/o/x/3p was printing, despite the failure + to do a substition. + +Fri Jun 5 04:40:24 PDT 1998 Ken Pizzini + + * configure.in: change the AC_ARG_WITH(regnexec, ...) + to be the more appropriate AC_ARG_ENABLE(regnexec, ...). + + * configure.in, testsuite/version.good: update to beta11. + +Fri Jun 5 00:54:25 PDT 1998 Ken Pizzini + + *** Version 3.01-beta10 released + + * sed/execute.c: forgot to P_() the prototype and + old-style the declaration for bootstrap_memchr()! + +Thu Jun 4 18:42:30 PDT 1998 Ken Pizzini + + * sed/compile.c(snarf_char_class): added code to + recognize \n or \ sequence within a + char-class as the newline character. + +Tue Jun 2 11:56:02 PDT 1998 Ken Pizzini + + * configure.in: added check for and + a AC_ARG_WITH(regnexec,...) check, to simplify use + of other regex libraries which have regexec() but + not regnexec(), with the corresponding loss of + functionality (regexps will not work right against + input lines which contain NULs). + + * sed/execute.c: add nul_append() function, a #define + for a regnexec() -> regexec() macro (conditional on + the lack of the WITH_REGNEXEC symbol), and a couple + of calls to nul_append() (in match_an_address_p() + and do_subst()) to permit the use of the POSIX standard + regexec() function call instead of the suggested + regnexec() call. + + * sed/compile.c, sed/execute.c, sed/sed.c: check for + and include it (before "regex.h") if + available. This makes it simpler to use the system's + regex library instead of the one in lib/regex.c, should + that be desired. + +Tue Jun 2 08:41:05 PDT 1998 Ken Pizzini + + * sed/basicdefs.h: define VCAST macros to allow sed to + compile on systems which predate the definition + of "void *", and yet still get feedback about + stupid programming errors from systems which *do* + know about "void *"s. Also define MALLOC, REALLOC, + MEMDUP, and FREE macros to keep under control the + degree of code ugliness which would otherwise be + introduced in making use of the VCAST macro. + + * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c: + pervasively use the new VCAST, MALLOC, REALLOC, MEMDUP, + and FREE macros wherever appropriate. + + * sed/utils.c, sed/utils.h: correct type of first arguments + to ck_fread() and ck_fwrite() to be [const] VOID *. + + * sed/basicdefs.h, sed/execute.c: protect against + the rumored systems which stupidly #define __STDC__ 0. + + * testsuite/help.good, testsuite/Makefile.in: make + the ``help'' test insensitive to the spelling of + the executable's name. Also, enhanced `make clean' + target. + + * doc/sed.texi, doc/sed.1: correct documentation of `q' + command; fix typos. + + * configure, testsuite/version.good: update to beta10. + +Sat May 30 17:28:00 PDT 1998 Ken Pizzini + + *** Version 3.01-beta9 released + + * Makefile.am: make testsuite a normal SUBDIR. + + * configure.in: discontinue using AC_ISC_POSIX -- + check for -lcposix library instead; added + testsuite/Makefile to AC_OUTPUT list. + + * lib/memmove.c(memmove): fixed wrong sense used + for HAVE_BCOPY test. + + * sed/execute.c: checked more specifically for a version + of gcc which supports __attribute__ (i.e., >= 2.7). + + * testsuite/*: renamed files to fit 14 char limit. + + * testsuite/Makefile, testsuite/Makefile.in: Makefile + renamed to Makefile.in and then modified so that + "make -j check" from top directory will work. + + * testsuite/subwrite.sed, testsuite/writeout.sed: changed + file name of the "w" command to be consistent with the + new naming used in testsuite/Makefile.in. + + * doc/sed.1, doc/sed.texi: fixed some typos, formatting + glitches, and poor wordings. + +Sat May 30 04:02:29 PDT 1998 Ken Pizzini + + * configure.in: specify that config.h is to be derived + from config_h.in in order to avoid the braindead + DOS filesystem limitations. + +Fri May 29 21:56:30 PDT 1998 Ken Pizzini + + * sed/compile.c(compile_address), doc/sed.texi: gave + a better definition to the meaning of N~0 address + forms -- N~M addresses now mean that lines match + when there exists a non-negative x such that + lineno == N+x*M. + +Fri May 29 12:07:38 PDT 1998 Ken Pizzini + + * sed/compile.c(compile_address), + sed/execute.c(match_an_address_p): update semantics of + N~M address form: now N is the first line which will + match and M is the step between succeeding matches. + If N=M seems more useful. + + * doc/sed.1, doc/sed.texi: update documentation of N~M + address form; added "Other Resources" node to sed.texi; + minor formatting changes to some items in sed.1 with + an eye to improving clarity. + + * configure.in, testsuite/version.good: update to beta9. + +Sat May 23 20:04:31 HST 1998 Ken Pizzini + + *** Version 3.01-beta8 released + + * sed/compile.c(compile_regex): forgot to make last_re be + a *copy* of the buffered text in today's earlier fix. + + * sed/execute.c(read_file_line): EOF check was wrong -- + it forgot to allow for the possibility that we were + appending to the end of the ``line'' (instead of merely + reading a fresh line). + +Sat May 23 18:07:18 HST 1998 Ken Pizzini + + * sed/compile.c(compile_regex): don't track compiled version + of regex -- the modifiers may change. Track the regex + source instead. (For "last regex" (aka //) notation.) + + * configure.in, testsuite/version.good: update to beta8. + +Sat May 23 16:07:09 HST 1998 Ken Pizzini + + *** Version 3.01-beta7 released + + * sed/execute.c: #undef'd EXPERIMENTAL_DASH_N_OPTIMIZATION + because its code is buggy. + +Tue May 19 17:03:52 HST 1998 Ken Pizzini + + * sed/sed.c: label rx library code as such with #ifdefs + (instead of just #if 0). + + * sed/compile.c(compile_program): make incremental + improvement to the "Unknown command" error message. + +Sat May 16 23:16:26 HST 1998 Ken Pizzini + + * testsuite/Makefile: simplify: get rid of automatic run + against system's sed; don't time by default; allow for + alternative comparison command. + + * configure.in, testsuite/version.good: update to beta7. + +Wed May 13 21:44:28 PDT 1998 Ken Pizzini + + *** Version 3.01-beta6 released + + * lib/Makefile.am: fix spelling of libsed_a_LIBADD in + libsed_a_DEPENDENCIES. + + * configure.in, testsuite/version.good: update to beta6. + +Wed May 13 14:38:08 PDT 1998 Ken Pizzini + + *** Version 3.01-beta5 released + + * sed/execute.c(do_subst): added not_bol_p variable to track when + we have iterated past the beginning of the pattern. + [Thanks to Jim Meyering for the bug report.] + +Wed May 13 13:54:04 PDT 1998 Ken Pizzini + + * sed/execute.c(bootstrap_memchr): new function. When + bootstrapping we don't know if we are on a 64-bit machine, + so lib/memchr.c breaks. Supply this (slow) implementation + just to get us bootstrapped. + + * bootstrap.sh: add a #define BOOTSTRAP symbol; add -I. + for emphasis for the compiles in sed/; be explicit + about what files we're bothering to compile. + + * configure.in, testsuite/version.good: update version + to beta5. + +Wed May 13 06:39:06 PDT 1998 Ken Pizzini + + *** Version 3.01-beta4 released + + * rename writeout.good? to wrtout?.good and subwrite.good? to + subwrt?.good to comply with DOS 8+3 file name restrictions. + [Eli Zaretskii suggested this to + simplify DJGPP ports, and it was easy.] + + * testsuite/Makefile: reflect above name changes. + +Wed May 12 21:09:32 PDT 1998 Ken Pizzini + + * sed/sed.c(usage): fix non-portable omission of \n\ at end of + lines within long string. + + * sed/sed.c(main): remove spurious argument to fprintf() in the + 'V'ersion output. + + * sed/execute.c(line_append): embed newline between the two + text fragments unconditionally. + + * sed/execute.c(do_subst): change structure assignment to memcpy() + (for portability reasons). + + * README.bootstrap: suggest using -w option. + +Tue May 12 10:02:37 PDT 1998 Ken Pizzini + + * configure.in: use AC_REPLACE_FUNCS where appropriate. + + * lib/Makefile.am: updated to reflect AC_REPLACE_FUNCS change in + configure.in. + + * lib/memchr.c lib/memcmp.c: revert to standard GNU versions. + + * lib/alloca.c: added this missing file. + + * testsuite/version.good: updated for new version identifier. + +Mon May 11 18:50:56 PDT 1998 Ken Pizzini + + *** Version 3.01-beta3 released + + * sed/Makefile.am: fix INCLUDES to work right with VPATH. + [Thanks to Jim Meyering for the bug report.] + + * sed/sed.c(usage): make --help output more user-friendly? + + * sed/execute.c(execute_program): fix bug in 'x' command introduced + in the alleged portability fix of May 9. + + * configure.in: update version to 3.01-beta3. + + * testsuite/version.good, testsuite/help.good: freshen with + latest output. + +Sat May 9 22:35:45 PDT 1998 Ken Pizzini + + *** Version 3.01-beta2 released + + * sed/sed.c: add #include in HAVE_MMAP + block (needed on some machines). + + * lib/memmove.c: #include , if HAVE_MEMORY_H. + +Sat May 9 21:29:00 PDT 1998 Ken Pizzini + + * configure.in: remove dangling references to rx library; + added HEADER and FUNC checks for items used by source in + lib/. + + * lib/ansidecl.h, lib/memcopy.h, lib/pagecopy.h, lib/string.h + lib/memcpy.c, lib/memmove.c: deletes these files. There + are still pieces of glibc missing to support these, and + it isn't worth the headache right now. + + * lib/memmove.c: de novo, simpler version. Uses bcopy() + if available, and slow-but-simple code if not. + + * lib/Makefile.am: remove references to deleted files. + Added forgotten reference to memcpy.c. Re-ordered + SOURCE entries to reflect dependencies for systems + which lack ranlib. + + * sed/basicdefs.h: updated to reflect above changes to lib/, + and experience with non-STDC compilers. + + * lib/regex.c: made regerror() function publicly visible. + + * lib/strerror.c: use old-style function declaration. + + * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c, + sed/sed.h, sed/utils.h: ensure that private definitions of + some symbols do not cause problems when #include'ing system + headers (mainly by re-ordering the #include directives). + (This is particularly an issue for bootstrap.sh runs.) + + * sed/execute.c (execute_program): use memcpy() instead of + structure assingment ('x' command), for portablility to + old compilers. + + * sed/execute.c (slow_getline): use old-style function + declaration, with a P_ prototype. + + * sed/sed.c: change the type of the fallback MAP_FAILED + definition to work on archaic systems. (Modern systems + should be defining it themselves, so the change from + void * shouldn't be a problem.) + + * bootstrap.sh, README.bootstrap: actual testing of bootstrap + code revealed that I was too optimistic. Redesigned and + replaced implementation. + + * testsuite/Makefile: ignore errors from reference-implementation + seds that aren't up to snuff. + + * testsuite/help.good, testsuite/version.good: update to + current version's output. + +Fri May 8 15:08:28 PDT 1998 Ken Pizzini + + *** Version 3.01-beta1 released + + * sed/sed.c (main, usage): once again tweak the --help and + --version output to bettery comply with GNU coding standards. + + * testsuite/help.good, testsuite/version.good: update to + reflect above change. + + * doc/sed.texi: fix "Invoking" node's spelling to comply + with GNU standards. + +Fri May 8 11:43:10 PDT 1998 Ken Pizzini + + * doc/sed.1, doc/Makefile.am: wrote (very basic) man page. + +Thu May 7 20:40:21 PDT 1998 Ken Pizzini + + * lib/Makefile.am, lib/memmove.c, lib/memchr.c, lib/regex.c, + lib/memcpy.c, lib/regex.h, lib/memcopy.h, lib/string.h, + lib/pagecopy.h, lib/ansidecl.h: grab yet-another-version + from gnu.org for baseline and/or edit copyright boilerplate + using official lgpl2gpl.sed script. Take care not to + loose regnexec() interface or special conditional-compilation + code. + +Wed May 6 23:35:12 PDT 1998 Ken Pizzini + + * lib/regex.c, lib/regex.h: take from grep-2.1 distribution, + then trivially added the regnexec() interface. + + * sed/sed.c, sed/compile.c, sed/execute.c: made modifications + to work with regex instead of rx. + + * rx/*: deleted directory; the code is just too slow. + I think it will be easier to extend regex to fully + support POSIX.2 than to tune rx to be reasonable. + Even if this supposition is wrong, I'd rather make + the 3.01 release with the slightly deficient regex. + + * Makefile.am lib/Makefile.am, sed/Makefile.am: made changes + related to the substitution of regex for rx. + + * lib/Makefile.am, sed/Makefile.am: since regex is not a + ``compatability'' module, changed name of library to + ``libsed.a''. + + * lib/memchr.c, lib/memcpy.c, lib/memmove.c: add conditional + compilation code to leave zero-sized .o file if system + already supports the implemented function. + + * testsuite/help.good, testsuite/version.good: brought + up-to-date (once again). + + * NEWS, ANNOUNCE: changes to reflect this batch of changes. + +Wed May 6 18:40:47 PDT 1998 Ken Pizzini + + * sed/execute.c: discovered awful bug in '}' handling: + it could read past the end of vec (because `n' was + being decremented below zero)! Needed to "continue" + instead of "break". + +Tue May 5 14:34:38 PDT 1998 Ken Pizzini + + * doc/sed.texi, doc/version.texi: wrote some rudimentary + texinfo documentation. + + * ANNOUNCE, NEWS, README, README.rx, Makefile.am: + more updates for the upcoming beta-release. + + * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c, + sed/sed.h, lib/strerror.c: update copyright notice text. + +Fri May 1 15:41:37 PDT 1998 Ken Pizzini + + * sed/execute.c (match_an_address_p, match_address_p): if + the second element of an address range is a line number, + and that line number is *less than* (or equal to) the + current line number, we only match the one line (per + POSIX.2, section 4.55.7.1). [Bug discovered as reported + in the seders mailing list FAQ.] + + * AUTHORS, NEWS, acconfig.h, configure.in, doc/Makefile.am, + lib/Makefile.am, sed/Makefile.am, lib/README, + testsuite/help.good, testsuite/version.good: + Updated in anticipation of the 3.01-beta1 release. + Reorganized development source tree to make creation + of a distribution simpler. Most notable changes were + to the various Makefile.am files and configure.in, but + some minor edits (such as deleting or changing #include + directives) have been made in many other source files. + + * bootstrap.sh, README.bootstrap: created a mechanism for + creating sed on a system which lacks a working sed. + +Thu Apr 16 23:52:11 PDT 1998 Ken Pizzini + + * sed.h, sed.c, execute.c, compile.c: did a spell-check on + the comments; fixed several typos. + +Thu Apr 16 13:43:01 PDT 1998 Ken Pizzini + + * execute.c (do_subst): fixed bug where the "replaced" flag + was being set to one inappropriately when at least one + but fewer than sub->numb matches of the regexp were found. + (Thanks to Simon Taylor + for the bug report.) + +Wed Apr 15 11:35:31 PDT 1998 Ken Pizzini + + * sed.h, sed.c, compile.c, execute.c: having a concern that + a cast was being done inappropriately, and realizing that + there is no quick way to locate all casts in a program, I + went through and marked all casts with a simple macro. + Now it is a simple matter to locate the casts, and it is + also a simple matter to turn of casts for a lint session + (if it should be desired). + +Wed Apr 15 10:29:21 PDT 1998 Ken Pizzini + + * compile.c, sed.c: redo compile phase so that brace + expressions can be spread across multiple files. + For example: + printf '{' >a; printf 'l;d' >b; printf '}' >c + sed -f a -f b -f c foo + will now compile (and work), instead of complaining + about an unmatched '{'. The mess created in compile.c + allowed a little simplification to the command-line + processing of "-e" options in sed.c. + + sed.h: added (opaque) err_info member to struct vector; + added comments to the members of struct vector. + +Wed Apr 14 23:50:50 PDT 1998 Ken Pizzini + + * sed.h, sed.c, compile.c, execute.c: added types countT and + flagT in order to clarify what various "int"s were doing. + Also makes it easy to change the type used for counts + (for example, to "unsigned long long") if desired, although + there are still some gotchas (such as the printf() format + for the '=' command). + +Tue Apr 14 17:34:54 PDT 1998 Ken Pizzini + + * execute.c (execute_program, process_files, count_branches, + shrink_program): Added a first attempt at program optimization. + We now can quit early if we are running with the "-n" + and all of the commands are known to be valid only for + lines less than the current line. Thus the "sed" in + "foo | sed -n 1,2p" will print read three lines, printint + the first two, and then quit, regardless of how much longer + "foo" might run or output. This optimization does not buy + much in most cases (it sometimes even costs a little), + but when it does help it can help big. The code is + all conditionally compiled based on the + EXPERIMENTAL_DASH_N_OPTIMIZATION symbol being #defined, + so it can be easily omitted if it causes problems. + +Tue Apr 14 12:25:06 PDT 1998 Ken Pizzini + + * execute.c (test_dollar_EOF, last_file_with_data_p): + test_dollar_EOF() was incorrectly returning a false (0) + when there were unprocessed files, none of which had any + data (either unopenable or zero-length). Created + last_file_with_data_p() to detect this situation, and + modified test_dollar_EOF() to make use of it. + +Thu Apr 2 23:02:18 PST 1998 Ken Pizzini + + * compile.c (match_slash): match_slash() did not handle + [.coll.], [=equiv=], and [:class:] sequences within a + character class. Added snarf_char_class() [which is a + remote derivative of parse_char_class() from GNU ed-0.2] + to deal with the details, and altered match_slash() + to make use of it. Also created the trivial + add_then_next() to avoid clutter in snarf_char_class(). + +Thu Apr 2 20:34:42 PST 1998 Ken Pizzini + + * execute.c, sed.c, sed.h: There was a severe bug in + how the code handled "sed 5n a b" when "a" consists + of exactly five lines -- it behaved like "sed 5q a b"! + + Rearranged where files get opened -- large scale + changes primarily involving main(), process_files(), + and read_pattern_space(), but also touching on several + other parts of execute.c. The read_pattern_space() + function became unwieldly and parts were split into + open_next_file(), closedown(), read_always_fail(), + read_mem_line(), and read_file_line(). The + at_end_of_file_p() function became obsolete and was + eliminated; test_dollar_EOF_p() was updated. A few + global and module-static variables were elminated, and + "struct line" was extended; comments were added to the + "struct line" declartation to document some important + dependencies in it. + + I undertook the reorganization with dread, but I + feel that the new organization is an improvement + well beyond just fixing the bug that inspired it. + +Thu Apr 2 01:16:25 PST 1998 Ken Pizzini + + * execute.c (read_file_line, slow_getline): the fread() + buffering code gives insufficient feedback to a user + running sed with a tty input device, so I created + slow_getline() for reading from a tty device. + Additionally, EOF detection has been made a little more + sensitive to avoid requiring multiple EOFs to be entered + from a tty. + + * configure.in: added isatty() check. + +Wed Apr 1 11:04:30 PST 1998 Ken Pizzini + + * configure.in (CPPFLAGS, LDFLAGS, LIBS): + Set to appropriate values if large file support needs + explicit enabling. Code fragment taken from a 1997-10-25 + patch to gawk by Paul Eggert + +Thu Aug 14 17:43:27 PDT 1997 Ken Pizzini + + * utils.c (ck_fclose): modified to ignore NULL parameter. + +Thu Aug 14 12:08:45 PDT 1997 Ken Pizzini + + * execute.c: tweaked execute_program() to eliminate + gratuitous "goto" usage. + +Thu Aug 14 11:30:04 PDT 1997 Ken Pizzini + + * compile.c: added case-insensitive modifier ('I') to + address and s/// regexps. The s/// case also accepts + the more popular 'i' modifier. (The address regexp + cannot use 'i' as a modifier, as that conflicts with + the use of the 'i'nsert command.) + +Thu Aug 14 09:29:06 PDT 1997 Ken Pizzini + + * compile.c: abstracted out match_slash() from the s///, y///, + and address-regexp special-case codes. + + * execute.c: made dump_append_queue() use ck_fread() instead + of hand-rolled error checking. + +Mon Jul 28 10:50:41 PDT 1997 Ken Pizzini + + * sed.c, sed.h, execute.c: POSIX.2, section 4.55.7, says that + a newline must end *every* output line. But I think that + it is useful (when seding a binary file) to omit a trailing + newline if the input lacks one. Thus the addition of + POSIXLY_CORRECT behavior. + + * execute.c: however, when seding multiple files my feeling + is that it makes sense to have each file but the last + behave as-if it ended in a newline. Modified read_pattern_space() + accordingly. + + * utils.c: realized that add1_buffer(), for performance reasons, + shouldn't be calling memcpy() (indirectly via add_buffer()), + so rewrote it. + +Sat Jul 26 23:08:28 PDT 1997 Ken Pizzini + + * execute.c: attempted to make read_pattern_space more + efficient for the the non-mmap() case. + + * utils.c, utils.h, execute.c: new function ck_fread() + created and used. + +Sat Jul 26 20:22:14 PDT 1997 Ken Pizzini + + * execute.c, compile.c, sed.c: abstracted the mmap() + interface into map_file()/unmap_file() [sed.c], and + changed the ad-hoc code in compile_file() [compile.c] + and process_file() [execute.c] to make use of the new + interface. + +Sat Jul 26 19:45:46 PDT 1997 Ken Pizzini + + * execute.c, compile.c, configure.in: Check to see if mmap() + is available; if so make use of it on regular files. + + * compile.c: compile_file() now closes the input file + when it is through! + +Sun Jul 20 23:57:02 PDT 1997 Ken Pizzini + + * compile.c: modified parsing to permit whitespace in more + places where it makes sense; + added backslash escaping to the y/// command, per POSIX. + + * execute.c: Merged append_pattern_space() into read_pattern_space(); + moved body of 's' command to new function do_subst(); + moved body of 'l' command to new function do_list(); + changed output of 'l' command to conform to POSIX.2; + made line handling conform to POSIX; added output_line() function; + redesigned append-space algorithm; added append_queue structure and + the next_append_slot() and dump_append_queue() functions. + + * sed.h: moved the definition of what is now struct subst + outside of the definition of struct sed_cmd. + +Sat Jul 19 16:29:09 PDT 1997 Ken Pizzini + + * sed.c, execute.c, sed.h, Makefile.am: Separated out the + pieces dealing with executing the program from the top-level + parameter parsing and control. + +Sat Jul 19 01:16:35 PDT 1997 Ken Pizzini + + * sed.c, compile.c, sed.h, Makefile.am: separate out the + pieces dealing with compiling the program from the pieces + dealing with interpreting the result. + + * compile.c: add functions in_nonblank() and in_integer(), + and change interface to compile_address() with an eye + to making code clearer. + +Fri Jul 18 13:35:50 PDT 1997 Ken Pizzini + + * utils.c: attempt at a quasi-unification of the + STDC and traditional C approaches to panic(). + + * sed.c: eliminate some gratuitous bit twiddling. + (Using flag bits can be a useful technique, but + this code is cleaner without them.) + + * sed.c: place mutually exclusive members of struct addr + within a union, mainly to document the exclusivity; + eliminate unused structure members from struct fp_list; + eliminate unnecessary module-global variables; + remove some #if 0 code that is too odd to keep; + allegedly simplified the 'l' case of execute_program(); + allegedly simplified inchar(); + localized some static variables; + renamed some variables to better document their purpose; + removed some goto-s rendered obsolete by other changes. + +Thu Jul 17 15:30:44 PDT 1997 Ken Pizzini + + * utils.c, utils.h, sed.c: added and made use of + ck_free() function. + + * utils.c, utils.h, sed.c: changed all the *_buffer() + functions to take/return an incomplete type + "struct buffer *" instead of using VOID *. + + * utils.c, utils.h, sed.c: renamed "finish_buffer()" + to "free_buffer()", on the premise that the new + name better describes the function's purpose. + +Wed Jul 16 13:52:14 PDT 1997 Ken Pizzini + + * utils.c, utils.h, sed.c: added and made use of + ck_memdup() function. + + * sed.c: protected a call to add1_buffer() in + compile_program() which could have tried to + push an EOF if a a/i/c command ended with + a '\', EOF sequence. + + * utils.c: added sanity check to add1_buffer() so that + EOF will not be added to the buffer. + +Wed Jul 16 03:56:26 PDT 1997 Ken Pizzini + + * configure.in, compat.h, compat.c: added memchr. + + * sed.c: got rid of arbitrary NUM_FPS limit; + made global functions and variables "static" where appropriate; + make various cosmetic changes, hopefully improving readability; + simplified some redundant predicates; + simplified some code, but nothing fundamental (yet?). + +Wed Jul 16 00:24:54 PDT 1997 Ken Pizzini + + * alloca.c, getopt.c, getopt.h, getopt1.c: updated from + versions in textutils-1.22. + + * Makefile.in, Makefile.am, configure.in: put in automake support. + + * basicdefs.h, compat.h, compat.c [, sed.c, utils.c]: took out + some very ugly compatibility #ifdefs and packaged into one + place. + + * sed.c, utils.c: some gratuitous formatting changes. + + * utils.c: changed datatype of utils_id_s in order to + eliminate arbitrary array size. + +Sun Jul 13 17:00:26 PDT 1997 Ken Pizzini + + * sed.c, utils.c, utils.h: de-linting oriented cleanup. + +Sun Jul 13 00:46:48 PDT 1997 Ken Pizzini + + * sed.c: fixed bug which caused SEGV for files missing a + final newline. Corrected calls to regnexec to pass the + proper parameters, in the proper order. + +Sat Dec 30 20:16:59 1995 Tom Lord + + *** Version 3.00 released + + * sed.c: Use posix entry points to regexp functions. + Fix enough bugs to pass the test-suite. + +....... Jason Molenda + + * testsuite/: trippy test suite. + + +Wed May 11 07:46:24 1994 Chip Salzenberg (chip@fin.uucp) + + *** Version 2.05 released + + * sed.c (compile_address): Recognize numeric addresses. + Fixes typo made during installation of "~" feature. + +Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com) + + *** Version 2.04 released + + * sed.c: applied a patch from + From: kap1@tao.cpe.uchicago.edu (Dietrich Kappe) + + Dietrich writes: + + As my contribution to the creeping feature creature in sed, + here is a new type of address. The address has form n~m, + which means "the line number is equal to n modulo m." The + modifications to sed are trivial, and the general + usefulness of this address should be obvious. If m is 0 or + missing, 1 is used in its place (could be a bug or a + feature :-). + +Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com) + + * rx.c (solve_destination): protect `solution' more carefully. + This is a cleanup of a patch from Kevin Buettner + (kev@cujo.geg.mot.com). + +Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com) + + * rx.c: make translation tables unsigned chars + + * sed.c (main): Compile accumulated -e commands as + soon as a -f command comes along. This ensures that + the commands are executed in the right order. + +Mon Oct 25 14:41:47 1993 Tom Lord (lord@rtl.cygnus.com) + + * sed.c (execute_program): 'w' flushes the buffer after it + writes -- diagnosed by doug@research.att.com. 'r' and 'w' to + the same file is now supported -- hopefully even in a way that + satisfies Posix (it now behaves differently from some + /bin/sed's and the spec is hard to read so i'm not sure). + + Also, 'r' of a non-existent file is now permitted. + +Mon Oct 11 21:06:10 1993 Tom Lord (lord@cygnus.com) + + * sed.c (execute_program): remember that 'b' and 't' are more + like longjmp than goto. Patch from tom@basil.icce.rug.nl (Tom + R.Hageman) + + * rx.c: patch from From: fin!chip@rutgers.edu (Chip + Salzenberg) to get rid of compiler warnings. + + +Sat Aug 7 01:04:59 1993 Tom Lord (lord@unix7.andrew.cmu.edu) + + *** Version 2.03 released + + * sed.c (compile_regex): report error messages for bogus + regexps. + + SEE ALSO: ChangeLog.rx + + +Wed Jul 21 00:28:03 1993 Tom Lord (lord@unix8.andrew.cmu.edu) + + * alloca.c: upgraded to a more recent version + + * rx.c (re_search_2): prefer matches with longer + subexpressions to those with shorter ones, giving precedence + to low numbered subexpressions. + + * rx.c (re_compile): don't free `params' if its null. + +Fri Jul 16 01:12:08 1993 Tom Lord (lord@unix8.andrew.cmu.edu) + + * rx.[ch], sed.c: rx replaces regex. + + + +Thu May 27 11:13:03 1993 Tom Lord (lord@unix3.andrew.cmu.edu) + + * sed.c (execute_program, match_addr): caught more cases + that need to be sensitive to a missing \n at EOF. + +Fri May 21 00:39:22 1993 Tom Lord (lord@unix8.andrew.cmu.edu) + + * sed.c (execute_program): apply gaumondp's patch + to fix '\xabcxs/foo/bar/'. + + * sed.c (execute_program): + If a second address is a regexp, never match it on the + same line as the first address. + + * sed.c (compile_regexp): + Numeric ranges x,y s.t. y < x are now treated as x,x. + There was a bug in that they were being handled like x,x+1. + + * sed.c (execute_program, read_pattern_space, + append_pattern_space) don't add newlines to lines + that don't have them. + +Wed May 19 13:34:45 1993 Tom Lord (lord@unix9.andrew.cmu.edu) + + * sed.c (compile_program): grok \\n in comments. + +Mon May 17 16:34:50 1993 Tom Lord (lord@unix9.andrew.cmu.edu) + + * alloca.c: new (standard) file + + * configure.in: AC_CONSTified + + * sed.c (compile_program): properly diagnose the error of + a missing command (e.g. sed /x/). (thanks gaumondp) + + * sed.c (compile_regexp): handle character classes correctly. + Thanks gaumondp@ERE.UMontreal.CA + and schwab@issan.informatik.uni-dortmund.de. + +Thu May 6 12:37:18 1993 Tom Lord (lord@unix10.andrew.cmu.edu) + + * sed.c (compile_filename, execute_program): don't use + `access' or `/dev/null'. + + * sed.c (execute_program): 'N' at EOF should delete the pat buf. + + * sed.c (compile_filename): truncate, don't append files + being openned for `w' or `s///w' + + * sed.c (execute_program): -n switch shouldn't effect `i' or `c'. + + * sed.c (compile_program): don't compile unescaped newlines + into the substitution string of an `s' command (they are an error). + + * sed.c (compile_regex): correctly skip over character + sets that contain `]'. + + * sed.c (execute_program): patch from gaumondp + Correctly handle empty-string matches in the case of an `s' + command with a repeat count. + + * sed.c (compile_program): patch from gaumondp@ere.UMontreal.ca. + Don't consume characters after the label of a `b', `t' or `:' command. + + * sed.c (compile_program): unmatched open braces are an error. + + * sed.c (compile_file): when consuming an initial comment, + count lines correctly. + +Wed Nov 18 02:10:58 1992 Tom Lord (lord@unix2.andrew.cmu.edu) + + * sed.c (execute_program): Made s///p print even if -n was + specified. + + * sed.c (compile_string): Changed the type of this function to + fix a compile warning. + +Wed Nov 4 17:15:34 1992 Tom Lord (lord@unix7.andrew.cmu.edu) + + * sed.c (main): Initialize the hold area to contain "\n" + instead of "". In execute_program, all lines are expected + to be newline terminated. Also, if H is the first command + in the script, the result is a pattern buffer that begins + with a blank line. Thanks to pinard@iro.umontreal.ca + (Francois Pinard) for pointing out this and many other bugs. + + * sed.c (execute_program): Fixed a case of `D' command. + Thanks Chris Weber + + * sed.c: added new tests of no_default_output to make -n work. + Thanks Andrew Herbert + + * sed.c, configure.in,Makefile.in: autoconfed bcopy and const. + Thanks "J.T. Conklin" + + * sed.c: made prog_cur, prog_start, and prog_end unsigned so + that users could write `sed -e s/ÿ/foo/g'. + +Tue Oct 13 00:04:05 1992 Tom Lord (lord@unix3.andrew.cmu.edu) + + * sed.c (execute_program): fixed the cycling behavior of 'D' + + * sed.c: integrated patch that closes files + + * sed.c: changed regexp syntax + +Fri May 22 15:11:12 1992 Tom Lord (lord at moriarty.bh.andrew.cmu.edu) + + * regex.c: this is not my change, but a pointer to the fact + that karl@gnu fixed some regexp bugs that were plaguing sed. + +Thu Apr 30 13:02:21 1992 Tom Lord (lord at unix3.andrew.cmu.edu) + + * sed.c (compile_program, execute_program) + subprograms are now compiled with an explicit continuation ;) + return_v and return_i in struct vector. execute_program + no longer recurses to execute subprograms (case '{') and now + understands a return instruction (case '{'). + +Tue Apr 28 17:13:04 1992 Tom Lord (lord at unix7.andrew.cmu.edu) + + * sed.c (compile_address) added \?regexp? syntax for addresses. + + * sed.c (main) added {} intervals to the obscure regexp + syntax. + + * sed.c (compile_program) after calling compile_address, + normalize numeric addresses (make a2.addr_number > a1.addr_number). + This is necessary because line numbers must match exactly, + but sed does not try to match a2 until after a1 has matched, + yet a1,a2 where a2 <= a1 is defined to be equivelent to + a1,a1+1 + +Sat Feb 29 10:55:54 1992 David J. MacKenzie (djm@nutrimat) + + * sed.c (usage): Document long options as starting with `--'. + +Mon Dec 9 23:56:40 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * sed.c: Include sys/types.h, for new regex.h. + +Tue Nov 5 02:16:01 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * utils.c: Change NO_VFPRINTF to VPRINTF_MISSING, for + compatibility with autoconf. + +Mon Sep 2 22:02:40 1991 David J. MacKenzie (djm at apple-gunkies) + + * sed.c (compile_regex): Treat \ as a normal character when in + a char class. + +Thu Aug 8 00:15:33 1991 David J. MacKenzie (djm at bleen) + + * Version 1.08. + + * sed.c (compile_filename): If reading a file fails, read + /dev/null instead. It's what Unix and POSIX do, effectively. + + * sed.c (compile_regex): The 'slash' character doesn't + terminate the regex if it's in a character class. + + * sed.c (main): If given no args, or bad option, print usage + message. + (usage): New function. + + * sed.c (execute_program): Amount written for 'P' command was + wrong. From stephend@ksr.com (Stephen Davis). + +Wed Aug 7 16:51:14 1991 David J. MacKenzie (djm at apple-gunkies) + + * sed.c (append_pattern_space): Check for buffer full before + instead of after writing to buffer. Don't need to test for + EOF initially anymore, due to the next change. + (execute_program): For 'n' and 'N' commands, if eof is reached + in input, quit the script like Unix sed does. + Fix memory allocation problems for 'a' and 'r' commands. + (compile_program): Fix off by one error in processing comments. + All of the above are from Tapani Tarvainen, tarvaine@tukki.jyu.fi. + + * sed.c (setup_jump): Use isblank instead of testing for ' ' + or '\t', for POSIX locales. + + * utils.c (ck_strdup): Renamed from strdup. + * sed.c: Change callers. + + * sed.c, utils.c: Clean up declarations and includes to get + rid of compiler warnings. + + * sed.c (main): Add long-named options. Don't complain if -n + is given twice. + +Fri Aug 2 12:33:16 1991 David J. MacKenzie (djm at apple-gunkies) + + * configure: Support +srcdir arg. Create config.status and + remove it and Makefile if interrupted while creating them. + * Makefile.in: Change DESTDIR to prefix. + +Mon Jul 15 13:07:39 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + + * sed.c (main): Add -V option to print version number. + (USAGE): Mention -V. + +Mon Jul 8 01:42:22 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) + + * sed.c: Define bcopy in terms of memcpy if STDC_HEADERS as + well as if USG. + (compile_filename): Don't glob filename (for 'r' and 'w' + commands). Unix sed doesn't do it and it's not very useful, + since it can only match 0 or 1 files. + (execute_program): Change '\a' to 007 since some compilers + don't recognize \a. + * utils.c: New file; code moved from sed.c. + * Replace Makefile with Makefile.in and configure. + Update README. + +Tue Mar 26 13:00:48 EST 1991 Jay Fenlason (hack@gnu.ai.mit.edu) + + * sed.c (match_address) Added a trivial cast for portability. + +Mon Feb 25 13:23:29 EST 1991 Jay Fenlason (hack@ai.mit.edu) + + * sed.c Changed 's' command to work with latest version of regex() + routines, which mysteriously changed somewhere in there. . . + A one-line patch from David Eckelkamp (eckelkamp@mcc.com). + + Initialize the fastmap in the hopes that it'll make sed faster. + +Thu Feb 21 13:42:27 EST 1991 Jay Fenlason (hack@ai.mti.edu) + + * sed.c Change panic to compile with other __STDC__ compilers. + +Wed Jan 30 10:46:38 EST 1991 Jay Fenlason (hack@ai.mit.edu) + + * sed.c Changed version number. Made new release. + +Tue Nov 27 15:34:51 EST 1990 Jay Fenlason (hack@ai.mit.edu) + + * sed.c (setup_jump) Don't blow chunks if there isn't a label + after a b or t command. + + (main) Don't panic if it a branch command doesn't have + a label to branch to. + + (main) Collect all the -e arguments together and parse them + all at once. This way, -e { -e mumble -e } will work. + + All these small patches from David Schmidt (davids@isc-br.isc-br.com) + +Tue Sep 11 12:51:37 EDT 1990 Jay Fenlason (hack@ai.mit.edu) + + * sed.c Changed some function forward declarations to use VOID * + instead of char * + +Mon Jul 16 11:12:54 EDT 1990 Jay Fenlason (hack@ai.mit.edu) + + * sed.c (ck_malloc) Use malloc(1) instead of malloc(0) if given + a request for zero bytes. + +Tue Jun 5 02:05:37 1990 David J. MacKenzie (djm at albert.ai.mit.edu) + + * sed.c: Remove excess newlines from calls to panic. + Reformat some comments to fit in 79 columns. + Base whether to use void * on __STDC__, not __GNU__. + (main): Add missing arg when printing usage message. + Print usage if given invalid arg. + (panic) [__STDC__]: Add missing ", ...". + (compile_filename): Print correct error message if glob_filename + returns NULL. + +Thu Apr 5 21:41:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * sed.c (execute_program, case 'r'): When need to realloc append.text, + multiply append.alloc by 2 instead of adding + cur_cmd->x.cmd_txt.text_len. + +Tue Mar 6 15:55:35 EST 1990 Jay Fenlason (hack@ai.mit.edu) + + * sed.c (compile_regex) Allocate 10 bytes extra space needed by + re_compile_pattern. + +Sun Feb 25 16:32:10 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) + + * sed.c (execute_program, case 'l'): Print \00 instead of \0. + Print backslash as \\ not \. + Print \xx instead of /xx. + +Thu Feb 1 14:02:28 EST 1990 hack@wookumz + + * sed.c (memchr) Use () inside inner loop so it will work correctly. + A two character patch from Robert A Bruce (rab@allspice.berkeley.edu) + +Wed Sep 27 18:47:39 EDT 1989 hack@ai.mit.edu + + * sed.c (compile_regex) New function. When compiling regex, + turn ^ into \` and $ into \' so that they won't match on embedded + newlines. UN*X pattern matching is a crock. + (compile_program, compile_address) call compile_regex. + +Mon Sep 18 10:15:32 EDT 1989 hack@ai.mit.edu + + * sed.c (compile_program): define translate as unsigned char * so + that y command will work on non-ascii characters. + + Changed version number to 1.06. + +Thu Sep 14 15:57:08 EDT 1989 hack@ai.mit.edu + + * sed.c (compile_program) Let programs use ; to terminate } as + well as newline. + + (read_file) Print an error msg to stderr if it can't open an + input file. + +Thu Mar 23 18:04:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) + + * Makefile, sed.c: Added new copyright notice. + + * Makefile: Make distributions which follow the symlinks. + +hack@ai.mit.edu + + 1.05 Fixed error in 'r' (now does things in the right order) + + 1.04 Fixed s/re/rep/[number] + + 1.03 Fixes from Mike Haertel for regexps that match the + empty string, and for Ritchie stdio (non-sticky EOF) + + 1.02 Fixed 't', 'b', ':' to trim leading spaces and tabs + Fixed \\ in replacement of 's' command + Added comments + + 1.01 Added s/re/rep/[digits] + added #n as first line of script + added filename globbing + added 'l' command + All in the name of POSIX + + 1.00 Began (thinking about) distributing this file + +Local Variables: +mode: indented-text +left-margin: 8 +version-control: never +End: diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/INSTALL b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/INSTALL new file mode 100644 index 0000000..23e5f25 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/NEWS b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/NEWS new file mode 100644 index 0000000..cd755d2 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/NEWS @@ -0,0 +1,502 @@ +Sed 4.2.1 + +* fix parsing of s/[[[[[[[[[]// + +* security contexts are preserved by -i too under SELinux + +* temporary files for sed -i are not made group/world-readable until + they are complete + +---------------------------------------------------------------------------- +Sed 4.2 + +* now released under GPLv3 + +* added a new extension `z` to clear pattern space even in the presence +of invalid multibyte sequences + +* a preexisting GNU gettext installation is needed in order to compile +GNU sed with NLS support + +* new option --follow-symlinks, available when editing a file in-place. +This option may not be available on some systems (in this case, the +option will *not* be a no-op; it will be completely unavailable). +In the future, the option may be added as a no-op on systems without +symbolic links at all, since in this case a no-op is effectively +indistinguishable from a correct implementation. + +* hold-space is reset between different files in -i and -s modes. + +* multibyte processing fixed + +* the following GNU extensions are turned off by --posix: options [iImMsSxX] +in the `s' command, address kinds `FIRST~STEP' and `ADDR1,+N' and `ADDR1,~N', +line address 0, `e' or `z' commands, text between an `a' or `c' or `i' +command and the following backslash, arguments to the `l' command. +--posix disables all extensions to regular expressions. + +* fixed bug in 'i\' giving a segmentation violation if given alone. + +* much improved portability + +* much faster in UTF-8 locales + +* will correctly replace ACLs when using -i + +* will now accept NUL bytes for `.' + +---------------------------------------------------------------------------- +Sed 4.1.5 + +* fix parsing of a negative character class not including a closed bracket, + like [^]] or [^]a-z]. + +* fix parsing of [ inside an y command, like y/[/A/. + +* output the result of commands a, r, R when a q command is found. + +---------------------------------------------------------------------------- +Sed 4.1.4 + +* \B correctly means "not on a word boundary" rather than "inside a word" + +* bugfixes for platform without internationalization + +* more thorough testing framework for tarballs (`make full-distcheck') + +---------------------------------------------------------------------------- +Sed 4.1.3 + +* regex addresses do not use leftmost-longest matching. In other words, + /.\+/ only looks for a single character, and does not try to find as + many of them as possible like it used to do. + +* added a note to BUGS and the manual about changed interpretation + of `s|abc\|def||', and about localization issues. + +* fixed --disable-nls build problems on Solaris. + +* fixed `make check' in non-English locales. + +* `make check' tests the regex library by default if the included regex + is used (regex tests had to be enabled separately up to now). + +---------------------------------------------------------------------------- +Sed 4.1.2 + +* fix bug in 'y' command in multi-byte character sets + +* fix severe bug in parsing of ranges with an embedded open bracket + +* fix off-by-one error when printing a "bad command" error + +---------------------------------------------------------------------------- +Sed 4.1.1 + +* preserve permissions of in-place edited files + +* yield an error when running -i on terminals or other non regular files + +* do not interpret - as stdin when running in in-place editing mode + +* fix bug that prevented 's' command modifiers from working + +---------------------------------------------------------------------------- +Sed 4.1 + +* // matches the last regular expression even in POSIXLY_CORRECT mode. + +* change the way we treat lines which are not terminated by a newline. +Such lines are printed without the terminating newline (as before) +but as soon as more text is sent to the same output stream, the +missing newline is printed, so that the two lines don't concatenate. +The behavior is now independent from POSIXLY_CORRECT because POSIX +actually has undefined behavior in this case, and the new implementation +arguably gives the ``least expected surprise''. Thanks to Stepan +Kasal for the implementation. + +* documentation improvements, with updated references to the POSIX.2 +specification + +* error messages on I/O errors are better, and -i does not leave temporary +files around (e.g. when running ``sed -i'' on a directory). + +* escapes are accepted in the y command (for example: y/o/\n/ transforms +o's into newlines) + +* -i option tries to set the owner and group to the same as the input file + +* `L' command is deprecated and will be removed in sed 4.2. + +* line number addresses are processed differently -- this is supposedly +conformant to POSIX and surely more idiot-proof. Line number addresses +are not affected by jumping around them: they are activated and +deactivated exactly where the script says, while previously + 5,8b + 1,5d +would actually delete lines 1,2,3,4 and 9 (!). + +* multibyte characters are taken in consideration to compute the +operands of s and y, provided you set LC_CTYPE correctly. They are +also considered by \l, \L, \u, \U, \E. + +* [\n] matches either backslash or 'n' when POSIXLY_CORRECT. + +* new option --posix, disables all GNU extensions. POSIXLY_CORRECT only +disables GNU extensions that violate the POSIX standard. + +* options -h and -V are not supported anymore, use --help and --version. + +* removed documentation for \s and \S which worked incorrectly + +* restored correct behavior for \w and \W: match [[:alnum:]_] and +[^[:alnum:]_] (they used to match [[:alpha:]_] and [^[:alpha:]_] + +* the special address 0 can only be used in 0,/RE/ or 0~STEP addresses; +other cases give an error (you are hindering portability for no reason +if specifying 0,N and you are giving a dead command if specifying 0 +alone). + +* when a \ is used to escape the character that would terminate an operand +of the s or y commands, the backslash is removed before the regex is +compiled. This is left undefined by POSIX; this behavior makes `s+x\+++g' +remove occurrences of `x+', consistently with `s/x\///g'. (However, if +you enjoy yourself trying `s*x\***g', sed will use the `x*' regex, and you +won't be able to pass down `x\*' while using * as the delimiter; ideas on +how to simplify the parser in this respect, and/or gain more coherent +semantics, are welcome). + + +---------------------------------------------------------------------------- +Sed 4.0.9 + +* 0 address behaves correctly in single-file (-i and -s) mode. + +* documentation improvements. + +* tested with many hosts and compilers. + +* updated regex matcher from upstream, with many bugfixes and speedups. + +* the `N' command's feature that is detailed in the BUGS file was disabled +by the first change below in sed 4.0.8. The behavior has now been +restored, and is only enabled if POSIXLY_CORRECT behavior is not +requested. + +---------------------------------------------------------------------------- +Sed 4.0.8 + +* fix `sed n' printing the last line twice. + +* fix incorrect error message for invalid character classes. + +* fix segmentation violation with repeated empty subexpressions. + +* fix incorrect parsing of ^ after escaped (. + +* more comprehensive test suite (and with many expected failures...) + +---------------------------------------------------------------------------- +Sed 4.0.7 + +* VPATH builds working on non-glibc machines + +* fixed bug in s///Np: was printing even if less than N matches were +found. + +* fixed infinite loop on s///N when LHS matched a null string and +there were not enough matches in pattern space + +* behavior of s///N is consistent with s///g when the LHS can match +a null string (and the infinite loop did not happen :-) + +* updated some translations + +---------------------------------------------------------------------------- +Sed 4.0.6 + +* added parameter to `v' for the version of sed that is expected. + +* configure switch --without-included-regex to use the system regex matcher + +* fix for -i option under Cygwin + +---------------------------------------------------------------------------- +Sed 4.0.5 + +* portability fixes + +* improvements to some error messages (e.g. y/abc/defg/ incorrectly said +`excess characters after command' instead of `y arguments have different +lengths') + +* `a', `i', `l', `L', `r' accept two addresses except in POSIXLY_CORRECT +mode. Only `q' and `Q' do not accept two addresses in standard (GNU) mode. + +---------------------------------------------------------------------------- +Sed 4.0.4 + +* documentation fixes + +* update regex matcher + +---------------------------------------------------------------------------- +Sed 4.0.3 + +* fix packaging problem (two missing translation catalogs) + +---------------------------------------------------------------------------- +Sed 4.0.2 + +* more translations + +* fix build problems (vpath builds and bootstrap builds) + +---------------------------------------------------------------------------- +Sed 4.0.1 + +* Remove last vestiges of super-sed + +* man page automatically built + +* more translations provided + +* portability improvements + +---------------------------------------------------------------------------- +Sed 4.0 + +* Update regex matcher + +---------------------------------------------------------------------------- +Sed 3.96 + +* `y' command supports multibyte character sets + +* Update regex matcher + +---------------------------------------------------------------------------- +Sed 3.95 + +* `R' command reads a single line from a file. + +* CR-LF pairs are always ignored under Windows, even if (under Cygwin) +a disk is mounted as binary. + +* More attention to errors on stdout + +* New `W' command to write first line of pattern space to a file + +* Can customize line wrap width on single `l' commands + +* `L' command formats and reflows paragraphs like `fmt' does. + +* The test suite makefiles are better organized (this change is +transparent however). + +* Compiles and bootstraps out-of-the-box under MinGW32 and Cygwin. + +* Optimizes cases when pattern space is truncated at its start or at +its end by `D' or by a substitution command with an empty RHS. +For example scripts like this, + + seq 1 10000 | tr \\n \ | ./sed ':a; s/^[0-9][0-9]* //; ta' + +whose behavior was quadratic with previous versions of sed, have +now linear behavior. + +* New command `e' to pipe the output of a command into the output +of sed. + +* New option `e' to pass the output of the `s' command through the +Bourne shell and get the result into pattern space. + +* Switched to obstacks in the parser -- less memory-related bugs +(there were none AFAIK but you never know) and less memory usage. + +* New option -i, to support in-place editing a la Perl. Usually one +had to use ed or, for more complex tasks, resort to Perl; this is +not necessary anymore. + +* Dumped buffering code. The performance loss is 10%, but it caused +bugs in systems with CRLF termination. The current solution is +not definitive, though. + +* Bug fix: Made the behavior of s/A*/x/g (i.e. `s' command with a +possibly empty LHS) more consistent: + + pattern GNU sed 3.x GNU sed 4.x + B xBx xBx + BC xBxCx xBxCx + BAC xBxxCx xBxCx + BAAC xBxxCx xBxCx + +* Bug fix: the // empty regular expressions now refers to the last +regular expression that was matched, rather than to the last +regular expression that was compiled. This richer behavior seems +to be the correct one (albeit neither one is POSIXLY_CORRECT). + +* Check for invalid backreferences in the RHS of the `s' command +(e.g. s/1234/\1/) + +* Support for \[lLuUE] in the RHS of the `s' command like in Perl. + +* New regular expression matcher + +* Bug fix: if a file was redirected to be stdin, sed did not consume +it. So + (sed d; sed G) < TESTFILE + +double-spaced TESTFILE, while the equivalent `useless use of cat' + cat TESTFILE | (sed d; sed G) + +printed nothing (which is the correct behavior). A test for this +bug was added to the test suite. + +* The documentation is now much better, with a few examples provided, +and a thorough description of regular expressions. The manual often +refers to "GNU extensions", but if they are described here they are +specific to this version. + +* Documented command-line option: + -r, --regexp-extended + Use extended regexps -- e.g. (abc+) instead of \(abc\+\) + +* Added feature to the `w' command and to the `w' option of the `s' +command: if the file name is /dev/stderr, it means the standard +error (inspired by awk); and similarly for /dev/stdout. This is +disabled if POSIXLY_CORRECT is set. + +* Added `m' and `M' modifiers to `s' command for multi-line +matching (Perl-style); in addresses, only `M' works. + +* Added `Q' command for `silent quit'; added ability to pass +an exit code from a sed script to the caller. + +* Added `T' command for `branch if failed'. + +* Added `v' command, which is a do-nothing intended to fail on +seds that do not support GNU sed 4.0's extensions. + +---------------------------------------------------------------------------- +Sed 3.02.80 + +* Started new version nomenclature for pre-3.03 releases. (I'm being +pessimistic in assuming that .90 won't give me enough breathing room.) + +* Bug fixes: the regncomp()/regnexec() interfaces proved to be inadequate to +properly handle expressions such as "s/\ after a, i, and c commands). +Also, conditionally (on NO_INPUT_INDENT) added +experimental support for skipping leading whitespace on +each {a,i,c} input line. + +* Added addressing of the form: + /foo/,+5 p (print from foo to 5th line following) + /foo/,~5 p (print from foo to next line whose line number is a multiple of 5) +The first address of these can be any of the previously existing +addressing types; the +N and ~N forms are only allowed as the +second address of a range. + +* Added support for pseudo-address "0" as the first address in an +address-range, simplifying scripts which happen to match the end +address on the first line of input. For example, a script +which deletes all lines from the beginning of the file to the +first line which contains "foo" is now simply "sed 0,/foo/d", +whereas before one had to go through contortions to deal with +the possibility that "foo" might appear on the first line of +the input. + +* Made NUL characters in regexps work "correctly" --- i.e., a NUL +in a RE matches a NUL; it does not prematurely terminate the RE. +(This only works in -f scripts, as the POSIX.1 exec*() interface +only passes NUL-terminated strings, and so sed will only be able +to see up to the first NUL in any -e scriptlet.) + +* Wherever a `;' is accepted as a command terminator, also allow a `}' +or a `#' to appear. (This allows for less cluttered-looking scripts.) + +* Lots of internal changes that are only relevant to source junkies +and development testing. Some of which might cause imperceptible +performance improvements. + +---------------------------------------------------------------------------- +Sed 3.02 + +* Fixed a bug in the parsing of character classes (e.g., /[[:space:]]/). +Corrected an omission in djgpp/Makefile.am and an improper dependency +in testsuite/Makefile.am. + +---------------------------------------------------------------------------- +Sed 3.01 + +* This version of sed mainly contains bug fixes and portability +enhancements, plus performance enhancements related to sed's handling +of input files. Due to excess performance penalties, I have reverted +(relative to 3.00) to using regex.c instead of the rx package for +regular expression handling, at the expense of losing true POSIX.2 +BRE compatibility. However, performance related to regular expression +handling *still* needs a fair bit of work. + +* One new feature has been added: regular expressions may be followed +with an "I" directive ("i" was taken [the "i"nsert command]) to +indicate that the regexp should be matched in a case-insensitive +manner. Also of note are a new organization to the source code, +new documentation, and a new maintainer. + +---------------------------------------------------------------------------- +Sed 3.0 + +* This version of sed passes the new test-suite donated by +Jason Molenda. + +* Overall performance has been improved in the following sense: Sed 3.0 +is often slightly slower than sed 2.05. On a few scripts, though, sed +2.05 was so slow as to be nearly useless or to use up unreasonable +amounts of memory. These problems have been fixed and in such cases, +sed 3.0 should have acceptable performance. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README new file mode 100644 index 0000000..3da31c2 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README @@ -0,0 +1,13 @@ +This is the GNU implementation of sed, the Unix stream editor. + +See the NEWS file for a brief summary and the ChangeLog for +more detailed descriptions of changes. + +See the file INSTALL for generic compilation and installation +instructions. + +See the file BUGS for instructions about reporting bugs. + +The file README.boot gives instructions for making a "bootstrap" +version of sed on systems which lack any pre-existing and working +version of sed. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README-alpha b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README-alpha new file mode 100644 index 0000000..9235efe --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README-alpha @@ -0,0 +1,8 @@ +This is an alpha version of GNU sed. Please try it on a wide +range of scripts (especially configure scripts) and submit +bug reports to bonzini@gnu.org. + +Thanks, + +Paolo Bonzini +GNU sed maintainer diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README.boot b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README.boot new file mode 100644 index 0000000..fd2d1a0 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/README.boot @@ -0,0 +1,23 @@ +Because a working sed is a prerequisite for running the ``configure'' +script, I have provided the script ``bootstrap.sh'' which will attempt +to build a version of sed adequate for running ``configure''. If it +fails, edit the ``config.h'' file that was created according to the +comments found therein, and then try running ``bootstrap.sh'' again. + +The bootstrap build is quite likely to babble on and on with +various compiler warnings. You may want to tell bootstrap.sh +how to invoke your compiler with warnings disabled. For example, +with a Bourne-like shell and gcc one could use: + $ CC='gcc -w' sh bootstrap.sh +or with a csh-like shell, one could try: + % env CC='gcc -w' sh bootstrap.sh + +Once you get a working version of sed, temporarily install sed/sed +somewhere in your $PATH, and then really re-build the normal way +(starting with ``sh configure''); the bootstrap version is almost +certainly more crippled than it needs to be on your machine. + +I don't much care to hear about any bugs in ``bootstrap'' versions +of sed beyond those which actually keep the ``bootstrap'' version from +building, or sed's configure script from running properly. I am +especially uninterested in compiler warnings from the bootstrap build. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/THANKS b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/THANKS new file mode 100644 index 0000000..76397d2 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/THANKS @@ -0,0 +1,54 @@ +Akim Demaille +Alan Modra +Arnold Robbins +Andreas Schwab +Andrew Herbert +Bruno Haible +Chip Salzenberg +Chris Weber +Corinna Vinschen +Daniel R. Grayson +David Eckelkamp +David J. MacKenzie +David Schmidt +Dietrich Kappe +Doug McIlroy +Eero Hakkinen +Eli Zaretskii +Eric Pement +Erick Branderhorst +Francois Pinard +Gaumond Pierre +Greg Ubben +Isamu Hasegawa +J.T. Conklin +Jakub Jelinek +Jason Molenda +Jim Meyering +Laurent Vogel +Karl Berry +Karl Heuer +Kaveh R. Ghazi +Kevin Buettner +Maciej W. Rozycki +Mark Kettenis +Michael De La Rue +Michel de Ruiter +Paul Eggert +Robert A Bruce +Ronnie Glasscock +Sergey Farbotka +Simon Taylor +Stepan Kasal +Stephen Davis +Steve Ingram +Tapani Tarvainen +Timothy J Luoma +Tom R.Hageman +Ulrich Drepper +Vladimir Marek +Vladimir Volovich +Wichert Akkerman +Zhongxing Xu + +And the GNU translation teams. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/doc/sed.info b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/doc/sed.info new file mode 100644 index 0000000..5e1c9ae --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/doc/sed.info @@ -0,0 +1,2558 @@ +This is ../../doc/sed.info, produced by makeinfo version 4.12 from +../../doc//config.texi. + +INFO-DIR-SECTION Text creation and manipulation +START-INFO-DIR-ENTRY +* sed: (sed). Stream EDitor. + +END-INFO-DIR-ENTRY + + This file documents version 4.2.1 of GNU `sed', a stream editor. + + Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 Free Software +Foundation, Inc. + + This document is released under the terms of the GNU Free +Documentation License as published by the Free Software Foundation; +either version 1.1, or (at your option) any later version. + + You should have received a copy of the GNU Free Documentation +License along with GNU `sed'; see the file `COPYING.DOC'. If not, +write to the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02110-1301, USA. + + There are no Cover Texts and no Invariant Sections; this text, along +with its equivalent in the printed manual, constitutes the Title Page. + + +File: sed.info, Node: Top, Next: Introduction, Up: (dir) + +sed, a stream editor +******************** + +This file documents version 4.2.1 of GNU `sed', a stream editor. + + Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 Free Software +Foundation, Inc. + + This document is released under the terms of the GNU Free +Documentation License as published by the Free Software Foundation; +either version 1.1, or (at your option) any later version. + + You should have received a copy of the GNU Free Documentation +License along with GNU `sed'; see the file `COPYING.DOC'. If not, +write to the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02110-1301, USA. + + There are no Cover Texts and no Invariant Sections; this text, along +with its equivalent in the printed manual, constitutes the Title Page. + +* Menu: + +* Introduction:: Introduction +* Invoking sed:: Invocation +* sed Programs:: `sed' programs +* Examples:: Some sample scripts +* Limitations:: Limitations and (non-)limitations of GNU `sed' +* Other Resources:: Other resources for learning about `sed' +* Reporting Bugs:: Reporting bugs + +* Extended regexps:: `egrep'-style regular expressions + +* Concept Index:: A menu with all the topics in this manual. +* Command and Option Index:: A menu with all `sed' commands and + command-line options. + +--- The detailed node listing --- + +sed Programs: +* Execution Cycle:: How `sed' works +* Addresses:: Selecting lines with `sed' +* Regular Expressions:: Overview of regular expression syntax +* Common Commands:: Often used commands +* The "s" Command:: `sed''s Swiss Army Knife +* Other Commands:: Less frequently used commands +* Programming Commands:: Commands for `sed' gurus +* Extended Commands:: Commands specific of GNU `sed' +* Escapes:: Specifying special characters + +Examples: +* Centering lines:: +* Increment a number:: +* Rename files to lower case:: +* Print bash environment:: +* Reverse chars of lines:: +* tac:: Reverse lines of files +* cat -n:: Numbering lines +* cat -b:: Numbering non-blank lines +* wc -c:: Counting chars +* wc -w:: Counting words +* wc -l:: Counting lines +* head:: Printing the first lines +* tail:: Printing the last lines +* uniq:: Make duplicate lines unique +* uniq -d:: Print duplicated lines of input +* uniq -u:: Remove all duplicated lines +* cat -s:: Squeezing blank lines + + +File: sed.info, Node: Introduction, Next: Invoking sed, Prev: Top, Up: Top + +1 Introduction +************** + +`sed' is a stream editor. A stream editor is used to perform basic text +transformations on an input stream (a file or input from a pipeline). +While in some ways similar to an editor which permits scripted edits +(such as `ed'), `sed' works by making only one pass over the input(s), +and is consequently more efficient. But it is `sed''s ability to +filter text in a pipeline which particularly distinguishes it from +other types of editors. + + +File: sed.info, Node: Invoking sed, Next: sed Programs, Prev: Introduction, Up: Top + +2 Invocation +************ + +Normally `sed' is invoked like this: + + sed SCRIPT INPUTFILE... + + The full format for invoking `sed' is: + + sed OPTIONS... [SCRIPT] [INPUTFILE...] + + If you do not specify INPUTFILE, or if INPUTFILE is `-', `sed' +filters the contents of the standard input. The SCRIPT is actually the +first non-option parameter, which `sed' specially considers a script +and not an input file if (and only if) none of the other OPTIONS +specifies a script to be executed, that is if neither of the `-e' and +`-f' options is specified. + + `sed' may be invoked with the following command-line options: + +`--version' + Print out the version of `sed' that is being run and a copyright + notice, then exit. + +`--help' + Print a usage message briefly summarizing these command-line + options and the bug-reporting address, then exit. + +`-n' +`--quiet' +`--silent' + By default, `sed' prints out the pattern space at the end of each + cycle through the script (*note How `sed' works: Execution Cycle.). + These options disable this automatic printing, and `sed' only + produces output when explicitly told to via the `p' command. + +`-e SCRIPT' +`--expression=SCRIPT' + Add the commands in SCRIPT to the set of commands to be run while + processing the input. + +`-f SCRIPT-FILE' +`--file=SCRIPT-FILE' + Add the commands contained in the file SCRIPT-FILE to the set of + commands to be run while processing the input. + +`-i[SUFFIX]' +`--in-place[=SUFFIX]' + This option specifies that files are to be edited in-place. GNU + `sed' does this by creating a temporary file and sending output to + this file rather than to the standard output.(1). + + This option implies `-s'. + + When the end of the file is reached, the temporary file is renamed + to the output file's original name. The extension, if supplied, + is used to modify the name of the old file before renaming the + temporary file, thereby making a backup copy(2)). + + This rule is followed: if the extension doesn't contain a `*', + then it is appended to the end of the current filename as a + suffix; if the extension does contain one or more `*' characters, + then _each_ asterisk is replaced with the current filename. This + allows you to add a prefix to the backup file, instead of (or in + addition to) a suffix, or even to place backup copies of the + original files into another directory (provided the directory + already exists). + + If no extension is supplied, the original file is overwritten + without making a backup. + +`-l N' +`--line-length=N' + Specify the default line-wrap length for the `l' command. A + length of 0 (zero) means to never wrap long lines. If not + specified, it is taken to be 70. + +`--posix' + GNU `sed' includes several extensions to POSIX sed. In order to + simplify writing portable scripts, this option disables all the + extensions that this manual documents, including additional + commands. Most of the extensions accept `sed' programs that are + outside the syntax mandated by POSIX, but some of them (such as + the behavior of the `N' command described in *note Reporting + Bugs::) actually violate the standard. If you want to disable + only the latter kind of extension, you can set the + `POSIXLY_CORRECT' variable to a non-empty value. + +`-b' +`--binary' + This option is available on every platform, but is only effective + where the operating system makes a distinction between text files + and binary files. When such a distinction is made--as is the case + for MS-DOS, Windows, Cygwin--text files are composed of lines + separated by a carriage return _and_ a line feed character, and + `sed' does not see the ending CR. When this option is specified, + `sed' will open input files in binary mode, thus not requesting + this special processing and considering lines to end at a line + feed. + +`--follow-symlinks' + This option is available only on platforms that support symbolic + links and has an effect only if option `-i' is specified. In this + case, if the file that is specified on the command line is a + symbolic link, `sed' will follow the link and edit the ultimate + destination of the link. The default behavior is to break the + symbolic link, so that the link destination will not be modified. + +`-r' +`--regexp-extended' + Use extended regular expressions rather than basic regular + expressions. Extended regexps are those that `egrep' accepts; + they can be clearer because they usually have less backslashes, + but are a GNU extension and hence scripts that use them are not + portable. *Note Extended regular expressions: Extended regexps. + +`-s' +`--separate' + By default, `sed' will consider the files specified on the command + line as a single continuous long stream. This GNU `sed' extension + allows the user to consider them as separate files: range + addresses (such as `/abc/,/def/') are not allowed to span several + files, line numbers are relative to the start of each file, `$' + refers to the last line of each file, and files invoked from the + `R' commands are rewound at the start of each file. + +`-u' +`--unbuffered' + Buffer both input and output as minimally as practical. (This is + particularly useful if the input is coming from the likes of `tail + -f', and you wish to see the transformed output as soon as + possible.) + + + If no `-e', `-f', `--expression', or `--file' options are given on +the command-line, then the first non-option argument on the command +line is taken to be the SCRIPT to be executed. + + If any command-line parameters remain after processing the above, +these parameters are interpreted as the names of input files to be +processed. A file name of `-' refers to the standard input stream. +The standard input will be processed if no file names are specified. + + ---------- Footnotes ---------- + + (1) This applies to commands such as `=', `a', `c', `i', `l', `p'. +You can still write to the standard output by using the `w' or `W' +commands together with the `/dev/stdout' special file + + (2) Note that GNU `sed' creates the backup file whether or not any +output is actually changed. + + +File: sed.info, Node: sed Programs, Next: Examples, Prev: Invoking sed, Up: Top + +3 `sed' Programs +**************** + +A `sed' program consists of one or more `sed' commands, passed in by +one or more of the `-e', `-f', `--expression', and `--file' options, or +the first non-option argument if zero of these options are used. This +document will refer to "the" `sed' script; this is understood to mean +the in-order catenation of all of the SCRIPTs and SCRIPT-FILEs passed +in. + + Each `sed' command consists of an optional address or address range, +followed by a one-character command name and any additional +command-specific code. + +* Menu: + +* Execution Cycle:: How `sed' works +* Addresses:: Selecting lines with `sed' +* Regular Expressions:: Overview of regular expression syntax +* Common Commands:: Often used commands +* The "s" Command:: `sed''s Swiss Army Knife +* Other Commands:: Less frequently used commands +* Programming Commands:: Commands for `sed' gurus +* Extended Commands:: Commands specific of GNU `sed' +* Escapes:: Specifying special characters + + +File: sed.info, Node: Execution Cycle, Next: Addresses, Up: sed Programs + +3.1 How `sed' Works +=================== + +`sed' maintains two data buffers: the active _pattern_ space, and the +auxiliary _hold_ space. Both are initially empty. + + `sed' operates by performing the following cycle on each lines of +input: first, `sed' reads one line from the input stream, removes any +trailing newline, and places it in the pattern space. Then commands +are executed; each command can have an address associated to it: +addresses are a kind of condition code, and a command is only executed +if the condition is verified before the command is to be executed. + + When the end of the script is reached, unless the `-n' option is in +use, the contents of pattern space are printed out to the output +stream, adding back the trailing newline if it was removed.(1) Then the +next cycle starts for the next input line. + + Unless special commands (like `D') are used, the pattern space is +deleted between two cycles. The hold space, on the other hand, keeps +its data between cycles (see commands `h', `H', `x', `g', `G' to move +data between both buffers). + + ---------- Footnotes ---------- + + (1) Actually, if `sed' prints a line without the terminating +newline, it will nevertheless print the missing newline as soon as more +text is sent to the same output stream, which gives the "least expected +surprise" even though it does not make commands like `sed -n p' exactly +identical to `cat'. + + +File: sed.info, Node: Addresses, Next: Regular Expressions, Prev: Execution Cycle, Up: sed Programs + +3.2 Selecting lines with `sed' +============================== + +Addresses in a `sed' script can be in any of the following forms: +`NUMBER' + Specifying a line number will match only that line in the input. + (Note that `sed' counts lines continuously across all input files + unless `-i' or `-s' options are specified.) + +`FIRST~STEP' + This GNU extension matches every STEPth line starting with line + FIRST. In particular, lines will be selected when there exists a + non-negative N such that the current line-number equals FIRST + (N + * STEP). Thus, to select the odd-numbered lines, one would use + `1~2'; to pick every third line starting with the second, `2~3' + would be used; to pick every fifth line starting with the tenth, + use `10~5'; and `50~0' is just an obscure way of saying `50'. + +`$' + This address matches the last line of the last file of input, or + the last line of each file when the `-i' or `-s' options are + specified. + +`/REGEXP/' + This will select any line which matches the regular expression + REGEXP. If REGEXP itself includes any `/' characters, each must + be escaped by a backslash (`\'). + + The empty regular expression `//' repeats the last regular + expression match (the same holds if the empty regular expression is + passed to the `s' command). Note that modifiers to regular + expressions are evaluated when the regular expression is compiled, + thus it is invalid to specify them together with the empty regular + expression. + +`\%REGEXP%' + (The `%' may be replaced by any other single character.) + + This also matches the regular expression REGEXP, but allows one to + use a different delimiter than `/'. This is particularly useful + if the REGEXP itself contains a lot of slashes, since it avoids + the tedious escaping of every `/'. If REGEXP itself includes any + delimiter characters, each must be escaped by a backslash (`\'). + +`/REGEXP/I' +`\%REGEXP%I' + The `I' modifier to regular-expression matching is a GNU extension + which causes the REGEXP to be matched in a case-insensitive manner. + +`/REGEXP/M' +`\%REGEXP%M' + The `M' modifier to regular-expression matching is a GNU `sed' + extension which causes `^' and `$' to match respectively (in + addition to the normal behavior) the empty string after a newline, + and the empty string before a newline. There are special character + sequences (`\`' and `\'') which always match the beginning or the + end of the buffer. `M' stands for `multi-line'. + + + If no addresses are given, then all lines are matched; if one +address is given, then only lines matching that address are matched. + + An address range can be specified by specifying two addresses +separated by a comma (`,'). An address range matches lines starting +from where the first address matches, and continues until the second +address matches (inclusively). + + If the second address is a REGEXP, then checking for the ending +match will start with the line _following_ the line which matched the +first address: a range will always span at least two lines (except of +course if the input stream ends). + + If the second address is a NUMBER less than (or equal to) the line +matching the first address, then only the one line is matched. + + GNU `sed' also supports some special two-address forms; all these +are GNU extensions: +`0,/REGEXP/' + A line number of `0' can be used in an address specification like + `0,/REGEXP/' so that `sed' will try to match REGEXP in the first + input line too. In other words, `0,/REGEXP/' is similar to + `1,/REGEXP/', except that if ADDR2 matches the very first line of + input the `0,/REGEXP/' form will consider it to end the range, + whereas the `1,/REGEXP/' form will match the beginning of its + range and hence make the range span up to the _second_ occurrence + of the regular expression. + + Note that this is the only place where the `0' address makes + sense; there is no 0-th line and commands which are given the `0' + address in any other way will give an error. + +`ADDR1,+N' + Matches ADDR1 and the N lines following ADDR1. + +`ADDR1,~N' + Matches ADDR1 and the lines following ADDR1 until the next line + whose input line number is a multiple of N. + + Appending the `!' character to the end of an address specification +negates the sense of the match. That is, if the `!' character follows +an address range, then only lines which do _not_ match the address range +will be selected. This also works for singleton addresses, and, +perhaps perversely, for the null address. + + +File: sed.info, Node: Regular Expressions, Next: Common Commands, Prev: Addresses, Up: sed Programs + +3.3 Overview of Regular Expression Syntax +========================================= + +To know how to use `sed', people should understand regular expressions +("regexp" for short). A regular expression is a pattern that is +matched against a subject string from left to right. Most characters +are "ordinary": they stand for themselves in a pattern, and match the +corresponding characters in the subject. As a trivial example, the +pattern + + The quick brown fox + +matches a portion of a subject string that is identical to itself. The +power of regular expressions comes from the ability to include +alternatives and repetitions in the pattern. These are encoded in the +pattern by the use of "special characters", which do not stand for +themselves but instead are interpreted in some special way. Here is a +brief description of regular expression syntax as used in `sed'. + +`CHAR' + A single ordinary character matches itself. + +`*' + Matches a sequence of zero or more instances of matches for the + preceding regular expression, which must be an ordinary character, + a special character preceded by `\', a `.', a grouped regexp (see + below), or a bracket expression. As a GNU extension, a postfixed + regular expression can also be followed by `*'; for example, `a**' + is equivalent to `a*'. POSIX 1003.1-2001 says that `*' stands for + itself when it appears at the start of a regular expression or + subexpression, but many nonGNU implementations do not support this + and portable scripts should instead use `\*' in these contexts. + +`\+' + As `*', but matches one or more. It is a GNU extension. + +`\?' + As `*', but only matches zero or one. It is a GNU extension. + +`\{I\}' + As `*', but matches exactly I sequences (I is a decimal integer; + for portability, keep it between 0 and 255 inclusive). + +`\{I,J\}' + Matches between I and J, inclusive, sequences. + +`\{I,\}' + Matches more than or equal to I sequences. + +`\(REGEXP\)' + Groups the inner REGEXP as a whole, this is used to: + + * Apply postfix operators, like `\(abcd\)*': this will search + for zero or more whole sequences of `abcd', while `abcd*' + would search for `abc' followed by zero or more occurrences + of `d'. Note that support for `\(abcd\)*' is required by + POSIX 1003.1-2001, but many non-GNU implementations do not + support it and hence it is not universally portable. + + * Use back references (see below). + +`.' + Matches any character, including newline. + +`^' + Matches the null string at beginning of the pattern space, i.e. + what appears after the circumflex must appear at the beginning of + the pattern space. + + In most scripts, pattern space is initialized to the content of + each line (*note How `sed' works: Execution Cycle.). So, it is a + useful simplification to think of `^#include' as matching only + lines where `#include' is the first thing on line--if there are + spaces before, for example, the match fails. This simplification + is valid as long as the original content of pattern space is not + modified, for example with an `s' command. + + `^' acts as a special character only at the beginning of the + regular expression or subexpression (that is, after `\(' or `\|'). + Portable scripts should avoid `^' at the beginning of a + subexpression, though, as POSIX allows implementations that treat + `^' as an ordinary character in that context. + +`$' + It is the same as `^', but refers to end of pattern space. `$' + also acts as a special character only at the end of the regular + expression or subexpression (that is, before `\)' or `\|'), and + its use at the end of a subexpression is not portable. + +`[LIST]' +`[^LIST]' + Matches any single character in LIST: for example, `[aeiou]' + matches all vowels. A list may include sequences like + `CHAR1-CHAR2', which matches any character between (inclusive) + CHAR1 and CHAR2. + + A leading `^' reverses the meaning of LIST, so that it matches any + single character _not_ in LIST. To include `]' in the list, make + it the first character (after the `^' if needed), to include `-' + in the list, make it the first or last; to include `^' put it + after the first character. + + The characters `$', `*', `.', `[', and `\' are normally not + special within LIST. For example, `[\*]' matches either `\' or + `*', because the `\' is not special here. However, strings like + `[.ch.]', `[=a=]', and `[:space:]' are special within LIST and + represent collating symbols, equivalence classes, and character + classes, respectively, and `[' is therefore special within LIST + when it is followed by `.', `=', or `:'. Also, when not in + `POSIXLY_CORRECT' mode, special escapes like `\n' and `\t' are + recognized within LIST. *Note Escapes::. + +`REGEXP1\|REGEXP2' + Matches either REGEXP1 or REGEXP2. Use parentheses to use complex + alternative regular expressions. The matching process tries each + alternative in turn, from left to right, and the first one that + succeeds is used. It is a GNU extension. + +`REGEXP1REGEXP2' + Matches the concatenation of REGEXP1 and REGEXP2. Concatenation + binds more tightly than `\|', `^', and `$', but less tightly than + the other regular expression operators. + +`\DIGIT' + Matches the DIGIT-th `\(...\)' parenthesized subexpression in the + regular expression. This is called a "back reference". + Subexpressions are implicity numbered by counting occurrences of + `\(' left-to-right. + +`\n' + Matches the newline character. + +`\CHAR' + Matches CHAR, where CHAR is one of `$', `*', `.', `[', `\', or `^'. + Note that the only C-like backslash sequences that you can + portably assume to be interpreted are `\n' and `\\'; in particular + `\t' is not portable, and matches a `t' under most implementations + of `sed', rather than a tab character. + + + Note that the regular expression matcher is greedy, i.e., matches +are attempted from left to right and, if two or more matches are +possible starting at the same character, it selects the longest. + +Examples: +`abcdef' + Matches `abcdef'. + +`a*b' + Matches zero or more `a's followed by a single `b'. For example, + `b' or `aaaaab'. + +`a\?b' + Matches `b' or `ab'. + +`a\+b\+' + Matches one or more `a's followed by one or more `b's: `ab' is the + shortest possible match, but other examples are `aaaab' or + `abbbbb' or `aaaaaabbbbbbb'. + +`.*' +`.\+' + These two both match all the characters in a string; however, the + first matches every string (including the empty string), while the + second matches only strings containing at least one character. + +`^main.*(.*)' + his matches a string starting with `main', followed by an opening + and closing parenthesis. The `n', `(' and `)' need not be + adjacent. + +`^#' + This matches a string beginning with `#'. + +`\\$' + This matches a string ending with a single backslash. The regexp + contains two backslashes for escaping. + +`\$' + Instead, this matches a string consisting of a single dollar sign, + because it is escaped. + +`[a-zA-Z0-9]' + In the C locale, this matches any ASCII letters or digits. + +`[^ tab]\+' + (Here `tab' stands for a single tab character.) This matches a + string of one or more characters, none of which is a space or a + tab. Usually this means a word. + +`^\(.*\)\n\1$' + This matches a string consisting of two equal substrings separated + by a newline. + +`.\{9\}A$' + This matches nine characters followed by an `A'. + +`^.\{15\}A' + This matches the start of a string that contains 16 characters, + the last of which is an `A'. + + + +File: sed.info, Node: Common Commands, Next: The "s" Command, Prev: Regular Expressions, Up: sed Programs + +3.4 Often-Used Commands +======================= + +If you use `sed' at all, you will quite likely want to know these +commands. + +`#' + [No addresses allowed.] + + The `#' character begins a comment; the comment continues until + the next newline. + + If you are concerned about portability, be aware that some + implementations of `sed' (which are not POSIX conformant) may only + support a single one-line comment, and then only when the very + first character of the script is a `#'. + + Warning: if the first two characters of the `sed' script are `#n', + then the `-n' (no-autoprint) option is forced. If you want to put + a comment in the first line of your script and that comment begins + with the letter `n' and you do not want this behavior, then be + sure to either use a capital `N', or place at least one space + before the `n'. + +`q [EXIT-CODE]' + This command only accepts a single address. + + Exit `sed' without processing any more commands or input. Note + that the current pattern space is printed if auto-print is not + disabled with the `-n' options. The ability to return an exit + code from the `sed' script is a GNU `sed' extension. + +`d' + Delete the pattern space; immediately start next cycle. + +`p' + Print out the pattern space (to the standard output). This + command is usually only used in conjunction with the `-n' + command-line option. + +`n' + If auto-print is not disabled, print the pattern space, then, + regardless, replace the pattern space with the next line of input. + If there is no more input then `sed' exits without processing any + more commands. + +`{ COMMANDS }' + A group of commands may be enclosed between `{' and `}' characters. + This is particularly useful when you want a group of commands to + be triggered by a single address (or address-range) match. + + + +File: sed.info, Node: The "s" Command, Next: Other Commands, Prev: Common Commands, Up: sed Programs + +3.5 The `s' Command +=================== + +The syntax of the `s' (as in substitute) command is +`s/REGEXP/REPLACEMENT/FLAGS'. The `/' characters may be uniformly +replaced by any other single character within any given `s' command. +The `/' character (or whatever other character is used in its stead) +can appear in the REGEXP or REPLACEMENT only if it is preceded by a `\' +character. + + The `s' command is probably the most important in `sed' and has a +lot of different options. Its basic concept is simple: the `s' command +attempts to match the pattern space against the supplied REGEXP; if the +match is successful, then that portion of the pattern space which was +matched is replaced with REPLACEMENT. + + The REPLACEMENT can contain `\N' (N being a number from 1 to 9, +inclusive) references, which refer to the portion of the match which is +contained between the Nth `\(' and its matching `\)'. Also, the +REPLACEMENT can contain unescaped `&' characters which reference the +whole matched portion of the pattern space. Finally, as a GNU `sed' +extension, you can include a special sequence made of a backslash and +one of the letters `L', `l', `U', `u', or `E'. The meaning is as +follows: + +`\L' + Turn the replacement to lowercase until a `\U' or `\E' is found, + +`\l' + Turn the next character to lowercase, + +`\U' + Turn the replacement to uppercase until a `\L' or `\E' is found, + +`\u' + Turn the next character to uppercase, + +`\E' + Stop case conversion started by `\L' or `\U'. + + To include a literal `\', `&', or newline in the final replacement, +be sure to precede the desired `\', `&', or newline in the REPLACEMENT +with a `\'. + + The `s' command can be followed by zero or more of the following +FLAGS: + +`g' + Apply the replacement to _all_ matches to the REGEXP, not just the + first. + +`NUMBER' + Only replace the NUMBERth match of the REGEXP. + + Note: the POSIX standard does not specify what should happen when + you mix the `g' and NUMBER modifiers, and currently there is no + widely agreed upon meaning across `sed' implementations. For GNU + `sed', the interaction is defined to be: ignore matches before the + NUMBERth, and then match and replace all matches from the NUMBERth + on. + +`p' + If the substitution was made, then print the new pattern space. + + Note: when both the `p' and `e' options are specified, the + relative ordering of the two produces very different results. In + general, `ep' (evaluate then print) is what you want, but + operating the other way round can be useful for debugging. For + this reason, the current version of GNU `sed' interprets specially + the presence of `p' options both before and after `e', printing + the pattern space before and after evaluation, while in general + flags for the `s' command show their effect just once. This + behavior, although documented, might change in future versions. + +`w FILE-NAME' + If the substitution was made, then write out the result to the + named file. As a GNU `sed' extension, two special values of + FILE-NAME are supported: `/dev/stderr', which writes the result to + the standard error, and `/dev/stdout', which writes to the standard + output.(1) + +`e' + This command allows one to pipe input from a shell command into + pattern space. If a substitution was made, the command that is + found in pattern space is executed and pattern space is replaced + with its output. A trailing newline is suppressed; results are + undefined if the command to be executed contains a NUL character. + This is a GNU `sed' extension. + +`I' +`i' + The `I' modifier to regular-expression matching is a GNU extension + which makes `sed' match REGEXP in a case-insensitive manner. + +`M' +`m' + The `M' modifier to regular-expression matching is a GNU `sed' + extension which causes `^' and `$' to match respectively (in + addition to the normal behavior) the empty string after a newline, + and the empty string before a newline. There are special character + sequences (`\`' and `\'') which always match the beginning or the + end of the buffer. `M' stands for `multi-line'. + + + ---------- Footnotes ---------- + + (1) This is equivalent to `p' unless the `-i' option is being used. + + +File: sed.info, Node: Other Commands, Next: Programming Commands, Prev: The "s" Command, Up: sed Programs + +3.6 Less Frequently-Used Commands +================================= + +Though perhaps less frequently used than those in the previous section, +some very small yet useful `sed' scripts can be built with these +commands. + +`y/SOURCE-CHARS/DEST-CHARS/' + (The `/' characters may be uniformly replaced by any other single + character within any given `y' command.) + + Transliterate any characters in the pattern space which match any + of the SOURCE-CHARS with the corresponding character in DEST-CHARS. + + Instances of the `/' (or whatever other character is used in its + stead), `\', or newlines can appear in the SOURCE-CHARS or + DEST-CHARS lists, provide that each instance is escaped by a `\'. + The SOURCE-CHARS and DEST-CHARS lists _must_ contain the same + number of characters (after de-escaping). + +`a\' +`TEXT' + As a GNU extension, this command accepts two addresses. + + Queue the lines of text which follow this command (each but the + last ending with a `\', which are removed from the output) to be + output at the end of the current cycle, or when the next input + line is read. + + Escape sequences in TEXT are processed, so you should use `\\' in + TEXT to print a single backslash. + + As a GNU extension, if between the `a' and the newline there is + other than a whitespace-`\' sequence, then the text of this line, + starting at the first non-whitespace character after the `a', is + taken as the first line of the TEXT block. (This enables a + simplification in scripting a one-line add.) This extension also + works with the `i' and `c' commands. + +`i\' +`TEXT' + As a GNU extension, this command accepts two addresses. + + Immediately output the lines of text which follow this command + (each but the last ending with a `\', which are removed from the + output). + +`c\' +`TEXT' + Delete the lines matching the address or address-range, and output + the lines of text which follow this command (each but the last + ending with a `\', which are removed from the output) in place of + the last line (or in place of each line, if no addresses were + specified). A new cycle is started after this command is done, + since the pattern space will have been deleted. + +`=' + As a GNU extension, this command accepts two addresses. + + Print out the current input line number (with a trailing newline). + +`l N' + Print the pattern space in an unambiguous form: non-printable + characters (and the `\' character) are printed in C-style escaped + form; long lines are split, with a trailing `\' character to + indicate the split; the end of each line is marked with a `$'. + + N specifies the desired line-wrap length; a length of 0 (zero) + means to never wrap long lines. If omitted, the default as + specified on the command line is used. The N parameter is a GNU + `sed' extension. + +`r FILENAME' + As a GNU extension, this command accepts two addresses. + + Queue the contents of FILENAME to be read and inserted into the + output stream at the end of the current cycle, or when the next + input line is read. Note that if FILENAME cannot be read, it is + treated as if it were an empty file, without any error indication. + + As a GNU `sed' extension, the special value `/dev/stdin' is + supported for the file name, which reads the contents of the + standard input. + +`w FILENAME' + Write the pattern space to FILENAME. As a GNU `sed' extension, + two special values of FILE-NAME are supported: `/dev/stderr', + which writes the result to the standard error, and `/dev/stdout', + which writes to the standard output.(1) + + The file will be created (or truncated) before the first input + line is read; all `w' commands (including instances of `w' flag on + successful `s' commands) which refer to the same FILENAME are + output without closing and reopening the file. + +`D' + Delete text in the pattern space up to the first newline. If any + text is left, restart cycle with the resultant pattern space + (without reading a new line of input), otherwise start a normal + new cycle. + +`N' + Add a newline to the pattern space, then append the next line of + input to the pattern space. If there is no more input then `sed' + exits without processing any more commands. + +`P' + Print out the portion of the pattern space up to the first newline. + +`h' + Replace the contents of the hold space with the contents of the + pattern space. + +`H' + Append a newline to the contents of the hold space, and then + append the contents of the pattern space to that of the hold space. + +`g' + Replace the contents of the pattern space with the contents of the + hold space. + +`G' + Append a newline to the contents of the pattern space, and then + append the contents of the hold space to that of the pattern space. + +`x' + Exchange the contents of the hold and pattern spaces. + + + ---------- Footnotes ---------- + + (1) This is equivalent to `p' unless the `-i' option is being used. + + +File: sed.info, Node: Programming Commands, Next: Extended Commands, Prev: Other Commands, Up: sed Programs + +3.7 Commands for `sed' gurus +============================ + +In most cases, use of these commands indicates that you are probably +better off programming in something like `awk' or Perl. But +occasionally one is committed to sticking with `sed', and these +commands can enable one to write quite convoluted scripts. + +`: LABEL' + [No addresses allowed.] + + Specify the location of LABEL for branch commands. In all other + respects, a no-op. + +`b LABEL' + Unconditionally branch to LABEL. The LABEL may be omitted, in + which case the next cycle is started. + +`t LABEL' + Branch to LABEL only if there has been a successful `s'ubstitution + since the last input line was read or conditional branch was taken. + The LABEL may be omitted, in which case the next cycle is started. + + + +File: sed.info, Node: Extended Commands, Next: Escapes, Prev: Programming Commands, Up: sed Programs + +3.8 Commands Specific to GNU `sed' +================================== + +These commands are specific to GNU `sed', so you must use them with +care and only when you are sure that hindering portability is not evil. +They allow you to check for GNU `sed' extensions or to do tasks that +are required quite often, yet are unsupported by standard `sed's. + +`e [COMMAND]' + This command allows one to pipe input from a shell command into + pattern space. Without parameters, the `e' command executes the + command that is found in pattern space and replaces the pattern + space with the output; a trailing newline is suppressed. + + If a parameter is specified, instead, the `e' command interprets + it as a command and sends its output to the output stream (like + `r' does). The command can run across multiple lines, all but the + last ending with a back-slash. + + In both cases, the results are undefined if the command to be + executed contains a NUL character. + +`L N' + This GNU `sed' extension fills and joins lines in pattern space to + produce output lines of (at most) N characters, like `fmt' does; + if N is omitted, the default as specified on the command line is + used. This command is considered a failed experiment and unless + there is enough request (which seems unlikely) will be removed in + future versions. + +`Q [EXIT-CODE]' + This command only accepts a single address. + + This command is the same as `q', but will not print the contents + of pattern space. Like `q', it provides the ability to return an + exit code to the caller. + + This command can be useful because the only alternative ways to + accomplish this apparently trivial function are to use the `-n' + option (which can unnecessarily complicate your script) or + resorting to the following snippet, which wastes time by reading + the whole file without any visible effect: + + :eat + $d Quit silently on the last line + N Read another line, silently + g Overwrite pattern space each time to save memory + b eat + +`R FILENAME' + Queue a line of FILENAME to be read and inserted into the output + stream at the end of the current cycle, or when the next input + line is read. Note that if FILENAME cannot be read, or if its end + is reached, no line is appended, without any error indication. + + As with the `r' command, the special value `/dev/stdin' is + supported for the file name, which reads a line from the standard + input. + +`T LABEL' + Branch to LABEL only if there have been no successful + `s'ubstitutions since the last input line was read or conditional + branch was taken. The LABEL may be omitted, in which case the next + cycle is started. + +`v VERSION' + This command does nothing, but makes `sed' fail if GNU `sed' + extensions are not supported, simply because other versions of + `sed' do not implement it. In addition, you can specify the + version of `sed' that your script requires, such as `4.0.5'. The + default is `4.0' because that is the first version that + implemented this command. + + This command enables all GNU extensions even if `POSIXLY_CORRECT' + is set in the environment. + +`W FILENAME' + Write to the given filename the portion of the pattern space up to + the first newline. Everything said under the `w' command about + file handling holds here too. + +`z' + This command empties the content of pattern space. It is usually + the same as `s/.*//', but is more efficient and works in the + presence of invalid multibyte sequences in the input stream. + POSIX mandates that such sequences are _not_ matched by `.', so + that there is no portable way to clear `sed''s buffers in the + middle of the script in most multibyte locales (including UTF-8 + locales). + + +File: sed.info, Node: Escapes, Prev: Extended Commands, Up: sed Programs + +3.9 GNU Extensions for Escapes in Regular Expressions +===================================================== + +Until this chapter, we have only encountered escapes of the form `\^', +which tell `sed' not to interpret the circumflex as a special +character, but rather to take it literally. For example, `\*' matches +a single asterisk rather than zero or more backslashes. + + This chapter introduces another kind of escape(1)--that is, escapes +that are applied to a character or sequence of characters that +ordinarily are taken literally, and that `sed' replaces with a special +character. This provides a way of encoding non-printable characters in +patterns in a visible manner. There is no restriction on the +appearance of non-printing characters in a `sed' script but when a +script is being prepared in the shell or by text editing, it is usually +easier to use one of the following escape sequences than the binary +character it represents: + + The list of these escapes is: + +`\a' + Produces or matches a BEL character, that is an "alert" (ASCII 7). + +`\f' + Produces or matches a form feed (ASCII 12). + +`\n' + Produces or matches a newline (ASCII 10). + +`\r' + Produces or matches a carriage return (ASCII 13). + +`\t' + Produces or matches a horizontal tab (ASCII 9). + +`\v' + Produces or matches a so called "vertical tab" (ASCII 11). + +`\cX' + Produces or matches `CONTROL-X', where X is any character. The + precise effect of `\cX' is as follows: if X is a lower case + letter, it is converted to upper case. Then bit 6 of the + character (hex 40) is inverted. Thus `\cz' becomes hex 1A, but + `\c{' becomes hex 3B, while `\c;' becomes hex 7B. + +`\dXXX' + Produces or matches a character whose decimal ASCII value is XXX. + +`\oXXX' + Produces or matches a character whose octal ASCII value is XXX. + +`\xXX' + Produces or matches a character whose hexadecimal ASCII value is + XX. + + `\b' (backspace) was omitted because of the conflict with the +existing "word boundary" meaning. + + Other escapes match a particular character class and are valid only +in regular expressions: + +`\w' + Matches any "word" character. A "word" character is any letter or + digit or the underscore character. + +`\W' + Matches any "non-word" character. + +`\b' + Matches a word boundary; that is it matches if the character to + the left is a "word" character and the character to the right is a + "non-word" character, or vice-versa. + +`\B' + Matches everywhere but on a word boundary; that is it matches if + the character to the left and the character to the right are + either both "word" characters or both "non-word" characters. + +`\`' + Matches only at the start of pattern space. This is different + from `^' in multi-line mode. + +`\'' + Matches only at the end of pattern space. This is different from + `$' in multi-line mode. + + + ---------- Footnotes ---------- + + (1) All the escapes introduced here are GNU extensions, with the +exception of `\n'. In basic regular expression mode, setting +`POSIXLY_CORRECT' disables them inside bracket expressions. + + +File: sed.info, Node: Examples, Next: Limitations, Prev: sed Programs, Up: Top + +4 Some Sample Scripts +********************* + +Here are some `sed' scripts to guide you in the art of mastering `sed'. + +* Menu: + +Some exotic examples: +* Centering lines:: +* Increment a number:: +* Rename files to lower case:: +* Print bash environment:: +* Reverse chars of lines:: + +Emulating standard utilities: +* tac:: Reverse lines of files +* cat -n:: Numbering lines +* cat -b:: Numbering non-blank lines +* wc -c:: Counting chars +* wc -w:: Counting words +* wc -l:: Counting lines +* head:: Printing the first lines +* tail:: Printing the last lines +* uniq:: Make duplicate lines unique +* uniq -d:: Print duplicated lines of input +* uniq -u:: Remove all duplicated lines +* cat -s:: Squeezing blank lines + + +File: sed.info, Node: Centering lines, Next: Increment a number, Up: Examples + +4.1 Centering Lines +=================== + +This script centers all lines of a file on a 80 columns width. To +change that width, the number in `\{...\}' must be replaced, and the +number of added spaces also must be changed. + + Note how the buffer commands are used to separate parts in the +regular expressions to be matched--this is a common technique. + + #!/usr/bin/sed -f + + # Put 80 spaces in the buffer + 1 { + x + s/^$/ / + s/^.*$/&&&&&&&&/ + x + } + + # del leading and trailing spaces + y/tab/ / + s/^ *// + s/ *$// + + # add a newline and 80 spaces to end of line + G + + # keep first 81 chars (80 + a newline) + s/^\(.\{81\}\).*$/\1/ + + # \2 matches half of the spaces, which are moved to the beginning + s/^\(.*\)\n\(.*\)\2/\2\1/ + + +File: sed.info, Node: Increment a number, Next: Rename files to lower case, Prev: Centering lines, Up: Examples + +4.2 Increment a Number +====================== + +This script is one of a few that demonstrate how to do arithmetic in +`sed'. This is indeed possible,(1) but must be done manually. + + To increment one number you just add 1 to last digit, replacing it +by the following digit. There is one exception: when the digit is a +nine the previous digits must be also incremented until you don't have +a nine. + + This solution by Bruno Haible is very clever and smart because it +uses a single buffer; if you don't have this limitation, the algorithm +used in *note Numbering lines: cat -n, is faster. It works by +replacing trailing nines with an underscore, then using multiple `s' +commands to increment the last digit, and then again substituting +underscores with zeros. + + #!/usr/bin/sed -f + + /[^0-9]/ d + + # replace all leading 9s by _ (any other character except digits, could + # be used) + :d + s/9\(_*\)$/_\1/ + td + + # incr last digit only. The first line adds a most-significant + # digit of 1 if we have to add a digit. + # + # The `tn' commands are not necessary, but make the thing + # faster + + s/^\(_*\)$/1\1/; tn + s/8\(_*\)$/9\1/; tn + s/7\(_*\)$/8\1/; tn + s/6\(_*\)$/7\1/; tn + s/5\(_*\)$/6\1/; tn + s/4\(_*\)$/5\1/; tn + s/3\(_*\)$/4\1/; tn + s/2\(_*\)$/3\1/; tn + s/1\(_*\)$/2\1/; tn + s/0\(_*\)$/1\1/; tn + + :n + y/_/0/ + + ---------- Footnotes ---------- + + (1) `sed' guru Greg Ubben wrote an implementation of the `dc' RPN +calculator! It is distributed together with sed. + + +File: sed.info, Node: Rename files to lower case, Next: Print bash environment, Prev: Increment a number, Up: Examples + +4.3 Rename Files to Lower Case +============================== + +This is a pretty strange use of `sed'. We transform text, and +transform it to be shell commands, then just feed them to shell. Don't +worry, even worse hacks are done when using `sed'; I have seen a script +converting the output of `date' into a `bc' program! + + The main body of this is the `sed' script, which remaps the name +from lower to upper (or vice-versa) and even checks out if the remapped +name is the same as the original name. Note how the script is +parameterized using shell variables and proper quoting. + + #! /bin/sh + # rename files to lower/upper case... + # + # usage: + # move-to-lower * + # move-to-upper * + # or + # move-to-lower -R . + # move-to-upper -R . + # + + help() + { + cat << eof + Usage: $0 [-n] [-r] [-h] files... + + -n do nothing, only see what would be done + -R recursive (use find) + -h this message + files files to remap to lower case + + Examples: + $0 -n * (see if everything is ok, then...) + $0 * + + $0 -R . + + eof + } + + apply_cmd='sh' + finder='echo "$@" | tr " " "\n"' + files_only= + + while : + do + case "$1" in + -n) apply_cmd='cat' ;; + -R) finder='find "$@" -type f';; + -h) help ; exit 1 ;; + *) break ;; + esac + shift + done + + if [ -z "$1" ]; then + echo Usage: $0 [-h] [-n] [-r] files... + exit 1 + fi + + LOWER='abcdefghijklmnopqrstuvwxyz' + UPPER='ABCDEFGHIJKLMNOPQRSTUVWXYZ' + + case `basename $0` in + *upper*) TO=$UPPER; FROM=$LOWER ;; + *) FROM=$UPPER; TO=$LOWER ;; + esac + + eval $finder | sed -n ' + + # remove all trailing slashes + s/\/*$// + + # add ./ if there is no path, only a filename + /\//! s/^/.\// + + # save path+filename + h + + # remove path + s/.*\/// + + # do conversion only on filename + y/'$FROM'/'$TO'/ + + # now line contains original path+file, while + # hold space contains the new filename + x + + # add converted file name to line, which now contains + # path/file-name\nconverted-file-name + G + + # check if converted file name is equal to original file name, + # if it is, do not print nothing + /^.*\/\(.*\)\n\1/b + + # now, transform path/fromfile\n, into + # mv path/fromfile path/tofile and print it + s/^\(.*\/\)\(.*\)\n\(.*\)$/mv "\1\2" "\1\3"/p + + ' | $apply_cmd + + +File: sed.info, Node: Print bash environment, Next: Reverse chars of lines, Prev: Rename files to lower case, Up: Examples + +4.4 Print `bash' Environment +============================ + +This script strips the definition of the shell functions from the +output of the `set' Bourne-shell command. + + #!/bin/sh + + set | sed -n ' + :x + + # if no occurrence of "=()" print and load next line + /=()/! { p; b; } + / () $/! { p; b; } + + # possible start of functions section + # save the line in case this is a var like FOO="() " + h + + # if the next line has a brace, we quit because + # nothing comes after functions + n + /^{/ q + + # print the old line + x; p + + # work on the new line now + x; bx + ' + + +File: sed.info, Node: Reverse chars of lines, Next: tac, Prev: Print bash environment, Up: Examples + +4.5 Reverse Characters of Lines +=============================== + +This script can be used to reverse the position of characters in lines. +The technique moves two characters at a time, hence it is faster than +more intuitive implementations. + + Note the `tx' command before the definition of the label. This is +often needed to reset the flag that is tested by the `t' command. + + Imaginative readers will find uses for this script. An example is +reversing the output of `banner'.(1) + + #!/usr/bin/sed -f + + /../! b + + # Reverse a line. Begin embedding the line between two newlines + s/^.*$/\ + &\ + / + + # Move first character at the end. The regexp matches until + # there are zero or one characters between the markers + tx + :x + s/\(\n.\)\(.*\)\(.\n\)/\3\2\1/ + tx + + # Remove the newline markers + s/\n//g + + ---------- Footnotes ---------- + + (1) This requires another script to pad the output of banner; for +example + + #! /bin/sh + + banner -w $1 $2 $3 $4 | + sed -e :a -e '/^.\{0,'$1'\}$/ { s/$/ /; ba; }' | + ~/sedscripts/reverseline.sed + + +File: sed.info, Node: tac, Next: cat -n, Prev: Reverse chars of lines, Up: Examples + +4.6 Reverse Lines of Files +========================== + +This one begins a series of totally useless (yet interesting) scripts +emulating various Unix commands. This, in particular, is a `tac' +workalike. + + Note that on implementations other than GNU `sed' this script might +easily overflow internal buffers. + + #!/usr/bin/sed -nf + + # reverse all lines of input, i.e. first line became last, ... + + # from the second line, the buffer (which contains all previous lines) + # is *appended* to current line, so, the order will be reversed + 1! G + + # on the last line we're done -- print everything + $ p + + # store everything on the buffer again + h + + +File: sed.info, Node: cat -n, Next: cat -b, Prev: tac, Up: Examples + +4.7 Numbering Lines +=================== + +This script replaces `cat -n'; in fact it formats its output exactly +like GNU `cat' does. + + Of course this is completely useless and for two reasons: first, +because somebody else did it in C, second, because the following +Bourne-shell script could be used for the same purpose and would be +much faster: + + #! /bin/sh + sed -e "=" $@ | sed -e ' + s/^/ / + N + s/^ *\(......\)\n/\1 / + ' + + It uses `sed' to print the line number, then groups lines two by two +using `N'. Of course, this script does not teach as much as the one +presented below. + + The algorithm used for incrementing uses both buffers, so the line +is printed as soon as possible and then discarded. The number is split +so that changing digits go in a buffer and unchanged ones go in the +other; the changed digits are modified in a single step (using a `y' +command). The line number for the next line is then composed and +stored in the hold space, to be used in the next iteration. + + #!/usr/bin/sed -nf + + # Prime the pump on the first line + x + /^$/ s/^.*$/1/ + + # Add the correct line number before the pattern + G + h + + # Format it and print it + s/^/ / + s/^ *\(......\)\n/\1 /p + + # Get the line number from hold space; add a zero + # if we're going to add a digit on the next line + g + s/\n.*$// + /^9*$/ s/^/0/ + + # separate changing/unchanged digits with an x + s/.9*$/x&/ + + # keep changing digits in hold space + h + s/^.*x// + y/0123456789/1234567890/ + x + + # keep unchanged digits in pattern space + s/x.*$// + + # compose the new number, remove the newline implicitly added by G + G + s/\n// + h + + +File: sed.info, Node: cat -b, Next: wc -c, Prev: cat -n, Up: Examples + +4.8 Numbering Non-blank Lines +============================= + +Emulating `cat -b' is almost the same as `cat -n'--we only have to +select which lines are to be numbered and which are not. + + The part that is common to this script and the previous one is not +commented to show how important it is to comment `sed' scripts +properly... + + #!/usr/bin/sed -nf + + /^$/ { + p + b + } + + # Same as cat -n from now + x + /^$/ s/^.*$/1/ + G + h + s/^/ / + s/^ *\(......\)\n/\1 /p + x + s/\n.*$// + /^9*$/ s/^/0/ + s/.9*$/x&/ + h + s/^.*x// + y/0123456789/1234567890/ + x + s/x.*$// + G + s/\n// + h + + +File: sed.info, Node: wc -c, Next: wc -w, Prev: cat -b, Up: Examples + +4.9 Counting Characters +======================= + +This script shows another way to do arithmetic with `sed'. In this +case we have to add possibly large numbers, so implementing this by +successive increments would not be feasible (and possibly even more +complicated to contrive than this script). + + The approach is to map numbers to letters, kind of an abacus +implemented with `sed'. `a's are units, `b's are tens and so on: we +simply add the number of characters on the current line as units, and +then propagate the carry to tens, hundreds, and so on. + + As usual, running totals are kept in hold space. + + On the last line, we convert the abacus form back to decimal. For +the sake of variety, this is done with a loop rather than with some 80 +`s' commands(1): first we convert units, removing `a's from the number; +then we rotate letters so that tens become `a's, and so on until no +more letters remain. + + #!/usr/bin/sed -nf + + # Add n+1 a's to hold space (+1 is for the newline) + s/./a/g + H + x + s/\n/a/ + + # Do the carry. The t's and b's are not necessary, + # but they do speed up the thing + t a + : a; s/aaaaaaaaaa/b/g; t b; b done + : b; s/bbbbbbbbbb/c/g; t c; b done + : c; s/cccccccccc/d/g; t d; b done + : d; s/dddddddddd/e/g; t e; b done + : e; s/eeeeeeeeee/f/g; t f; b done + : f; s/ffffffffff/g/g; t g; b done + : g; s/gggggggggg/h/g; t h; b done + : h; s/hhhhhhhhhh//g + + : done + $! { + h + b + } + + # On the last line, convert back to decimal + + : loop + /a/! s/[b-h]*/&0/ + s/aaaaaaaaa/9/ + s/aaaaaaaa/8/ + s/aaaaaaa/7/ + s/aaaaaa/6/ + s/aaaaa/5/ + s/aaaa/4/ + s/aaa/3/ + s/aa/2/ + s/a/1/ + + : next + y/bcdefgh/abcdefg/ + /[a-h]/ b loop + p + + ---------- Footnotes ---------- + + (1) Some implementations have a limit of 199 commands per script + + +File: sed.info, Node: wc -w, Next: wc -l, Prev: wc -c, Up: Examples + +4.10 Counting Words +=================== + +This script is almost the same as the previous one, once each of the +words on the line is converted to a single `a' (in the previous script +each letter was changed to an `a'). + + It is interesting that real `wc' programs have optimized loops for +`wc -c', so they are much slower at counting words rather than +characters. This script's bottleneck, instead, is arithmetic, and +hence the word-counting one is faster (it has to manage smaller +numbers). + + Again, the common parts are not commented to show the importance of +commenting `sed' scripts. + + #!/usr/bin/sed -nf + + # Convert words to a's + s/[ tab][ tab]*/ /g + s/^/ / + s/ [^ ][^ ]*/a /g + s/ //g + + # Append them to hold space + H + x + s/\n// + + # From here on it is the same as in wc -c. + /aaaaaaaaaa/! bx; s/aaaaaaaaaa/b/g + /bbbbbbbbbb/! bx; s/bbbbbbbbbb/c/g + /cccccccccc/! bx; s/cccccccccc/d/g + /dddddddddd/! bx; s/dddddddddd/e/g + /eeeeeeeeee/! bx; s/eeeeeeeeee/f/g + /ffffffffff/! bx; s/ffffffffff/g/g + /gggggggggg/! bx; s/gggggggggg/h/g + s/hhhhhhhhhh//g + :x + $! { h; b; } + :y + /a/! s/[b-h]*/&0/ + s/aaaaaaaaa/9/ + s/aaaaaaaa/8/ + s/aaaaaaa/7/ + s/aaaaaa/6/ + s/aaaaa/5/ + s/aaaa/4/ + s/aaa/3/ + s/aa/2/ + s/a/1/ + y/bcdefgh/abcdefg/ + /[a-h]/ by + p + + +File: sed.info, Node: wc -l, Next: head, Prev: wc -w, Up: Examples + +4.11 Counting Lines +=================== + +No strange things are done now, because `sed' gives us `wc -l' +functionality for free!!! Look: + + #!/usr/bin/sed -nf + $= + + +File: sed.info, Node: head, Next: tail, Prev: wc -l, Up: Examples + +4.12 Printing the First Lines +============================= + +This script is probably the simplest useful `sed' script. It displays +the first 10 lines of input; the number of displayed lines is right +before the `q' command. + + #!/usr/bin/sed -f + 10q + + +File: sed.info, Node: tail, Next: uniq, Prev: head, Up: Examples + +4.13 Printing the Last Lines +============================ + +Printing the last N lines rather than the first is more complex but +indeed possible. N is encoded in the second line, before the bang +character. + + This script is similar to the `tac' script in that it keeps the +final output in the hold space and prints it at the end: + + #!/usr/bin/sed -nf + + 1! {; H; g; } + 1,10 !s/[^\n]*\n// + $p + h + + Mainly, the scripts keeps a window of 10 lines and slides it by +adding a line and deleting the oldest (the substitution command on the +second line works like a `D' command but does not restart the loop). + + The "sliding window" technique is a very powerful way to write +efficient and complex `sed' scripts, because commands like `P' would +require a lot of work if implemented manually. + + To introduce the technique, which is fully demonstrated in the rest +of this chapter and is based on the `N', `P' and `D' commands, here is +an implementation of `tail' using a simple "sliding window." + + This looks complicated but in fact the working is the same as the +last script: after we have kicked in the appropriate number of lines, +however, we stop using the hold space to keep inter-line state, and +instead use `N' and `D' to slide pattern space by one line: + + #!/usr/bin/sed -f + + 1h + 2,10 {; H; g; } + $q + 1,9d + N + D + + Note how the first, second and fourth line are inactive after the +first ten lines of input. After that, all the script does is: exiting +on the last line of input, appending the next input line to pattern +space, and removing the first line. + + +File: sed.info, Node: uniq, Next: uniq -d, Prev: tail, Up: Examples + +4.14 Make Duplicate Lines Unique +================================ + +This is an example of the art of using the `N', `P' and `D' commands, +probably the most difficult to master. + + #!/usr/bin/sed -f + h + + :b + # On the last line, print and exit + $b + N + /^\(.*\)\n\1$/ { + # The two lines are identical. Undo the effect of + # the n command. + g + bb + } + + # If the `N' command had added the last line, print and exit + $b + + # The lines are different; print the first and go + # back working on the second. + P + D + + As you can see, we mantain a 2-line window using `P' and `D'. This +technique is often used in advanced `sed' scripts. + + +File: sed.info, Node: uniq -d, Next: uniq -u, Prev: uniq, Up: Examples + +4.15 Print Duplicated Lines of Input +==================================== + +This script prints only duplicated lines, like `uniq -d'. + + #!/usr/bin/sed -nf + + $b + N + /^\(.*\)\n\1$/ { + # Print the first of the duplicated lines + s/.*\n// + p + + # Loop until we get a different line + :b + $b + N + /^\(.*\)\n\1$/ { + s/.*\n// + bb + } + } + + # The last line cannot be followed by duplicates + $b + + # Found a different one. Leave it alone in the pattern space + # and go back to the top, hunting its duplicates + D + + +File: sed.info, Node: uniq -u, Next: cat -s, Prev: uniq -d, Up: Examples + +4.16 Remove All Duplicated Lines +================================ + +This script prints only unique lines, like `uniq -u'. + + #!/usr/bin/sed -f + + # Search for a duplicate line --- until that, print what you find. + $b + N + /^\(.*\)\n\1$/ ! { + P + D + } + + :c + # Got two equal lines in pattern space. At the + # end of the file we simply exit + $d + + # Else, we keep reading lines with `N' until we + # find a different one + s/.*\n// + N + /^\(.*\)\n\1$/ { + bc + } + + # Remove the last instance of the duplicate line + # and go back to the top + D + + +File: sed.info, Node: cat -s, Prev: uniq -u, Up: Examples + +4.17 Squeezing Blank Lines +========================== + +As a final example, here are three scripts, of increasing complexity +and speed, that implement the same function as `cat -s', that is +squeezing blank lines. + + The first leaves a blank line at the beginning and end if there are +some already. + + #!/usr/bin/sed -f + + # on empty lines, join with next + # Note there is a star in the regexp + :x + /^\n*$/ { + N + bx + } + + # now, squeeze all '\n', this can be also done by: + # s/^\(\n\)*/\1/ + s/\n*/\ + / + + This one is a bit more complex and removes all empty lines at the +beginning. It does leave a single blank line at end if one was there. + + #!/usr/bin/sed -f + + # delete all leading empty lines + 1,/^./{ + /./!d + } + + # on an empty line we remove it and all the following + # empty lines, but one + :x + /./!{ + N + s/^\n$// + tx + } + + This removes leading and trailing blank lines. It is also the +fastest. Note that loops are completely done with `n' and `b', without +relying on `sed' to restart the the script automatically at the end of +a line. + + #!/usr/bin/sed -nf + + # delete all (leading) blanks + /./!d + + # get here: so there is a non empty + :x + # print it + p + # get next + n + # got chars? print it again, etc... + /./bx + + # no, don't have chars: got an empty line + :z + # get next, if last line we finish here so no trailing + # empty lines are written + n + # also empty? then ignore it, and get next... this will + # remove ALL empty lines + /./!bz + + # all empty lines were deleted/ignored, but we have a non empty. As + # what we want to do is to squeeze, insert a blank line artificially + i\ + + bx + + +File: sed.info, Node: Limitations, Next: Other Resources, Prev: Examples, Up: Top + +5 GNU `sed''s Limitations and Non-limitations +********************************************* + +For those who want to write portable `sed' scripts, be aware that some +implementations have been known to limit line lengths (for the pattern +and hold spaces) to be no more than 4000 bytes. The POSIX standard +specifies that conforming `sed' implementations shall support at least +8192 byte line lengths. GNU `sed' has no built-in limit on line length; +as long as it can `malloc()' more (virtual) memory, you can feed or +construct lines as long as you like. + + However, recursion is used to handle subpatterns and indefinite +repetition. This means that the available stack space may limit the +size of the buffer that can be processed by certain patterns. + + +File: sed.info, Node: Other Resources, Next: Reporting Bugs, Prev: Limitations, Up: Top + +6 Other Resources for Learning About `sed' +****************************************** + +In addition to several books that have been written about `sed' (either +specifically or as chapters in books which discuss shell programming), +one can find out more about `sed' (including suggestions of a few +books) from the FAQ for the `sed-users' mailing list, available from: + `http://sed.sourceforge.net/sedfaq.html' + + Also of interest are +`http://www.student.northpark.edu/pemente/sed/index.htm' and +`http://sed.sf.net/grabbag', which include `sed' tutorials and other +`sed'-related goodies. + + The `sed-users' mailing list itself maintained by Sven Guckes. To +subscribe, visit `http://groups.yahoo.com' and search for the +`sed-users' mailing list. + + +File: sed.info, Node: Reporting Bugs, Next: Extended regexps, Prev: Other Resources, Up: Top + +7 Reporting Bugs +**************** + +Email bug reports to . Be sure to include the word +"sed" somewhere in the `Subject:' field. Also, please include the +output of `sed --version' in the body of your report if at all possible. + + Please do not send a bug report like this: + + while building frobme-1.3.4 + $ configure + error--> sed: file sedscr line 1: Unknown option to 's' + + If GNU `sed' doesn't configure your favorite package, take a few +extra minutes to identify the specific problem and make a stand-alone +test case. Unlike other programs such as C compilers, making such test +cases for `sed' is quite simple. + + A stand-alone test case includes all the data necessary to perform +the test, and the specific invocation of `sed' that causes the problem. +The smaller a stand-alone test case is, the better. A test case should +not involve something as far removed from `sed' as "try to configure +frobme-1.3.4". Yes, that is in principle enough information to look +for the bug, but that is not a very practical prospect. + + Here are a few commonly reported bugs that are not bugs. + +`N' command on the last line + Most versions of `sed' exit without printing anything when the `N' + command is issued on the last line of a file. GNU `sed' prints + pattern space before exiting unless of course the `-n' command + switch has been specified. This choice is by design. + + For example, the behavior of + sed N foo bar + would depend on whether foo has an even or an odd number of + lines(1). Or, when writing a script to read the next few lines + following a pattern match, traditional implementations of `sed' + would force you to write something like + /foo/{ $!N; $!N; $!N; $!N; $!N; $!N; $!N; $!N; $!N } + instead of just + /foo/{ N;N;N;N;N;N;N;N;N; } + + In any case, the simplest workaround is to use `$d;N' in scripts + that rely on the traditional behavior, or to set the + `POSIXLY_CORRECT' variable to a non-empty value. + +Regex syntax clashes (problems with backslashes) + `sed' uses the POSIX basic regular expression syntax. According to + the standard, the meaning of some escape sequences is undefined in + this syntax; notable in the case of `sed' are `\|', `\+', `\?', + `\`', `\'', `\<', `\>', `\b', `\B', `\w', and `\W'. + + As in all GNU programs that use POSIX basic regular expressions, + `sed' interprets these escape sequences as special characters. + So, `x\+' matches one or more occurrences of `x'. `abc\|def' + matches either `abc' or `def'. + + This syntax may cause problems when running scripts written for + other `sed's. Some `sed' programs have been written with the + assumption that `\|' and `\+' match the literal characters `|' and + `+'. Such scripts must be modified by removing the spurious + backslashes if they are to be used with modern implementations of + `sed', like GNU `sed'. + + On the other hand, some scripts use s|abc\|def||g to remove + occurrences of _either_ `abc' or `def'. While this worked until + `sed' 4.0.x, newer versions interpret this as removing the string + `abc|def'. This is again undefined behavior according to POSIX, + and this interpretation is arguably more robust: older `sed's, for + example, required that the regex matcher parsed `\/' as `/' in the + common case of escaping a slash, which is again undefined + behavior; the new behavior avoids this, and this is good because + the regex matcher is only partially under our control. + + In addition, this version of `sed' supports several escape + characters (some of which are multi-character) to insert + non-printable characters in scripts (`\a', `\c', `\d', `\o', `\r', + `\t', `\v', `\x'). These can cause similar problems with scripts + written for other `sed's. + +`-i' clobbers read-only files + In short, `sed -i' will let you delete the contents of a read-only + file, and in general the `-i' option (*note Invocation: Invoking + sed.) lets you clobber protected files. This is not a bug, but + rather a consequence of how the Unix filesystem works. + + The permissions on a file say what can happen to the data in that + file, while the permissions on a directory say what can happen to + the list of files in that directory. `sed -i' will not ever open + for writing a file that is already on disk. Rather, it will work + on a temporary file that is finally renamed to the original name: + if you rename or delete files, you're actually modifying the + contents of the directory, so the operation depends on the + permissions of the directory, not of the file. For this same + reason, `sed' does not let you use `-i' on a writeable file in a + read-only directory, and will break hard or symbolic links when + `-i' is used on such a file. + +`0a' does not work (gives an error) + There is no line 0. 0 is a special address that is only used to + treat addresses like `0,/RE/' as active when the script starts: if + you write `1,/abc/d' and the first line includes the word `abc', + then that match would be ignored because address ranges must span + at least two lines (barring the end of the file); but what you + probably wanted is to delete every line up to the first one + including `abc', and this is obtained with `0,/abc/d'. + +`[a-z]' is case insensitive + You are encountering problems with locales. POSIX mandates that + `[a-z]' uses the current locale's collation order - in C parlance, + that means using `strcoll(3)' instead of `strcmp(3)'. Some + locales have a case-insensitive collation order, others don't. + + Another problem is that `[a-z]' tries to use collation symbols. + This only happens if you are on the GNU system, using GNU libc's + regular expression matcher instead of compiling the one supplied + with GNU sed. In a Danish locale, for example, the regular + expression `^[a-z]$' matches the string `aa', because this is a + single collating symbol that comes after `a' and before `b'; `ll' + behaves similarly in Spanish locales, or `ij' in Dutch locales. + + To work around these problems, which may cause bugs in shell + scripts, set the `LC_COLLATE' and `LC_CTYPE' environment variables + to `C'. + +`s/.*//' does not clear pattern space + This happens if your input stream includes invalid multibyte + sequences. POSIX mandates that such sequences are _not_ matched + by `.', so that `s/.*//' will not clear pattern space as you would + expect. In fact, there is no way to clear sed's buffers in the + middle of the script in most multibyte locales (including UTF-8 + locales). For this reason, GNU `sed' provides a `z' command (for + `zap') as an extension. + + To work around these problems, which may cause bugs in shell + scripts, set the `LC_COLLATE' and `LC_CTYPE' environment variables + to `C'. + + ---------- Footnotes ---------- + + (1) which is the actual "bug" that prompted the change in behavior + + +File: sed.info, Node: Extended regexps, Next: Concept Index, Prev: Reporting Bugs, Up: Top + +Appendix A Extended regular expressions +*************************************** + +The only difference between basic and extended regular expressions is in +the behavior of a few characters: `?', `+', parentheses, and braces +(`{}'). While basic regular expressions require these to be escaped if +you want them to behave as special characters, when using extended +regular expressions you must escape them if you want them _to match a +literal character_. + +Examples: +`abc?' + becomes `abc\?' when using extended regular expressions. It + matches the literal string `abc?'. + +`c\+' + becomes `c+' when using extended regular expressions. It matches + one or more `c's. + +`a\{3,\}' + becomes `a{3,}' when using extended regular expressions. It + matches three or more `a's. + +`\(abc\)\{2,3\}' + becomes `(abc){2,3}' when using extended regular expressions. It + matches either `abcabc' or `abcabcabc'. + +`\(abc*\)\1' + becomes `(abc*)\1' when using extended regular expressions. + Backreferences must still be escaped when using extended regular + expressions. + + +File: sed.info, Node: Concept Index, Next: Command and Option Index, Prev: Extended regexps, Up: Top + +Concept Index +************* + +This is a general index of all issues discussed in this manual, with the +exception of the `sed' commands and command-line options. + +[index] +* Menu: + +* 0 address: Reporting Bugs. (line 103) +* Additional reading about sed: Other Resources. (line 6) +* ADDR1,+N: Addresses. (line 78) +* ADDR1,~N: Addresses. (line 78) +* Address, as a regular expression: Addresses. (line 27) +* Address, last line: Addresses. (line 22) +* Address, numeric: Addresses. (line 8) +* Addresses, in sed scripts: Addresses. (line 6) +* Append hold space to pattern space: Other Commands. (line 125) +* Append next input line to pattern space: Other Commands. (line 105) +* Append pattern space to hold space: Other Commands. (line 117) +* Appending text after a line: Other Commands. (line 27) +* Backreferences, in regular expressions: The "s" Command. (line 19) +* Branch to a label, if s/// failed: Extended Commands. (line 63) +* Branch to a label, if s/// succeeded: Programming Commands. + (line 22) +* Branch to a label, unconditionally: Programming Commands. + (line 18) +* Buffer spaces, pattern and hold: Execution Cycle. (line 6) +* Bugs, reporting: Reporting Bugs. (line 6) +* Case-insensitive matching: The "s" Command. (line 94) +* Caveat -- #n on first line: Common Commands. (line 20) +* Command groups: Common Commands. (line 50) +* Comments, in scripts: Common Commands. (line 12) +* Conditional branch <1>: Extended Commands. (line 63) +* Conditional branch: Programming Commands. + (line 22) +* Copy hold space into pattern space: Other Commands. (line 121) +* Copy pattern space into hold space: Other Commands. (line 113) +* Delete first line from pattern space: Other Commands. (line 99) +* Disabling autoprint, from command line: Invoking sed. (line 34) +* empty regular expression: Addresses. (line 31) +* Emptying pattern space <1>: Reporting Bugs. (line 130) +* Emptying pattern space: Extended Commands. (line 85) +* Evaluate Bourne-shell commands: Extended Commands. (line 12) +* Evaluate Bourne-shell commands, after substitution: The "s" Command. + (line 85) +* Exchange hold space with pattern space: Other Commands. (line 129) +* Excluding lines: Addresses. (line 101) +* Extended regular expressions, choosing: Invoking sed. (line 113) +* Extended regular expressions, syntax: Extended regexps. (line 6) +* Files to be processed as input: Invoking sed. (line 141) +* Flow of control in scripts: Programming Commands. + (line 11) +* Global substitution: The "s" Command. (line 51) +* GNU extensions, /dev/stderr file <1>: Other Commands. (line 88) +* GNU extensions, /dev/stderr file: The "s" Command. (line 78) +* GNU extensions, /dev/stdin file <1>: Extended Commands. (line 53) +* GNU extensions, /dev/stdin file: Other Commands. (line 78) +* GNU extensions, /dev/stdout file <1>: Other Commands. (line 88) +* GNU extensions, /dev/stdout file <2>: The "s" Command. (line 78) +* GNU extensions, /dev/stdout file: Invoking sed. (line 149) +* GNU extensions, 0 address <1>: Reporting Bugs. (line 103) +* GNU extensions, 0 address: Addresses. (line 78) +* GNU extensions, 0,ADDR2 addressing: Addresses. (line 78) +* GNU extensions, ADDR1,+N addressing: Addresses. (line 78) +* GNU extensions, ADDR1,~N addressing: Addresses. (line 78) +* GNU extensions, branch if s/// failed: Extended Commands. (line 63) +* GNU extensions, case modifiers in s commands: The "s" Command. + (line 23) +* GNU extensions, checking for their presence: Extended Commands. + (line 69) +* GNU extensions, disabling: Invoking sed. (line 81) +* GNU extensions, emptying pattern space <1>: Reporting Bugs. (line 130) +* GNU extensions, emptying pattern space: Extended Commands. (line 85) +* GNU extensions, evaluating Bourne-shell commands <1>: Extended Commands. + (line 12) +* GNU extensions, evaluating Bourne-shell commands: The "s" Command. + (line 85) +* GNU extensions, extended regular expressions: Invoking sed. (line 113) +* GNU extensions, g and NUMBER modifier interaction in s command: The "s" Command. + (line 57) +* GNU extensions, I modifier <1>: The "s" Command. (line 94) +* GNU extensions, I modifier: Addresses. (line 49) +* GNU extensions, in-place editing <1>: Reporting Bugs. (line 85) +* GNU extensions, in-place editing: Invoking sed. (line 51) +* GNU extensions, L command: Extended Commands. (line 26) +* GNU extensions, M modifier: The "s" Command. (line 99) +* GNU extensions, modifiers and the empty regular expression: Addresses. + (line 31) +* GNU extensions, N~M addresses: Addresses. (line 13) +* GNU extensions, quitting silently: Extended Commands. (line 36) +* GNU extensions, R command: Extended Commands. (line 53) +* GNU extensions, reading a file a line at a time: Extended Commands. + (line 53) +* GNU extensions, reformatting paragraphs: Extended Commands. (line 26) +* GNU extensions, returning an exit code <1>: Extended Commands. + (line 36) +* GNU extensions, returning an exit code: Common Commands. (line 30) +* GNU extensions, setting line length: Other Commands. (line 65) +* GNU extensions, special escapes <1>: Reporting Bugs. (line 78) +* GNU extensions, special escapes: Escapes. (line 6) +* GNU extensions, special two-address forms: Addresses. (line 78) +* GNU extensions, subprocesses <1>: Extended Commands. (line 12) +* GNU extensions, subprocesses: The "s" Command. (line 85) +* GNU extensions, to basic regular expressions <1>: Reporting Bugs. + (line 51) +* GNU extensions, to basic regular expressions: Regular Expressions. + (line 26) +* GNU extensions, two addresses supported by most commands: Other Commands. + (line 25) +* GNU extensions, unlimited line length: Limitations. (line 6) +* GNU extensions, writing first line to a file: Extended Commands. + (line 80) +* Goto, in scripts: Programming Commands. + (line 18) +* Greedy regular expression matching: Regular Expressions. (line 143) +* Grouping commands: Common Commands. (line 50) +* Hold space, appending from pattern space: Other Commands. (line 117) +* Hold space, appending to pattern space: Other Commands. (line 125) +* Hold space, copy into pattern space: Other Commands. (line 121) +* Hold space, copying pattern space into: Other Commands. (line 113) +* Hold space, definition: Execution Cycle. (line 6) +* Hold space, exchange with pattern space: Other Commands. (line 129) +* In-place editing: Reporting Bugs. (line 85) +* In-place editing, activating: Invoking sed. (line 51) +* In-place editing, Perl-style backup file names: Invoking sed. + (line 62) +* Inserting text before a line: Other Commands. (line 46) +* Labels, in scripts: Programming Commands. + (line 14) +* Last line, selecting: Addresses. (line 22) +* Line length, setting <1>: Other Commands. (line 65) +* Line length, setting: Invoking sed. (line 76) +* Line number, printing: Other Commands. (line 62) +* Line selection: Addresses. (line 6) +* Line, selecting by number: Addresses. (line 8) +* Line, selecting by regular expression match: Addresses. (line 27) +* Line, selecting last: Addresses. (line 22) +* List pattern space: Other Commands. (line 65) +* Mixing g and NUMBER modifiers in the s command: The "s" Command. + (line 57) +* Next input line, append to pattern space: Other Commands. (line 105) +* Next input line, replace pattern space with: Common Commands. + (line 44) +* Non-bugs, 0 address: Reporting Bugs. (line 103) +* Non-bugs, in-place editing: Reporting Bugs. (line 85) +* Non-bugs, localization-related: Reporting Bugs. (line 112) +* Non-bugs, N command on the last line: Reporting Bugs. (line 31) +* Non-bugs, regex syntax clashes: Reporting Bugs. (line 51) +* Parenthesized substrings: The "s" Command. (line 19) +* Pattern space, definition: Execution Cycle. (line 6) +* Perl-style regular expressions, multiline: Addresses. (line 54) +* Portability, comments: Common Commands. (line 15) +* Portability, line length limitations: Limitations. (line 6) +* Portability, N command on the last line: Reporting Bugs. (line 31) +* POSIXLY_CORRECT behavior, bracket expressions: Regular Expressions. + (line 105) +* POSIXLY_CORRECT behavior, enabling: Invoking sed. (line 84) +* POSIXLY_CORRECT behavior, escapes: Escapes. (line 11) +* POSIXLY_CORRECT behavior, N command: Reporting Bugs. (line 46) +* Print first line from pattern space: Other Commands. (line 110) +* Printing line number: Other Commands. (line 62) +* Printing text unambiguously: Other Commands. (line 65) +* Quitting <1>: Extended Commands. (line 36) +* Quitting: Common Commands. (line 30) +* Range of lines: Addresses. (line 65) +* Range with start address of zero: Addresses. (line 78) +* Read next input line: Common Commands. (line 44) +* Read text from a file <1>: Extended Commands. (line 53) +* Read text from a file: Other Commands. (line 78) +* Reformat pattern space: Extended Commands. (line 26) +* Reformatting paragraphs: Extended Commands. (line 26) +* Replace hold space with copy of pattern space: Other Commands. + (line 113) +* Replace pattern space with copy of hold space: Other Commands. + (line 121) +* Replacing all text matching regexp in a line: The "s" Command. + (line 51) +* Replacing only Nth match of regexp in a line: The "s" Command. + (line 55) +* Replacing selected lines with other text: Other Commands. (line 52) +* Requiring GNU sed: Extended Commands. (line 69) +* Script structure: sed Programs. (line 6) +* Script, from a file: Invoking sed. (line 46) +* Script, from command line: Invoking sed. (line 41) +* sed program structure: sed Programs. (line 6) +* Selecting lines to process: Addresses. (line 6) +* Selecting non-matching lines: Addresses. (line 101) +* Several lines, selecting: Addresses. (line 65) +* Slash character, in regular expressions: Addresses. (line 41) +* Spaces, pattern and hold: Execution Cycle. (line 6) +* Special addressing forms: Addresses. (line 78) +* Standard input, processing as input: Invoking sed. (line 143) +* Stream editor: Introduction. (line 6) +* Subprocesses <1>: Extended Commands. (line 12) +* Subprocesses: The "s" Command. (line 85) +* Substitution of text, options: The "s" Command. (line 47) +* Text, appending: Other Commands. (line 27) +* Text, deleting: Common Commands. (line 36) +* Text, insertion: Other Commands. (line 46) +* Text, printing: Common Commands. (line 39) +* Text, printing after substitution: The "s" Command. (line 65) +* Text, writing to a file after substitution: The "s" Command. + (line 78) +* Transliteration: Other Commands. (line 14) +* Unbuffered I/O, choosing: Invoking sed. (line 131) +* Usage summary, printing: Invoking sed. (line 28) +* Version, printing: Invoking sed. (line 24) +* Working on separate files: Invoking sed. (line 121) +* Write first line to a file: Extended Commands. (line 80) +* Write to a file: Other Commands. (line 88) +* Zero, as range start address: Addresses. (line 78) + + +File: sed.info, Node: Command and Option Index, Prev: Concept Index, Up: Top + +Command and Option Index +************************ + +This is an alphabetical list of all `sed' commands and command-line +options. + +[index] +* Menu: + +* # (comments): Common Commands. (line 12) +* --binary: Invoking sed. (line 93) +* --expression: Invoking sed. (line 41) +* --file: Invoking sed. (line 46) +* --follow-symlinks: Invoking sed. (line 104) +* --help: Invoking sed. (line 28) +* --in-place: Invoking sed. (line 51) +* --line-length: Invoking sed. (line 76) +* --quiet: Invoking sed. (line 34) +* --regexp-extended: Invoking sed. (line 113) +* --silent: Invoking sed. (line 34) +* --unbuffered: Invoking sed. (line 131) +* --version: Invoking sed. (line 24) +* -b: Invoking sed. (line 93) +* -e: Invoking sed. (line 41) +* -f: Invoking sed. (line 46) +* -i: Invoking sed. (line 51) +* -l: Invoking sed. (line 76) +* -n: Invoking sed. (line 34) +* -n, forcing from within a script: Common Commands. (line 20) +* -r: Invoking sed. (line 113) +* -u: Invoking sed. (line 131) +* : (label) command: Programming Commands. + (line 14) +* = (print line number) command: Other Commands. (line 62) +* a (append text lines) command: Other Commands. (line 27) +* b (branch) command: Programming Commands. + (line 18) +* c (change to text lines) command: Other Commands. (line 52) +* D (delete first line) command: Other Commands. (line 99) +* d (delete) command: Common Commands. (line 36) +* e (evaluate) command: Extended Commands. (line 12) +* G (appending Get) command: Other Commands. (line 125) +* g (get) command: Other Commands. (line 121) +* H (append Hold) command: Other Commands. (line 117) +* h (hold) command: Other Commands. (line 113) +* i (insert text lines) command: Other Commands. (line 46) +* L (fLow paragraphs) command: Extended Commands. (line 26) +* l (list unambiguously) command: Other Commands. (line 65) +* N (append Next line) command: Other Commands. (line 105) +* n (next-line) command: Common Commands. (line 44) +* P (print first line) command: Other Commands. (line 110) +* p (print) command: Common Commands. (line 39) +* q (quit) command: Common Commands. (line 30) +* Q (silent Quit) command: Extended Commands. (line 36) +* r (read file) command: Other Commands. (line 78) +* R (read line) command: Extended Commands. (line 53) +* s command, option flags: The "s" Command. (line 47) +* T (test and branch if failed) command: Extended Commands. (line 63) +* t (test and branch if successful) command: Programming Commands. + (line 22) +* v (version) command: Extended Commands. (line 69) +* w (write file) command: Other Commands. (line 88) +* W (write first line) command: Extended Commands. (line 80) +* x (eXchange) command: Other Commands. (line 129) +* y (transliterate) command: Other Commands. (line 14) +* z (Zap) command: Extended Commands. (line 85) +* {} command grouping: Common Commands. (line 50) + + + +Tag Table: +Node: Top944 +Node: Introduction3867 +Node: Invoking sed4421 +Ref: Invoking sed-Footnote-110512 +Ref: Invoking sed-Footnote-210704 +Node: sed Programs10803 +Node: Execution Cycle11951 +Ref: Execution Cycle-Footnote-113129 +Node: Addresses13430 +Node: Regular Expressions18174 +Node: Common Commands26082 +Node: The "s" Command28085 +Ref: The "s" Command-Footnote-132422 +Node: Other Commands32494 +Ref: Other Commands-Footnote-137636 +Node: Programming Commands37708 +Node: Extended Commands38622 +Node: Escapes42630 +Ref: Escapes-Footnote-145641 +Node: Examples45832 +Node: Centering lines46928 +Node: Increment a number47820 +Ref: Increment a number-Footnote-149380 +Node: Rename files to lower case49500 +Node: Print bash environment52203 +Node: Reverse chars of lines52958 +Ref: Reverse chars of lines-Footnote-153959 +Node: tac54176 +Node: cat -n54943 +Node: cat -b56765 +Node: wc -c57512 +Ref: wc -c-Footnote-159420 +Node: wc -w59489 +Node: wc -l60953 +Node: head61197 +Node: tail61528 +Node: uniq63209 +Node: uniq -d63997 +Node: uniq -u64708 +Node: cat -s65419 +Node: Limitations67270 +Node: Other Resources68111 +Node: Reporting Bugs68956 +Ref: Reporting Bugs-Footnote-176092 +Node: Extended regexps76163 +Node: Concept Index77349 +Node: Command and Option Index92298 + +End Tag Table diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/po/ChangeLog b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/po/ChangeLog new file mode 100644 index 0000000..0042d6f --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/po/ChangeLog @@ -0,0 +1,53 @@ +2004-11-11 Paolo Bonzini + + * Makevars: New. + +2004-11-02 gettextize + + * Makefile.in.in: Upgrade to gettext-0.10.40. + +2002-10-26 Paolo Bonzini + + * po/*.po: updated from Translation Project + +2001-10-19 gettextize + + * Makefile.in.in: Upgrade to gettext-0.10.40. + * cat-id-tbl.c: Remove file. + * stamp-cat-id: Remove file. + +2001-03-02 Paolo Bonzini + + * po/it.po: updated + * po/sed.pot: likewise. + +2000-12-10 Paolo Bonzini + + * po/it.po: Italian translation reviewed for new POT file. + * po/sed.pot: updated + +Mon Mar 15 16:25:53 PST 1999 Ken Pizzini + + * po/it.po: new translation file. + +Sun Feb 7 21:22:17 PST 1999 Ken Pizzini + + * po/de.po: new translation file. + +Sat Dec 12 11:18:55 PST 1998 Ken Pizzini + + * po/ru.po: new translation file. + +Sun Dec 6 00:51:23 PST 1998 Ken Pizzini + + * po/fr.po: new translation file. + +Sun Aug 16 02:59:20 PDT 1998 Ken Pizzini + + * sed/compile.c: added N_() markers and corresponding gettext() + (er, _()) calls. + * po/sed.pot: updated to reflect changed and newly marked text. + +1998-07-24 Erick Branderhorst + + * po/nl.po: Dutch translation. diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex10.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex10.c new file mode 100644 index 0000000..1a21617 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex10.c @@ -0,0 +1,65 @@ +/* Test for re_match with non-zero start. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +int +main (void) +{ + struct re_pattern_buffer regex; + struct re_registers regs; + const char *s; + int match; + int result = 0; + + regs.num_regs = 1; + memset (®ex, '\0', sizeof (regex)); + s = re_compile_pattern ("[abc]*d", 7, ®ex); + if (s != NULL) + { + puts ("re_compile_pattern return non-NULL value"); + result = 1; + } + else + { + match = re_match (®ex, "foacabdxy", 9, 2, ®s); + if (match != 5) + { + printf ("re_match returned %d, expected 5\n", match); + result = 1; + } + else if (regs.start[0] != 2 || regs.end[0] != 7) + { + printf ("re_match returned %d..%d, expected 2..7\n", + regs.start[0], regs.end[0]); + result = 1; + } + puts (" -> OK"); + } + + return result; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex11.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex11.c new file mode 100644 index 0000000..dbfa3f9 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex11.c @@ -0,0 +1,143 @@ +/* Regular expression tests. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#ifdef HAVE_MCHECK_H +#include +#endif +#include +#include +#include + +/* Tests supposed to match. */ +struct +{ + const char *pattern; + const char *string; + int flags, nmatch; + regmatch_t rm[5]; +} tests[] = { + /* Test for newline handling in regex. */ + { "[^~]*~", "\nx~y", 0, 2, { { 0, 3 }, { -1, -1 } } }, + /* Other tests. */ + { "a(.*)b", "a b", REG_EXTENDED, 2, { { 0, 3 }, { 1, 2 } } }, + { ".*|\\([KIO]\\)\\([^|]*\\).*|?[KIO]", "10~.~|P|K0|I10|O16|?KSb", 0, 3, + { { 0, 21 }, { 15, 16 }, { 16, 18 } } }, + { ".*|\\([KIO]\\)\\([^|]*\\).*|?\\1", "10~.~|P|K0|I10|O16|?KSb", 0, 3, + { { 0, 21 }, { 8, 9 }, { 9, 10 } } }, + { "^\\(a*\\)\\1\\{9\\}\\(a\\{0,9\\}\\)\\([0-9]*;.*[^a]\\2\\([0-9]\\)\\)", + "a1;;0a1aa2aaa3aaaa4aaaaa5aaaaaa6aaaaaaa7aaaaaaaa8aaaaaaaaa9aa2aa1a0", 0, + 5, { { 0, 67 }, { 0, 0 }, { 0, 1 }, { 1, 67 }, { 66, 67 } } }, + /* Test for BRE expression anchoring. POSIX says just that this may match; + in glibc regex it always matched, so avoid changing it. */ + { "\\(^\\|foo\\)bar", "bar", 0, 2, { { 0, 3 }, { -1, -1 } } }, + { "\\(foo\\|^\\)bar", "bar", 0, 2, { { 0, 3 }, { -1, -1 } } }, + /* In ERE this must be treated as an anchor. */ + { "(^|foo)bar", "bar", REG_EXTENDED, 2, { { 0, 3 }, { -1, -1 } } }, + { "(foo|^)bar", "bar", REG_EXTENDED, 2, { { 0, 3 }, { -1, -1 } } }, + /* Here ^ cannot be treated as an anchor according to POSIX. */ + { "(^|foo)bar", "(^|foo)bar", 0, 2, { { 0, 10 }, { -1, -1 } } }, + { "(foo|^)bar", "(foo|^)bar", 0, 2, { { 0, 10 }, { -1, -1 } } }, + /* More tests on backreferences. */ + { "()\\1", "x", REG_EXTENDED, 2, { { 0, 0 }, { 0, 0 } } }, + { "()x\\1", "x", REG_EXTENDED, 2, { { 0, 1 }, { 0, 0 } } }, + { "()\\1*\\1*", "", REG_EXTENDED, 2, { { 0, 0 }, { 0, 0 } } }, + { "([0-9]).*\\1(a*)", "7;7a6", REG_EXTENDED, 3, { { 0, 4 }, { 0, 1 }, { 3, 4 } } }, + { "([0-9]).*\\1(a*)", "7;7a", REG_EXTENDED, 3, { { 0, 4 }, { 0, 1 }, { 3, 4 } } }, + { "(b)()c\\1", "bcb", REG_EXTENDED, 3, { { 0, 3 }, { 0, 1 }, { 1, 1 } } }, + { "()(b)c\\2", "bcb", REG_EXTENDED, 3, { { 0, 3 }, { 0, 0 }, { 0, 1 } } }, + { "a(b)()c\\1", "abcb", REG_EXTENDED, 3, { { 0, 4 }, { 1, 2 }, { 2, 2 } } }, + { "a()(b)c\\2", "abcb", REG_EXTENDED, 3, { { 0, 4 }, { 1, 1 }, { 1, 2 } } }, + { "()(b)\\1c\\2", "bcb", REG_EXTENDED, 3, { { 0, 3 }, { 0, 0 }, { 0, 1 } } }, + { "(b())\\2\\1", "bbbb", REG_EXTENDED, 3, { { 0, 2 }, { 0, 1 }, { 1, 1 } } }, + { "a()(b)\\1c\\2", "abcb", REG_EXTENDED, 3, { { 0, 4 }, { 1, 1 }, { 1, 2 } } }, + { "a()d(b)\\1c\\2", "adbcb", REG_EXTENDED, 3, { { 0, 5 }, { 1, 1 }, { 2, 3 } } }, + { "a(b())\\2\\1", "abbbb", REG_EXTENDED, 3, { { 0, 3 }, { 1, 2 }, { 2, 2 } } }, + { "(bb())\\2\\1", "bbbb", REG_EXTENDED, 3, { { 0, 4 }, { 0, 2 }, { 2, 2 } } }, + { "^(.?)(.?)(.?)(.?)(.?).?\\5\\4\\3\\2\\1$", + "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } }, + { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$|^.?$", + "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } }, + { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$|^.?$", + "abcdedcba", REG_EXTENDED, 1, { { 0, 9 } } }, +#if 0 + /* XXX Not used since they fail so far. */ + { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$|^.?$", + "ababababa", REG_EXTENDED, 1, { { 0, 9 } } }, + { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$", + "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } }, + { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$", + "ababababa", REG_EXTENDED, 1, { { 0, 9 } } }, +#endif +}; + +int +main (void) +{ + regex_t re; + regmatch_t rm[5]; + size_t i; + int n, ret = 0; + +#ifdef HAVE_MCHECK_H + mtrace (); +#endif + + for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + { + n = regcomp (&re, tests[i].pattern, tests[i].flags); + if (n != 0) + { + char buf[500]; + regerror (n, &re, buf, sizeof (buf)); + printf ("%s: regcomp %lu failed: %s\n", tests[i].pattern, i, buf); + ret = 1; + continue; + } + + if (regexec (&re, tests[i].string, tests[i].nmatch, rm, 0)) + { + printf ("%s: regexec %lu failed\n", tests[i].pattern, i); + ret = 1; + regfree (&re); + continue; + } + + for (n = 0; n < tests[i].nmatch; ++n) + if (rm[n].rm_so != tests[i].rm[n].rm_so + || rm[n].rm_eo != tests[i].rm[n].rm_eo) + { + if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1) + break; + printf ("%s: regexec %lu match failure rm[%d] %d..%d\n", + tests[i].pattern, i, n, rm[n].rm_so, rm[n].rm_eo); + ret = 1; + break; + } + + regfree (&re); + } + + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex12.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex12.c new file mode 100644 index 0000000..a4db0cc --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex12.c @@ -0,0 +1,81 @@ +/* Regular expression tests. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#ifdef HAVE_MCHECK_H +#include +#endif +#include +#include +#include + +/* Tests supposed to not match. */ +struct +{ + const char *pattern; + const char *string; + int flags, nmatch; +} tests[] = { + { "^<\\([^~]*\\)\\([^~]\\)[^~]*~\\1\\(.\\).*|=.*\\3.*\\2", + "<,.8~2,~so-|=-~.0,123456789<><", REG_NOSUB, 0 }, + /* In ERE, all carets must be treated as anchors. */ + { "a^b", "a^b", REG_EXTENDED, 0 } +}; + +int +main (void) +{ + regex_t re; + regmatch_t rm[4]; + size_t i; + int n, ret = 0; + +#ifdef HAVE_MCHECK_H + mtrace (); +#endif + + for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + { + n = regcomp (&re, tests[i].pattern, tests[i].flags); + if (n != 0) + { + char buf[500]; + regerror (n, &re, buf, sizeof (buf)); + printf ("regcomp %lu failed: %s\n", i, buf); + ret = 1; + continue; + } + + if (! regexec (&re, tests[i].string, tests[i].nmatch, + tests[i].nmatch ? rm : NULL, 0)) + { + printf ("regexec %lu incorrectly matched\n", i); + ret = 1; + } + + regfree (&re); + } + + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex13.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex13.c new file mode 100644 index 0000000..a28c5fa --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex13.c @@ -0,0 +1,111 @@ +/* Regular expression tests. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#ifdef HAVE_MCHECK_H +#include +#endif +#include +#include +#include +#include + +static struct +{ + int syntax; + const char *pattern; + const char *string; + int start; +} tests[] = { + {RE_BACKSLASH_ESCAPE_IN_LISTS, "[0\\-9]", "1", -1}, /* It should not match. */ + {RE_BACKSLASH_ESCAPE_IN_LISTS, "[0\\-9]", "-", 0}, /* It should match. */ + {RE_SYNTAX_POSIX_BASIC, "s1\n.*\ns3", "s1\ns2\ns3", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}c", "ac", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}c", "abc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}c", "abbc", -1}, + /* Nested duplication. */ + {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{1}c", "ac", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{1}c", "abc", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{1}c", "abbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "ac", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "abbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "abbbbc", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "abbbbbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}{1}c", "ac", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}{1}c", "abc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}{1}c", "abbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{0}c", "ac", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{0}c", "abc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{0}c", "abbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}*c", "ac", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}*c", "abc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}*c", "abbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}?c", "ac", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}?c", "abc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}?c", "abbc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}+c", "ac", 0}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}+c", "abc", -1}, + {RE_SYNTAX_POSIX_EXTENDED, "ab{0}+c", "abbc", -1}, +}; + +int +main (void) +{ + struct re_pattern_buffer regbuf; + const char *err; + size_t i; + int ret = 0; + +#ifdef HAVE_MCHECK_H + mtrace (); +#endif + + for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + { + int start; + re_set_syntax (tests[i].syntax); + memset (®buf, '\0', sizeof (regbuf)); + err = re_compile_pattern (tests[i].pattern, strlen (tests[i].pattern), + ®buf); + if (err != NULL) + { + printf ("re_compile_pattern failed: %s\n", err); + ret = 1; + continue; + } + + start = re_search (®buf, tests[i].string, strlen (tests[i].string), + 0, strlen (tests[i].string), NULL); + if (start != tests[i].start) + { + printf ("re_search failed %d\n", start); + ret = 1; + regfree (®buf); + continue; + } + regfree (®buf); + } + + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex14.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex14.c new file mode 100644 index 0000000..4b296d8 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex14.c @@ -0,0 +1,62 @@ +/* Tests re_comp and re_exec. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Isamu Hasegawa , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define _REGEX_RE_COMP +#include +#ifdef HAVE_MCHECK_H +#include +#endif +#include +#include +#include + +int +main (void) +{ + const char *err; + size_t i; + int ret = 0; + +#ifdef HAVE_MCHECK_H + mtrace (); +#endif + + for (i = 0; i < 100; ++i) + { + err = re_comp ("a t.st"); + if (err) + { + printf ("re_comp failed: %s\n", err); + ret = 1; + } + + if (! re_exec ("This is a test.")) + { + printf ("re_exec failed\n"); + ret = 1; + } + } + + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex15.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex15.c new file mode 100644 index 0000000..76aa92d --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex15.c @@ -0,0 +1,53 @@ +/* Test for memory/CPU leak in regcomp. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include + +#define TEST_DATA_LIMIT (32 << 20) + +int +main () +{ +#ifdef RLIMIT_DATA + regex_t re; + int reerr; + + /* Try to avoid eating all memory if a test leaks. */ + struct rlimit data_limit; + if (getrlimit (RLIMIT_DATA, &data_limit) == 0) + { + if ((rlim_t) TEST_DATA_LIMIT > data_limit.rlim_max) + data_limit.rlim_cur = data_limit.rlim_max; + else if (data_limit.rlim_cur > (rlim_t) TEST_DATA_LIMIT) + data_limit.rlim_cur = (rlim_t) TEST_DATA_LIMIT; + if (setrlimit (RLIMIT_DATA, &data_limit) < 0) + perror ("setrlimit: RLIMIT_DATA"); + } + else + perror ("getrlimit: RLIMIT_DATA"); + + reerr = regcomp (&re, "^6?3?[25]?5?[14]*[25]*[69]*+[58]*87?4?$", + REG_EXTENDED | REG_NOSUB); + if (reerr != 0) + { + char buf[100]; + regerror (reerr, &re, buf, sizeof buf); + printf ("regerror %s\n", buf); + return 1; + } + + return 0; +#else + return 77; +#endif +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex16.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex16.c new file mode 100644 index 0000000..7a1d3c8 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex16.c @@ -0,0 +1,39 @@ +/* Test re_compile_pattern error messages. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +int +main (void) +{ + struct re_pattern_buffer re; + const char *s; + int ret = 0; + + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (&re, 0, sizeof (re)); + s = re_compile_pattern ("[[.invalid_collating_symbol.]]", 30, &re); + if (s == NULL || strcmp (s, "Invalid collation character")) + { + printf ("re_compile_pattern returned %s\n", s); + ret = 1; + } + s = re_compile_pattern ("[[=invalid_equivalence_class=]]", 31, &re); + if (s == NULL || strcmp (s, "Invalid collation character")) + { + printf ("re_compile_pattern returned %s\n", s); + ret = 1; + } + s = re_compile_pattern ("[[:invalid_character_class:]]", 29, &re); + if (s == NULL || strcmp (s, "Invalid character class name")) + { + printf ("re_compile_pattern returned %s\n", s); + ret = 1; + } + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex21.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex21.c new file mode 100644 index 0000000..0232876 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex21.c @@ -0,0 +1,53 @@ +/* Test for memory leaks in regcomp. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2003. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_MCHECK_H +#include +#endif +#include +#include + +int main (void) +{ + regex_t re; + int i; + int ret = 0; + +#ifdef HAVE_MCHECK_H + mtrace (); +#endif + + for (i = 0; i < 32; ++i) + { + if (regcomp (&re, "X-.+:.+Y=\".*\\.(A|B|C|D|E|F|G|H|I", + REG_EXTENDED | REG_ICASE) == 0) + { + puts ("regcomp unexpectedly succeeded"); + ret = 1; + } + else + regfree (&re); + } + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex27.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex27.c new file mode 100644 index 0000000..340ade9 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex27.c @@ -0,0 +1,65 @@ +/* Test REG_NEWLINE. + Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2007. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include +#include + +struct tests +{ + const char *regex; + const char *string; + int cflags; + int retval; +} tests[] = { + { "a.b", "a\nb", REG_EXTENDED | REG_NEWLINE, REG_NOMATCH }, + { "a.b", "a\nb", REG_EXTENDED, 0 }, + { "a[^x]b", "a\nb", REG_EXTENDED | REG_NEWLINE, REG_NOMATCH }, + { "a[^x]b", "a\nb", REG_EXTENDED, 0 } +}; + +int +main (void) +{ + regex_t r; + size_t i; + int ret = 0; + + for (i = 0; i < sizeof (tests) / sizeof (tests[i]); ++i) + { + memset (&r, 0, sizeof (r)); + if (regcomp (&r, tests[i].regex, tests[i].cflags)) + { + printf ("regcomp %lu failed\n", i); + ret = 1; + continue; + } + int rv = regexec (&r, tests[i].string, 0, NULL, 0); + if (rv != tests[i].retval) + { + printf ("regexec %lu unexpected value %d != %d\n", + i, rv, tests[i].retval); + ret = 1; + } + regfree (&r); + } + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex28.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex28.c new file mode 100644 index 0000000..f546b35 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex28.c @@ -0,0 +1,76 @@ +/* Test RE_HAT_LISTS_NOT_NEWLINE and RE_DOT_NEWLINE. + Copyright (C) 2007 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2007. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include +#include + +struct tests +{ + const char *regex; + const char *string; + reg_syntax_t syntax; + int retval; +} tests[] = { +#define EGREP RE_SYNTAX_EGREP +#define EGREP_NL (RE_SYNTAX_EGREP | RE_DOT_NEWLINE) & ~RE_HAT_LISTS_NOT_NEWLINE + { "a.b", "a\nb", EGREP, -1 }, + { "a.b", "a\nb", EGREP_NL, 0 }, + { "a[^x]b", "a\nb", EGREP, -1 }, + { "a[^x]b", "a\nb", EGREP_NL, 0 }, + /* While \S and \W are internally handled as [^[:space:]] and [^[:alnum:]_], + RE_HAT_LISTS_NOT_NEWLINE did not make any difference, so ensure + it doesn't change. */ + { "a\\Sb", "a\nb", EGREP, -1 }, + { "a\\Sb", "a\nb", EGREP_NL, -1 }, + { "a\\Wb", "a\nb", EGREP, 0 }, + { "a\\Wb", "a\nb", EGREP_NL, 0 } +}; + +int +main (void) +{ + struct re_pattern_buffer r; + size_t i; + int ret = 0; + + for (i = 0; i < sizeof (tests) / sizeof (tests[i]); ++i) + { + re_set_syntax (tests[i].syntax); + memset (&r, 0, sizeof (r)); + if (re_compile_pattern (tests[i].regex, strlen (tests[i].regex), &r)) + { + printf ("re_compile_pattern %lu failed\n", i); + ret = 1; + continue; + } + size_t len = strlen (tests[i].string); + int rv = re_search (&r, tests[i].string, len, 0, len, NULL); + if (rv != tests[i].retval) + { + printf ("re_search %lu unexpected value %d != %d\n", + i, rv, tests[i].retval); + ret = 1; + } + regfree (&r); + } + return ret; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex7.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex7.c new file mode 100644 index 0000000..2051985 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex7.c @@ -0,0 +1,96 @@ +/* Test for regs allocation in re_search and re_match. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Stepan Kasal , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + + +int +main (void) +{ + struct re_pattern_buffer regex; + struct re_registers regs; + const char *s; + int match, n; + int result = 0; + + memset (®ex, '\0', sizeof (regex)); + regs.start = regs.end = NULL; + regs.num_regs = 0; + s = re_compile_pattern ("a", 1, ®ex); + if (s != NULL) + { + puts ("failed to compile pattern \"a\""); + result = 1; + } + else + { + match = re_search (®ex, "baobab", 6, 0, 6, ®s); + n = 1; + if (match != 1) + { + printf ("re_search returned %d, expected 1\n", match); + result = 1; + } + else if (regs.num_regs <= n || regs.start[n] != -1 || regs.end[n] != -1) + { + puts ("re_search failed to fill the -1 sentinel"); + result = 1; + } + } + + free (regex.buffer); + memset (®ex, '\0', sizeof (regex)); + + s = re_compile_pattern ("\\(\\(\\(a\\)\\)\\)", 13, ®ex); + if (s != NULL) + { + puts ("failed to compile pattern /\\(\\(\\(a\\)\\)\\)/"); + result = 1; + } + else + { + match = re_match (®ex, "apl", 3, 0, ®s); + n = 4; + if (match != 1) + { + printf ("re_match returned %d, expected 1\n", match); + result = 1; + } + else if (regs.num_regs <= n || regs.start[n] != -1 || regs.end[n] != -1) + { + puts ("re_match failed to fill the -1 sentinel"); + result = 1; + } + } + + if (result == 0) + puts (" -> OK"); + + return result; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex8.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex8.c new file mode 100644 index 0000000..e39ad59 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex8.c @@ -0,0 +1,88 @@ +/* Test for the STOP parameter of re_match_2 and re_search_2. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Stepan Kasal , 2002. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include + + +int +main (void) +{ + struct re_pattern_buffer regex; + const char *s; + int match[4]; + + memset (®ex, '\0', sizeof (regex)); + + s = re_compile_pattern ("xy$", 3, ®ex); + if (s != NULL) + { + puts ("failed to compile pattern \"xy$\""); + return 1; + } + else + match[0] = re_match_2(®ex,"xyz",3,NULL,0,0,NULL,2); + + free (regex.buffer); + memset (®ex, '\0', sizeof (regex)); + + s = re_compile_pattern ("xy\\>", 4, ®ex); + if (s != NULL) + { + puts ("failed to compile pattern \"xy\\>\""); + return 1; + } + else + match[1] = re_search_2(®ex,"xyz",3,NULL,0,0,2,NULL,2); + + free (regex.buffer); + memset (®ex, '\0', sizeof (regex)); + + s = re_compile_pattern ("xy \\<", 5, ®ex); + if (s != NULL) + { + puts ("failed to compile pattern \"xy \\<\""); + return 1; + } + else + { + match[2] = re_match_2(®ex,"xy ",4,NULL,0,0,NULL,3); + match[3] = re_match_2(®ex,"xy z",4,NULL,0,0,NULL,3); + } + + if (match[0] != -1 || match[1] != -1 || match[2] != -1 || match[3] != 3) + { + printf ("re_{match,search}_2 returned %d,%d,%d,%d, expected -1,-1,-1,3\n", + match[0], match[1], match[2], match[3]); + return 1; + } + + puts (" -> OK"); + + return 0; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex9.c b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex9.c new file mode 100644 index 0000000..c0e9e18 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1-src/testsuite/bug-regex9.c @@ -0,0 +1,75 @@ +/* Test for memory handling in regex. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2001. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#ifdef HAVE_MCHECK_H +#include +#endif +#include +#include +#include + + +static const char text[] = "#! /bin/sh"; + +int +main (void) +{ + regex_t re; + regmatch_t rm[2]; + int n; + +#ifdef HAVE_MCHECK_H + mtrace (); +#endif + + n = regcomp (&re, "^#! */.*/(k|ba||pdk|z)sh", REG_EXTENDED); + if (n != 0) + { + char buf[500]; + regerror (n, &re, buf, sizeof (buf)); + printf ("regcomp failed: %s\n", buf); + exit (1); + } + + for (n = 0; n < 20; ++n) + { + if (regexec (&re, text, 2, rm, 0)) + { + puts ("regexec failed"); + exit (2); + } + if (rm[0].rm_so != 0 || rm[0].rm_eo != 10 + || rm[1].rm_so != 8 || rm[1].rm_eo != 8) + { + printf ("regexec match failure: %d %d %d %d\n", + rm[0].rm_so, rm[0].rm_eo, rm[1].rm_so, rm[1].rm_eo); + exit (3); + } + } + + regfree (&re); + + return 0; +} diff --git a/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1/check.log b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1/check.log new file mode 100644 index 0000000..a87e303 --- /dev/null +++ b/coreutils-5.3.0-bin/contrib/sed/4.2.1/sed-4.2.1/sed-4.2.1/check.log @@ -0,0 +1,104 @@ +Making check in lib +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/lib' wordt binnengegaan +make.exe check-recursive +make[2]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/lib' wordt binnengegaan +make[3]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/lib' wordt binnengegaan +make[3]: Er is niets te doen voor 'check-am'. +make[3]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/lib' wordt verlaten +make[2]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/lib' wordt verlaten +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/lib' wordt verlaten +Making check in po +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/po' wordt binnengegaan +make[1]: Er is niets te doen voor 'check'. +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/po' wordt verlaten +Making check in sed +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/sed' wordt binnengegaan +make[1]: Er is niets te doen voor 'check'. +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/sed' wordt verlaten +Making check in doc +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/doc' wordt binnengegaan +make[1]: Er is niets te doen voor 'check'. +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/doc' wordt verlaten +Making check in testsuite +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/testsuite' wordt binnengegaan +make.exe +make[2]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/testsuite' wordt binnengegaan +make[2]: Er is niets te doen voor 'all'. +make[2]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/testsuite' wordt verlaten +make.exe check-TESTS +make[2]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/testsuite' wordt binnengegaan +PASS: appquit +PASS: enable +PASS: sep +PASS: inclib +PASS: 8bit +PASS: newjis +PASS: xabcx +PASS: dollar +PASS: noeol +PASS: noeolw +PASS: modulo +PASS: numsub +PASS: numsub2 +PASS: numsub3 +PASS: numsub4 +PASS: numsub5 +PASS: 0range +PASS: bkslashes +PASS: head +PASS: madding +PASS: mac-mf +PASS: empty +PASS: xbxcx +PASS: xbxcx3 +PASS: recall +PASS: recall2 +PASS: xemacs +PASS: fasts +PASS: uniq +PASS: manis +PASS: khadafy +PASS: linecnt +PASS: eval +PASS: distrib +PASS: 8to7 +PASS: y-bracket +PASS: y-newline +PASS: allsub +PASS: cv-vars +PASS: classes +PASS: middle +XPASS: bsd +PASS: stdin +PASS: flipcase +PASS: insens +PASS: subwrite +PASS: writeout +PASS: readin +PASS: insert +SKIP: utf8-1 +SKIP: utf8-2 +SKIP: utf8-3 +SKIP: utf8-4 +PASS: badenc +PASS: inplace-hold +PASS: brackets +PASS: help +PASS: version +PASS: file +PASS: quiet +PASS: factor +PASS: binary3 +PASS: binary2 +PASS: binary +PASS: dc +============================================================== +1 of 61 tests did not behave as expected (1 unexpected passes) +(4 tests were not run) +Please report to bug-gnu-utils@gnu.org +============================================================== +make[2]: [check-TESTS] Fout 1 (genegeerd) +make[2]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/testsuite' wordt verlaten +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1/testsuite' wordt verlaten +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1' wordt binnengegaan +make[1]: Map '/cygdrive/j/Textproc/sed/4.2.1/sed-4.2.1' wordt verlaten -- cgit v1.2.3