summaryrefslogtreecommitdiff
path: root/bin/clone.csh
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1996-10-21 21:41:34 +0000
commita5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch)
treebcf0a25c3d45a209a6e3ac37b233a4812f29c732 /bin/clone.csh
downloadATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz
Initial revision
Diffstat (limited to 'bin/clone.csh')
-rw-r--r--bin/clone.csh26
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/clone.csh b/bin/clone.csh
new file mode 100644
index 00000000000..1c14e912d64
--- /dev/null
+++ b/bin/clone.csh
@@ -0,0 +1,26 @@
+#!/bin/csh
+
+set src_root=`pwd`
+set dst_root=`abspath $1`
+
+set subdirs=`find * -type d -print`
+
+mkdir $dst_root
+set files=`find * \( -type d -prune \) -o -type f -print`
+
+if ($#files) then
+ ln $files $dst_root
+endif
+
+if ($#subdirs) then
+ foreach subdir ($subdirs)
+ cd $src_root
+ mkdir $dst_root/$subdir
+ cd $src_root/$subdir
+ set files=`find * \( -type d -prune \) -o -type f -print`
+ if ($#files) then
+ ln $files $dst_root/$subdir
+ endif
+ end
+endif
+exit 0