Path: utzoo!attcan!uunet!mcvax!enea!erix!howard From: howard@erix.ericsson.se (Howard Gayle) Newsgroups: comp.sources.d Subject: You can help improve shar Message-ID: <1823@erix.ericsson.se> Date: 12 Sep 88 12:49:13 GMT Organization: Ericsson Telecom, Stockholm, Sweden Lines: 633 I am working on yet another version of shar, called trshar because it uses the tr command when necessary. Trshar will archive any files containing any bytes, using tr if necessary to encode unprintable characters in printable form. It will automatically switch to a binary encoding such as btoa or uuencode if that is more compact than a tr encoding. (Files containing the NUL character must use a binary encoding since tr can not handle NULs.) Lines in trshar archives will always be less than 80 columns, regardless of the line lengths of the input files. No leading Xs or other characters will be added to lines, thus making archives more human-readable, and also saving a little space. I intend to release trshar as free software when it is finished. I expect it to be especially useful for transmitting "almost ASCII" files such as documents written in the ISO 8859 character sets. To finish trshar, I need your help. Below is a trshar archive of a test file, together with the same file in btoa and uuencode encodings. You can help by unsharing this archive and comparing the test file with one of its binary-encoded versions. Any difference reveals a problem I need to take into account. I have provided shell files to perform the comparisons easily. Just create a directory, cd to it, run the Bourne shell on the archive there, and read the README. Trshar currently makes the following assumptions about mail and news systems. If you know of a mail or news system for which one or more of these assumptions does not hold, please let me know. 1) Backspace, tab, newline, and form feed are passed unchanged. 2) Any printable character except '.' may appear alone on a line. 3) Articles or messages may be at least 65535 bytes long. 4) Lines may be at least 79 bytes long (with tab stops set 8 spaces apart). I posted this to comp.sources.d to avoid having it archived. Please respond by mail. Howard Gayle TN/ETX/TX/UMG Ericsson Telecom AB S-126 25 Stockholm Sweden howard@ericsson.se {mcvax, uunet}!enea!ericsson.se!howard Phone: +46 8 719 5565 FAX : +46 8 719 9598 Telex: 14910 ERIC S CUT HERE : trshar1.8 export PATH||(echo 'sh (Bourne shell) extracts this archive';kill $$) a='README' b=1288 if test -f "$a" then echo "Will not overwrite $a" else echo "$a.." cat<<'Z'>"$a" The following files should be present: t.t - Test file delivered by trshar. t.b.b - The same test file, encoded by btoa. t.u.u - The same test file, encoded by uuencode. t-btoa - Bourne shell file to decode t.b.b and compare it with t.t. t-uuencode - Bourne shell file to decode t.u.u and compare it with t.t. To run the test, simply execute either of the shell files t-btoa or t-uuencode. If all goes well, the shell file will print out a message. No further action is required. If the test file as delivered by trshar differs from the binary-encoded copy, the shell file will print an error message and will also binary-encode the test file so you can mail it back to me. In your mail message, please include what kind of hardware and software you have, for example VAX-11/750 running 4.3BSD. If you can diagnose the problem, or even just have a hunch, please include it. If you don't mind my contacting you for further information if necessary, please include your electronic and snail addresses, phone, etc. Thank you very much for your help! Howard Gayle TN/ETX/TX/UMG Ericsson Telecom AB S-126 25 Stockholm Sweden howard@ericsson.se {mcvax, uunet}!enea!ericsson.se!howard Phone: +46 8 719 5565 FAX : +46 8 719 9598 Telex: 14910 ERIC S Z if test $b -ne `wc -c<"$a"` then echo "*** Error: $a should be $b bytes ***" else echo "$a..$b bytes" fi fi a='t-btoa' b=187 if test -f "$a" then echo "Will not overwrite $a" else echo "$a.." cat<<'Z'>"$a" atobt.b if cmp -s t.t t.b then echo 'All is well.' else btoat.t.b echo 'Something is wrong. Please mail t.t.b back.' fi echo 'Thank you very much for your help.' Z if test $b -ne `wc -c<"$a"` then echo "*** Error: $a should be $b bytes ***" else chmod +x $a echo "$a..$b bytes" fi fi a='t-uuencode' b=209 if test -f "$a" then echo "Will not overwrite $a" else echo "$a.." cat<<'Z'>"$a" chmod 777 . uudecode t.u.u if cmp -s t.t t.u then echo 'All is well.' else uuencode t.t t.t.u>t.t.u echo 'Something is wrong. Please mail t.t.u back.' fi echo 'Thank you very much for your help.' Z if test $b -ne `wc -c<"$a"` then echo "*** Error: $a should be $b bytes ***" else chmod +x $a echo "$a..$b bytes" fi fi a='t.b.b' b=2711 if test -f "$a" then echo "Will not overwrite $a" else echo "$a.." cat<<'Z'>"$a" xbtoa Begin <+oue+DGm>@3BZ'F*&O:Bl%?'AoD]4FE2G9@<*t-$:,eNBl7K)GA2/4+?:Qd@:F:=$4/En1'o`C1^Q #G2@2;K3!hSP$:,eNBl7K)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IJJNLK:ZOL+&RL[2UMK>XN;J[O+V^O\#!PL/$Q<;' MR,G*R\S-SL_0T=+3U-76U]C9VMOKK[.WN[_#Q\O/T M]?;W^/GZ^_S]_O\*"D$@;&EN92!W:71H(#$P,C0@8GET97,Z"CPM+2TQ+2TM M+3$M+2TM*RTM+2TR+2TM+2LM+2TM,RTM+2TK+2TM+30M+2TM*RTM+2TU+2TM M+2LM+2TM-BTM+2TK+2TM+371E&-E<'0@ M3E5,(&%N9" G+B@I["GP* M?0I^"G\*@ J!"H(*@PJ$"H4*A@J'"H@*B0J*"HL*C J-"HX*CPJ0"I$*D@J3 M"I0*E0J6"I<*F J9"IH*FPJ<"IT*G@J?"J *H0JB"J,*I JE"J8*IPJH"JD* MJ@JK"JP*K0JN"J\*L JQ"K(*LPJT"K4*M@JW"K@*N0JZ"KL*O J]"KX*OPK M"L$*P@K#"L0*Q0K&"L<*R K)"LH*RPK,"LT*S@K/"M *T0K2"M,*U K5"M8* MUPK8"MD*V@K;"MP*W0K>"M\*X KA"N(*XPKD"N4*Y@KG"N@*Z0KJ"NL*[ KM M"NX*[PKP"O$*\@KS"O0*]0KV"O<*^ KY"OH*^PK\"OT*_@K_"@I!(&QI;F4@ M"$a" This is a test file for trshar. A line with 9 tabs: 1 2 3 4 5 6 7 8 9 A line with 10 tabs: Z tr -d '\12'<<'Z'|tr '\\' '\12'>>"$a" 1 2 3 4 5 6 7 8 9 0\ Z cat<<'Z'>>"$a" A line with all bytes except NUL and newline: Z c='bcdefghijklmnopqrstuvwxyz{|}' d='\12\1\2\3\4\5\6\7\13\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36' e='\37' tr -d '\12'<<'Z'|tr "$c" "$d$e">>"$a" cdefghi j klmnopqrstuvwxyz{|} !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI JKLMNOPQRSTUVWXYZ[\]^_`a Z c='!"#$%&\47()\*+,\-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]^_`' d='\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220' e='\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242' f='\243\244\245\246\250\251\252\253\254\255\256\257\260\261\262\263\264\265' g='\266\267\270\271\272\12\247\273\274\275' tr -d '\12'<<'Z'|tr "$c" "$d$e$f$g">>"$a" bcdefghijklmnopqrstuvwxyz{|}~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH]IJKLMNOPQ RSTUVWXYZ[^_` Z c='!"#$%&\47()\*+,\-./356789;<=>?@BCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]^_`acdf{|}' d='~' e='\276\300\301\302\303\305\306\307\310\312\313\314\315\316\317\320\322\323' f='\324\325\326\327\330\331\332\333\311\335\336\340\342\343\345\346\347\350' g='\352\353\354\355\356\357\360\362\363\364\365\366\367\370\371\372\304\321' h='\277\334\373\351\374\375\376\377\344\361\341\337' tr "$c$d" "$e$f$g$h"<<'Z'>>"$a" !]"#$%[&'()@*+,-./3\56789;<=>?^BC~D}EF{GHIJ`KLMNOPQ|RSTUVWXYZ_acdf A line with 1024 bytes: Z tr -d '\12'<<'Z'|tr '\\' '\12'>>"$a" <---1----1----+----2----+----3----+----4----+----5----+----6----+----7----+---- 8----+----9----+---10----+---11----+---12----+---13----+---14----+---15----+--- 16----+---17----+---18----+---19----+---20----+---21----+---22----+---23----+-- -24----+---25----+---26----+---27----+---28----+---29----+---30----+---31----+- --32----+---33----+---34----+---35----+---36----+---37----+---38----+---39----+ ---40----+---41----+---42----+---43----+---44----+---45----+---46----+---47---- +---48----+---49----+---50----+---51----+---52----+---53----+---54----+---55--- -+---56----+---57----+---58----+---59----+---60----+---61----+---62----+---63-- --+---64----+---65----+---66----+---67----+---68----+---69----+---70----+---71- ---+---72----+---73----+---74----+---75----+---76----+---77----+---78----+---79 ----+---80----+---81----+---82----+---83----+---84----+---85----+---86----+---8 7----+---88----+---89----+---90----+---91----+---92----+---93----+---94----+--- 95----+---96----+---97----+---98----+---99----+--100----+--101----+--102--->\ Z c='STVWXY\[\\\]^_`fghjkmoquvwz{|}' d='\1\2\3\4\5\6\7\13\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37' tr "$c" "$d"<<'Z'>>"$a" All bytes except NUL and '.', 1 per line: S T V W X Y [  \ ] ^ _ ` f g h j k m o q u v w z { | } ! " # $ % & ' ( ) * + , - / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R Z c='"#$%&\47()\*+,\-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQ' d='\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220' e='\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242' f='\243\244\245\246\247\250\251\252\253\254\255\256' tr "$c" "$d$e$f"<<'!'>>"$a" S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q ! c='!"#$%&\47()\*+,\-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY\[\\\]^_`ab' d='cdefghijklmn{|}~' e='\257\261\262\263\264\265\266\267\270\271\272\273\274\275\276\300\301\302' f='\303\305\306\307\310\312\313\314\315\316\317\320\322\311\323\324\325\326' g='\327\330\331\332\333\335\336\340\342\343\344\345\346\347\350\352\353\354' h='\355\356\357\304\321\277\334\360\351\362\363\364\365\366\367\370\371\372' i='\373\374\375\376\377\260\361\341\337' tr "$c$d" "$e$f$g$h$i"<<'Z'>>"$a" ! { " # $ % & ' ( ) * + , - . / ] 0 1 2 3 [ 4 5 6 7 @ 8 9 : ; < = > \ ? A B C D E F G H I ^ J K ~ L } M N O P Q R S ` T U V W X Y _ | a b c d e f g h i j k l m n Z tr ',' '.'<<'Z'>>"$a" A line starting with '.': .. A line with a lone '.': , End of test file. Z if test $b -ne `wc -c<"$a"` then echo "*** Error: $a should be $b bytes ***" else echo "$a..$b bytes" fi fi exit 0