diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2005-05-10 13:40:50 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2005-05-10 13:40:50 +0000 |
| commit | 1ed86f6c9046ce2954aa607f1b8d00b519ca1a70 (patch) | |
| tree | 1da6ff05e95f80364243ccacd701d2a23c265798 /usr.bin/sed | |
| parent | c26295ddea669e7a5c836662f940eecf38c1d2d9 (diff) | |
Notes
Diffstat (limited to 'usr.bin/sed')
| -rw-r--r-- | usr.bin/sed/main.c | 10 | ||||
| -rw-r--r-- | usr.bin/sed/sed.1 | 6 |
2 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index 55285145b06b..5703d2052542 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -128,7 +128,7 @@ main(int argc, char *argv[]) fflag = 0; inplace = NULL; - while ((c = getopt(argc, argv, "Eae:f:i:n")) != -1) + while ((c = getopt(argc, argv, "Eae:f:i:ln")) != -1) switch (c) { case 'E': rflags = REG_EXTENDED; @@ -151,6 +151,10 @@ main(int argc, char *argv[]) case 'i': inplace = optarg; break; + case 'l': + if(setlinebuf(stdout) != 0) + warnx("setlinebuf() failed"); + break; case 'n': nflag = 1; break; @@ -186,8 +190,8 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sed script [-Ean] [-i extension] [file ...]", - " sed [-an] [-i extension] [-e script] ... [-f script_file] ... [file ...]"); + "usage: sed script [-Ealn] [-i extension] [file ...]", + " sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]"); exit(1); } diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index a21248f5c77a..de7844313817 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -39,11 +39,11 @@ .Nd stream editor .Sh SYNOPSIS .Nm -.Op Fl Ean +.Op Fl Ealn .Ar command .Op Ar .Nm -.Op Fl Ean +.Op Fl Ealn .Op Fl e Ar command .Op Fl f Ar command_file .Op Fl i Ar extension @@ -105,6 +105,8 @@ It is not recommended to give a zero-length .Ar extension when in-place editing files, as you risk corruption or partial content in situations where disk space is exhausted, etc. +.It Fl l +Make output line buffered. .It Fl n By default, each line of input is echoed to the standard output after all of the commands have been applied to it. |
