diff options
| author | Charles.Forsyth <devnull@localhost> | 2008-06-10 15:06:19 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2008-06-10 15:06:19 +0000 |
| commit | cd48a233840576d6782a2be4745d44badcb1bbeb (patch) | |
| tree | e99527feb19b45c282350d79d07f4f819ea475b2 /man | |
| parent | 13c8260ff19b8d186b77c30ae42db83c4f29e0b6 (diff) | |
20080910-1604
Diffstat (limited to 'man')
| -rw-r--r-- | man/1/sh-expr | 50 | ||||
| -rw-r--r-- | man/1/sh-mload | 68 | ||||
| -rw-r--r-- | man/2/INDEX | 52 |
3 files changed, 130 insertions, 40 deletions
diff --git a/man/1/sh-expr b/man/1/sh-expr index 976e6c04..be9d2b97 100644 --- a/man/1/sh-expr +++ b/man/1/sh-expr @@ -1,8 +1,10 @@ .TH SH-EXPR 1 .SH NAME -expr, ntest \- shell module for simple arithmetic. +expr, ntest, mpexpr \- shell module for simple arithmetic. .SH SYNOPSIS .B load expr +OR +.B load mpexpr .B ${expr [ @@ -19,10 +21,17 @@ expr, ntest \- shell module for simple arithmetic. .br .SH DESCRIPTION .I Expr -is a loadable module for +and +.I mpexpr +are loadable modules for .IR sh (1) -that provides support for simple integer arithmetic. -It provides one command, +that provide support for integer arithmetic. +.I Expr +uses 64-bit signed integers; +.I mpexpr +uses arbitrary-precision signed integers. +They each provide the same interface: +a command .IR ntest , which performs a simple boolean test on its integer argument, and the @@ -54,15 +63,16 @@ Alternative names are given for some operators; this is to avoid the necessity of quoting operators that contain .IR sh (1) -metacharacters. All operations use 64-bit signed -integers; integers are given in the same form acceptable +metacharacters. Integers are given in the same form acceptable to Limbo. The relational operators yield either 1 (true) or 0 (false). If the .B -r option is given, .I radix -specifies an output base for numbers yielded by -.IR expr . +specifies an output base for printed numbers. +It may be from 2 to 36; +.I mpexpr +also allows 64 to specify base64 notation. Numbers are printed in a form suitable for re-interpretation by .IR expr . @@ -70,8 +80,9 @@ by When all its arguments have been evaluated, .B expr yields all the values remaining on its stack, first pushed -first. The operators supported by expr are as follows (the number -of operands required in is given parentheses): +first. Note that bitwise operators treat their operands as if they +were stored in two's complement form. The operators supported by expr are as follows (the number +of operands required in is given parentheses). .TP 15 .BR + \ (2) Addition @@ -148,13 +159,30 @@ pushes on the stack a sequence of numbers ranging numerically from its first argument up to and including its second argument. If its second argument is less than its first, the sequence will descend. +.TP +.BR rand \ (1) +(\fImpexpr\fP only). Push a secure random number; +the argument value gives the size of the number, in bits. +.TP +.BR bits \ (1) +(\fImpexpr\fP only). Push the size, in bits, of the argument. +.TP +.BR expmod ", " invert " (2)" +(\fImpexpr\fP only). See +.IR ipint (2). +.TP +.BR exp ", " xx ", " ** +(\fImpexpr\fP only). Exponentiation. .SH SOURCE .B /appl/cmd/sh/expr.b .SH SEE ALSO .IR sh (1), .IR sh-std (1), -.IR sh-tk (1) +.IR sh-tk (1), +.IR keyring-ipint (2) .SH BUGS Postfix notation can be confusing. Any operators that contain shell metacharacters (e.g. ``*'', ``>'') must be quoted to avoid interpretation by the shell. +Base64 notation can contain # characters, which need +quoting to avoid interpretation by the shell. diff --git a/man/1/sh-mload b/man/1/sh-mload new file mode 100644 index 00000000..e56cb92a --- /dev/null +++ b/man/1/sh-mload @@ -0,0 +1,68 @@ +.TH SH-MLOAD 1 +.SH NAME +mload, munload \- namespace separation for shell modules +.SH SYNOPSIS +.B load mload + +.B mload +.I name +[ +.IR path ... +] +.br +.B munload +.I name +[ +.IR path ... +] +.br +.SH DESCRIPTION +.I Mload +is a loadable module for +.IR sh (1) +that allows the simultaneous use of shell modules with +potentially clashing command name spaces. +.B Mload +creates a new namespace +.I name +and loads each +.I path +as a builtin module in the same way as +.B load +(see +.IR sh (1)). +Any commands or substitution builtins defined +by the modules are accessible by giving +the command and its arguments as arguments to +the +.I name +command. +.PP +.B Munload +unloads a module from the namespace +.IR name . +If no modules remain in the namespace, +.I name +is undefined as a command. +.SH EXAMPLE +Load +.I mpexpr +in a different namespace from +.I expr +(see +.IR sh-expr (1)): +.EX +load expr +mload mp mpexpr +echo ${expr 1 2 +} +echo ${mp expr 2 300 xx} +.EE +.SH SOURCE +.B /appl/cmd/sh/mload.b +.SH SEE ALSO +.IR sh (1), +.SH BUGS +Because of the way shell modules are implemented, +the namespaces are global across all processes that +share an instance of +.IR mload . diff --git a/man/2/INDEX b/man/2/INDEX index 07b31546..c90cf393 100644 --- a/man/2/INDEX +++ b/man/2/INDEX @@ -150,19 +150,6 @@ readjson json writejson json keyring intro keyring-0intro keyring-intro keyring-0intro -auth keyring-auth -keyring keyring-auth -keyring-auth keyring-auth -readauthinfo keyring-auth -writeauthinfo keyring-auth -certtostr keyring-certtostr -keyring keyring-certtostr -keyring-certtostr keyring-certtostr -pktostr keyring-certtostr -sktostr keyring-certtostr -strtocert keyring-certtostr -strtopk keyring-certtostr -strtosk keyring-certtostr aescbc keyring-crypt aessetup keyring-crypt descbc keyring-crypt @@ -173,24 +160,22 @@ ideaecb keyring-crypt ideasetup keyring-crypt keyring keyring-crypt keyring-crypt keyring-crypt +dsagen keyring-dsagen +eggen keyring-dsagen +keyring keyring-dsagen +keyring-dsagen keyring-dsagen +rsadecrypt keyring-dsagen +rsaencrypt keyring-dsagen +rsafill keyring-dsagen +rsagen keyring-dsagen dhparams keyring-gensk gensk keyring-gensk genskfrompk keyring-gensk keyring keyring-gensk keyring-gensk keyring-gensk +sign keyring-gensk sktopk keyring-gensk -getmsg keyring-getmsg -keyring keyring-getmsg -keyring-getmsg keyring-getmsg -senderrmsg keyring-getmsg -sendmsg keyring-getmsg -getbytearray keyring-getstring -getstring keyring-getstring -keyring keyring-getstring -keyring-getstring keyring-getstring -putbytearray keyring-getstring -puterror keyring-getstring -putstring keyring-getstring +verify keyring-gensk ipint keyring-ipint keyring keyring-ipint keyring-ipint keyring-ipint @@ -207,8 +192,6 @@ keyring-sha1 keyring-sha1 md4 keyring-sha1 md5 keyring-sha1 sha1 keyring-sha1 -sign keyring-sha1 -verify keyring-sha1 keyset keyset allsat lists anysat lists @@ -346,12 +329,23 @@ secstore secstore intro security-0intro security-intro security-0intro auth security-auth -client security-auth +fauth security-auth init security-auth security-auth security-auth -server security-auth login security-login security-login security-login +certtostr security-oldauth +oldauth security-oldauth +pktostr security-oldauth +readauthinfo security-oldauth +security-oldauth security-oldauth +sign security-oldauth +sktostr security-oldauth +strtocert security-oldauth +strtopk security-oldauth +strtosk security-oldauth +verify security-oldauth +writeauthinfo security-oldauth random security-random randombuf security-random randomint security-random |
