
bison | 63
Linux
Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Examples
Note in these examples that when you type some quantity (a
number or expression), it is evaluated and printed, but assignment
statements produce no display.
ibase = 8 Octal input
20 Evaluate this octal number
16 Terminal displays decimal value
obase = 2 Display output in base 2 instead of base 10
20 Octal input
10000 Terminal now displays binary value
ibase = A Restore base-10 input
scale = 3 Truncate results to 3 decimal places
8/7 Evaluate a division
1.001001000 Oops! Forgot to reset output base to 10
obase = 10 Input is decimal now, so A isn't needed
8/7
1.142 Terminal displays result (truncated)
The following lines show the use of functions:
define p(r,n){ Function p uses two arguments
auto v v is a local variable
v = r^n r raised to the n power
return(v)} Value returned
scale = 5
x = p(2.5,2) x = 2.5 ^ 2
x Print value of x
6.25
length(x) Number of digits
3
scale(x) Number of places right of decimal point
2
biff
biff [arguments]
Notify user of mail arrival and sender’s name. biff operates asyn-
chronously. Mail notification works only if your system is running
the comsat(8) server. The command biff y enables notification, and
the command biff n disables notification. With no arguments, biff
reports biff’s current status.
bison
bison [options] file
Given a file containing ...