Re: here-document in function and temp file



On Mar 15, 9:16 pm, Shurik <shurikgef...@xxxxxxxxx> wrote:
On Mar 15, 7:25 pm, Sven Mascheck <masch...@xxxxxxxxxxxxx> wrote:





Shurik wrote:
I have the following function definition on HP-UX ( ksh shell )

[here-document inside function]

I see that after the definition created temp file in /tmp/sh<process_id>.1

Yes, this is a common behaviour of Bourne and Korn (ksh88) shells.

Can I change the temp location?

No, except you want to "in-place" edit the compiled-in path in the ksh binary.

However, there's a workaround: put the function body into "eval".

function() {
eval 'cat<<EOF
EOF
'

}

--http://www.in-ulm.de/~mascheck/bourne/common.html

Sven, thanks a lot, now I don't have temp file

I found that if I defined function as below

function CheckDB
.....

The temp file created, but if I use the other option for function
definition

CheckDB()
......

The temporary file doesn't created.

Why?
.