Command Reference Guide

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
b
bs(1) bs(1)
does not cause stored statements to execute (see run below).
for name = expression expression statement
for name = expression expression
...
next
for
expression , expression , expression statement
for expression , expression , expression
...
next The for statement repetitively executes a statement (first form) or a group of statements
(second form) under control of a named variable. The variable takes on the value of the
first expression, then is incremented by one on each loop, not to exceed the value of the
second expression. The third and fourth forms require three expressions separated by com-
mas. The first of these is the initialization, the second is the test (true to continue), and the
third is the loop-continuation action (normally an increment).
fun f( [a, ...]) [v, ...]
...
nuf fun defines the function name, arguments, and local variables for a user-written function.
Up to ten arguments and local variables are allowed. Such names cannot be arrays, nor
can they be I/O associated. Function definitions cannot be nested. Calling an undefined
function is permissible; see function calls below.
freturn A way to signal the failure of a user-written function. See the interrogation operator (
?)
below. If interrogation is not present,
freturn merely returns zero. When interrogation
is active,
freturn transfers to that expression (possibly by-passing intermediate function
returns).
goto name Control is passed to the internally stored statement with the matching label.
ibase n ibase sets the input base (radix) to n. The only supported values for n are the constants
8, 10 (the default), and 16. Hexadecimal values 10-15 are entered as a-f. A leading digit
is required (i.e.,
f0a must be entered as 0f0a). ibase (and obase discussed below)
are executed immediately.
if expression statement
if expression
...
[else...]
fi The statement (first form) or group of statements (second form) is executed if the expres-
sion evaluates to non-zero. The strings 0 and "" (null) evaluate as zero. In the second
form, an optional else provides for a second group of statements to be executed when the
first group is not. The only statement permitted on the same line with an else is an
if;
only other
fis can be on the same line with a fi. The concatenation of else and if
into an elif is supported. Only a single fi is required to close an if ... elif ...
[ else ... ] sequence.
include expression
expression must evaluate to a file name. The file must contain bs source statements.
Such statements become part of the program being compiled.
include statements can-
not be nested.
obase n obase sets the output base to n (see ibase above).
onintr label
onintr onintr provides program control of interrupts. In the first form, control passes to the
label given, just as if a goto had been executed at the time onintr was executed. The
effect of the statement is cleared after each interrupt. In the second form, an interrupt
causes bs to terminate.
return [expression]
The expression is evaluated and the result is passed back as the value of a function call. If
no expression is given, zero is returned.
run The random number generator is reset. Control is passed to the first internal statement.
If the run statement is contained in a file, it should be the last statement.
Section 1−−50 − 2 − HP-UX Release 11i: December 2000
___
___