jtt@cunixd.cc.columbia.edu (James T. Tanis) (11/11/90)
is there a mac utility that will unpack shell archives? I've got a lot of little source files that need to go down to my mac, and I don't want to do them one at a time, nor is batching reliable. PLEASE respond via net mail, or post to csmp. thanks. -JT
c60a-cz@danube.Berkeley.EDU (Donald Burr) (11/11/90)
In article <1990Nov10.163234.20256@cunixf.cc.columbia.edu> jtt@cunixd.cc.columbia.edu (James T. Tanis) writes: >is there a mac utility that will unpack shell archives? I've got a lot of >little source files that need to go down to my mac, and I don't want to do >them one at a time, nor is batching reliable. Hmm. I'm looking for the same thing. Let me know if you find one; better yet, mail it to me please. Thanks. I suppose , if one does not exist, I suppose I could hack something up in QuickBasic or C or something. watch this space for more details, coming soon to a UNIX near you BTW: What IS the format of shell archives anyways? ______________________________________________________________________________ Donald Burr, c60a-cz@danube.Berkeley.edu | "I have a seperate mail-address University of California, Berkeley | for flames and other such nega- Majoring in Computer Science | tive msgs; it's called /dev/null."
blob@Apple.COM (Brian Bechtel) (11/12/90)
c60a-cz@danube.Berkeley.EDU (Donald Burr) writes: >In article <1990Nov10.163234.20256@cunixf.cc.columbia.edu> jtt@cunixd.cc.columbia.edu (James T. Tanis) writes: >>is there a mac utility that will unpack shell archives? I've got a lot of >>little source files that need to go down to my mac, and I don't want to do >>them one at a time, nor is batching reliable. >Hmm. I'm looking for the same thing. Let me know if you find one; >better yet, mail it to me please. Thanks. A primitive one, with source, is available via anonymous ftp from ftp.apple.com in the ~ftp/nerdtools directory. --Brian Bechtel blob@apple.com "My opinion, not Apple's"
bayes@hpislx.HP.COM (Scott Bayes) (11/14/90)
> BTW: What IS the format of shell archives anyways? > ______________________________________________________________________________ > Donald Burr, c60a-cz@danube.Berkeley.edu | "I have a seperate mail-address > University of California, Berkeley | for flames and other such nega- > Majoring in Computer Science | tive msgs; it's called /dev/null." All the shell archives I've seen tend to be a procedural format. That is, the files to be archived tend to be copied as or converted to text, and packaged together with shell commands that, when executed by a shell, unpack them, put them in the right places, set their UN*X permissions, etc. Binary files tend to be converted to ASCII, and an "unpacker" program source and compilation instructions included with them (i.e. to unpack a shar [shell archive] file that contains a binary, you'll probably need a C compiler on-line). It's hard to imagine being able to un-shar a shar file without a decent emulation of a UN*X shell doing the job. Below is an example sharfile containing a binary file and a text file, both very short. The binary unpacks to contain an escape char followed by "Hello", and the text file contains "hello world". It works on an HP300 HP-UX machine Revision 7.0 or 7.03, under Bourne Shell (sh). I have seen slightly variant formats used. I created the shar with: $ shar testshar testshar2 > test.shar Scott Bayes ----------------------------------------------------------------------------- # 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 Scott Bayes <bayes@hpislsfb> on Tue Nov 13 12:46:56 1990 # # This archive contains: # testshar testshar2 # LANG=""; export LANG PATH=/bin:/usr/bin:$PATH; export PATH rm -f /tmp/uud$$ (echo "begin 777 /tmp/uud$$\n \nend" | uudecode) >/dev/null 2>&1 if [ -f /tmp/uud$$ ] then rm -f /tmp/uud$$ unpacker=uudecode else echo Compiling unpacker for non-ascii files pwd=`pwd`; cd /tmp cat >unpack$$.c <<-'EOF' #include <stdio.h> #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 cc -o unpack$$ unpack$$.c rm unpack$$.c cd $pwd unpacker=/tmp/unpack$$ fi echo x - testshar '[non-ascii]' $unpacker <<'@eof' begin 666 testshar '&TAE;&QO"AX end @eof chmod 666 testshar echo x - testshar2 cat >testshar2 <<'@EOF' hello world @EOF chmod 666 testshar2 rm -f /tmp/unpack$$ exit 0