For use in PS1. Returns a concatenated version of $(pwd) based on a max length parameter.