From cbmvax!uunet!nuchat!kevin Wed Apr 17 04:39:03 1991 Return-Path: Received: by snark.thyrsus.com (/\=-/\ Smail3.1.18.1 #18.14) id ; Wed, 17 Apr 91 04:38 EDT Received: by cbmvax.cbm.commodore.com (5.57/UUCP-Project/Commodore 2/8/91) id AA04893; Wed, 17 Apr 91 05:11:36 EDT Received: from nuchat.UUCP by relay1.UU.NET with UUCP (5.61/UUNET-shadow-mx) id AA02531; Wed, 17 Apr 91 02:21:35 -0400 Received: by nuchat.sccsi.com (/\=-/\ Smail3.1.18.1 #18.3) id ; Tue, 16 Apr 91 06:52 CDT Message-Id: Date: Tue, 16 Apr 91 06:52 CDT From: cbmvax!uunet!nuchat.sccsi.com!kevin (Kevin Brown) To: eric@snark.thyrsus.com Subject: Your sed program.... Organization: Teenage Mutant Ninja NiceGuys(tm) Cc: kevin@nuchat.sccsi.com Status: RO Hi Eric. I've been doing some replacing, er, I mean upgrading, of various tools on my Minix system. In doing so, I've discovered bugs and limitations in a lot of the 'standard' tools on Minix. Your sed program is one such tool. I'd rather not replace it with GNU sed, as it is large, unwieldy, and uses alloca() in ways that are difficult to fix (meaning that it's going to be difficult to get rid of the alloca() calls in such a way that memory is freed up properly). So I'd like to give fixing your sed a shot first. The sed I have is the one that came with the Minix 1.5 distribution from Prentice-Hall. It has no version number in the source code, so I can't tell quite how early a version it is (it's packed into one file, though, whereas your comments indicate that it wasn't always that way). However, you may have fixed the problem that I noticed. Namely: given the program sed -e 's/"/\\"/g' \ -e 's/[^ ]*[ ][ ]*[^ ]*[ ][ ]*\(.*\)/ "\1",/' \ and input that looks like this: TEOF 1 end of file TNL 0 newline TSEMI 0 ";" TBACKGND 0 "&" TAND 0 "&&" TOR 0 "||" TPIPE 0 "|" TLP 0 "(" TRP 1 ")" Unix sed generates: "end of file", "newline", "\";\"", "\"&\"", "\"&&\"", "\"||\"", "\"|\"", "\"(\"", "\")\"", whereas your sed generates: "end of file", "newline", "\\";\\"", "\\"&\\"", "\\"&&\\"", "\\"||\\"", "\\"|\\"", "\\"(\\"", "\\")\\"", Notice how where a backslash exists in the Unix sed output, two exist in your sed's output? Strange... Having just gone through the pain of fixing a minor bug in bawk and porting ash to Minix (the standard Minix shell sucks rocks, IMHO, mainly because it doesn't have a shred of documentation in the code), I'm not looking forward to tracking down this one. Since it's your program, I though you might be able to render some assistance (especially if the problem's been fixed in your latest version :-). I'd very much like to receive a copy of your latest version in any case). Anyway, thanks for any help you can give me on this. BTW, I'm running Minix-386 with lots of memory, which is why I'm able to port things like ash over. Kevin -- Kevin Brown Disclaimer: huh? kevin@nuchat.sccsi.com csci31f7@cl.uh.edu Minix -- the Unix[tm] of the 90's. System V -- the Multics of the 90's. :-) P.S.: The Jargon File is GREAT stuff! Everyone I've shown it to has gotten laughs out of it, including myself. :-)