Quote:
Originally Posted by jterra
Hello vgersh99,
This is very interesting, but using here-documents I think that sh+pid file is allocated on /tmp automatically, so when system finds <<EOF the automatic allocation is done although later you redirect the output using >> "${tmpFile}". So the problem remains.
jterra
I don't understand.
You have a 'here-doc' that you redirect the output to a temp file. Right?
And that temp might exist with missing 'w' permissions for you to write to. Right?
If that's the case what I'm suggesting is to find a temp file that does not exist. Take a value of '$$' - see if the tempFile exists. If it doesn't - use that file for redirection.
If it does, keep incrementing '$$' till you find the file that does not exist.
Am I missing something obvious here?
It might help if you posted relative parts of your script.