Path: utzoo!utgpu!watmath!clyde!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.sources.wanted Subject: Re: "Safe" unshar Message-ID: <367@lakart.UUCP> Date: 2 Dec 88 21:37:18 GMT References: <781@quintus.UUCP> Organization: Lakart Corporation, Newton, MA Lines: 28 From article <781@quintus.UUCP>, by ok@quintus.uucp (Richard A. O'Keefe): ] In article <346@lakart.UUCP> dg@lakart.UUCP (I) write: ]>What it does, is to look for lines of the form: ]> ]>sed 's/^X//' > file.xyz << FunkyStuff ]> ]>get the ^X, file.xyz and FunkyStuff out, open file.xyz for output, ]>read the input shar till it finds a line FunkyStuff, and trim X off the ] ] It might be a good idea to be a wee bit more flexible. Not everyone uses ] StuffyFunk. (The sharchiver I have uses lines like ] sed -e 's/^X//' >file <<'------ EOF ------' ] and I have considered changing it to use ] <<'------ EOF ------' sed -e 's/^X//' >file ] so that the variable part of the line would always start at a fixed column. ] I've noticed several other end-of-file markers in use on the net. My apologies for not being clear. It parses the line, and takes whatever text it finds after the << as the "end of file word". Hence it will grok my shars that say '##__EOF..file.c__##' just as happily as those that say Funky_Stuff or RoNnIe_RaYgUn or whatever. I've just added a bit of code to spot mkdirs, and do those, so it now can handle (e.g.) the wanderer shars that required the creation of a directory to hold the screens. However, it DOES rely on the sed (or cat) being the first thing on the line, so saying: <<\Grok_This sed -e 's/^X//' > file.c would (unfortunately) slip past it. -- dg@lakart.UUCP - David Goodenough +---+ | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@harvard.harvard.edu +---+