diff options
author | sjaz <sjaz@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-01 12:00:20 +0000 |
---|---|---|
committer | sjaz <sjaz@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-01 12:00:20 +0000 |
commit | c777c8d9aa7cd5c2e9a399727a7fa9985a77fb1c (patch) | |
tree | 9e996ae4a1bbb833cec036c5cd4d87a590149e85 /src/bin/cp-recursive |
Anope Stable Branch
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1902 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/bin/cp-recursive')
-rwxr-xr-x | src/bin/cp-recursive | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bin/cp-recursive b/src/bin/cp-recursive new file mode 100755 index 000000000..e51230db7 --- /dev/null +++ b/src/bin/cp-recursive @@ -0,0 +1,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 - |