summaryrefslogtreecommitdiff
path: root/lib/sbin
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-14 11:30:26 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-09-14 11:30:26 +0000
commit4700d08041f4bd97de3a32eee26d40c88e28ab79 (patch)
tree950b43fde54ab1d51627a91ae857e28a040953eb /lib/sbin
parent524536b9fb652039d3181a20ad46a806d8e9a11e (diff)
Routine to copy example parameter files to one directory
git-svn-id: http://svn.cactuscode.org/flesh/trunk@915 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rw-r--r--lib/sbin/CopyParFiles.pl43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/sbin/CopyParFiles.pl b/lib/sbin/CopyParFiles.pl
new file mode 100644
index 00000000..d2487a2d
--- /dev/null
+++ b/lib/sbin/CopyParFiles.pl
@@ -0,0 +1,43 @@
+#!/bin/perl -s
+#
+# Script to copy parameter files
+# Version: $Id$
+
+$home = `pwd`;
+chop($home);
+
+$config = $ARGV[0];
+
+open(THORNLIST,"<configs/$config/ThornList") || die "ThornList not available";
+
+if (! -d "thornparfiles")
+{
+ mkdir("thornparfiles", 0755) || die "Unable to create thornparfiles directory";
+}
+
+while (<THORNLIST>)
+{
+ $thorn = $_;
+ chop($thorn);
+ print "Thorn $thorn\n";
+ $thorn = "arrangements/$thorn/par";
+ if (-d $thorn)
+ {
+ chdir $thorn;
+ while ($parfile = <*.par>)
+ {
+ if (-e "$home/thornparfiles/$parfile")
+ {
+ print " $parfile exists, will not overwrite\n";
+ }
+ else
+ {
+ print " Copying $parfile\n";
+ system("cp $parfile $home/thornparfiles/$parfile");
+ }
+ }
+
+ chdir "$home${sep}";
+
+ }
+}