#!/bin/sh #set -x #@(#) copy directory $1 to a subdirectory in $2 IN=${1:-.} INDIR="`dirname ${1-.}`" INBASE="`basename ${1-.}`" OUTDIR=$2 export IN INDIR OUTDIR INBASE [ "$OUTDIR" = '' ] && 'missing output directory' [ "$OUTDIR" = '' ] && exit ( cd $INDIR tar pcf - $INBASE )|( cd $OUTDIR tar pxvf - ) exit # Most cp(1) commands can now do this; scp(1) and rcp(1) do the same as # the version of this that used remsh/rsh/ssh to copy a directory between # commands