unlink tmpfile instead of rm so no confirmation
better pattern expansion in .bunctionsh