9base

revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log | Files | Refs | README | LICENSE

read.1 (1806B)


      1 .TH CAT 1
      2 .SH NAME
      3 cat, read, nobs \- catenate files
      4 .SH SYNOPSIS
      5 .B cat
      6 [
      7 .I file ...
      8 ]
      9 .br
     10 .B read
     11 [
     12 .B -c
     13 ] [
     14 [
     15 .B -m
     16 ] [
     17 .B -n
     18 .I nline
     19 ] [
     20 .I file ...
     21 ]
     22 .br
     23 .B nobs
     24 [
     25 .I file ...
     26 ]
     27 .SH DESCRIPTION
     28 .I Cat
     29 reads each
     30 .I file
     31 in sequence and writes it on the standard output.
     32 Thus
     33 .IP
     34 .L
     35 cat file
     36 .LP
     37 prints a file and
     38 .IP
     39 .L
     40 cat file1 file2 >file3
     41 .LP
     42 concatenates the first two files and places the result
     43 on the third.
     44 .PP
     45 If no
     46 .I file
     47 is given,
     48 .I cat 
     49 reads from the standard input.
     50 Output is buffered in blocks matching the input.
     51 .PP
     52 .I Read
     53 copies to standard output exactly one line from the named
     54 .IR file ,
     55 default standard input.
     56 It is useful in interactive
     57 .IR rc (1)
     58 scripts.
     59 .PP
     60 The
     61 .B -m
     62 flag causes it to continue reading and writing multiple lines until end of file;
     63 .B -n
     64 causes it to read no more than
     65 .I nline
     66 lines.
     67 .PP
     68 With the
     69 .B -c
     70 flag,
     71 .I read
     72 copies exactly
     73 .I nbytes
     74 of characters instead of lines. It is mutually exclusive with
     75 .B -n
     76 and
     77 .B -m
     78 flag.
     79 .PP
     80 .I Read
     81 always executes a single
     82 .B write
     83 for each line of input, which can be helpful when
     84 preparing input to programs that expect line-at-a-time data.
     85 It never reads any more data from the input than it prints to the output.
     86 .PP
     87 .I Nobs
     88 copies the named files to
     89 standard output except that it removes all backspace
     90 characters and the characters that precede them.
     91 It is useful to use as
     92 .B $PAGER
     93 with the Unix version of
     94 .IR man (1)
     95 when run inside a
     96 .I win
     97 (see
     98 .IR acme (1))
     99 window.
    100 .SH SOURCE
    101 .B \*9/src/cmd/cat.c
    102 .br
    103 .B \*9/src/cmd/read.c
    104 .br
    105 .B \*9/bin/nobs
    106 .SH SEE ALSO
    107 .IR cp (1)
    108 .SH DIAGNOSTICS
    109 .I Read
    110 exits with status
    111 .B eof
    112 on end of file or, in the
    113 .B -n
    114 case, if it doesn't read
    115 .I nlines
    116 lines.
    117 .SH BUGS
    118 Beware of
    119 .L "cat a b >a"
    120 and
    121 .LR "cat a b >b" ,
    122 which
    123 destroy input files before reading them.