FreeBSD Manual Pages
bfs(1) General Commands Manual bfs(1) NAME bfs - big file scanner SYNOPSIS name DESCRIPTION is similar to except that it is read-only (see ed(1)) can handle files with up to 32K - 1 lines; each line can contain up to 512 characters, including the new-line character. is usually more efficient than for scanning a file, since the file is not copied to a buffer. Histori- cally, this command was most useful for identifying sections of a large file where could be used to divide it into more manageable pieces for editing (see csplit(1)). However, most editors now support files larger than the above-mentioned limits. Normally, the size of the file being scanned is printed, as is the size of any file written with the command. The optional suppresses printing of sizes. Input is prompted with if and a carriage-return are typed, as in Prompting can be turned off again by inputting another and press- ing Return. Note that messages are given in response to errors if prompting is turned on. supports the Basic Regular Expression (RE) syntax (see regexp(5)) with the addition that a null RE (e.g., is equivalent to the last RE encoun- tered. All address expressions described under are supported. In ad- dition, regular expressions can 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 through can be used, and all 26 marks are re- membered. The and null commands operate as described under Commands such as and are accepted. Note that and both print the first ten lines. The com- mand only prints the name of the file being scanned; there is no remem- bered file name. The command is independent of output diversion, trun- cation, or crunching (see the and commands, below). The following ad- ditional commands are available: Further commands are taken from the named file. When an end-of-file is reached, an interrupt sig- nal is received or an error occurs, reading resumes with the file containing the commands may be nested to a depth of 10. Further output from the and null commands is diverted to the named file, which, if necessary, is created mode 666. If file is missing, output is diverted to the standard output. Note that each diversion causes truncation or creation of the file. This positions a label in a command file. label is terminated by a new- line, and blanks between the and the start of label are ignored. This command can also be used to insert com- ments into a command file, since labels need not be ref- erenced. A jump (either upward or downward) is made to label if the command succeeds. It fails under any of the following conditions: 1. Either address is not between 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 label. This command is the only one that does not issue an error message on bad addresses. Thus it can be used to test whether addresses are bad before other commands are executed. Note that the command is an unconditional jump. The 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. List the marks currently in use (marks are set by the command). Output from the and null commands is truncated to at most number charac- ters. The initial number is 255. The variable name is the specified digit following the or both assign the value to the variable assigns the value to the variable To reference a variable, put a in front of the variable name. For example, using the above assignments for variables and all print the first 100 lines. globally searches for the characters and prints each line containing a match. To escape the special meaning of a must precede it. For example, to match and list lines in a program file that contain format strings specifying characters, decimal integers, or strings, the following could be used: Another feature of the command is that the first line of output from an HP-UX command can be stored into a vari- able. The only requirement is that the first character of value be an For example: each put the current line into variable print it, and increment the variable by one. To escape the special meaning of as the first character of value, precede it with a stores the value into variable These two commands test the last saved return code from the execution of an HP-UX system com- mand for a zero or non-zero value, respectively, and cause a branch to the specified label. The two examples below both search for the next five lines containing the string First example: Second Example: If switch is output from the and null commands is crunched; if switch is it isn't. Without an argument, reverses switch. Initially switch is set for no crunching. Crunched output has strings of tabs and blanks reduced to one blank, and blank lines suppressed. EXTERNAL INFLUENCES Environment Variables determines the collating sequence used in evaluating regular expres- sions. determines the classification of characters as letters, and the charac- ters matched by character class expressions in regular expressions. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all international- ization variables are set to "C". See environ(5). International Code Set Support Single-byte character code sets are supported. DIAGNOSTICS for errors in commands, if prompting is turned off. Self-explanatory error messages when prompting is on. SEE ALSO csplit(1), ed(1), lang(5), regexp(5). bfs(1)
NAME | SYNOPSIS | DESCRIPTION | EXTERNAL INFLUENCES | DIAGNOSTICS | SEE ALSO
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=bfs&sektion=1&manpath=HP-UX+11.11>
