Regular reminder that bash has a powerful "parameter substitution" feature to manipulate and expand variables. For instance to set default values, but you can do a looot more like search/replace, substring extraction, lower/uppercase, etc. Look it up!