in reply to Delayed-write object/module
(note that the perl code could also use File::Copy's move() as well; and also note that the bash script could check the exit code of the perl call;)#!/bin/bash out=/tmp/wrapper.$$ perl some_script.pl > $out 2>&1 # run your script, trapping everythin +g dest=`perl -x $0 $out` # examine logfile, figure out right place mkdir -p ${dest%/*} # make sure the directory exists mv $out $dest # move the log into place exit ############################### #!/usr/bin/perl use strict; use warnings; my $filename = $ARGV[0]; my $output; # read in $file, figure out where it should go; set $output print $output;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Delayed-write object/module
by Tanktalus (Canon) on Feb 14, 2006 at 04:28 UTC |