.
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 10726d2..1c8a058 100644 (file)
    basename functions.lisp p
    => functions.lis */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index fe129b9..da33d41 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 22e983d..3fb5c1a 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 ea7510e..ee2402a 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 46a4071..19c2a62 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 7cf9110..e1ee8e7 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 2a79398..df533a5 100644 (file)
 
 /* Jim Meyering <meyering@comco.com> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 #include <sys/types.h>
 
index 7061466..92f2bd6 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 bc21afc..7b152e5 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 444131f..9f33866 100644 (file)
 
 /* David MacKenzie <djm@gnu.ai.mit.edu> */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
 
 #define NDEBUG
index 3b7c8e5..de8bc6c 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 4ddaeba..bbdca9d 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 c472811..e437abe 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 8da058a..807e77b 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 dda1ea4..f584f5c 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 5efeb24..b98d1a9 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 e67d048..4a16407 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 ca1e271..de0348b 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 7aefb0a..6830ca7 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 3d6c532..f7ad301 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 ae34b54..39b1702 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 c173977..acfd1d0 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 6bb4315..233313e 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 68bf9ae..bb7539b 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>