Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!sunkisd!uunet!mcvax!hafro!krafla!geysir!eik From: eik@os.is (Einar Kjartansson) Newsgroups: comp.sys.hp Subject: pr bug in HP-UX 2.1 Keywords: 8-bits pr bug tabs Message-ID: <114@geysir.os.is> Date: 29 Jan 89 09:09:29 GMT Organization: National Energy Authority of Iceland Lines: 127 When I installed 2.1 HP-UX, the behavior of the pr command changed. Pr now inserts unwanted tab characters into files that contain 8-bit character codes, when outputting more than one column. The enclosed shar contains an example, just unwarap it in an empty directory. # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by eik at geysir on Sun Jan 29 09:01:01 1989 # # This archive contains: # Makefile in out # LANG=""; export LANG echo x - Makefile cat >Makefile <<'@EOF' all : clean pr -2 -l24 < in > out shar Makefile in out > Shar clean : -rm Shar -rm out @EOF chmod 644 Makefile unpacker=/tmp/unpack$$ ; compile="y" for uudecode in /bin/uudecode /usr/bin/uudecode /usr/local/bin/uudecode /usr/contrib/bin/uudecode /etc/uudecode /usr/public/bin/uudecode /usr/ucb/bin/uudecode do if test -s $uudecode then unpacker=$uudecode ; compile="n" ; break fi done pwd=`pwd`; cd /tmp if test $compile = "y" then cat >$unpacker.c <<'EOF' #include #define DEC(c) (((c) - ' ') & 077) main() { int n; char dest[128], a,b,c,d; scanf("begin %o ", &n); gets(dest); if (freopen(dest, "w", stdout) == NULL) { perror(dest); exit(1); } while ((n=getchar()) != EOF && (n=DEC(n))!=0) { while (n>0) { a = DEC(getchar()); b = DEC(getchar()); c = DEC(getchar()); d = DEC(getchar()); if (n-- > 0) putchar(a << 2 | b >> 4); if (n-- > 0) putchar(b << 4 | c >> 2); if (n-- > 0) putchar(c << 6 | d); } n=getchar(); } exit(0); } EOF echo Compiling unpacker for non-ascii files cc -o $unpacker $unpacker.c 1>/dev/null 2>&1 rm $unpacker.c fi cd $pwd echo x - in '[non-ASCII]' $unpacker <<'@eof' begin 644 in M0OII\"!E7)J82#A(&'P(&QE6YI"F]G('1I;"!E7)J96YD M=7(@6YI+@H* )"@H*"@H*"@H* end @eof chmod 644 out rm -f /tmp/unpack$$ exit 0 -- Einar Kjartansson | eik@os.is Orkustofnun (National Energy Authority) | eik@geysir.uucp Grensasvegi 9, IS-108 Reykjavik, Iceland | mcvax!hafro!geysir!eik Phone: 354-1-83600 Fax: 354-1-688896 Home: 354-1-16407