Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site avsdT.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!hao!hplabs!hpda!fortune!dsd!avsdS!avsdT!rlr From: rlr@avsdT.UUCP (Rhode Roberts) Newsgroups: net.sources Subject: Re: cpdir shell script & man page for 4.2 BSD Message-ID: <117@avsdT.UUCP> Date: Wed, 15-May-85 17:35:22 EDT Article-I.D.: avsdT.117 Posted: Wed May 15 17:35:22 1985 Date-Received: Thu, 30-May-85 00:03:37 EDT References: <10123@brl-tgr.ARPA> <592@tpvax.fluke.UUCP> Organization: Ampex Audio-Video Engineering, Redwood City, CA Lines: 59 > > Yes, this is a trivial hack, but somebody had to do it. Cut at the > > dotted lines. Works for us on VAX/4.2 BSD - others, beware. > > > > -- Rex > > ............................................................................ > > .TH CPDIR 1 LOCAL "USGS Pacific Marine Geology" > > .SH NAME > > cpdir - copy directory (and subdirectories) > ... > > Pardon me, but doesn't the -r option to cp do the same thing? > > ...truncated portion of cp man page: > > cp [ -i ] [ -r ] file1 file2 > > cp [ -i ] [ -r ] file ... directory > > DESCRIPTION > > If the -r option is specified and any of the source files > are directories, cp copies each subtree rooted at that name; > in this case the destination must be a directory. > > -------------- > works good for me... > > I tried direct e-mail, but the mailer bounced it back... must have been > gatewayed from arpanet. oh-well... > > Rick Chinn > John Fluke Mfg. Co MS 232E > PO Box C9090 Everett WA 98206 > > {ihnp4!uw-beaver, ucbvax!lbl-csam, microsoft, allegra, ssc-vax}!fluke!rzdz > (206) 356-5232 *** REPLACE THIS LINE WITH YOUR MESSAGE *** some people don't like to do things the easy way as in "cp -r". so here is ( right out of the maual ) the tar version. # # Phony tree cp # # if( $#argv != 2 ) then echo Incorrect Usage echo treecp path/dir_name dir_name echo \(path/dir is the directory to be copied\) echo \(dir_name is the name for the new directory\) exit ( 0 ) endif set noglob set target_path=`pwd` set target=`echo $target_path/${2}` mkdir $target cd ${1} ; tar cf - . | ( cd $target ; tar xf - . )