source: PSPA/madxPSPA/testing/mad_install @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 766 bytes
Line 
1#!/usr/bin/perl
2# a Perl script to copy a list of files into a target dir
3# usually invoked through 'Makefile install'
4
5if ( $#ARGV < 1 ) {
6    print "expect at least 2 args:\n";
7    print "(1) file to be installed and (2) installation directory\n" ;
8    exit ;
9} else {
10    $installationDir = @ARGV[$#ARGV];
11    $existsInstallationDir = `ls -d $installationDir | wc -l`;
12    if ($existsInstallationDir==0) {die "target directory does not exist\n";}
13    @files = ();
14    for (my $i = 0; $i <= $#ARGV-1; $i++ ) {
15        my $file = @ARGV[$i];
16        $existsFile = `ls $file | wc -l`;
17        if ($existsFile==0) {die "file '$file' does not exist locally\n";}
18        @files = (@files, $file);
19    }
20    # now do the coy
21    foreach $file (@files) {
22        `cp $file $installationDir`;
23    }
24   
25}
26
27
Note: See TracBrowser for help on using the repository browser.