My colleague, Ryan, came to me with a bug in his Bash script, and I identified the problem with this test:
$ mkdir ryan
$ mkdir ryan/smells-bad
$ FOO=ryan/sm
The problem is that the glob will only expand if the file "rotten_eggs" exists, because it is included in the glob pattern. You should use an array.
FOO=( ryan/smells-* )
touch "${FOO[@]/%//rotten_eggs}"
The FOO array contains everything matched by the glob. The expansion using % appends /rotten_eggs to each element.