I think that by generalising beyond dirempty to include exists, you're getting closer to a generic unix tool.
I worry though that the tool might be test(1). These seem like fairly good candidates to add to test, especially dirempty. -- see shy jo
signature.asc
Description: Digital signature

