[Prev][Next][Index][Thread]
[comp.mail.sendmail] Silly (ab)uses of sendmail (fwd)
---------- Forwarded message ----------
Date: 07 Oct 1996 13:10:58 -0400
From: Andrew Hobson <[email protected]>
To: [email protected]
Subject: [comp.mail.sendmail] Silly (ab)uses of sendmail
This, I like.
Drew
------- Start of forwarded message -------
From: [email protected] (Matthew Slattery)
Newsgroups: comp.mail.sendmail
Subject: Silly (ab)uses of sendmail
Date: 7 Oct 1996 14:57:58 +0100
Organization: Advanced Telecommunications Modules Ltd, Cambridge, UK.
Message-ID: <[email protected]>
As a bit of light relief from all the questions about virtual domains,
check_* rulesets, and the like, I would like to present this:
----------snip----------
################################################
################################################
#### ####
#### Simple calculator in sendmail.cf ####
#### ####
#### by Matthew Slattery <[email protected]> ####
#### ####
#### version 0.03 (4th October 1996) ####
#### ####
################################################
################################################
#
# Invoke as follows:
#
# /usr/lib/sendmail -bt -C<filename>
#
# ...where <filename> is this file.
#
# Then you should enter sums prefixed with "9 ", e.g.
#
# > 9 1+2
# > 9 20-6
# > 9 5*-4
#
# More complex expressions (e.g. '1+2*3-4') work too.
#
# Addition (+), subtraction (-), multiplication (*, x or X), integer division
# (/) and modulus (%) are supported. Brackets are not. Expressions are
# evaluated strictly from left to right (i.e. no operator priorities).
#
# If numbers become to large, strange things may happen e.g. "Infinite
# loop" or "Expansion too long" errors. With my sendmail, 100 recursive
# calls is considered infinite, so a result of greater than 99 will cause
# problems (but you can calculate with larger numbers -- "125-50" works).
#
#
V5
Do.:%@!^/[]0123456789+-*xX
CX 0 1 2 3 4 5 6 7 8 9
CY + - * / % !
CZ 0 1 2 3 4 5 6 7 8 9 + - * / %
S9
R$*x$* $1*$2
R$*X$* $1*$2
R$*$~Z$* $1$3
R$*$=Y $1
R$* $:!$1!
R!! $@0
R$*$=Y$=X$* $1$2[$3$4
R$*$=X$=Y$* $1$2]$3$4
R!$*[$*]$*! $1[$2]$3
R$* $:$>5$1
R$*[$*]$*[$*]$* $>7$1[$2]$3[$4].$5
R$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*!$*].$* $1[$2]*[$3!$3$4].$5
R$*[]*[$*!$*].$* $@$1[$3]$4
R-[$*]/-[$*].$* $:[$1]/[$2].$3
R[$*]/-[$*].$* $:-[$1]/[$2].$3
R$*[$*]/[].$* $#error $@ USAGE $: "Division by zero"
R$*[$*]/[$*].$* $:$1[$2]/[$3!$3!].$4
R$*[$+]/[$*!$*!$*].$* $>4$1[$2]/[$3!$4!$5].$6
R$*[$*]/[$*!$*!$*].$* $@$1[$5]$6
R$*[$*!$*!$*].$* $@$1[$2]$5
R-[$*]%-[$*].$* $:[$1]%[$2].$3
R[$*]%-[$*].$* $:-[$1]%[$2].$3
R$*[$*]%[].$* $#error $@ USAGE $: "Division by zero"
R$*[$*]%[$*].$* $:$1[$2]/[$3!$3!].$4
R$*[$+]/[$*!$*!$*].$* $>4$1[$2]/[$3!$4!$5].$6
R$*[$*]/[$*!$*!$*].$* $@$1[]$6
R$*[$*!$*!$*].$* $@$1[$4]$5
S6
R$*: $@$1:1
R$*:$*0 $@$1:$2 1
R$*:$*1 $@$1:$2 2
R$*:$*2 $@$1:$2 3
R$*:$*3 $@$1:$2 4
R$*:$*4 $@$1:$2 5
R$*:$*5 $@$1:$2 6
R$*:$*6 $@$1:$2 7
R$*:$*7 $@$1:$2 8
R$*:$*8 $@$1:$2 9
R$*:$*9 $:$>6$1:$2
R$*:$* $@$1:$2 0
S4
R$*[$*@]/[@$*!$*!$*].$* $1[$2]/[$3!$4!$5].$6
R$*[]/[$+!$*!$*].$* $:$1[$4!$2!$3].$5
R$*[$*]/[$*!$*!$*].$* $@$1[$2]/[$4!$4!@$5].$6
R$*[$*!$*@!$*@].$* $1[$2!$3!$4].$5
----------snip----------
Enjoy!
--
Matthew Slattery
[email protected]
------- End of forwarded message -------