16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

c<br />

A || B Is true if A is true or B is true. If A is true, the expression B is never<br />

evaluated.<br />

Comments and White Space<br />

A comment has the form:<br />

Instructions<br />

/* Any string */<br />

Comments can extend over more than one line of text. When bc sees /* at the<br />

start of a The only effect a comment has is to indicate the end of a token. As an<br />

extension, this version of bc also provides an additional comment convention using<br />

the # character. All text from the # to the end of the line is treated as a single blank,<br />

as in:<br />

2+2 # this is a comment<br />

bc is free format. You can freely insert blanks or horizontal tab characters to<br />

improve the readability of the code. Instructions are assumed to end at the end of<br />

the line. If you have an instruction that is so long you need to continue it on a new<br />

line, put a backslash (\) as the very last character of the first line and continue on<br />

the second, as in:<br />

a = 2\<br />

+ 3<br />

The \ indicates that the instruction continues on the next line, so this is equivalent<br />

to:<br />

a = 2 + 3<br />

A bc instruction can be an expression that performs a calculation, an assignment, a<br />

function definition, or a statement. If an instruction is not an assignment, bc<br />

displays the result of the instruction when it has completed the calculation. For<br />

example, if you enter:<br />

3.14 * 23<br />

bc displays the result of the calculation. However, with:<br />

a = 3.14 * 23<br />

bc does not display anything, because the expression is an assignment. If you do<br />

want to display the value of an assignment expression, simply place the expression<br />

in parentheses.<br />

The following list shows the instruction forms recognized by bc:<br />

expression<br />

Calculates the value of the expression.<br />

“string”<br />

Is a string constant. When bc sees a statement of this form, it displays the<br />

contents of the string. For example:<br />

"Hello world!"<br />

tells bc to display Hello world! A newline character is not output after the<br />

string. This makes it possible to do things like:<br />

foo = 15<br />

"The value of foo is "; foo<br />

56 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!