Skip to content

Instantly share code, notes, and snippets.

@earnhardt3rd
Created June 19, 2023 13:56
Show Gist options
  • Save earnhardt3rd/d108274fe1a6845f2e012c19f8ced8fe to your computer and use it in GitHub Desktop.
Save earnhardt3rd/d108274fe1a6845f2e012c19f8ced8fe to your computer and use it in GitHub Desktop.
require 'getopts.pl';
Getopts('m:d:t');
my $MODE = uc($opt_m) || "";
my $DEBUG = $opt_d || 0;
if (defined $opt_t) { my %TEST = &buildManualUnixFiles();}
1;
sub buildManualUnixFiles {
my $line = $_[0];
$line =~ s/\\/\//g;
print " U:$line\n" if $DEBUG > 0;
my $to = $line;
$to =~ s/NXROOT//g;
$to =~ s/^\\//;
$to =~ s/^\///;
$to =~ s/\\/_-_/g;
$to =~ s/\//_-_/g;
$to = "\$HOST/$to";
$line =~ s/NXROOT/\$ROOTS{"NXROOT"}/;
my $get = $OS_TOOLS{"cp"} . " \"$line\" \"${to}\"";
my $put = $OS_TOOLS{"cp"} . " \"$to\" \"$line\"";
open (GT,">> $guFile");
print " gu: $get\n" if $DEBUG > 0;
print GT "$get\n";
close(GT);
open (GT,">> $puFile");
print " pu: $put\n" if $DEBUG > 0;
print GT "$put\n";
close(GT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment