diff options
| author | Daniel O'Callaghan <danny@FreeBSD.org> | 1997-10-03 12:54:30 +0000 |
|---|---|---|
| committer | Daniel O'Callaghan <danny@FreeBSD.org> | 1997-10-03 12:54:30 +0000 |
| commit | fbab7e4d80c1bced53f0958202758107cb90e8dc (patch) | |
| tree | e47a8a69a6782a15890810bf49fa8fdae24bed1c /bin | |
| parent | 4cf98c18cb86422fce18f0730e35438d42ad40e0 (diff) | |
Notes
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/date/date.1 | 5 | ||||
| -rw-r--r-- | bin/date/date.c | 17 |
2 files changed, 7 insertions, 15 deletions
diff --git a/bin/date/date.1 b/bin/date/date.1 index 4fdbceffb830..68c9e1dfb7b7 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -46,7 +46,7 @@ .Op Fl d Ar dst .Op Fl r Ar seconds .Op Fl t Ar minutes_west -.Op Fl nsu +.Op Fl nu .Op Cm + Ns Ar format .Op Fl v Ar [+|-]val[ymwdHM] .Ar ... @@ -95,9 +95,6 @@ from setting the time for other than the current machine. Print out the date and time in .Ar seconds from the Epoch. -.It Fl s -Single-line print - don't print final linefeed character, useful for -adding dated lines to logfiles generated by shell scripts. .It Fl t Set the kernel's value for minutes west of .Tn GMT . diff --git a/bin/date/date.c b/bin/date/date.c index 587170ae29d3..31112cdd3499 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: date.c,v 1.7.2.4 1997/09/30 20:07:00 joerg Exp $ + * $Id: date.c,v 1.7.2.5 1997/10/01 06:12:58 danny Exp $ */ #ifndef lint @@ -76,7 +76,7 @@ main(argc, argv) extern int optind; extern char *optarg; struct timezone tz; - int ch, rflag, sflag; + int ch, rflag; char *format, buf[1024]; char *endptr, *fmt; int set_timezone; @@ -88,9 +88,9 @@ main(argc, argv) fmt = NULL; (void) setlocale(LC_TIME, ""); tz.tz_dsttime = tz.tz_minuteswest = 0; - rflag = sflag = 0; + rflag = 0; set_timezone = 0; - while ((ch = getopt(argc, argv, "d:f:nr:st:uv:")) != -1) + while ((ch = getopt(argc, argv, "d:f:nr:t:uv:")) != -1) switch((char)ch) { case 'd': /* daylight savings time */ tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0; @@ -108,9 +108,6 @@ main(argc, argv) rflag = 1; tval = atol(optarg); break; - case 's': /* suppress newline */ - sflag = 1; - break; case 't': /* minutes west of GMT */ /* error check; don't allow "PST" */ tz.tz_minuteswest = strtol(optarg, &endptr, 10); @@ -167,9 +164,7 @@ main(argc, argv) } vary_destroy(v); (void)strftime(buf, sizeof(buf), format, <); - (void)printf("%s", buf); - if (!sflag) - (void)printf("\n"); + (void)printf("%s\n", buf); exit(retval); } @@ -281,7 +276,7 @@ static void usage() { (void)fprintf(stderr, "%s\n%s\n", - "usage: date [-nsu] [-d dst] [-r seconds] [-t west] [+format]", + "usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]", " [-v [+|-]val[ymwdHM]] ... [-f fmt date | [[[[yy]mm]dd]HH]MM[.ss]]"); exit(1); } |
