HP-UX Reference (11i v1 00/12) - 1 User Commands A-M (vol 1)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
b
bs(1) bs(1)
NAME
bs - a compiler/interpreter for modest-sized programs
SYNOPSIS
bs [file [args ]]
DESCRIPTION
bs is a remote descendant of BASIC and SNOBOL4 with some C language added. bs is designed for pro-
gramming tasks where program development time is as important as the resulting speed of execution. For-
malities of data declaration and file/process manipulation are minimized. Line-at-a-time debugging, the
trace and dump statements, and useful run-time error messages all simplify program testing. Further-
more, incomplete programs can be debugged; inner functions can be tested before outer functions have been
written, and vice versa.
If file is specified on the command-line, it is used for input before any input is taken from the keyboard. By
default, statements read from file are compiled for later execution. Likewise, statements entered from the
keyboard are normally executed immediately (see compile and execute below). Unless the final
operation is assignment, the result of an immediate expression statement is printed.
bs programs are made up of input lines. If the last character on a line is a
\, the line is continued. bs
accepts lines of the following form:
statement
label statement
A label is a name (see below) followed by a colon. A label and a variable can have the same name.
A bs statement is either an expression or a keyword followed by zero or more expressions. Some key-
words (clear, compile, !, execute, include, ibase, obase, and run
) are always executed as
they are compiled.
Statement Syntax:
expression The expression is executed for its side effects (value, assignment, or function call). The
details of expressions follow the description of statement types below.
break break exits from the innermost for/while loop.
clear Clears the symbol table and compiled statements. clear is executed immediately.
compile [expression]
Succeeding statements are compiled (overrides the immediate execution default). The
optional expression is evaluated and used as a file name for further input. A clear is
associated with this latter case.
compile is executed immediately.
continue continue transfers to the loop-continuation of the current
for/while loop.
dump [name] The name and current value of every non-local variable is printed. Optionally, only the
named variable is reported. After an error or interrupt, the number of the last statement
is displayed. The user-function trace is displayed after an error or stop that occurred in
a function.
edit A call is made to the editor selected by the EDITOR environment variable if it is present,
or ed(1) if EDITOR is undefined or null. If the file argument is present on the command
line, file is passed to the editor as the file to edit (otherwise no file name is used). Upon
exiting the editor, a
compile statement (and associated clear) is executed giving that
file name as its argument.
exit [expression]
Return to system level. The expression is returned as process status.
execute Change to immediate execution mode (an interrupt has a similar effect). This statement
HP-UX Release 11i: December 2000 1 Section 149
___
___