# # sendmail.cf であそぼ〜 # # 実行:/usr/lib/sendmail -bt -C special.cf # デバッグ:/usr/lib/sendmail -bt -d21.12 -C special.cf O OperatorChars=[].@<> # 集合の積を取る。 # 例: # > setmul [a b c] [d e f] # =>[a d] [a e] [a f] [b d] [b e] [b f] [c d] [c e] [c f] # Ssetmul R $* $: $1 @ R [$- $*] [$*] @ $* [$2] [$3] @ $4 $>setmul1 $1 [$3] R $* @ $* $@ $2 Ssetmul1 R $- [ $* ] $: $1 < $2 > R $- < $- $* > $* $1 < $3 > $4 [$1 $2] R $- <> $* $@ $2 # 逆ポーランド記法を中置記法に変換 # 例: # > poland a b + c d - * # =>[ [ a + b ] * [ c - d ] ] # C{OPERATOR} + - * / Spoland R $- $@ $1 R $- $+ $: $2 <> $1 R $- $* <> $+ $2 <> $>poland1 $1 @ $3 R $* @ $* $#error: Invalid form R <> $* $@ $1 Spoland1 R $={OPERATOR} @ $+ @ $+ @ $* $@ [$3 $1 $2] @ $4 R $={OPERATOR} @ $+ @ $+ $@ [$3 $1 $2] # 逆順にする。 # 例: # > reverse a b c d # =>d c b a # Sreverse R $- $@ $1 R $- $+ $: $2 <> $1 R $- $+ <> $+ $2 <> $1 $3 R $- <> $+ $@ $1 $2 # IP アドレスを PTR 形式に変換 # 例: # > ptr 1.2.3.4 # =>4.3.2.1.in-addr.arpa # Sptr R $* $: $>reverse $1 R $* $@ $1.in-addr.arpa