diff options
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/Makefile | 10 | ||||
-rw-r--r-- | text-utils/line.1 | 17 | ||||
-rw-r--r-- | text-utils/line.sh | 22 | ||||
-rw-r--r-- | text-utils/more.1 | 6 | ||||
-rw-r--r-- | text-utils/more.c | 16 |
5 files changed, 60 insertions, 11 deletions
diff --git a/text-utils/Makefile b/text-utils/Makefile index a1c4dc87a..8609bacde 100644 --- a/text-utils/Makefile +++ b/text-utils/Makefile @@ -6,9 +6,9 @@ include ../make_include include ../MCONFIG -MAN1= col.1 colcrt.1 colrm.1 column.1 hexdump.1 rev.1 +MAN1= col.1 colcrt.1 colrm.1 column.1 hexdump.1 rev.1 line.1 -USRBIN= col colcrt colrm column hexdump rev +USRBIN= col colcrt colrm column hexdump rev line BIN= @@ -71,6 +71,12 @@ column.o: $(LIB)/errs.h column: column.o $(ERR_O) more.o: more.c $(LIB)/pathnames.h rev: rev.o +line: line.sh + +%: %.sh + cp $@.sh $@ + chmod 755 $@ + colcrt.o colrm.o column.o rev.o ul.o: $(LIB)/widechar.h diff --git a/text-utils/line.1 b/text-utils/line.1 new file mode 100644 index 000000000..2c356a6bd --- /dev/null +++ b/text-utils/line.1 @@ -0,0 +1,17 @@ +.\" This page is in the public domain +.Dd August 2, 2001 +.Dt line 1 +.Os Linux 2.4 +.Sh NAME +.Nm line +.Nd read one line +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +.Nm +copies one line (up to a newline) from standard input and writes it to +standard output. It always prints at least a newline and returns an exit +code of 1 on EOF. +.Sh SEE ALSO +.Xr read 2 , +.Xr sh 1 diff --git a/text-utils/line.sh b/text-utils/line.sh new file mode 100644 index 000000000..0d1c59c7d --- /dev/null +++ b/text-utils/line.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# line read one line +# +# Version: $Id: line,v 1.1 2001/08/03 14:54:10 hch Exp hch $ +# +# Author: Christoph Hellwig <hch@caldera.de> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version +# 2 of the License, or (at your option) any later version. +# + +read line +echo ${line} + +if [ -z "${line}" ]; then + exit 1 +else + exit 0 +fi diff --git a/text-utils/more.1 b/text-utils/more.1 index 0a5fa47aa..0142d8ce4 100644 --- a/text-utils/more.1 +++ b/text-utils/more.1 @@ -141,6 +141,7 @@ Skip forward k lines of text. Defaults to 1. Skip forward k screenfuls of text. Defaults to 1. .It Ic b No or Ic \&^B Skip backwards k screenfuls of text. Defaults to 1. +Only works with files, not pipes. .It Ic ' Go to place where previous search started. .It Ic = @@ -152,7 +153,10 @@ Search for kth occurrence of last r.e. Defaults to 1. .It Ic !<cmd> No or Ic :!<cmd> Execute <cmd> in a subshell .It Ic v -Start up /usr/bin/vi at current line +Start up an editor at current line. +The editor is taken from the environment variable VISUAL if defined, +or EDITOR if VISUAL is not defined, +or defaults to "vi" if neither VISUAL nor EDITOR is defined. .It Ic \&^L Redraw screen .It Ic :n diff --git a/text-utils/more.c b/text-utils/more.c index 0411b17fe..62c44006b 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -508,7 +508,7 @@ checkf (fs, clearfirst) { struct stat stbuf; register FILE *f; - char c; + int c; if (stat (fs, &stbuf) == -1) { (void)fflush(stdout); @@ -1186,12 +1186,10 @@ int command (char *filename, register FILE *f) xprintf ("\n"); if (clreol) cleareol (); - xprintf (_("...back %d page"), nlines); - if (nlines > 1) - pr ("s\n"); + if (nlines != 1) + xprintf (_("...back %d pages"), nlines); else - pr ("\n"); - + xprintf (_("...back 1 page")); if (clreol) cleareol (); pr ("\n"); @@ -1680,8 +1678,10 @@ void skipf (register int nskip) pr ("\n"); if (clreol) cleareol (); - pr (_("...Skipping ")); - pr (nskip > 0 ? _("to file ") : _("back to file ")); + if (nskip > 0) + pr (_("...Skipping to file ")); + else + pr (_("...Skipping back to file ")); pr (fnames[fnum]); pr ("\n"); if (clreol) |