Somebody is trying to test if a temp file already exists. Though I don't know this type of syntax and can't get it to work. Easiest and most easy to read might be to use the -e switch of the test command or inside the if -condition with single or double square brackets.
Also use code tags when writing code, data or logs etc. thanks.
With you second snippet of code, I am not sure what is still code and what did you edit in that line. You want to know what >&2 means?
! >$tmp.out means the negation of the return code of the command >$tmp.out . This latter command writes an empty string to the file "$tmp.out" . If this is successful then the return code is 0, if not it is >0 (1 in this case). The ! renders a negation of this value so 0 becomes 1 and a value 1 becomes 0.
So in short if the action is unsuccessful and the return code is 1, then the negation becomes 0 and therefore the if statement gets executed...
print "\nTrouble removing file" >&2 --> &2
Is Kornshell syntax. It means write the string to stderr. The second part contains an error, there should not be a space between > and &