bs(1)

 

bs(1)

stop

Execution of internal statements is stopped. bs reverts to immediate mode.

trace [expression]

 

 

The

trace statement controls function tracing. If the expression is null (or evaluates to

 

zero), tracing is turned off. Otherwise, a record of user-function calls/returns is printed.

 

Each

return decrements the trace expression value.

while expression statement while expression

...

while is similar to for except that only the conditional expression for loop-continuation

next

 

is given.

!shell command

An immediate escape to the shell.

# ...

This statement is ignored (treated as a comment).

Expression Syntax:

name A name is used to specify a variable. Names are composed of a letter (uppercase or lower- case) optionally followed by letters and digits. Only the ®rst six characters of a name are signi®cant. Except for names declared in fun statements, all names are global to the pro- gram. Names can take on numeric (double ¯oat) values, string values, or can be associated with input/output (see the built-in function open( ) below).

name ( [expression [ , expression] ... ] )

Functions can be called by a name followed by the arguments in parentheses separated by commas. Except for built-in functions (listed below), the name must be de®ned with a fun statement. Arguments to functions are passed by value. If the function is unde®ned, the call history to the call of that function is printed, and a request for a return value (as an expression) is made. The result of that expression is taken to be the result of the unde®ned function. This permits debugging programs where not all the functions are yet de®ned. The value is read from the current input ®le.

name [ expression [ , expression ] ... ]

This syntax is used to reference either arrays or tables (see built-in table functions below). For arrays, each expression is truncated to an integer and used as a speci®er for the name. The resulting array reference is syntactically identical to a name; a[1,2] is the same as a[1][2]. The truncated expressions are restricted to values between 0 and 32767.

number

A number is used to represent a constant value. A number is written in Fortran style, and

 

contains digits, an optional decimal point, and possibly a scale factor consisting of an e fol-

 

lowed by a possibly signed exponent.

string

Character strings are delimited by " characters. The \ escape character allows the double

 

quote (\"), new-line (\n), carriage return (\r), backspace (\b), and tab (\t) characters to

 

appear in a string. Otherwise, \ stands for itself.

( expression )

Parentheses are used to alter the normal order of evaluation.

( expression , expression [ , expression ... ] ) [ expression ]

The bracketed expression is used as a subscript to select a comma-separated expression from the parenthesized list. List elements are numbered from the left, starting at zero.

 

The expression:

 

( False, True )[ a == b ]

 

has the value True if the comparison is true.

? expression

The interrogation operator tests for the success of the expression rather than its value. At

 

the moment, it is useful for testing end-of-®le (see examples in the Programming Tips sec-

 

tion below), the result of the eval built-in function, and for checking the return from

 

user-written functions (see freturn). An interrogation ``trap'' (end-of-®le, etc.) causes an

 

immediate transfer to the most recent interrogation, possibly skipping assignment state-

 

ments or intervening function levels.

- expression

The result is the negation of the expression.

b

HP-UX Release 11i: December 2000

− 3 −

Section 151