Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.unix.wizards Subject: Re: _doscan Message-ID: <1989Nov10.193301.8315@twwells.com> Date: 10 Nov 89 19:33:01 GMT References: <21404@adm.BRL.MIL> <20645@mimsy.umd.edu> Organization: None, Ft. Lauderdale, FL Lines: 26 In article <20645@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: : Using _doscan in code that is not part of the stdio library is, to : paraphrase Dennis Ritchie, `unwarranted chumminess with the implementation'. That, I'm afraid, is going to require me to completely rewrite one of my favorite little utilites: scanprt [options] with a few useful options (controlling whether the scanf is fgets/sscanf or scanf, whether the printf has a newline after it, etc.) I wrote it way back when for blank filling in some shell scripts, as in: scanprt %s %-10s. I've used it as a stage in a cheap binary editor: hd file >somewhere; ; cut -c9-56 somewhere | scanprt -n -l0 %x %c >file.new. I've used it for number conversions, e.g., on the output of cmp -l: cmp -l foo bar | scanprt %d%o%o '%X %X %X', etc. Oh well, the internals of that thing are ugly anyway. I suppose it was time for a rewrite. :-) --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com