#!/bin/sh
#
#NAME
#  lntree - copy directory tree via cpio
#
#SYNOPSIS
#  lntree olddir newdir
#
#DESCRIPTION
#  This makes a "linked copy" of olddir to newdir.  That is, cpio's "l"
#  option is used to make the new files linked to the old, so the only
#  really new things that are created are the directories.
#
#
#AUTHOR
# John Chambers <jc@trillian.mit.edu>
if [ $# != 2 ];then echo Usage: $0 olddir newdir; exit 1; fi
case $1 in
	/*) src=$1;;
	 *) src=`pwd`/$1;;
esac
case $2 in
	/*) dst=$2;;
	 *) dst=`pwd`/$2;;
esac
test -d $src || { echo No directory $src; exit 1; }
test -d $dst || mkdir -p $dst
test -d $dst || { echo No directory $dst; exit 1; }
cd $src
find . -print | cpio -pdlum $dst
