Calc command line Calc has the following command line: calc [-c] [-C] [-d] [-D calc_debug[:resource_debug[:user_debug]]] [-e] [-h] [-i] [-m mode] [-n] [-p] [-q] [-s] [-u] [-v] [calc_cmd ...] #!/usr/local/bin/calc -S [other_flags] -c Continue reading command lines even after an scan/parse error has caused the abandonment of a line. Note that this option only deals with scanning and parsing of the calc language. It does not deal with execution or run-time errors. For example: calc read many_errors.cal will cause calc to abort on the first syntax error, whereas: calc -c read many_errors.cal will cause calc to try to process each line being read despite the scan/parse errors that it encounters. By default, calc startup resource files are silently ignored if not found. This flag will report missing startup scripts unless -d is also given. -C Permit the execution of custom builtin functions. Without this flag, calling the custom() builtin function will simply generate an error. Use of this flag may cause calc to execute functions that are non-standard and that are not portable. Custom builtin functions are disabled by default for this reason. -d Disable the printing of the opening title. The printing of resource file debug and informational messages is also disabled as if config("resource_debug", 0) had been executed. For example: calc 'read qtime; qtime(2)' will output something like: qtime(utc_hr_offset) defined It's nearly ten past six. whereas: calc -d 'read qtime; qtime(2)' will just say: It's nearly ten past six. This flag disables the reporting of missing calc startup scripts. -D calc_debug[:resource_debug:[user_debug]] Force the initial value of config("calc_debug"), config("resource_debug") and config("user_debug"). The : separated strings are interpreted as signed 32 bit integers. After an optional leading sign a leading zero indicates octal conversion, and a leading ``0x'' or ``0X'' hexadecimal conversion. Otherwise, decimal conversion is assumed. By default, calc_debug is 0, resource_debug is 3 and user_debug is 0. For more information use the following calc command: help config -e Ignore any environment variables on startup. The getenv() builtin will still return values, however. -h Print a help message. This option implies -q. This is equivalent to the calc command help help. The help facility is disabled unless the mode is 5 or 7. See -m. -i Become interactive if possible. If calc_cmd args are given, by default, calc will execute them and exit. This flag causes calc to drop into interactive mode after the commands are executed. For example: calc 2+5 will print the value 7 and exit whereas: calc -i 2+5 will print the value 7 and prompt the user for more calc commands. -m mode This flag sets the permission mode of calc. It controls the ability for calc to open files and execute programs. Mode may be a number from 0 to 7. The mode value is interpreted in a way similar to that of the chmod(1) octal mode: 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) If one wished to run calc from a privileged user, one might want to use -m 0 in an effort to make calc somewhat more secure. Mode bits for reading and writing apply only on an open. Files already open are not effected. Thus if one wanted to use the -m 0 in an effort to make calc somewhat more secure, but still wanted to read and write a specific file, one might want to do in sh(1), ksh(1), bash(1)-like shells: calc -m 0 3