]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
.
authorJim Meyering <jim@meyering.net>
Sat, 1 Oct 1994 02:52:05 +0000 (02:52 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 1 Oct 1994 02:52:05 +0000 (02:52 +0000)
24 files changed:
src/basename.c
src/date.c
src/dirname.c
src/echo.c
src/env.c
src/expr.c
src/hostname.c
src/id.c
src/logname.c
src/nice.c
src/pathchk.c
src/printenv.c
src/printf.c
src/pwd.c
src/sleep.c
src/stty.c
src/su.c
src/tee.c
src/test.c
src/tty.c
src/uname.c
src/who.c
src/whoami.c
src/yes.c

index 10726d22529e4f7fed30445a66ab64497f969b80..1c8a058e253a6e5fa0377c00ad6a0c576fdcafda 100644 (file)
    basename functions.lisp p
    => functions.lis */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index fe129b9bb96f121ce0ca8e9821c7f68a028c8f3e..da33d416941ec62d5387514d768c6acc243fa0c6 100644 (file)
 
    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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
-
-/* Options:
-   -d DATESTR   Display the date DATESTR.
-   -s DATESTR   Set the date to DATESTR.
-   -u           Display or set the date in universal instead of local time.
-   +FORMAT      Specify custom date output format, described below.
-   MMDDhhmm[[CC]YY][.ss]        Set the date in the format described below.
-
-   If one non-option argument is given, it is used as the date to which
-   to set the system clock, and must have the format:
-   MM   month (01..12)
-   DD   day in month (01..31)
-   hh   hour (00..23)
-   mm   minute (00..59)
-   CC   first 2 digits of year (optional, defaults to current) (00..99)
-   YY   last 2 digits of year (optional, defaults to current) (00..99)
-   ss   second (00..61)
-
-   If a non-option argument that starts with a `+' is specified, it
-   is used to control the format in which the date is printed; it
-   can contain any of the `%' substitutions allowed by the strftime
-   function.  A newline is always added at the end of the output.
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
    David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -97,7 +72,11 @@ static struct option const long_options[] =
   {NULL, 0, NULL, 0}
 };
 
-/* FIXME: comment */
+/* Parse each line in INPUT_FILENAME as with --date and display the
+   each resulting time and date.  If the file cannot be opened, tell why
+   then exit.  Issue a diagnostic for any lines that cannot be parsed.
+   If any line cannot be parsed, return non-zero;  otherwise return zero.
+   */
 
 static int
 batch_convert (const char *input_filename, const char *format)
@@ -144,7 +123,10 @@ batch_convert (const char *input_filename, const char *format)
          error (0, 0, "invalid date `%s'", line);
          status = 1;
        }
-      show_date (format, when);
+      else
+       {
+         show_date (format, when);
+       }
     }
 
   if (have_read_stdin && fclose (stdin) == EOF)
@@ -350,6 +332,7 @@ Usage: %s [OPTION]... [+FORMAT]\n\
       printf ("\
 \n\
   -d, --date=STRING        display time described by STRING, not `now'\n\
+  -f, --file=DATEFILE      like --date once for each line of DATEFILE\n\
   -s, --set=STRING         set time described by STRING\n\
   -u, --utc, --universal   print or set Coordinated Universal Time\n\
       --help               display this help and exit\n\
index 22e983dd297b796f1621e105c57b352eb96aca13..3fb5c1a4ab21c3c9a0183b8770d50dbacd4e6362 100644 (file)
 
 /* Written by David MacKenzie and Jim Meyering. */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index ea7510e63b4c5477138f5d51345c3c848779a6b8..ee2402a39715dd129719197fe184d6866b3402cf 100644 (file)
@@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along
 with Bash; see the file COPYING.  If not, write to the Free Software
 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include "system.h"
index 46a4071e830e80f4a3eb3e9a7daed61a4d9b89f2..19c2a62c17670d080d9227310c986f01437a9803 100644 (file)
--- a/src/env.c
+++ b/src/env.c
        { LOGNAME=foo PATH=/energy }
 */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index 7cf9110b344f9e17fad6b178d35f76f3ca397f79..e1ee8e722dc5197162ba78bc006d71d685cf2217 100644 (file)
 
    Define EVAL_TRACE to print an evaluation trace.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <regex.h>
index 2a79398644444c817f590b9b03d585432b091982..df533a57bc984b133641f2a2a2b8deacef726efd 100644 (file)
 
 /* Jim Meyering <meyering@comco.com> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index 706146661c39a82f07a3f3b09660bebd0699b1e2..92f2bd6c7e47c82194634ff5092dea0df25fe771 100644 (file)
--- a/src/id.c
+++ b/src/id.c
 /* Written by Arnold Robbins, arnold@audiofax.com.
    Major rewrite by David MacKenzie, djm@gnu.ai.mit.edu. */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index bc21afcd48af51d88b463c4ff636f6ba8c98e04c..7b152e5f2a8048515848da9405a1103faf063454 100644 (file)
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
index 444131f7a0bd67569bc6fcee1ede5a021f319f4d..9f338662b0a2207576771279477fdce7d17caac0 100644 (file)
 
 /* David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 
 #define NDEBUG
index 3b7c8e534b75bee0bc02d390bb29e717335afb0f..de8bc6c3f11c26485c6354a9a0071bbce2039cf3 100644 (file)
    David MacKenzie <djm@gnu.ai.mit.edu>
    and Jim Meyering <meyering@cs.utexas.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index 4ddaeba8cb502f2cabd781c53e67284a18d38f89..bbdca9d6264937adfe5a7f8abcbe8bd9cbec7af4 100644 (file)
 
    David MacKenzie and Richard Mlynarik */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
index c4728114ecaa64b8bd3edc886f7e76c8e2449819..e437abe137bab3d17ffc43d02a96a095bb57aa0c 100644 (file)
 
    David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
index 8da058a6b5fa11bfa25d5d5de303a1eefb9b9061..807e77b744248dc2f483d38cd151567d61518e09 100644 (file)
--- a/src/pwd.c
+++ b/src/pwd.c
 
 /* Jim Meyering <meyering@comco.com> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index dda1ea48ae0e80043198341dafe1e62c505463a8..f584f5cad7686f0672505016df62cbacf9db586c 100644 (file)
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
index 5efeb243b8213071e199b206f4caff5b061587e2..b98d1a9b83c6c8b1db645405cb56830986176a07 100644 (file)
 
    David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <termios.h>
index e67d048e5008837a97b88826fed282ac2ff06867..4a1640767afe56379f8636e4556cb2ea601f71cd 100644 (file)
--- a/src/su.c
+++ b/src/su.c
 
    Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index ca1e2712318c16ecf382b75dd8fcaae2dbe2ca46..de0348b5d7a12f4d17b66a1133c728d2d73006b2 100644 (file)
--- a/src/tee.c
+++ b/src/tee.c
 
 /* Mike Parker, Richard M. Stallman, and David MacKenzie */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <signal.h>
index 7aefb0a4674876451c091ef59b5a9f24ac6e7f9e..6830ca70315fe758d9342be2521145c0babb7fc5 100644 (file)
    the shell builtin version. */
 /* #define TEST_STANDALONE */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index 3d6c532be74e32de08f389f363aa6737fa01d9a6..f7ad301c018572e64aa9bb57790319e8da599b60 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
 
    Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
index ae34b543cd6aec7915fa363769564e1f0f12d3a4..39b17028564d4277294bbec51e079e51332441f8 100644 (file)
 
    David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
index c173977c80139591e5e4701f46cd7cfea2e19f7c..acfd1d09748e764430f559d9d03277b721883cbb 100644 (file)
--- a/src/who.c
+++ b/src/who.c
    -H          Print column headings at top.
    -w, -T      -s plus mesg (+ or -, or ? if bad line). */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index 6bb43153f8a862136cd24694cd8de4af5d179832..233313ef62c7b637f79df343602f62bc840edbcb 100644 (file)
 /* Equivalent to `id -un'. */
 /* Written by Richard Mlynarik. */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <pwd.h>
index 68bf9ae14bdc5c836eb536d7c4f32099c7dc38fa..bb7539ba7b8743e921a543247f36f151b0628a8e 100644 (file)
--- a/src/yes.c
+++ b/src/yes.c
 
 /* David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
-
-#endif
-
+#include <config.h>
 #include <stdio.h>
 #include <getopt.h>