blob: e51230db7e69b452d5a5f510758eb0311c6ac85f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/bin/sh
if [ $1 = "-t" ] ; then
shift
fi
if [ ! "$2" ] ; then
echo >&2 Usage: $0 '<sourcedir> <targetdir>'
exit 1
fi
if [ -d "$1" ] ; then
dir="$1"
else
dir="`echo $1 | sed 's#\(.*\)/.*#\1#'`"
fi
while [ "$2" ] ; do
shift
done
if [ ! -d $1 ] ; then
mkdir -p $1 || exit 1
fi
/bin/tar -Ccf $dir - . | /bin/tar -Cxf $1 -
|