```addr="${addr%%+(/)}" # strip trailing slash``` requires the globbing shell option ``shopt -s extglob``