diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/basename.c | 3 | ||||
-rw-r--r-- | src/date.c | 39 | ||||
-rw-r--r-- | src/dirname.c | 3 | ||||
-rw-r--r-- | src/echo.c | 3 | ||||
-rw-r--r-- | src/env.c | 3 | ||||
-rw-r--r-- | src/expr.c | 3 | ||||
-rw-r--r-- | src/hostname.c | 3 | ||||
-rw-r--r-- | src/id.c | 3 | ||||
-rw-r--r-- | src/logname.c | 3 | ||||
-rw-r--r-- | src/nice.c | 3 | ||||
-rw-r--r-- | src/pathchk.c | 3 | ||||
-rw-r--r-- | src/printenv.c | 3 | ||||
-rw-r--r-- | src/printf.c | 3 | ||||
-rw-r--r-- | src/pwd.c | 3 | ||||
-rw-r--r-- | src/sleep.c | 3 | ||||
-rw-r--r-- | src/stty.c | 3 | ||||
-rw-r--r-- | src/su.c | 3 | ||||
-rw-r--r-- | src/tee.c | 3 | ||||
-rw-r--r-- | src/test.c | 3 | ||||
-rw-r--r-- | src/tty.c | 3 | ||||
-rw-r--r-- | src/uname.c | 3 | ||||
-rw-r--r-- | src/who.c | 3 | ||||
-rw-r--r-- | src/whoami.c | 3 | ||||
-rw-r--r-- | src/yes.c | 5 |
24 files changed, 12 insertions, 98 deletions
diff --git a/src/basename.c b/src/basename.c index 10726d225..1c8a058e2 100644 --- a/src/basename.c +++ b/src/basename.c @@ -25,10 +25,7 @@ basename functions.lisp p => functions.lis */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <sys/types.h> diff --git a/src/date.c b/src/date.c index fe129b9bb..da33d4169 100644 --- a/src/date.c +++ b/src/date.c @@ -13,36 +13,11 @@ 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\ diff --git a/src/dirname.c b/src/dirname.c index 22e983dd2..3fb5c1a4a 100644 --- a/src/dirname.c +++ b/src/dirname.c @@ -17,10 +17,7 @@ /* Written by David MacKenzie and Jim Meyering. */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <sys/types.h> diff --git a/src/echo.c b/src/echo.c index ea7510e63..ee2402a39 100644 --- a/src/echo.c +++ b/src/echo.c @@ -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" @@ -77,10 +77,7 @@ { LOGNAME=foo PATH=/energy } */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <getopt.h> #include <sys/types.h> diff --git a/src/expr.c b/src/expr.c index 7cf9110b3..e1ee8e722 100644 --- a/src/expr.c +++ b/src/expr.c @@ -28,10 +28,7 @@ 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> diff --git a/src/hostname.c b/src/hostname.c index 2a7939864..df533a57b 100644 --- a/src/hostname.c +++ b/src/hostname.c @@ -17,10 +17,7 @@ /* Jim Meyering <meyering@comco.com> */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <sys/types.h> @@ -18,10 +18,7 @@ /* 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> diff --git a/src/logname.c b/src/logname.c index bc21afcd4..7b152e5f2 100644 --- a/src/logname.c +++ b/src/logname.c @@ -15,10 +15,7 @@ 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> diff --git a/src/nice.c b/src/nice.c index 444131f7a..9f338662b 100644 --- a/src/nice.c +++ b/src/nice.c @@ -17,10 +17,7 @@ /* David MacKenzie <djm@gnu.ai.mit.edu> */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #define NDEBUG diff --git a/src/pathchk.c b/src/pathchk.c index 3b7c8e534..de8bc6c3f 100644 --- a/src/pathchk.c +++ b/src/pathchk.c @@ -38,10 +38,7 @@ 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> diff --git a/src/printenv.c b/src/printenv.c index 4ddaeba8c..bbdca9d62 100644 --- a/src/printenv.c +++ b/src/printenv.c @@ -27,10 +27,7 @@ David MacKenzie and Richard Mlynarik */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <sys/types.h> #include <getopt.h> diff --git a/src/printf.c b/src/printf.c index c4728114e..e437abe13 100644 --- a/src/printf.c +++ b/src/printf.c @@ -43,10 +43,7 @@ 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> @@ -17,10 +17,7 @@ /* Jim Meyering <meyering@comco.com> */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <sys/types.h> diff --git a/src/sleep.c b/src/sleep.c index dda1ea48a..f584f5cad 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -15,10 +15,7 @@ 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> diff --git a/src/stty.c b/src/stty.c index 5efeb243b..b98d1a9b8 100644 --- a/src/stty.c +++ b/src/stty.c @@ -27,10 +27,7 @@ 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> @@ -69,10 +69,7 @@ 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> @@ -17,10 +17,7 @@ /* 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> diff --git a/src/test.c b/src/test.c index 7aefb0a46..6830ca703 100644 --- a/src/test.c +++ b/src/test.c @@ -24,10 +24,7 @@ the shell builtin version. */ /* #define TEST_STANDALONE */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - #include <stdio.h> #include <sys/types.h> @@ -22,10 +22,7 @@ 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> diff --git a/src/uname.c b/src/uname.c index ae34b543c..39b170285 100644 --- a/src/uname.c +++ b/src/uname.c @@ -28,10 +28,7 @@ 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> @@ -32,10 +32,7 @@ -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> diff --git a/src/whoami.c b/src/whoami.c index 6bb43153f..233313ef6 100644 --- a/src/whoami.c +++ b/src/whoami.c @@ -18,10 +18,7 @@ /* 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> @@ -17,10 +17,7 @@ /* David MacKenzie <djm@gnu.ai.mit.edu> */ -#ifdef HAVE_CONFIG_H - -#endif - +#include <config.h> #include <stdio.h> #include <getopt.h> |