.\" .\" Copyright (c) 1993 David I. Bell and Landon Curt Noll .\" Original man page dated 15nov93 .\" Copyright (c) 1999 David I. Bell and Landon Curt Noll .\" Permission is granted to use, distribute, or modify this source, .\" provided that this copyright notice remains intact. .\" .\" calculator by David I. Bell .\" man page by Landon Noll .TH calc 1 "^..^" "15Oct1999" .SH NAME calc \- arbitrary precision calculator .SH SYNOPSIS \fIcalc\fP .RB [ \-c ] .RB [ \-C ] .RB [ \-d ] .RB [ \-e ] .RB [ \-h ] .RB [ \-i ] .RB [ \-m\ \&mode ] .br .in +5n .RB [ \-n ] .RB [ \-p ] .RB [ \-q ] .RB [ \-u ] .RB [ \-v ] .RB [ calc_cmd\ \&.\|.\|. ] .in -5n .SH DESCRIPTION \& .br CALC COMMAND LINE .PP .TP .B \-c Continue reading command lines even after an execution error has caused the abandonment of a line. .sp 1 For example: .sp 1 .in +5n .nf calc read many_errors.cal .fi .in -5n .sp 1 will cause .B calc to abort on the first error, whereas: .sp 1 .in +5n .nf calc -c read many_errors.cal .fi .in -5n .sp 1 will cause .B calc to try to process each line being read despite the errors that it encounters. .TP .B \-C Permit the execution of custom builtin functions. Without this flag, calling the custom() builtin function will simply generate an error. .sp 1 Use if this flag may cause .B calc to execute functions that are non-standard and that are not portable. Custom builtin functions are disabled by default for this reason. .TP .B \-d Disable the printing of the opening title. The printing of library debug and informational messages is also disabled as if \fBconfig("lib_debug", 0)\fP had been executed. .sp 1 For example: .sp 1 .in +5n calc 'read qtime; qtime(2)' .in -5n .sp 1 will output something like: .sp 1 .in +5n .nf qtime(utc_hr_offset) defined It's nearly ten past six. .fi .in -5n .sp 1 whereas: .sp 1 .in +5n .nf calc -d 'read qtime; qtime(2)' .fi .in -5n .sp 1 will just say: .sp 1 .in +5n .nf It's nearly ten past six. .fi .in -5n .sp 1 .TP .B \-e Ignore any environment variables on startup. The getenv() builtin will still return values, however. .TP .B \-h Print a help message. This option implies .BR \-q . This is equivalent to the .B calc command help help. The help facility is disabled unless the mode is 5 or 7. See .BR \-m . .TP .B \-i Become interactive if possible. Be default, if .I calc_cmd args are given, .B calc will execute them and exit. This flag args are given, .B calc will execute them and exit. This flag will cause .B calc to drop into interactive mode after the commands are executed. .sp 1 For example: .sp 1 .in +5n .nf calc 2+5 .fi .in -5n .sp 1 will print the value 7 and exit whereas: .sp 1 .in +5n .nf calc -i 2+5 .fi .in -5n .sp 1 will print the value 7 and prompt the user for more .B calc commands. .TP .BR \-m " mode" This flag sets the permission mode of .BR calc . It controls the ability for .B calc to open files and execute programs. Mode may be a number from 0 to 7. .sp 1 The mode value is interpreted in a way similar to that of the .BR chmod (1) octal mode: .sp 1 .in +5n .nf 0 do not open any file, do not execute progs 1 do not open any file 2 do not open files for reading, do not execute progs 3 do not open files for reading 4 do not open files for writing, do not execute progs 5 do not open files for writing 6 do not execute any program 7 allow everything (default mode) .fi .in -5n .sp 1 If one wished to run .B calc from a privileged user, one might want to use .B \-m 0 in an effort to make .B calc somewhat more secure. .sp 1 Mode bits for reading and writing apply only on an open. Files already open are not effected. Thus if one wanted to use the .B \-m 0 in an effort to make .B calc somewhat more secure, but still wanted to read and write a specific file, one might want to do in .BR sh (1), .BR ksh (1), .BR bash (1)-like shells: .sp 1 .in +5n .nf calc -m 0 3