#!/bin/sh # KOI8R E: 0xA3, 0xB3 ÔÏÇÄÁ ÞÔÏ ÔÁËÏÅ? # http://kiarchive.relcom.ru/pub/internet/rfc/rfc1489.txt # http://www.orgland.ru/~maxim/charsets.images.html#koi help=" Ðåòåëïäéòï÷ýéë óäåìáîîùê éú tr $0 [-A | -a | -k | ... ] file1 file2 -A | -ALT - éú áìøôåòîáôé÷îïê ÷ Âåóôï÷óëõà -a | -alt - éú Âåóôï÷óëïê ÷ áìøôåòîáôé÷îõà -K | -KOI - Koi8 --> Besta -k | -koi - Besta --> Koi8 -I | -ISO - ISO ÷ Âåóôõ -i | -iso - Besta ÷ ISO -W | -WIN - Windows ÷ Âåóôõ -w | -win - Besta ÷ Windows -UTF8 - Word-8 UTF-8 ÷ Windows -utf8 - Windows × UTF-8 -MAC - Macintosh ÷ Âåóôõ -MACB - Macintosh éíåîé Âåìñå÷á ÷ Âåóôõ -MACYR - Macintosh éíåîé Ìø÷á Èáëáîá -mac - Besta ÷ Macintosh -KOI7 - True KOI7 --> Âåóôá (Üôï -- îáóôïñýéê ÇÏÓÔ ËÏÉ7.) -KOI7T - KOI7 ÉÍÅÎÉ ôÁÒÁÓÏ×Á -koi7 - Âåóôá --> true KOI7 (|TO -- NASTOQ]IJ gost koi7.) -RKOI7 - Readable KOI7 --> Âåóôá (Þéôáâåìøîùê ÇÏÓÔ ËÏÉ7.) -rkoi7 - Âåóôá --> readable KOI7 (~itabelxnyj GOST KOI7.) -R | -rus - Transliteraciq --> Âåóôá -r | -lat - Âåóôá --> Transliteraciq -b | -down - ÂÏÌØÛÉÅ ÂÕË×Ù ÷ íáìåîøëéå âõë÷ù -B | -UP - íáìåîøëéå âõë÷ù ÷ ÂÏÌØÛÉÅ ÂÕË×Ù -s | -sparc - KOI ÷ SPARCprinter-russian -M | -CRLFLF - CRLF --> LF ( dos --> UNIX) -m | -lfcrlf - LF --> CRLF (UNIX --> dos ) -L | -LETTER - Ðce÷äoëuòuììuãa ÷ ëéòéììéãõ çìõðáñ -TU - ^T^U ÷ ASCII -FIDO - Ëéòéììéãá ÷ ðce÷äoëupuììuãy çìõðáñ -P - Ðce÷äoëuòuììuãa ÷ ëéòéììéãõ õíîáñ -p - Ðåpåëïäépï÷ëá "îåpõóóëïê" "ò" -fido - Ëéòéìéãá ÷ Ðåpåëïäépï÷ëá "Î" --> "H", "ò" --> "p" -rk Ìéë÷éäáãéñ RK-ûîïê òáóëòáóëé é òáíïþåë -altram Ìéë÷éäáãéñ ALT-ûîùè òáíïþåë -altramwin Ðåòå÷ïä ALT-ûîùè òáíïþåë ÷ ÷éîäàëï÷ùå -koiram Ìéë÷éäáãéñ KOI-ûîùè òáíïþåë -bach2rk Ðòåïâòáúï÷á÷îéå òáíïþåë é òáóëòáóëé éú ëîéçé Íïòéóá Âáèá -iwasi2rk Ðòåïâòáúï÷á÷îéå òáóëòáóëé éú ëîéçé ó É÷áóñíé -rk2pcl RK ÷ HP laserjet II -mosaic2rk Nestscape Hex Encoding to besta -man2rk catman format ÷ Rk-ûîõà òáóëòáóëõ -rtf2rk ÷éîäï÷ùå âõë÷ù æïòíáôá RTF ÷ âåóôï÷óëõà ëïäéòï÷ëõ -GAK ëïäéòï÷ëá ðéóøíá, ëïôïòïå íîå ïäîáöäù ðòéóìáì Ëõûîéòåîëï -GOS ðïèïöáñ îá GAK ëïäéòï÷ëá - ÷ îåê ðòéûåì æáêì ó Ðåìå÷éîùí -NNF îé îá þôï îåðïèïöáñ ëïäéòï÷ëá ðòéóìáîîáñ Îéë.Îéë.Æåäïôï÷ùí -NNF2 ðïèïöáñ îá îåå ëïäéòï÷ëá ïô Ëáôé Äùíáëï÷ïê -PRUD ëïäéòï÷ëá ðéóøíá, ëïôïòïå íîå ïäîáöäù ðòéóìáì Ðòõäîéë -index2dir ïâòáôîáñ ðåòåëïäéòï÷ëá index.html ÷ .dir -EOP Ìéë÷éäéòï÷áôø òáúíåôëõ îá óôòáîéãù ÷ ëîéöëå -ABZAC Òáúäåìéôø áâúáãù ðõóôùíé óôòïëáíé -abzac Óðìàýéôø ðõóôùå óôòïëé íåöäõ áâúáãáíé -REABZAC õäáìéôø áâúáãîùê ïôóôõð ó íáìïê âõë÷ù. -LINE ÷ùôñîõôø áâúáãù ÷ ïäîõ óôòïëõ, äìñ úáçòõúëé ÷ ÷ïòä -OTSTUP ×ïóóôáîï÷éôø óâéôùê áâúáãîùê ïôóôõð -OTSTUP2 ×ïóóôáîï÷éôø óðìàýåîîùê áâúáãîùê ïôóôõð -WW æïòíáôéòï÷áîéå ×ïòä-6 äïëõíåîôá ÷ æáêì moshkow.txt -WWC æïòíáôéòï÷áîéå ×ïòä-6-courier äïëõíåîôá ÷ æáêì moshkow.txt -WWID þÉÓÔÉÔ ÷ÏÒÄÏ×ÓËÉÅ [Author ID...] -LYR Ðåòå÷ïä .lyr æáêìá óéóôåíù Äéíù Úáêãå÷á ÷ ÒË -AKSRUS Ìáôéîéãá ó òïíáîïí Áëóåîï÷á ÷ ÒË -HEX éú ûåóôîáäãáôåòéþëé 0xef -- ÷ ASCII -ANS éóðòá÷ìñåô Word DOC óïèòáîåîîùå ÷ As text with layout -ASC éóðòá÷ìñåô Word DOC óïèòáîåîîùå ÷ As text with layout -LEX Éú Ìåëóéëïîï÷óëïê òáóëòáóëé ÷ Òë -COM anticomma - òáóóôáîï÷ëá ðòïâåìï÷ íåöäõ úîáëáíé ðòåðéîáîéñ -CT1CU ×ùäåìñåô úáçïìï÷ëáíé ïôäåìøîùå ãéæòù -psewdo Ðòåïâòáúï÷áîéå ðóå÷äïçòáæéëé rk äìñ ðåþáôé -preformat Òáóôáýéôø ôéòå ÷ "==" ðåòåä æïòíáôïí Òë-ïê -PERENOS Ìéë÷éäéòï÷áôø ðåòåîïóù -PREFORMAT Ðòå÷òáôéôø "==" ÷ ôéòå ÷ "--" ðïóìå æïòíáôá Òë -HARRY Ðïäîñôø úáçïìï÷ëé ðï èáòòéæáîï÷óëé -wfor Ïôóôõð é ðõóôáñ óôòïëá ÷ ëáöäïí áâúáãå äìñ æïòíáôáöá doc-æáêìá -hlebnikow Õäáìéôø MS-óîùå úáëéäïîù éú html-æáêìá -MAN NROFF ÷ RK -NAB ×ïòäï÷óëéê html ÷ ëïôïòïí íîå ðòéóùìáàô Îáâïëï÷á -NA Õðìïýåîéå ×ïòäï÷óëïçï html -NA2 Óõòï÷ïå ðòåóóï÷áîéå ×ïòä-8-çï html ÷ íïê æïòíáô. -AKM Áîôéòåíï÷óëáñ çòùúîñ äìñ öõòîáìá "ÁËÍ" -AHREF "Ðïäîñôø" ÷óå http-ìéîëé -SKRIZHALI ×ïòäï÷óëéê html éíåîé Óåòçåñ Íéèáêìï÷á -SH Ðïþôé ôåëóôï÷ùå æáêìù ïô Áìåëóá Ûéìï -KRU Ðïþôé ôåëóôï÷ùå æáêìù ïô Åëáôåòéîù Ëòõçìï÷ïê -LIB Æïòíáô html-lib.ru ÷ .txt -TEXTSHARE -MSHTML ÷ùþéóôéôø MS-html ïô íõóïòá -NOHTML õäáìéôø ÷óå html ôáçé -NOHTMLIB õäáìéôø ÷óå html ôáçé ëòïíå -UTFHTML aqute - ÷ ÷éîäï÷ó -UTFNUM [ãéæòá] ÷ âåóôõ -mime To Nestscape Hex Encoding -MIME From Nestscape Hex Encoding -UNIW äÅÓÑÔÉÞÎÁÑ UNICODE-windows Á-Ð-Ñ А П Я - 1040 + 192 -uni Windows × Ä×ÕÈÂÁÊÔÏ×ÙÊ unicode -uniw ÷ äÅÓÑÔÉÞÎÁÑ UNICODE-windows Á-Ð-Ñ А П Я - 1040 + 192 -UNI äÅÓÑÔÉÞÎÁÑ UNICODE asciiÁ А ÉÌÉ a -oct To octanumeric -LADA æïòíáôéòï÷áôø ôåëóô ðïóìå Ìáäéîïçï íáëòïóá -KW æïòíáôéòï÷áôø ÷ïòäï÷ùê ÆÁÊÌ ÐÏÓÒÅÄÓÔ×ÏÍ kword × RH 7.3 -NO ÎÉþÅÇÏ ÎÅ ÍÅÎÑÔØ -WH ÐÏÌÎÁÑ ÚÁÞÉÓÔËÁ MS-ÈÔÍÌÎÏÇÏ ÆÁÊÌÁ -WHC ÐÏÌÎÁÑ ÚÁÞÉÓÔËÁ MS-ÈÔÍÌÎÏÇÏ ÆÁÊÌÁ Ó ÐÒÅÆÏÒÍÁÔÏÍ -RTF ×ÉÎÄÏ×Ó-1251-rtf × plaintext " CAT=cat export CAT # ðòåäëïäéòï÷ýéë. Îõöåî áìøôåòîáôé÷ëå - óðáóáôø âõë÷õ yo LC_CTYPE=C export LC_CTYPE # CAT=ALTYO export CAT KOI_help() { echo "$@ $help" } KBD='qwertyuiop[]asdfghjkl;'"'"'zxcvbnm,.QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>''/=1567902' BEST='êãõëåîçûýúè®æù÷áðòïìäö'"ü"'ñþóíéôøâàÊÃÕËÅÎÇÛÝÚȬÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀ''e?!:,.()-' BESTA="ÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛݬÙØÜÀÑáâ÷çäåöúéêëìíîïðòóôõæèãþûý®ùøüàñ¡" LATIN='ABWGDEVZIJKLMNOPRSTUFHC+{}¬YX|~Qabwgdevzijklmnoprstufhc=\133\135®yx\\`q¡' RKOI7='ABWGDEVZIJKLMNOPRSTUFHC^[]_YX\\@Qabwgdevzijklmnoprstufhc~{}_yx|`q¡' KOI7T='ABVGDE}ZIHKLMNOPRSTUFXC|WQ:{"+YJabvgde]zihklmnoprstufxc\\wq;['"'"'=yj¡' KOI7='abwgdevzijklmnoprstufhc~{}_yx|`qABWGDEVZIJKLMNOPRSTUFHC^[]\177YX\\@Q¡' SPARC="abcdefghijklmnopqrstuvwxyz®ùøüàñABCDEFGHIJKLMNOPQRSTUVWXYZ¬ÙØÜÀÑ¡" KOI="áâ÷çäåöúéêëìíîïðòóôõæèãþûý\377ùøüàñÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ¡" ISO='°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîï¡' WIN="ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ\377¡" ALTERNAT="\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357³" GAK="\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\232\241\242\243\244\245\246\247\263\277\252\253\254\255\256\257\301\302\327\307\304\305\326\332\311\312\352\314\315\355\317\320\300" GOS="\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\232\241\242\270\244\245\246\247\263\277\252\253\254\255\256\257\301\302\327\307\304\305\326\332\311\312\313\314\315\316\317\320\300" MAC="\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377³" BOLXSHIE="ABCDEFGHIJKLMNOPQRSTUVWXYZáâ÷çäåöúéêëìíîïðòóôõæèãþûýÿùøüàñ¡" malenxkie="abcdefghijklmnopqrstuvwxyzÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ¡" LETTERS='acpyeuoxcnmETOPAHKXCBM' BUKWY='áóòõåéïèóðíÅÔÏÒÁÎËÈÓÂÍ' NNF='Õ÷áöåíùêÍëóé.ÂðâïîôÔúàËìñÉä×ÐøçòõãÆÎþû' nnf='°ÔÒÃÈØ»Ý\234ߣÛ.ÓÑÓÀܲ¢Þ¾\232Ù¿\230Æ\222\237¼Õ³±¶¤\235·¸' NNF2='ÜÚÒÇÏÅêÍÞÑûàÐèÁÔ÷öÂÉÎçÓâþòãúíéðåóîïëáäÄ×ì''ñ''ø''''õ''ô''''ù' nnf2='ÎþÁõàèÝøÚм¢ñ¾ò×ÔÃóûüÕÂÓ¿¹³ÞØÛÑÈ£ÜÀßÒÆæôÙ\237\235\203\220\236' TRANSLATOR=tr UNIXORDOS=cat ECHO=echo case "$OSTYPE" in Linux|linux*) ECHO="echo -e" ;; SunOS*)case `uname -a` in *4.1*|SunOS4*) ECHO=/usr/5bin/echo ;; esac ;; "") case `uname -a` in SunOS*4.1*|SunOS4*) ECHO=/usr/5bin/echo ;; esac ;; esac LC_ALL=C export LC_ALL CTRL_M=`$ECHO "\015"` ESC=`$ECHO "\033"` # while # ÒÁÚÂÏÒ É ×ÙÄÅÌÅÎÉÅ ÆÌÁÇÏ× # [ X != "X$*" ] # do case "$1" in -a|-alt) FROM="$KOI" INTO="$ALTERNAT" UNIXORDOS=unix2dos ; shift ;; -A|-ALT) CAT=ALTYO FROM="$ALTERNAT" INTO="$KOI" UNIXORDOS=dos2unix ; shift ;; -GAK) FROM="$GAK" INTO="$KOI" UNIXORDOS=dos2unix ; shift ;; -GOS) FROM="$GOS" INTO="$KOI" UNIXORDOS=dos2unix ; shift ;; -NNF) FROM="$nnf" INTO="$NNF" ; shift ;; -NNF2) FROM="$nnf2" INTO="$NNF2" ; shift ;; -k|-koi) FROM="$BESTA" INTO="$KOI" ; shift ;; -K|-KOI) FROM="$KOI" INTO="$BESTA" ; shift ;; -i|-iso) FROM="$KOI" INTO="$ISO" ; shift ;; -I|-iso) FROM="$ISO" INTO="$KOI" ; shift ;; -w|-win) FROM="$KOI" INTO="$WIN" ; shift ;; -W|-WIN) FROM="$WIN" INTO="$KOI" UNIXORDOS=dos2unix ; shift ;; -MAC) FROM="$MAC"'Ò×ÇÈßÞÑ' INTO="$KOI"'""""ñå-' ; shift ;; -KOI7T) FROM="$KOI7T"'`%' INTO="$KOI"'e"' ; shift ;; -MACB) FROM="$MAC" INTO="$KOI" ; shift ;; -KBD) FROM="$KBD" INTO="$BEST" ; shift ;; -mac) FROM="$KOI" INTO="$MAC" ; shift ;; -KOI7) FROM="$KOI7" INTO="$KOI" ; shift ;; -koi7) FROM="$KOI" INTO="$KOI7" ; shift ;; -RKOI7) FROM="$RKOI7" INTO="$KOI" ; shift ;; -rkoi7) FROM="$KOI" INTO="$RKOI7" ; shift ;; -r|-lat) FROM="$KOI" INTO="$LATIN" ; shift ;; -R|-rus|-RUS) FROM="$LATIN" INTO="$KOI" ; shift ;; -s|-sparc) FROM="$KOI" INTO="$SPARC" ; shift ;; -L|-LETTER) FROM="$LETTERS" INTO="$BUKWY" ; shift ;; -b|-down) FROM="$BOLXSHIE" INTO="$malenxkie" ; shift ;; -B|-UP) FROM="$malenxkie" INTO="$BOLXSHIE" ; shift ;; -FIDO) FROM="$BUKWY" INTO="$LETTERS" ; shift ;; -UTF8) TRANSLATOR=cat UNIXORDOS=UTF8 ; shift ;; -utf8) TRANSLATOR=cat UNIXORDOS=utf8n ; shift ;; -TU) TRANSLATOR=cat UNIXORDOS=TU ; shift ;; -M|-CRLFLF) TRANSLATOR=cat UNIXORDOS=dos2unix ; shift ;; -m|-lfcrlf) TRANSLATOR=cat UNIXORDOS=unix2dos ; shift ;; -p) TRANSLATOR=cat UNIXORDOS=antip ; shift ;; -fido) TRANSLATOR=cat UNIXORDOS=tofido ; shift ;; -P) TRANSLATOR=cat UNIXORDOS=antiwse ; shift ;; -rk) TRANSLATOR=cat UNIXORDOS=anticolorramki; shift ;; -koiram) TRANSLATOR=cat UNIXORDOS=antikoiramki ; shift ;; -altram) TRANSLATOR=cat UNIXORDOS=altram ; shift ;; -altramwin) TRANSLATOR=cat UNIXORDOS=altramkiwin ; shift ;; -bach2rk) TRANSLATOR=cat UNIXORDOS=bach2rk ; shift ;; -iwasi2rk) TRANSLATOR=cat UNIXORDOS=iwasi2rk ; shift ;; -mosaic2rk) TRANSLATOR=cat UNIXORDOS=mosaic2rk ; shift ;; -rk2pcl) TRANSLATOR=cat UNIXORDOS=rk2pcl ; shift ;; -man2rk) TRANSLATOR=cat UNIXORDOS=man2rk ; shift ;; -RTF2RK) TRANSLATOR=cat UNIXORDOS=RTF2RK ; shift ;; -index2dir) TRANSLATOR=cat UNIXORDOS=index2dir; shift ;; -EOP) TRANSLATOR=cat UNIXORDOS=eop ; shift ;; -ABZAC) TRANSLATOR=cat UNIXORDOS=ABZAC ; shift ;; -abzac) TRANSLATOR=cat UNIXORDOS=abzac ; shift ;; -oTSTUP) TRANSLATOR=cat UNIXORDOS=oTSTUP ; shift ;; -OTSTUP) TRANSLATOR=cat UNIXORDOS=OTSTUP ; shift ;; -OTSTUP2) TRANSLATOR=cat UNIXORDOS=OTSTUP2 ; shift ;; -WW) TRANSLATOR=cat UNIXORDOS=WW ; shift ;; -WWC) TRANSLATOR=cat UNIXORDOS=WWC ; shift ;; -WWID) TRANSLATOR=cat UNIXORDOS=WWID ; shift ;; -KW) TRANSLATOR=cat UNIXORDOS=KW ; shift ;; -LYR) TRANSLATOR=cat UNIXORDOS=lyr ; shift ;; -AKSRUS) TRANSLATOR=cat UNIXORDOS=aksrus ; shift ;; -HEX) TRANSLATOR=cat UNIXORDOS=fromhex ; shift ;; -ANS) TRANSLATOR=cat UNIXORDOS=ANS ; shift ;; -ASC) TRANSLATOR=cat UNIXORDOS=ASC ; shift ;; -LEX) TRANSLATOR=cat UNIXORDOS=LEX ; shift ;; -COM) TRANSLATOR=cat UNIXORDOS=anticomma ; shift ;; -CT1CU) TRANSLATOR=cat UNIXORDOS=CT1CU ; shift ;; -PRUD) TRANSLATOR=cat UNIXORDOS=PRUD ; shift ;; -HRAM) TRANSLATOR=cat UNIXORDOS=HRAM ; shift ;; -PERENOS) TRANSLATOR=cat UNIXORDOS=PERENOS ; shift ;; -preformat) TRANSLATOR=cat UNIXORDOS=preformat; shift ;; -PREFORMAT) TRANSLATOR=cat UNIXORDOS=PREFORMAT; shift ;; -FORMAT) TRANSLATOR=cat UNIXORDOS=FORMAT ; shift ;; -wfor) TRANSLATOR=cat UNIXORDOS=wfor ; shift ;; -psewdo) TRANSLATOR=cat UNIXORDOS=psewdo ; shift ;; -hlebnikow) TRANSLATOR=cat UNIXORDOS=hlebnikow; shift ;; -MAN) TRANSLATOR=cat UNIXORDOS=MAN ; shift ;; -NAB) TRANSLATOR=cat UNIXORDOS=NAB ; shift ;; -NA) TRANSLATOR=cat UNIXORDOS=NA ; shift ;; -NA2) TRANSLATOR=cat UNIXORDOS=NA2 ; shift ;; -NA3) TRANSLATOR=cat UNIXORDOS=NA3 ; shift ;; -SKRIZHALI) TRANSLATOR=cat UNIXORDOS=SKRIZHALI; shift ;; -SH) TRANSLATOR=cat UNIXORDOS=SH ; shift ;; -KRU) TRANSLATOR=cat UNIXORDOS=KRU ; shift ;; -AHREF) TRANSLATOR=cat UNIXORDOS=AHREF ; shift ;; -HARRY) TRANSLATOR=cat UNIXORDOS=harry ; shift ;; -AKM) TRANSLATOR=cat UNIXORDOS=AKM ; shift ;; -LIB) TRANSLATOR=cat UNIXORDOS=LIB ; shift ;; -TEXTSHARE) TRANSLATOR=cat UNIXORDOS=TEXTSHARE; shift ;; -sort|-SORT) TRANSLATOR=cat UNIXORDOS=SORT ; shift ;; -REABZAC) TRANSLATOR=cat UNIXORDOS=REABZAC ; shift ;; -LINE) TRANSLATOR=cat UNIXORDOS=LINE ; shift ;; -MSHTML) TRANSLATOR=cat UNIXORDOS=MSHTML ; shift ;; -NOHTML) TRANSLATOR=cat UNIXORDOS=NOHTML ; shift ;; -NOHTMLIB) TRANSLATOR=cat UNIXORDOS=NOHTMLIB ; shift ;; -UTFHTML) TRANSLATOR=cat UNIXORDOS=UTFHTML ; shift ;; -UTFNUM) TRANSLATOR=cat UNIXORDOS=UTFNUM ; shift ;; -mime) TRANSLATOR=cat UNIXORDOS=mime ; shift ;; -MIME) TRANSLATOR=cat UNIXORDOS=MIME ; shift ;; -UNIW) TRANSLATOR=cat UNIXORDOS=UNIW ; shift ;; -uniw) TRANSLATOR=cat UNIXORDOS=uniw ; shift ;; -sx1) TRANSLATOR=cat UNIXORDOS=sx1 ; shift ;; -SX1) TRANSLATOR=cat UNIXORDOS=SX1 ; shift ;; -oct) TRANSLATOR=cat UNIXORDOS=oct ; shift ;; -LADA) TRANSLATOR=cat UNIXORDOS=LADA ; shift ;; -NO) TRANSLATOR=cat UNIXORDOS=cat ; shift ;; -WH) TRANSLATOR=cat UNIXORDOS=WH ; shift ;; -WHC) TRANSLATOR=cat UNIXORDOS=WHC ; shift ;; -RTF) TRANSLATOR=cat UNIXORDOS=RTF ; shift ;; -*|-*help) KOI_help ; exit 1 ;; *) FROM="$BESTA" INTO="$KOI" ;; esac ALTYO() { # áìøôåòîáôé÷îõà ïôòáöáåí âõì÷õ e: ÷ e # cat $1 | tr 'ñ0xF00xF10xF20xF3' '\2450xAA0xBA0xAF0xBF' cat $1 | tr 'ñ' '\245' } dos2unix() # Ðòå÷òáýáåô ^M^J ÷ ^J { sed -e "s/$CTRL_M$//" #awk '{sub("\015+$","");print}' } unix2dos() # Ðòå÷òáýáåô ^J ÷ ^M^J { # sed -e "/$CTRL_M$/ !s/^.*$/&$CTRL_M/" # sed -e "s/$/$CTRL_M/" awk '{print $0 "'$CTRL_M'"}' } antip() # Ðpå÷páýáåô "p" ÷ põóóëïí ôåëóôå ÷ "ò" { sed -e ' s/\([^ -~]\)p/\1ò/g s/p\([^ -~]\)/ò\1/g ' $1 } antiwse() { CTRL_I=`$ECHO "\011"` sed -e " s/£/Å/g s/\([^$CTRL_I-~]\)a/\1Á/g s/a\([^$CTRL_I-~]\)/Á\1/g s/\([^$CTRL_I-~]\)c/\1Ó/g s/c\([^$CTRL_I-~]\)/Ó\1/g s/\([^$CTRL_I-~]\)p/\1Ò/g s/p\([^$CTRL_I-~]\)/Ò\1/g s/\([^$CTRL_I-~]\)y/\1Õ/g s/y\([^$CTRL_I-~]\)/Õ\1/g s/\([^$CTRL_I-~]\)e/\1Å/g s/e\([^$CTRL_I-~]\)/Å\1/g s/\([^$CTRL_I-~]\)u/\1É/g s/u\([^$CTRL_I-~]\)/É\1/g s/\([^$CTRL_I-~]\)o/\1Ï/g s/o\([^$CTRL_I-~]\)/Ï\1/g s/\([^$CTRL_I-~]\)x/\1È/g s/x\([^$CTRL_I-~]\)/È\1/g s/\([^$CTRL_I-~]\)c/\1Ó/g s/c\([^$CTRL_I-~]\)/Ó\1/g s/\([^$CTRL_I-~]\)n/\1Ð/g s/n\([^$CTRL_I-~]\)/Ð\1/g s/\([^$CTRL_I-~]\)m/\1Í/g s/m\([^$CTRL_I-~]\)/Í\1/g s/\([^$CTRL_I-~]\)E/\1å/g s/E\([^$CTRL_I-~]\)/å\1/g s/\([^$CTRL_I-~]\)T/\1ô/g s/T\([^$CTRL_I-~]\)/ô\1/g s/\([^$CTRL_I-~]\)O/\1ï/g s/O\([^$CTRL_I-~]\)/ï\1/g s/\([^$CTRL_I-~]\)P/\1ò/g s/P\([^$CTRL_I-~]\)/ò\1/g s/\([^$CTRL_I-~]\)A/\1á/g s/A\([^$CTRL_I-~]\)/á\1/g s/\([^$CTRL_I-~]\)H/\1î/g s/H\([^$CTRL_I-~]\)/î\1/g s/\([^$CTRL_I-~]\)K/\1ë/g s/K\([^$CTRL_I-~]\)/ë\1/g s/\([^$CTRL_I-~]\)X/\1è/g s/X\([^$CTRL_I-~]\)/è\1/g s/\([^$CTRL_I-~]\)C/\1ó/g s/C\([^$CTRL_I-~]\)/ó\1/g s/\([^$CTRL_I-~]\)B/\1÷/g s/B\([^$CTRL_I-~]\)/÷\1/g s/\([^$CTRL_I-~]\)M/\1í/g s/M\([^$CTRL_I-~]\)/í\1/g " } tofido() { tr '[Îò]' '[Hp]' } rk2pcl() { kommentarij=' [\]^ ^^D reverse ^^E ^T underline ^U ^\ dim ^] ' UND_S=`$ECHO "\024"` UND_E=`$ECHO "\025"` REV_S=`$ECHO "\036D"` REV_E=`$ECHO "\036E"` DIM_S=`$ECHO "\034"` DIM_E=`$ECHO "\035"` und_s="${ESC}\&dD" und_e="${ESC}\&d@" rev_s="" rev_e="" dim_s="" dim_e="" sed -e " s/${UND_S}/${und_s}/g s/${UND_E}/${und_e}/g s/${DIM_S}/${dim_s}/g s/${DIM_E}/${dim_e}/g s/${REV_S}/${rev_s}/g s/${REV_E}/${rev_e}/g " } antikoiramki() { #CTRL_KR=`$ECHO "\036"` #CTRL_KRASKI=`$ECHO "[\024\025\034\035]"` # ^T^U^\^] UGOLKI=`$ECHO "[\231\213\230\214\202\204\205]"` # pqbd p bd PEREKL=`$ECHO "[\234\211\237¨¡¼\210]"` # ^|^ -| |- _|_ -| -|- WERT=`$ECHO "[\212\201]"` # | || GORIZ=`$ECHO "[\235 ]"` # - perekl=`$ECHO "[\206\207¯²]"` # + goriz=`$ECHO "[\200]"` # - wert=`$ECHO "[\203]"` # | | sed -e " s/$UGOLKI/+/g s/$PEREKL/+/g s/$perekl/+/g s/$WERT/|/g s/$GORIZ/-/g s/$wert/|/g s/$goriz/-/g " } altramkiwin() { UGOLKI='[¿´ÙÃÀÚÉȼ»]' # pqbd p bd PEREKL='[ÆÂÁÅØÎ×ÐÑÇËÌÒÊ϶¹µ]' goriz="[ÄÍ]" # - werti="[º]" # | sed -e " s/$goriz/-/g s/$werti/|/g s/$UGOLKI/+/g s/$PEREKL/+/g " } altram() { UGOLKI='[¿´ÙÚÀÉÈ»¼]' # pqbd p bdpqbd PEREKL='[ÂÁÅÃ]' GORIZ="[Í]" # = goriz="[Ä]" # - wert="[³]" # | WERT="[º]" # |I sed -e " s/$goriz/-/g s/$GORIZ/=/g s/$WERT/I/g s/$wert/|/g s/$UGOLKI/+/g s/$PEREKL/+/g s%ø%o%g " } bach2rk() { CTRL_T=`$ECHO "\024"` # ^T CTRL_U=`$ECHO "\025"` # ^U UGOLKI=`$ECHO "[\232\231\200¿]"` # pqbd p bd PEREKL=`$ECHO "[\205\203\202\201´]"` # ^|^ -| |- _|_ -| -|- WERT=`$ECHO "[³]"` # | || GORIZ=`$ECHO "[\204§]"` # - sed -e " s/${ESC}E/ $CTRL_T/g s/${ESC}F/$CTRL_U/g s/$UGOLKI/+/g s/$PEREKL/+/g s/$WERT/|/g s/$GORIZ/-/g " } iwasi2rk() { CTRL_A=`$ECHO "\001"` # CTRL_T=`$ECHO "\024"` # CTRL_Z=`$ECHO "\031"` # sed -e " s/[${CTRL_A}-${CTRL_Z}]//g s/${ESC}E/${CTRL_T}/g s/${ESC}.//g " } anticolorramki() { CTRL_KR=`$ECHO "\036"` CTRL_KRASKI=`$ECHO "[\024\025\034\035]"` # ^T^U^\^] UGOLKI=`$ECHO "\203[\201\202\203\204\221\222\223\224]"` # pqbd PEREKL=`$ECHO "\203[\205\206\207\210\211]"` # ^|^ -| |- _|_ -| -|- WERT=`$ECHO "\203[\212\232]"` # | || GORIZ=`$ECHO "\203[\213\233]"` # - perekl=`$ECHO "\205[\226]"` # + goriz=`$ECHO "\205[\202\204]"` # - wert=`$ECHO "\205[\201\203\205]"` # | | sed -e " s/$CTRL_KR.//g s/$CTRL_KRASKI//g s/$UGOLKI/+/g s/$PEREKL/+/g s/$perekl/+/g s/$WERT/|/g s/$GORIZ/-/g s/$wert/|/g s/$goriz/-/g " } mosaic2rk() { # s/%E1/À/g - ÷ïô ÷óå þôï äåìáåô üôïô AWK sed -e "`gawk 'BEGIN {for (i=192; i<=254 ; i=i+1) { printf ("s/[%%=]%2X/%c/g\n", i, i)}}' < /dev/null`" -e ' s/%22/"/g s/%20/ /g s/%3D/=/g s/%3F/?/g s/%5B/[/g s/%5D/]/g ' } man2rk() { UND_S=`$ECHO "\024"` UND_E=`$ECHO "\025"` REV_S=`$ECHO "\036D"` REV_E=`$ECHO "\036E"` Home=`$ECHO "\010"` # Óéí÷ïì Home sed -e " s/_$Home\([^_]\)/$UND_S\1$UND_E/g s/.$Home\(.\)/$REV_S\1$REV_E/g s/$UND_E$UND_S//g s/$REV_E$REV_S//g " } RTF2RK() { sed -e ' s/à/Á/g s/á/Â/g s/â/×/g s/ã/Ç/g s/ä/Ä/g s/å/Å/g s/æ/Ö/g s/ç/Ú/g s/è/É/g s/é/Ê/g s/ê/Ë/g s/ë/Ì/g s/ì/Í/g s/í/Î/g s/î/Ï/g s/ï/Ð/g s/ð/Ò/g s/ñ/Ó/g s/ò/Ô/g s/ó/Õ/g s/ô/Æ/g s/õ/È/g s/ö/Ã/g s/÷/Þ/g s/ø/Û/g s/ù/Ý/g s/ü/Ø/g s/û/Ù/g s/ú/ß/g s/ý/Ü/g s/þ/À/g s/ÿ/Ñ/g s/À/á/g s/Á/â/g s/Â/÷/g s/Ã/ç/g s/Ä/ä/g s/Å/å/g s/Æ/ö/g s/Ç/ú/g s/È/é/g s/É/Ê/g s/Ê/ë/g s/Ë/ì/g s/Ì/í/g s/Í/î/g s/Î/ï/g s/Ï/ð/g s/Ð/ò/g s/Ñ/ó/g s/Ò/ô/g s/Ó/õ/g s/Ô/æ/g s/Õ/è/g s/Ö/ã/g s/×/þ/g s/Ø/û/g s/Ù/ý/g s/Ü/ø/g s/Û/ù/g s/Ú/ÿ/g s/Ý/ü/g s/Þ/à/g s/ß/ñ/g s/\[\[Atilde]]/ç/g s/\[\[thorn]]/À/g s/\[\[eth]]/Ò/g s/\[\[Eth]]/ò/g s/&iaute;/Î/g ' $1 # awk 'BEGIN { for (i=128;i<256;i++) {printf ("s/\\\\'\''%x/%c/g\n",i,i)}}' rr } index2dir() { sed -e ' s%\(.*\)%\2 ¡ \1 % ' } eop() { CTRL_I=`$ECHO "\011"` # ^I CTRL_L=`$ECHO "\014"` # ^L sed -e "s/$CTRL_L/\\ /g" | grep -v "^[$CTRL_I ]*-[$CTRL_I ]*[0-9]*[$CTRL_I ]*-[$CTRL_I ]*$" } ABZAC() { CTRL_I=`$ECHO "\011"` # ^I sed -e " s/^$CTRL_I/ / s/^ /\\ / " } abzac() { perl -e 'while(read(STDIN,$_,100000)){s%\n\n%\n%g;print;}' } lyr() { #$song #%text Ûðáìéëï÷ Ç. #%music #%title ÏÓÅÎÎÉÊ ÌÅÓ #%first Íåîñàô ìàäé áäòåóá... #;%alias #;%theme #%exec @NADEZHDA #%chords 3 #;% - üôé ëïííåîôáòéé íù îå òáúìéþáåí #; - üôé ëïííåîôáòéé íù ïóôá÷ìñåí # perl -pe perl -e ' $inzagolowok=0; while() { s/\@ADELUNG/Áäåìõîç Ç.H./; s/\@BELETSKY_V/Âåìåãëéê ×./; s/\@PIRATS/Ðéòáôù/; s/\@TOURISM/Ôõòéúí/; s/\@MITYAEV_BRIGHT_PAST/Ó÷åôìïå ðòïûìïå.../; # if ($_ !~ /^[;%\$@]/) if ($_ !~ /^[%\$@]|^\;%|^\;$/) { if ( $inzagolowok ) { # ôïìøëï þôï ëïîþéìóñ úáçïìï÷ïë if ($chords > 0) { $plus=""; } else { $plus="- ";} if (length ($title) < 2) { $title=$first; } if ($music eq $text) { $text=""; } if (length $music && length $text) { $authors="$music, $text"; } else { $authors="$music $text"; } print "\n $plus",$title," \t$authors\n"; $inzagolowok=0;$title="";$first="";$music="";$text=""; } print; } else { $inzagolowok=1; #s/^%exec.*// ; #s/^\;.*// ; #s/^\$song\n// ; /^%chords *(\d*)/ && do {$chords=$1;}; /^%text *(.*)/ && do { $text=$1;}; /^%music *(.*)/ && do { $music=$1;}; /^%first *(.*)/ && do { $first=$1;}; /^%title *(.*)/ && do { $title=$1;}; } } ' } aksrus() { # õ îéè ÷åóøíá îåôòé÷éáìøîáñ òáóëìáäëá òõóóëéè âõë÷ ðï ìáôéîéãå tr "_XxVv:;hH'"'"'"£ÜWw%[*@°=" '\-Èè×÷ØøþÞöÖ""Ûû:à?!N®' | KOI -rus } fromhex() { perl -e ' while() { s/0x([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; print; } ' 2> /dev/null } ASC() { perl -e 'while(read(STDIN,$_,1000000)) { tr%\t% %; s%([\n\r\t ]*)([iub]>)%$2$1%sig ; s%(<[ibu]>)([\n\r\t ]*)%$2$1%sig ; s%( *)%$1%ig;s%( *)%$1%ig;s%( *)%$1%ig; print;}' |\ perl -e ' while() { tr/¸\001\222\223\224«»\204/ÅÅ\047\"\"\"\"\"/; # Úäåóø íù îåóëïìøëï óðåãóéí÷ïìï÷ ×ïòäá "ïðõóôéí" s%( *)%$1%ig;s%( *)%$1%ig; tr/\237\240\232\r/ñ \n/; s/\205/.../g; s/\037//g; s/[\227\226]/--/g; s/×\200"/--/g; s/×"--/No/g; s/¹/No/g; print; } ' 2> /dev/null } LEX() { perl -e ' while() { s/ÿ_([^ÿ]*)ÿ0/$1/g; s/ÿ1([^ÿ]*)ÿ0/$1/g; s/ÿ2([^ÿ]*)ÿ0/$1/g; s/ÿ[_0-2]([^ÿ\n]*)$/$1/g; print; } ' 2> /dev/null } ANS() { # Ðòé óïèòáîåîéé Save as text with layout ÷ îåëïôïòùè áâúáãáè # ðåò÷ïå óìï÷ï ÷ óôòïëå óïèòáîñåôóñ ìáôéîóëéíé âõë÷áíé - # ðòïóôï óâòáóù÷áåôóñ 8-ê âéô. perl -e ' while() { tr/\222\223\224/\047\"\"/; # Úäåóø íù îåóëïìøëï óðåãóéí÷ïìï÷ ×ïòäá "ïðõóôéí" s/\205/.../g; s/\227/--/g; s/\226/--/g; if ( $_ =~ /^( *[a-z`\|{~@}]*)(.*)/i ) { $a=$1; $c=$1 ; $b=$2 ; $a =~ tr/@ABWGDEVZIJKLMNOPRSTUFHC+{}¬YX|~Qabwgdevzijklmnoprstufhc=\133\135®yx\\`q¡/ÁÂ×ÞÚÄÅìÊËÌÍÎÏÐÒÔÕÆÈÖÉÇÀùü¬ÝÛøàÓâ÷þúäåã®êëìíîïðòôõæèöéçàÙÜ®ýûØáó¡/; print "$a$b\n" ;} else { print ; } } ' 2> /dev/null } CT1CU() { # ÷ùäåìñåí úáçïìï÷ëé ÷ ôåëóôå. # Ïôäåìøîï óôïñýåå þéóìï # ïóôáìøîïå ðòéäõíáåí ðï èïäõ CTRL_T=`$ECHO "\024"` # ^T CTRL_U=`$ECHO "\025"` # ^U sed -e ' s/^ *\([0-9][0-9]*\)$/ '"$CTRL_T"'\1'"$CTRL_U"'/ ' } psewdo() { # KOI -rk2pcl | KOI -a | KOI -psewdo - ðòå÷òáýáåô òë-òáíëé ÷ alt-ðóå÷äïçòáæéëõ perl -e ' while() { s/\203\201/\332/g; s/\203\202/\277/g; s/\203\203/\300/g; s/\203\204/\331/g; s/\203\205/\302/g; s/\203\206/\264/g; s/\203\207/\303/g; s/\203\210/\301/g; s/\203\211/\305/g; s/\203\212/\263/g; s/\203\213/\304/g; s/\203\214/\302/g; s/\203\215/\264/g; s/\203\216/\303/g; s/\203\217/\301/g; s/\203\220/\263/g; s/\203\221/\311/g; s/\203\222/\273/g; s/\203\223/\310/g; s/\203\224/\274/g; s/\203\225/\313/g; s/\203\226/\271/g; s/\203\227/\314/g; s/\203\230/\312/g; s/\203\231/\316/g; s/\203\232/\272/g; s/\203\233/\315/g; s/\205\201/\263/g; s/\205\202/\304/g; s/\205\203/\263/g; s/\205\204/\304/g; s/\205\205/\272/g; s/\205\206/\315/g; s/\205\207/\272/g; s/\205\210/\315/g; s/\205\213/\307/g; s/\205\215/\321/g; s/\205\216/\266/g; s/\205\217/\307/g; s/\205\220/\317/g; s/\205\225/\330/g; s/\205\226/\327/g; s/\205\227/\265/g; s/\205\230/\267/g; s/\205\231/\270/g; s/\205\232/\275/g; s/\205\233/\276/g; s/\205\234/\306/g; s/\205\235/\320/g; s/\205\236/\322/g; s/\205\237/\323/g; # s/\205\241/\324/g; s/\205\263/\324/g; s/\205\242/\325/g; s/\205\243/\326/g; print; } ' 2> /dev/null } PERENOS() { perl -e 'while(read(STDIN,$_,512000)){s/([^-])-\n/$1/sg;print;}' } preformat() { perl -e ' while() { s/ - / == /g; s/([ ,!.?])-{1,2}/$1==/g; s/^-{1,2}([^-])/== $1/; s/ -$/ ==/; s/^ /\n /; print; } ' } PREFORMAT() { perl -e ' while() { s/^==([^=])/--$1/g; s/([^=])==$/$1--/g; s/([^=])==([^=])/$1--$2/g; print; } ' | perl -e 'while(read(STDIN,$_,100000)){s%\n\n%\n%g;print;}' } wfor() { perl -e 'while(){s/^[ \t]*/\n /;print;}' } PRUD() { tr "\217ⶢ¨þ\214\232«÷¶·¯ÿ\221¬®£úíå©ò¿ð\215ê\201\225¥ì\210\212\203\237\202ë\227\216\204\220\207\222\200" "Ðòé÷åôÍáëóéíðïþøöâÓìîäõùèúñêàÎûÂÈç®ÉËÇÑ×ýÞÏÄÒÚÔÁ" } HRAM() { tr "é«»Òß »¿ÒÔ¬¿ÊóçÕÅñÀ콡ÞúÈÛªÙº¼ÝÑÜùØÃàí" "×ïðòó ðéòôëéê÷ÚõÐäàÎìîþçèûöùúíýåüþøãÅâ" } hlebnikow() { sed -e ' s%%% s%]*>%% s%]*>%% s% FACE=[^>]*%% s% SIZE=[123]%% s%%% ' } MAN() { # Convertor abs-book.txt NROFF formatted to HTML H=`echo -e "\010"` T=`echo -e "\024"` U=`echo -e "\025"` Q=`echo -e "\021"` R=`echo -e "\022"` sed -e " s/_$H\(.\)/$T\1$U/g s/$U$T//g s/$U\( *\)$T/\1/g s%.$H\(.\)%$Q\1$R%g s/$R$Q//g s/$R\( *\)$Q/\1/g s/\</g s%$Q%%g s%$R%%g " } # ¡ ~/bbs/moshkow.txt NA2() { LC_CTYPE=C export LC_CTYPE tr '\n' ' ' | perl -e ' while(read(STDIN,$_,1000000)){ # úáþéóôëá s%.*%%i; s%]*]*>%%i; s%?html>%%i; s%%%i; s%\002%*%g; s% % %gi; s%<(p|br|div) [^>]*>%<$1>%gi; s% (face|size) *= *"[^"]*"%%gi; s%(.*?)%$1%gi; s%?b>( *)?b>%$1%gi; s%?u>( *)?u>%$1%gi; s%?i>( *)?i>%$1%gi; s%( +)([iub])>%$2>$1%sgi; # ÐÏÄÁÒÏË ÏÔ óÔÁÒÉÎÏ×Á s%\023 +XE +".*?" +\025%%sg; # æïòíáôáö s%%\n %sgi; s%%\n\n %sgi; print; } ' } # ðïóô-áóëéûîáñ æïòíáôéòï÷ëá NA3() { LC_CTYPE=C export LC_CTYPE perl -e ' while(<>){ s%^ (.*)$% \024$1\025%i; print; } ' } NA() { LC_ALL=C LC_CTYPE=C export LC_CTYPE egrep -via 'charset=windows-12|meta http-equiv="Content-Type"' |\ perl -e ' while(){ s%]*>%% ; s% FACE="[A-Za-z, ]+"%%ig ; s% FACE=[^"> ,]*?%%ig ; s% SIZE=[12]%%ig ; s%<(p|b|i|div|br) .*?>%<$1>%ig ; s% % %ig; print; }' exit } NAB() { LC_ALL=C LC_CTYPE=C export LC_CTYPE # egrep -vi 'charset=windows-12|meta http-equiv="Content-Type"' ; exit egrep -v '^*HTML>$|^*HEAD>$|text/html; charset=windows-125' |\ perl -e 'while(read(STDIN,$_,100000)) {s%([^\n]{980,})!\n%$1%g; s%!\n!\n!\n!\n%%g;s%!\n!\n!\n%%g;s%!\n!\n%%g; s%!\n( *[à-ú])%$1%g; s%\n(size=[-0-9]+)% $1%ig;print;}' |\ perl -e ' while(){ s%]*>\n%% ; s%]*>\n%% ; s%*BODY[^>]*>%% ; s%\227% %g; s%—%--%g ; s% % %g; s%“%"%g; s%”%"%g; s% %%g; s%[“”]%"%g ; s% SIZE="[-0-9]+"%%ig ; s% SIZE=[-+0-9]+%%ig ; s% FACE="[A-Za-z ]+"%%ig ; s% FACE="?[^"> ]*"?%%ig ; s% COLOR="[^"]*"%%ig ; s%^%\n %i ; s%%\n\n %ig ; s%%\n\n %ig ; s%\n%\n %igs; s%%\n %ig ; s%%\n %ig ; s%?FONT>%%ig ; s%?DIR>%%ig ; s%%\n %ig ; s%%%ig ; s%^([^<]*)% $1%g; s%--%-- %g ; s%"%"%ig ; print ; } ' |\ perl -e 'while(read(STDIN,$_,100000)) {s%(<[bi]>)([ \n]+)%$2$1%ig; s%([ \n]+)([bi]>)%$2$1%ig; print;}' } SKRIZHALI() { LC_ALL=C LC_CTYPE=C export LC_CTYPE perl -e ' while(){ s% SIZE="[0-9]*"%%ig ; s% SIZE=[0-9]*%%ig ; s% COLOR="[^"]*"%%ig ; s% FACE="[^"]*"%%ig ; s%%%ig ; s%%%ig ; print ; } ' } OTSTUP() { sed -e 's/^[ ][ ]*/ /' |\ perl -e 'while(read(STDIN,$_,100000)){ s%\n\n([^\n ])%\n\n $1%g; print;}' } OTSTUP2() { MINSIZE=56 sed -e 's/^[ ][ ]*/ /' |\ perl -e 'while(read(STDIN,$_,100000)){ s%\n-%\n -%g; s%\n([^\n]{0,'"$MINSIZE"'})\n%\n$1\n %g; print;}' } wyazh() { tmp=/tmp/$$mm cat $1 |\ egrep -v '*HTML>|*HEAD>|*BODY' |\ tr '[A-Z]' '[a-z]' |\ sed -e ' s% % % s%%\ \ %' > $tmp } WWID() { perl -e 'while(read(STDIN,$_,100000)){ s/\[Author.*?\]//sgi; print;}' } WW() { tmp=/tmp/ww$$.doc trap "rm -f $tmp" 0 1 2 3 9 10 15 cat > $tmp if file $tmp | grep "Rich Text Format" > /dev/null 2> /dev/null ; then rtf2html $tmp| KOI -W |KOI -ASC |KOI -MSHTML | KOI -NA | KOI -NA2 |KOI -NOHTMLIB |KOI -OTSTUP|KOI -FORMAT|KOI -ASC |KOI -NA3|KOI -PREFORMAT else # if egrep -i 'microsoft word' $tmp > /dev/null # then # mswordview -o moshkow.txt ÏÔÍÅÎÅÎ LD_LIBRARY_PATH=/usr/local/lib wvHtml --charset=windows-1251 $tmp - |\ KOI -W |KOI -ASC |KOI -MSHTML |KOI -NA |KOI -NA2 |KOI -NOHTMLIB|KOI -ASC|KOI -ASC | KOI -WWID | KOI -OTSTUP |KOI -FORMAT|KOI -NA3|KOI -PREFORMAT|KOI -PREFORMAT # else # winword $tmp # for flag in -W -ASC -wfor -FORMAT -PREFORMAT ; do # KOI $flag moshkow.txt moshkow.txt # done # beep # fi fi } WWC() { tmp=/tmp/ww$$.doc trap "rm -f $tmp" 0 1 2 3 9 10 15 cat > $tmp if file $tmp | grep "Rich Text Format" > /dev/null 2> /dev/null ; then rtf2html $tmp| KOI -W |KOI -ASC |KOI -MSHTML | KOI -NA # | KOI -NA2 |KOI -NOHTMLIB | sed -e 's/^ //' -e 's/ *$//' else LD_LIBRARY_PATH=/usr/local/lib wvHtml --charset=windows-1251 $tmp - |\ KOI -W |KOI -ASC |KOI -MSHTML |KOI -NA # |KOI -NA2 |KOI -NOHTMLIB | KOI -OTSTUP |KOI -FORMAT|KOI -NA3|KOI -PREFORMAT|KOI -PREFORMAT fi } UTF8() { utf8 |\ perl -e ' while (<>){ s/]*src="?file[^>]*>//gi; s///gi; s/Â[«»]/"/gi; s/â\200[\234\235]/"/gi; s/â\200\224/--/gi; s/â\200¢//gi; s/â\200[\236¦]/.../gi; s/â\200\231/'"'"'/gi; last if /Document converted from word/; print; } ' true perl -e ' while(1) { break if (!read(STDIN,$C,1)); $I = $C-0320; if( $I == 0 || $I == 1 ) { # Ð,Ñ read(STDIN,$C,1); if( $I == 0 ) { if( $C >= 0220 && $C < 0300 ) {$C = $C-0220+0300;} } else { if ( $C >= 0200 ) { $C = $C+0160; } } } print $C; } ' } FORMAT() { LC_ALL=C LC_CTYPE=C formater.pl | sed 's/^ *$//' } SH() { CTRL_T=`$ECHO "\024"` # ^T CTRL_U=`$ECHO "\025"` # ^U egrep -v '^ *WWW: *$' |\ sed -e " s/WWW: *\([^| ]*\) *$/WWW: \1 | \1/; s/|/¡/; s/^ *\^[TÔ]/ $CTRL_T/; s/\^U/$CTRL_U/; " } AHREF() { sed -e 's%\(ftp://[-a-z0-9/_.~]*\)%\1% s%\(http://[-:a-zA-Z0-9/_.~]*\)%\1%' } AKM() { perl -e 'while(read(STDIN,$_,100000)){ s%.*?%%sgi; s%.*?%%sgi; # .* - íéîéíáìøîïå ÷èïöäåîéå $MOSHKOWENCODING=< koi win lat iso alt mac rema.ru/akm EOF s%%$MOSHKOWENCODING%sio; print; }' } mime() { perl -e 'while(read(STDIN,$_,100000)){ s/([^0-9 A-Za-z])/sprintf("%%%02X",unpack("C", $1))/seg; print; }' } UNIW() { # á ð ñ # А П Я - 1040 + 192 # Á Ð Ñ # а п я perl -e 'while(read(STDIN,$_,100000)){ s/\&\#(\d+)\;/pack("C", $1 - 848 )/seg; print "$_"; }' | KOI -W } uniw() { # á ð ñ # А П Я - 1040 + 192 # Á Ð Ñ # а п я perl -e 'while(read(STDIN,$_,100000)){ s/([\300-\377])/sprintf("%d",848+unpack("C", $1))/seg; print "$_"; }' } SX1() # UNICODE Ä×ÕÈÂÁÊÔÏ×ÙÊ ÄÌÑ SX1: abc -- > Á^@b^@c^@,áâ-àñ -> 0^D1^D-N^DO^D { perl -e ' sub rec{$c=unpack("C",@_[0]); if (@_[1] eq "\04"){ if(16 <= $c && $c <= 79 ){return sprintf ("%c",$c+176);} else{ return @_[0]; } }else{ return @_[0]; } } while(read(STDIN,$_,100000)){ s/^ÿþ//; s/(.)(.)/&rec($1,$2)/seg; print "$_"; }' } sx1() { perl -e ' sub rec{(192<=($c=unpack(C,@_[0])))?pack(C,$c-176)."\04":@_[0]."\0";} print "ÿþ"; while(<>){ s/./&rec($&)/seg; print $_; }' } utf8n() { # ¡ ../linlocal/C/utf8.c perl -e ' sub rec{(($c=unpack(C,@_[0]))<0360)?pack(C2,0320,$c-060):pack(C2,0321,$c-0160)} while(<>){s/[\300-\377]/&rec($&)/seg;print;} ' } MIME() { perl -e 'while(read(STDIN,$_,100000)){ s/[%=]([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/seg; print; }' } oct() { perl -e 'while(read(STDIN,$_,100000)){ s/(.)/sprintf("\\%03o",unpack("C", $1))/seg; print; }' } oTSTUP() { sed -e " s/^ *\([$malenxkie]\)/\1/ s/^ *- \([$malenxkie]\)/- \1/ " } KRU() { KOI -ASC |\ perl -e ' while(<>){ s/@@@/¡/; s%^\s*/###\s*(.*)\s*###/% \024 * $1 * \025%; s%^\s*###\s*(.*)\s*###% \024$1\025%; print; } ' } LIB() { perl -e 'while(read(STDIN,$_,100000)){ s%\n\n%\n-----------------------------------------------------------\n%sgi; s%.*1%%; s%%\n \024%sgi; s%%\n \024%sgi; s%%\025%sgi; s%%\025%sgi; s%Last-modified:.*%%s; print ; } ' } TU() { perl -e 'while(read(STDIN,$_,100000)){ unless ($n){s/^\s*/ /s;} s/\^T/\024/sg; s/\^U/\025/sg; s/§/\025/sg; s/¶/\n \024/sg; print; $n++;}' } TEXTSHARE() { perl -e 'while (read(STDIN,$_,500000)){ s/\n(--+)\n( +\(.*?\n)*/\n\n $&\n\n/sg; s/\[\d+\]\n//sg; s/([^-])-\n([^\n])/$1$2/sg; print; }' 2> /dev/null } SORT() { KOI -a|sort|KOI -A } REABZAC() { perl -e 'while (read(STDIN,$_,500000)){ s/-\n ([ÁÂ×ÇÄÅÖÚÉËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ])/$1/g; s/\n ([ÁÂ×ÇÄÅÖÚÉËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ])/ $1/g; print; } ' } LINE() { perl -e 'while (read(STDIN,$_,500000)){ s/\n([^ \n])/ $1/g; s/([^ \n]) +/$1 /g; print; } ' } MSHTML() { perl -e ' while (read (STDIN,$_,3000000)){ s%%%sg; s% name=\".+?\"%%gsi; s%?(o|w):.*?>%%sgi; # s%]*>.*?]*>%%sgi; # s%]*>.*?]*>%%sgi; s%<\!.*?>%%sgi; s%<(p|b|div|br) .*?>%<$1>%sgi; s%%%sgi; s% style='\''.*?'\''%%sgi; s%(span|p)>%%sgi; s%—%--%sgi; s%…%...%sgi; s%&[lr]dquo;%"%sgi; s%"%"%sgi; s%%%sgi; print; } ' } NOHTML() { perl -e 'while (read (STDIN,$_,1000000)){s%<.*?>%%sg;print;}' } NOHTMLIB() { perl -e ' while (read (STDIN,$_,1000000)) { s%<(/?[ib])>%{$1}%sgi; s%<(/?(table|tr|td)).*?>%{$1}%sgi; s%<(/?sup)>%{$1}%sgi; s%<(li)>%{$1}%sgi; s%<(img .*?)>%{$1}%sgi; s%(.*?)%\n \024$1\025\n%sgi; s%<.*?>%%sg; s%\{(/?[ib])\}%<$1>%sgi; s%\{(/?sup)\}%<$1>%sgi; s%\{(li)\}% <$1>%sgi; s%\{(img .*?)\}%<$1>%sgi; s%\{(/?(table|tr|td)).*?\}%<$1>%sgi; print; } ' } UTFHTML() { sed -e ' s/Ô/æ/g; s/Æ/ö/g; s/Ø/û/g; s/Ý/ü/g; s/Õ/è/g; s/Ó/õ/g; s/×/þ/g; s/ú/ß/g; s/Ð/ò/g; s/Ë/ì/g; s/Å/å/g; s/Ä/ä/g; s/À/á/g; s/Á/â/g; s/Ç/ú/g; s/Ò/ô/g; s/ô/Æ/g; s/ß/ñ/g; s/Ê/ë/g; s/Í/î/g; s/Â/÷/g; s/Ã/ç/g; s/Ì/í/g; s/Ñ/ó/g; s/Ï/ð/g; s/Î/ï/g; s/ý/Ü/g; s/ù/Ý/g; s/È/é/g; s/ö/Ã/g; s/þ/À/g; s/ø/Û/g; s/õ/È/g; s/æ/Ö/g; s/é/Ê/g; s/÷/Þ/g; s/á/Â/g; s/û/Ù/g; s/ç/Ú/g; s/ã/Ç/g; s/ÿ/Ñ/g; s/ü/Ø/g; s/ï/Ð/g; s/ì/Í/g; s/ó/Õ/g; s/ä/Ä/g; s/ê/Ë/g; s/ð/Ò/g; s/ë/Ì/g; s/â/×/g; s/ñ/Ó/g; s/ò/Ô/g; s/è/É/g; s/í/Î/g; s/à/Á/g; s/å/Å/g; s/î/Ï/g; s/ / /g; ' } UTFNUM() { sed -e ' s/ / /g; s/¸/e/g; s/À/á/g; s/Á/â/g; s/Â/÷/g; s/Ã/ç/g; s/Ä/ä/g; s/Å/å/g; s/Æ/ö/g; s/Ç/ú/g; s/È/é/g; s/É/ê/g; s/Ê/ë/g; s/Ë/ì/g; s/Ì/í/g; s/Í/î/g; s/Î/ï/g; s/Ï/ð/g; s/Ð/ò/g; s/Ñ/ó/g; s/Ò/ô/g; s/Ó/õ/g; s/Ô/æ/g; s/Õ/è/g; s/Ö/ã/g; s/×/þ/g; s/Ø/û/g; s/Ù/ý/g; s/Ú/ÿ/g; s/Û/ù/g; s/Ü/ø/g; s/Ý/ü/g; s/Þ/à/g; s/ß/ñ/g; s/à/Á/g; s/á/Â/g; s/â/×/g; s/ã/Ç/g; s/ä/Ä/g; s/å/Å/g; s/æ/Ö/g; s/ç/Ú/g; s/è/É/g; s/é/Ê/g; s/ê/Ë/g; s/ë/Ì/g; s/ì/Í/g; s/í/Î/g; s/î/Ï/g; s/ï/Ð/g; s/ð/Ò/g; s/ñ/Ó/g; s/ò/Ô/g; s/ó/Õ/g; s/ô/Æ/g; s/õ/È/g; s/ö/Ã/g; s/÷/Þ/g; s/ø/Û/g; s/ù/Û/g; s/ú/ß/g; s/û/Ù/g; s/ü/Ø/g; s/ý/Ü/g; s/þ/À/g; s/ÿ/Ñ/g; ' } getmail=' [ -d ~moshkow/mmm ] || exit 1 cd /var/spool/mqueue /etc/rc.d/rc3.d/S80sendmail stop ; sleep 3 ; /etc/rc.d/rc3.d/S80sendmail stop ; sleep 3 ; /etc/rc.d/rc3.d/S80sendmail stop grep -lq moshkow q* | sed "s/^.//" | while read f ; do mv q$f d$f ~moshkow/mmm/ ; done cd ~moshkow/mmm tar czvf ~/mail.tgz * ls -al ~/mail.tgz /etc/rc.d/rc3.d/S80sendmail start ' LADA() { KOI -W|KOI -ASC|KOI -ASC|KOI -wfor|KOI -FORMAT|KOI -PREFORMAT } KW() { tmp=/tmp/ww$$.doc trap "rm -f $tmp" 0 1 2 3 9 10 15 cat > $tmp cd cd bbs kword $tmp ; # mv $tmp ~/bbs/moshkow.txt mv ~/bbs/aa ~/bbs/moshkow.txt for flag in -UTF8 -W -ASC -NA -NA2 -NAB -OTSTUP -FORMAT -NA3 -PREFORMAT; do KOI $flag moshkow.txt moshkow.txt done } WH() { KOI -M|KOI -ASC |KOI -MSHTML|KOI -ASC|KOI -NA|KOI -NAB|KOI -NOHTMLIB|KOI -ASC|KOI -OTSTUP|KOI -FORMAT|KOI -PREFORMAT } WHC() { KOI -ASC |KOI -MSHTML|KOI -ASC|sed 's/^ *//'|KOI -NA|KOI -NAB|KOI -NOHTMLIB|KOI -OTSTUP|KOI -FORMAT|KOI -PREFORMAT } RTF() { perl -e ' while (read (STDIN,$_,1000000)) { #s/\r//sg; s/\\\r\n/\n/sg; s/\\cf\d//sg; s%\{\\([a-z]+)\d*(.*?)\}%<$1>\{$2\}$1>%sg; s%\{\\([a-z]+)\d*(.*?)\}%<$1>\{$2\}$1>%sg; s%\{\\([a-z]+)\d*(.*?)\}%<$1>\{$2\}$1>%sg; s%\\([ib])0%$1>%sg; s/\\([ib])/<$1>/sg; s/\\q\w//sg; s/\\pard/\n\n/sg; s/\\emdash/--/sg; s/\\~/ /sg; s/[{}]//sg; print; }' } if [ -z "$2" ] ; then $CAT $1 | $TRANSLATOR $FROM $INTO | $UNIXORDOS else if [ "$1" = "$2" ] then TMP=/tmp/koi$$ $CAT "$1" | $TRANSLATOR $FROM $INTO | $UNIXORDOS > $TMP ; touch -r "$1" $TMP # óïèòáîñåí ðòåöîàà äáôõ íïäéæéëáãéé mv -f $TMP $2 || ( cp -f $TMP $2 && rm $TMP ) else $CAT "$1" | $TRANSLATOR $FROM $INTO | $UNIXORDOS > "$2" fi fi exit
%\n\n %sgi; print; } ' } # ðïóô-áóëéûîáñ æïòíáôéòï÷ëá NA3() { LC_CTYPE=C export LC_CTYPE perl -e ' while(<>){ s%^ (.*)$% \024$1\025%i; print; } ' } NA() { LC_ALL=C LC_CTYPE=C export LC_CTYPE egrep -via 'charset=windows-12|meta http-equiv="Content-Type"' |\ perl -e ' while(){ s%]*>%% ; s% FACE="[A-Za-z, ]+"%%ig ; s% FACE=[^"> ,]*?%%ig ; s% SIZE=[12]%%ig ; s%<(p|b|i|div|br) .*?>%<$1>%ig ; s% % %ig; print; }' exit } NAB() { LC_ALL=C LC_CTYPE=C export LC_CTYPE # egrep -vi 'charset=windows-12|meta http-equiv="Content-Type"' ; exit egrep -v '^*HTML>$|^*HEAD>$|text/html; charset=windows-125' |\ perl -e 'while(read(STDIN,$_,100000)) {s%([^\n]{980,})!\n%$1%g; s%!\n!\n!\n!\n%%g;s%!\n!\n!\n%%g;s%!\n!\n%%g; s%!\n( *[à-ú])%$1%g; s%\n(size=[-0-9]+)% $1%ig;print;}' |\ perl -e ' while(){ s%]*>\n%% ; s%]*>\n%% ; s%*BODY[^>]*>%% ; s%\227% %g; s%—%--%g ; s% % %g; s%“%"%g; s%”%"%g; s% %%g; s%[“”]%"%g ; s% SIZE="[-0-9]+"%%ig ; s% SIZE=[-+0-9]+%%ig ; s% FACE="[A-Za-z ]+"%%ig ; s% FACE="?[^"> ]*"?%%ig ; s% COLOR="[^"]*"%%ig ; s%^%\n %i ; s%%\n\n %ig ; s%%\n\n %ig ; s%\n%\n %igs; s%%\n %ig ; s%%\n %ig ; s%?FONT>%%ig ; s%?DIR>%%ig ; s%%\n %ig ; s%
%\n %i ; s%
%\n\n %ig ; s%
Last-modified:.*%%s; print ; } ' } TU() { perl -e 'while(read(STDIN,$_,100000)){ unless ($n){s/^\s*/ /s;} s/\^T/\024/sg; s/\^U/\025/sg; s/§/\025/sg; s/¶/\n \024/sg; print; $n++;}' } TEXTSHARE() { perl -e 'while (read(STDIN,$_,500000)){ s/\n(--+)\n( +\(.*?\n)*/\n\n $&\n\n/sg; s/\[\d+\]\n//sg; s/([^-])-\n([^\n])/$1$2/sg; print; }' 2> /dev/null } SORT() { KOI -a|sort|KOI -A } REABZAC() { perl -e 'while (read(STDIN,$_,500000)){ s/-\n ([ÁÂ×ÇÄÅÖÚÉËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ])/$1/g; s/\n ([ÁÂ×ÇÄÅÖÚÉËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ])/ $1/g; print; } ' } LINE() { perl -e 'while (read(STDIN,$_,500000)){ s/\n([^ \n])/ $1/g; s/([^ \n]) +/$1 /g; print; } ' } MSHTML() { perl -e ' while (read (STDIN,$_,3000000)){ s%%%sg; s% name=\".+?\"%%gsi; s%?(o|w):.*?>%%sgi; # s%]*>.*?]*>%%sgi; # s%]*>.*?]*>%%sgi; s%<\!.*?>%%sgi; s%<(p|b|div|br) .*?>%<$1>%sgi; s%%%sgi; s% style='\''.*?'\''%%sgi; s%(span|p)>%%sgi; s%—%--%sgi; s%…%...%sgi; s%&[lr]dquo;%"%sgi; s%"%"%sgi; s%%%sgi; print; } ' } NOHTML() { perl -e 'while (read (STDIN,$_,1000000)){s%<.*?>%%sg;print;}' } NOHTMLIB() { perl -e ' while (read (STDIN,$_,1000000)) { s%<(/?[ib])>%{$1}%sgi; s%<(/?(table|tr|td)).*?>%{$1}%sgi; s%<(/?sup)>%{$1}%sgi; s%<(li)>%{$1}%sgi; s%<(img .*?)>%{$1}%sgi; s%(.*?)%\n \024$1\025\n%sgi; s%<.*?>%%sg; s%\{(/?[ib])\}%<$1>%sgi; s%\{(/?sup)\}%<$1>%sgi; s%\{(li)\}% <$1>%sgi; s%\{(img .*?)\}%<$1>%sgi; s%\{(/?(table|tr|td)).*?\}%<$1>%sgi; print; } ' } UTFHTML() { sed -e ' s/Ô/æ/g; s/Æ/ö/g; s/Ø/û/g; s/Ý/ü/g; s/Õ/è/g; s/Ó/õ/g; s/×/þ/g; s/ú/ß/g; s/Ð/ò/g; s/Ë/ì/g; s/Å/å/g; s/Ä/ä/g; s/À/á/g; s/Á/â/g; s/Ç/ú/g; s/Ò/ô/g; s/ô/Æ/g; s/ß/ñ/g; s/Ê/ë/g; s/Í/î/g; s/Â/÷/g; s/Ã/ç/g; s/Ì/í/g; s/Ñ/ó/g; s/Ï/ð/g; s/Î/ï/g; s/ý/Ü/g; s/ù/Ý/g; s/È/é/g; s/ö/Ã/g; s/þ/À/g; s/ø/Û/g; s/õ/È/g; s/æ/Ö/g; s/é/Ê/g; s/÷/Þ/g; s/á/Â/g; s/û/Ù/g; s/ç/Ú/g; s/ã/Ç/g; s/ÿ/Ñ/g; s/ü/Ø/g; s/ï/Ð/g; s/ì/Í/g; s/ó/Õ/g; s/ä/Ä/g; s/ê/Ë/g; s/ð/Ò/g; s/ë/Ì/g; s/â/×/g; s/ñ/Ó/g; s/ò/Ô/g; s/è/É/g; s/í/Î/g; s/à/Á/g; s/å/Å/g; s/î/Ï/g; s/ / /g; ' } UTFNUM() { sed -e ' s/ / /g; s/¸/e/g; s/À/á/g; s/Á/â/g; s/Â/÷/g; s/Ã/ç/g; s/Ä/ä/g; s/Å/å/g; s/Æ/ö/g; s/Ç/ú/g; s/È/é/g; s/É/ê/g; s/Ê/ë/g; s/Ë/ì/g; s/Ì/í/g; s/Í/î/g; s/Î/ï/g; s/Ï/ð/g; s/Ð/ò/g; s/Ñ/ó/g; s/Ò/ô/g; s/Ó/õ/g; s/Ô/æ/g; s/Õ/è/g; s/Ö/ã/g; s/×/þ/g; s/Ø/û/g; s/Ù/ý/g; s/Ú/ÿ/g; s/Û/ù/g; s/Ü/ø/g; s/Ý/ü/g; s/Þ/à/g; s/ß/ñ/g; s/à/Á/g; s/á/Â/g; s/â/×/g; s/ã/Ç/g; s/ä/Ä/g; s/å/Å/g; s/æ/Ö/g; s/ç/Ú/g; s/è/É/g; s/é/Ê/g; s/ê/Ë/g; s/ë/Ì/g; s/ì/Í/g; s/í/Î/g; s/î/Ï/g; s/ï/Ð/g; s/ð/Ò/g; s/ñ/Ó/g; s/ò/Ô/g; s/ó/Õ/g; s/ô/Æ/g; s/õ/È/g; s/ö/Ã/g; s/÷/Þ/g; s/ø/Û/g; s/ù/Û/g; s/ú/ß/g; s/û/Ù/g; s/ü/Ø/g; s/ý/Ü/g; s/þ/À/g; s/ÿ/Ñ/g; ' } getmail=' [ -d ~moshkow/mmm ] || exit 1 cd /var/spool/mqueue /etc/rc.d/rc3.d/S80sendmail stop ; sleep 3 ; /etc/rc.d/rc3.d/S80sendmail stop ; sleep 3 ; /etc/rc.d/rc3.d/S80sendmail stop grep -lq moshkow q* | sed "s/^.//" | while read f ; do mv q$f d$f ~moshkow/mmm/ ; done cd ~moshkow/mmm tar czvf ~/mail.tgz * ls -al ~/mail.tgz /etc/rc.d/rc3.d/S80sendmail start ' LADA() { KOI -W|KOI -ASC|KOI -ASC|KOI -wfor|KOI -FORMAT|KOI -PREFORMAT } KW() { tmp=/tmp/ww$$.doc trap "rm -f $tmp" 0 1 2 3 9 10 15 cat > $tmp cd cd bbs kword $tmp ; # mv $tmp ~/bbs/moshkow.txt mv ~/bbs/aa ~/bbs/moshkow.txt for flag in -UTF8 -W -ASC -NA -NA2 -NAB -OTSTUP -FORMAT -NA3 -PREFORMAT; do KOI $flag moshkow.txt moshkow.txt done } WH() { KOI -M|KOI -ASC |KOI -MSHTML|KOI -ASC|KOI -NA|KOI -NAB|KOI -NOHTMLIB|KOI -ASC|KOI -OTSTUP|KOI -FORMAT|KOI -PREFORMAT } WHC() { KOI -ASC |KOI -MSHTML|KOI -ASC|sed 's/^ *//'|KOI -NA|KOI -NAB|KOI -NOHTMLIB|KOI -OTSTUP|KOI -FORMAT|KOI -PREFORMAT } RTF() { perl -e ' while (read (STDIN,$_,1000000)) { #s/\r//sg; s/\\\r\n/\n/sg; s/\\cf\d//sg; s%\{\\([a-z]+)\d*(.*?)\}%<$1>\{$2\}$1>%sg; s%\{\\([a-z]+)\d*(.*?)\}%<$1>\{$2\}$1>%sg; s%\{\\([a-z]+)\d*(.*?)\}%<$1>\{$2\}$1>%sg; s%\\([ib])0%$1>%sg; s/\\([ib])/<$1>/sg; s/\\q\w//sg; s/\\pard/\n\n/sg; s/\\emdash/--/sg; s/\\~/ /sg; s/[{}]//sg; print; }' } if [ -z "$2" ] ; then $CAT $1 | $TRANSLATOR $FROM $INTO | $UNIXORDOS else if [ "$1" = "$2" ] then TMP=/tmp/koi$$ $CAT "$1" | $TRANSLATOR $FROM $INTO | $UNIXORDOS > $TMP ; touch -r "$1" $TMP # óïèòáîñåí ðòåöîàà äáôõ íïäéæéëáãéé mv -f $TMP $2 || ( cp -f $TMP $2 && rm $TMP ) else $CAT "$1" | $TRANSLATOR $FROM $INTO | $UNIXORDOS > "$2" fi fi exit