logname does not always exist
Refactor to perform zshrc-like