echo $(tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 16)
Source: https://stackoverflow.com/a/44377013