From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079336919432.tru64-unix-managers.marc@archive.invalid> From: Clemens Vonrhein Date: Wed, 16 Feb 2000 07:01:40 +0000 To: tru64-unix-managers Subject: SUMMARY: here document temporary files X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079336919432 Thanks to Bob Vickers Tom Blinn Alex Gorbachev for answering my question (appended) about temporay files used by Bourne shell in here documents (to do variable and command substitution). The real answer seems to be, that there might be a problem in /bin/sh under 4.0E. The funny thing is, it seems to happen only with fairly complicated scripts (and maybe only if started from an Apache cgi script written in perl?). Anyway, some ways around it, that are unfortunately not possible for me (untested): 1. use /bin/ksh (or any other shell for that matter) instead of /bin/sh 2. since all temporary files look like /tmp/sh, where is the process ID of the current shell ($$) it should be possible to do a /bin/rm /tmp/sh$$* at the end of the script Cheers Clemens ----- original message ---------------------------- 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 < with increasing 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? ----- End of original message----- -- **************************************************************** * Clemens Vonrhein, Ph.D. vonrhein@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) * ****************************************************************