david@ukma.UUCP (David Herron, NPR Lover) (01/17/85)
Index: /usr/src/local/shar/shar.c Problem: I made up an archive of a directory tree and shipped it over to one of our 3B2 machines. After running the archive I saw that the directories had been created but the files were all at top level. Looking deeper, I saw that the archive had "chdir" commands in it. Now. sh(1) on SysV r.2 doesn't recognize "chdir". (I just checked that in the manual). Fix: Following is a context diff which makes it put out "cd" instead of "chdir". It also makes the whole intro be a comment. (The "cut here" line isn't a comment....). Flame: People have been so worried that the standard for C will break all the existing programs. After looking at SysV r.2 for a week I think that AT&T-IS will break more programs than any standard will. Author: David Herron. (cbosgd!qusavx!ukma!david) *** /tmp/,RCSt1023453 Wed Jan 16 21:48:18 1985 --- /tmp/,RCSt2023453 Wed Jan 16 21:48:21 1985 *************** *** 1,5 #ifndef lint ! static char rcsid[] = "$Header: shar.c,v 1.1 85/01/10 17:24:33 root Exp $"; #endif lint /* * $Locker: root $ --- 1,5 ----- #ifndef lint ! static char rcsid[] = "$Header: shar.c,v 1.1.1.1 85/01/16 21:46:48 root Exp $"; #endif lint /* * $Locker: $ *************** *** 2,8 static char rcsid[] = "$Header: shar.c,v 1.1 85/01/10 17:24:33 root Exp $"; #endif lint /* ! * $Locker: root $ * $Log: shar.c,v $ * Revision 1.1 85/01/10 17:24:33 root * Initial revision --- 2,8 ----- static char rcsid[] = "$Header: shar.c,v 1.1.1.1 85/01/16 21:46:48 root Exp $"; #endif lint /* ! * $Locker: $ * $Log: shar.c,v $ * Revision 1.1.1.1 85/01/16 21:46:48 root * Branch for ukma changes. *************** *** 4,9 /* * $Locker: root $ * $Log: shar.c,v $ * Revision 1.1 85/01/10 17:24:33 root * Initial revision * --- 4,13 ----- /* * $Locker: $ * $Log: shar.c,v $ + * Revision 1.1.1.1 85/01/16 21:46:48 root + * Branch for ukma changes. + * Made it use "cd" for the chdir command instead of "chdir". + * * Revision 1.1 85/01/10 17:24:33 root * Initial revision * *************** *** 115,121 puts ("#\tThis is a shell archive."); puts ("#\tRemove everything above and including the cut line."); puts ("#\tThen run the rest of the file through sh."); ! puts ("-----cut here-----cut here-----cut here-----cut here-----"); puts ("#!/bin/sh"); puts ("# shar: Shell Archiver"); puts ("#\tRun the following text with /bin/sh to create:"); --- 119,125 ----- puts ("#\tThis is a shell archive."); puts ("#\tRemove everything above and including the cut line."); puts ("#\tThen run the rest of the file through sh."); ! puts ("#-----cut here-----cut here-----cut here-----cut here-----"); puts ("#!/bin/sh"); puts ("# shar: Shell Archiver"); puts ("#\tRun the following text with /bin/sh to create:"); *************** *** 178,184 if (Verbose) printf ("echo shar: creating directory %s\n", file); printf ("mkdir %s\n", file); ! printf ("chdir %s\n", file); } else /* type == 'f' */ { --- 182,188 ----- if (Verbose) printf ("echo shar: creating directory %s\n", file); printf ("mkdir %s\n", file); ! printf ("cd %s\n", file); } else /* type == 'f' */ { *************** *** 194,200 { if (Verbose) printf ("echo shar: done with directory %s\n", file); ! printf ("chdir ..\n"); } else /* type == 'f' (plain file) */ { --- 198,204 ----- { if (Verbose) printf ("echo shar: done with directory %s\n", file); ! printf ("cd ..\n"); } else /* type == 'f' (plain file) */ { -:--:- David Herron; ARPA-> "ukma!david"@ANL-MCS or david%ukma.uucp@anl-mcs.arpa (Note the quotes on the first. Try the second please.) {ucbvax,unmvax,boulder,research} ! {anlams,anl-mcs} -| |- !ukma!david {cbosgd!hasmed,mcvax!qtlon,vax135,mddc} ! qusavx -|