


      BBBBFFFFSSSS((((1111))))                      ((((UUUUNNNNIIIIXXXX 5555....2222))))                     BBBBFFFFSSSS((((1111))))



      NNNNAAAAMMMMEEEE
           bfs - big file scanner

      SSSSYYYYNNNNTTTTAAAAXXXX
           bbbbffffssss [ ---- ] name

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           The _B_f_s command is (almost) like _e_d(1) except that it is
           read-only and processes much larger files.  Files can be up
           to 1024K bytes (the maximum possible size) and 32K lines,
           with up to 512 characters, including new-line, per line (255
           for 16-bit machines).  _B_f_s is usually more efficient than _e_d
           for scanning a file, since the file is not copied to a
           buffer.  It is most useful for identifying sections of a
           large file where _c_s_p_l_i_t(1) can be used to divide it into
           more manageable pieces for editing.

           Normally, the size of the file being scanned is printed, as
           is the size of any file written with the wwww command.  The
           optional ---- suppresses printing of sizes.  Input is prompted
           with **** if PPPP and a return are typed as in _e_d.  Prompting can
           be turned off again by inputting another PPPP and return.  Note
           that messages are given in response to errors if prompting
           is turned on.

           All address expressions described under _e_d are supported.
           In addition, regular expressions may be surrounded with two
           symbols besides //// and ????:  >>>> indicates downward search
           without wrap-around, and <<<< indicates upward search without
           wrap-around.  There is a slight difference in mark names:
           only the letters aaaa through zzzz may be used, and all 26 marks
           are remembered.

           The eeee, gggg, vvvv, kkkk, pppp, qqqq, wwww, ====, !!!! and null commands operate as
           described under _e_d.  Commands such as ------------, ++++++++++++----, ++++++++++++====, ----11112222,
           and ++++4444pppp are accepted.  Note that 1111,,,,11110000pppp and 1111,,,,11110000 will both
           print the first ten lines.  The ffff command only prints the
           name of the file being scanned; there is no _r_e_m_e_m_b_e_r_e_d file
           name.  The wwww command is independent of output diversion,
           truncation, or crunching (see the xxxxoooo, xxxxtttt and xxxxcccc commands,
           below).  The following additional commands are available:

                xxxxffff _f_i_l_e
                     Further commands are taken from the named _f_i_l_e.
                     When an end-of-file is reached, an interrupt
                     signal is received or an error occurs, reading
                     resumes with the file containing the xxxxffff.  The xxxxffff
                     commands may be nested to a depth of 10.

                xxxxnnnn   List the marks currently in use (marks are set by
                     the kkkk command).




      Page 1                                                   (9010-E)






      BBBBFFFFSSSS((((1111))))                      ((((UUUUNNNNIIIIXXXX 5555....2222))))                     BBBBFFFFSSSS((((1111))))



                xxxxoooo [_f_i_l_e]
                     Further output from the pppp and null commands is
                     diverted to the named _f_i_l_e, which, if necessary,
                     is created mode 666.  If _f_i_l_e is missing, output
                     is diverted to the standard output.  Note that
                     each diversion causes truncation or creation of
                     the file.

                :::: _l_a_b_e_l
                     This positions a _l_a_b_e_l in a command file.  The
                     _l_a_b_e_l is terminated by new-line, and blanks
                     between the :::: and the start of the _l_a_b_e_l are
                     ignored.  This command may also be used to insert
                     comments into a command file, since labels need
                     not be referenced.

                ( .... , .... )xxxxbbbb/_r_e_g_u_l_a_r _e_x_p_r_e_s_s_i_o_n/_l_a_b_e_l
                     A jump (either upward or downward) is made to
                     _l_a_b_e_l if the command succeeds.  It fails under any
                     of the following conditions:
                             1. Either address is not between 1111 and $$$$.
                             2. The second address is less than the
                             first.
                             3. The regular expression does not match
                             at least one line in the specified range,
                             including the first and last lines.

                     On success, .... is set to the line matched and a
                     jump is made to _l_a_b_e_l.  This command is the only
                     one that does not issue an error message on bad
                     addresses, so it may be used to test whether
                     addresses are bad before other commands are
                     executed.  Note that the command

                          xb/^/ label

                     is an unconditional jump.
                     The xxxxbbbb command is allowed only if it is read from
                     someplace other than a terminal.  If it is read
                     from a pipe only a downward jump is possible.

                xxxxtttt _n_u_m_b_e_r
                     Output from the pppp and null commands is truncated
                     to at most _n_u_m_b_e_r characters.  The initial number
                     is 255.

                xxxxvvvv[_d_i_g_i_t][_s_p_a_c_e_s][_v_a_l_u_e]
                     The variable name is the specified _d_i_g_i_t following
                     the xxxxvvvv.  The commands xxxxvvvv5555111100000000 or xxxxvvvv5555 111100000000 both
                     assign the value 111100000000 to the variable 5555.  The
                     command XXXXvvvv66661111,,,,111100000000pppp assigns the value 1111,,,,111100000000pppp to the
                     variable 6666.  To reference a variable, put a %%%% in



      Page 2                                                   (9010-E)






      BBBBFFFFSSSS((((1111))))                      ((((UUUUNNNNIIIIXXXX 5555....2222))))                     BBBBFFFFSSSS((((1111))))



                     front of the variable name.  For example, using
                     the above assignments for variables 5555 and 6666:

                          1,%5p
                          1,%5
                          %6

                     will all print the first 100 lines.

                          g/%5/p

                     would globally search for the characters 111100000000 and
                     print each line containing a match.  To escape the
                     special meaning of %%%%, a \\\\ must precede it.

                          g/".*\%[cds]/p

                     could be used to match and list lines containing
                     _p_r_i_n_t_f of characters, decimal integers, or
                     strings.
                     Another feature of the xxxxvvvv command is that the
                     first line of output from a UNIX system command
                     can be stored into a variable.  The only
                     requirement is that the first character of _v_a_l_u_e
                     be an !!!!.  For example:

                          ....w junk
                          xv5!cat junk
                          !rm junk
                          !echo "%5"
                          xv6!expr %6 + 1

                     would put the current line into variable 5555, print
                     it, and increment the variable 6666 by one.  To
                     escape the special meaning of !!!! as the first
                     character of _v_a_l_u_e, precede it with a \\\\.

                          xv7\!date

                     stores the value !!!!ddddaaaatttteeee into variable 7777.

                xxxxbbbbzzzz _l_a_b_e_l

                xxxxbbbbnnnn _l_a_b_e_l
                     These two commands will test the last saved _r_e_t_u_r_n
                     _c_o_d_e from the execution of a UNIX system command
                     (!!!!_c_o_m_m_a_n_d) or nonzero value, respectively, to the
                     specified label.  The two examples below both
                     search for the next five lines containing the
                     string ssssiiiizzzzeeee.

                          xv55



      Page 3                                                   (9010-E)






      BBBBFFFFSSSS((((1111))))                      ((((UUUUNNNNIIIIXXXX 5555....2222))))                     BBBBFFFFSSSS((((1111))))



                          : l
                          /size/
                          xv5!expr %5 - 1
                          !if 0%5 != 0 exit 2
                          xbn l
                          xv45
                          : l
                          /size/
                          xv4!expr %4 - 1
                          !if 0%4 = 0 exit 2
                          xbz l

                xxxxcccc [_s_w_i_t_c_h]
                     If _s_w_i_t_c_h is 1111, output from the pppp and null
                     commands is crunched; if _s_w_i_t_c_h is 0000 it is not.
                     Without an argument, xxxxcccc reverses _s_w_i_t_c_h.
                     Initially _s_w_i_t_c_h is set for no crunching.
                     Crunched output has strings of tabs and blanks
                     reduced to one blank and blank lines suppressed.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           csplit(1), ed(1), regcmp(3X).

      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
           ???? for errors in commands, if prompting is turned off.
           Self-explanatory error messages when prompting is on.





























      Page 4                                                   (9010-E)



