AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
BFS(l) BFS (l) : label This positions a label in a command file. The label is terminated by new-line, and blanks between the : and the start of the label are ignored. This command may also be used to insert comments into a command file, since labels need not be referenced. ( • , • )x.bfregular expression/label 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 1 and $. 2. The second address is less than the first. 3. The regular expression doesn't 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 doesn't 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 xbr/ label is an unconditional jump. The xb 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. xt number Output from the p and null commands is truncated to at most number characters. The initial number is 255. xv[ digit] [spaces ] [value] The variable name is the specified digit following the xv. xv5100 or xv5 100 both assign the value 100 to the variable 5. Xv61,100p assigns the value 1,100p to the variable 6. To reference a variable, put a % in front of the variable name. For example, using the above assignments for variables 5 and 6: 1,%5p 1,%5 %6 will all print the first 100 lines. gf%5/p would globally search for the characters 100 and print each line containing a match. To escape the special meaning of %, a \ must precede it. gf".*\%[cds]/p - 2-
BFS (l) BFS (l) could be used to match and list lines containing print[ of characters, decimal integers, or strings. Another feature of the xv command is that the first line of output from a UNIX command can be stored into a variable. The only requirement is that the first character of value be an !. For example: .w junk xv5!cat junk !rm junk !echo "%5" xv6!expr %6 + 1 would put the current line into variable 5, print it, and increment the variable 6 by one. To escape the special meaning of ! as the first character of value, precede it with a \. xv7\!date stores the value !da.te into variable 7. xbz label xbn label These two commands will test the last saved return code from the execution of a UNIX command (!command) or nonzero value, respectively, to the specified label. The two examples below both search for the next five lines containing the string size. xv55 : I /size/ xv5!expr %5 - 1 !if 0%5 != 0 exit 2 xbn I xv45 :I /size/ xv4!expr %4 - 1 !if 0%4 = 0 exit 2 xbz I xc [switch] If switch is 1, output from the p and null commands is crunched; if switch is 0 it isn't. Without an argument, xc 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. - 3 -
- Page 155 and 156: stream. setbuf: assign buffering to
- Page 157 and 158: � Permuted Index /strcmp, strncmp
- Page 159 and 160: tsort: topologica.l sort. • . .
- Page 161 and 162: display editor based on/ vi, view:
- Page 163: INTRO ( 1) INTRO ( l ) NAME intro -
- Page 166 and 167: 300 ( 1 ) 300 ( 1 ) for C programs,
- Page 168 and 169: \�
- Page 170 and 171: I I I I I I I I I I I I I I I I I I
- Page 172 and 173: ADB ( 1 ) ADB (l) sr, and usp. symb
- Page 174 and 175: ADB ( 1} ADB (l} " ••• " 0 Pr
- Page 176 and 177: ADB ( 1) ADDRESSES b d e m 8 t The
- Page 178 and 179: ADMIN ( 1) -t[name] -fflag b ADMIN(
- Page 180 and 181: ADMIN(l) ADMIN(l) make deltas (chan
- Page 182 and 183: ( � � . · � .
- Page 184 and 185: AR(l) AR (I) X Extract the named fi
- Page 186 and 187: AS (l) (AT&T UNIX PC Only ) AS (I)
- Page 188 and 189: ·� · ·. rl · (1
- Page 191 and 192: AWK (l) AWK (l) NAME awk - pattern
- Page 193: AWK (l) AWK(l) Add up first column,
- Page 196 and 197: f) .. .... ._ __ . ·
- Page 198 and 199: I� �� I J
- Page 200 and 201: BC(l) BC (l) l(x) log a(x) arctange
- Page 203 and 204: BDIFF(l) BDIFF ( 1 ) NAME bdiff - b
- Page 205: BFS (I) BFS(I) NAME bfs - big file
- Page 209: CAL ( 1) CAL(l) NAME cal - print ca
- Page 212 and 213: ' ..
- Page 215 and 216: ;� CC ( l ) cc (1) NAME cc - C co
- Page 217: CC(l) /lib/crts.o /lib/mcrto.o /lib
- Page 221 and 222: CDC ( 1 ) CDC { 1) NAME cdc - chang
- Page 223: CDC (l) CDC (l) SEE ALSO admin( l),
- Page 226 and 227: CFLOW ( 1) CFLOW ( 1) produces the
- Page 228 and 229: CFONT(l) (AT&T UNIX PC only ) CFONT
- Page 231: CHOWN (l) CHOWN ( 1) NAME chown, ch
- Page 234 and 235: .'�
- Page 236 and 237: I I I I I I I I I I I I I I I I I I
- Page 238 and 239: COL(l) COL(l) BUGS Cannot back up m
- Page 240 and 241: COMB(l) COMB(l) FIT..ES s.COMB The
- Page 243 and 244: CP ( 1) CP ( 1) NAME cp, In, mv - c
- Page 245 and 246: CPIO ( 1 ) CPIO ( 1) NAME cpio - co
- Page 247: CPIO ( 1) CPIO ( 1) track of them a
- Page 250 and 251: CPP ( 1) CPP (1) Two special names
- Page 253 and 254: CRYPT { l ) ( Domestic Version Only
- Page 255 and 256: CSPLIT ( 1) CSPLIT (l) NAME csplit
BFS (l) BFS (l)<br />
could be used to match and list lines containing print[<br />
of characters, decimal integers, or strings.<br />
Another feature of the xv command is that the first<br />
line of output from a UNIX command can be stored<br />
into a variable. The only requirement is that the first<br />
character of value be an !. For example:<br />
.w junk<br />
xv5!cat junk<br />
!rm junk<br />
!echo "%5"<br />
xv6!expr %6 + 1<br />
would put the current line into variable 5, print it, and<br />
increment the variable 6 by one. To escape the special<br />
meaning of ! as the first character of value, precede it<br />
with a \.<br />
xv7\!date<br />
stores the value !da.te into variable 7.<br />
xbz label<br />
xbn label<br />
These two commands will test the last saved return<br />
code from the execution of a UNIX command (!command)<br />
or nonzero value, respectively, to the specified<br />
label. The two examples below both search for the<br />
next five lines containing the string size.<br />
xv55<br />
: I<br />
/size/<br />
xv5!expr %5 - 1<br />
!if 0%5 != 0 exit 2<br />
xbn I<br />
xv45<br />
:I<br />
/size/<br />
xv4!expr %4 - 1<br />
!if 0%4 = 0 exit 2<br />
xbz I<br />
xc [switch]<br />
If switch is 1, output from the p and null commands is<br />
crunched; if switch is 0 it isn't. Without an argument,<br />
xc reverses switch. Initially switch is set for no<br />
crunching. Crunched output has strings of tabs and<br />
blanks reduced to one blank and blank lines<br />
suppressed.<br />
- 3 -