here document temporary files

From: Clemens Vonrhein <vonrhein_at_GlobalPhasing.com>
Date: Tue, 15 Feb 2000 16:21:44 +0000 (GMT)

Dear all,

I've got some problems with here-documents. From the Bourne shell man
page (1b) I can see:

  The shell creates a temporary file containing the input document and
  performs variable and command substitution on its contents before
  passing it to the command.

Since I'm running shell scripts with a lot of here documents, like

program <<end_ip
KEY $key1
KEY $key2
end_ip

I end up with THOUSANDS of these temporary files in /tmp. They seem to
be called sh<PID><num> with increasing <num> for each here
document. At some stage one of the scripts will crash, because the
temporary file already exists. Why does the shell not remove the file
once it has done the variable substitution? The script runs fine under
Linux and IRIX ...

I'm running Digital UNIX V4.0E (Rev. 1091) on a DS20 if that is of any
significance. The /bin/sh scripts are started by an apache 1.3.6 httpd
via CGI scripts (perl5).

I've got the feeling that some shell setup is not done properly - or
do I just have to run a cronjob every 30min to clean up /tmp?

Thanks for any help.

Cheers

Clemens Vonrhein

-- 
****************************************************************
* Clemens Vonrhein, Ph.D.          vonrhein_at_GlobalPhasing.com  *
*                                                              *
*         Global Phasing Ltd.                                  *
*         Sheraton House, Castle Park                          *
*         Cambridge CB3 0AX, UK                                *
*    Tel: +44-(0)1223-353033   Fax: +44-(0)1223-366889         *
*--------------------------------------------------------------*
* BUSTER Development Group (http://Lagrange.mrc-lmb.cam.ac.uk) *
****************************************************************
Received on Tue Feb 15 2000 - 16:26:28 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT