I have .cgi
file and .sh
file. The cgi
is calling the script which is the .sh
file.
How will assign the tempfile created from .cgi
and pass it to the .sh
file?
Example below:
(on my CGI, $tmpfile
is created)
#! /usr/local/bin/perl
use CGI qw/:standard :html3/;
use CGI::Carp qw(fatalsToBrowser);
my $tmpfile = "$dir/output.$$";
(on my .sh file, i want to use the $tmpfile
from cgi)
#! /bin/csh -fb
umask 0
set tmpfile2 = $tmpfile #not working
答案 0 :(得分:0)
就像@muru所说的那样,将其放入环境中:
$ENV{tmpfile}= $tmpfile;
或将其作为参数传递给脚本。这比乱扔环境要干净得多。