Operating System - HP-UX
1833867 Members
2054 Online
110063 Solutions
New Discussion

big here documents fill /tmp

 
Duncan Galbraith
Frequent Advisor

big here documents fill /tmp

Hi,
I'm using a here doument to take a uuencoded file out of a script (ksh). The file is bigger than the free space in /tmp so I direct it into somewhere with lots of free space. This does not work as the shell creates a /tmp/shPID.# file, apparently before it starts to create the real output. To me this is not very sensible as it means that the entire contents of the here document are written to disk twice (at least they would be if you had enough space). Can anyone tell me how you stop the shell writing this to /tmp ?

Thanks in advance,

Duncan
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: big here documents fill /tmp

Hi Duncan:

You don't indicate your release, but recent cumulative Posix shell patches moved the location from /tmp to /var/tmp under the assumption that the later generally has a larger amount of free space.

For 11.0 see PHCO_26789

Regards!

...JRF...
Duncan Galbraith
Frequent Advisor

Re: big here documents fill /tmp

Thanks James. Release is 11.0. Unfortunately I don't happen to have anything like enough disk space in /tmp or /var/tmp and would like to be able to set my own 'tmp' directory for the shell to write into (that is unless I can get the shell not to do what would appear to me to be an extra disk write). I've tried setting $TMPDIR but I think that only works for things like vi.
Any more suggestions ?

Thanks.
curt larson_1
Honored Contributor

Re: big here documents fill /tmp

just a couple of quick suggestions:
check to see if the script itself is creating the /tmp/shPID.# file instead of the shell.

make sure the script with the here doc isn't in the /tmp directory.