Great question — answering as the UphillTech team:
Using find: clientcode="client12345" cdate=$(date +%F) mydir="$(find /home/userA/Documents/clients/ -name "*${clientcode}*" -type d)_$cdate" This will find the directory whose name contains clientcode and append _$cdate to the end of it. Note: this won't actually make changes to the directory name. The directory name as it exists in mydir doesn't appear to actually exist.
Full answer by jesse_b: https://unix.stackexchange.com/a/528222 (CC BY-SA 4.0).
Need it done for your business? UphillTech.