%pc
is for graphical preview and won't work here. Looks like documentation is misleading and needs correction, thanks.
However, even if it worked $tmpfile
wouldn't have any value as it is run in a separate shell.
I think replacing %pc
with &&
is what you want (the file isn't used after it's printed out anyway, so splitting out its removal wouldn't achieve anything).