#!/usr/bin/perl
#
# Copy some files from a given directory to this directory
#
# MWR 6/16/2016

$debug = 1;

# copy from this directory
$source_dir = "/home/richmond/z1/ritobs/jun19_2016/work/pff/";

# copy these files
@files = ("sn_template.pht", "refstar_mags.dat", "refstar_mags_jc.dat",
          "refstar_mags_aavso.dat",
          "color_terms_bogus.dat", "color_terms_jun2016.dat");
foreach $file (@files) {
  $cmd = "cp $source_dir/$file .";
  $ret = exec_cmd($cmd);
}


exit 0;



##############################################################################
# PROCEDURE: exec_cmd
#
# DESCRIPTION: Execute the given shell command line.  If the $debug flag
#              is set, we print to stdout the command line, and
#              also print out the result string.
#
# RETURNS:
#              the result of the command
#
#
sub exec_cmd {

  my($cmd, $ret);

  $cmd = $_[0];

  if ($debug > 0) {
    printf "cmd is ..$cmd.. \n";
  }
  $ret = `$cmd`;
  if ($debug > 0) {
    printf "ret is ..$ret.. \n";
  }

  return($ret);
}


