Thanks for the pointer. I looked for that quote for a while and couldn't find it. Go figure that it would be on a page I literally linked from the post.
Now that I have it, I'm going to edit the post to make it less misremembered.
What shell are you running this under? Unquoted exclamation marks will do things that may be outside your intent for this script. It’ll still fail, just perhaps not in the way you expect.
Now that I have it, I'm going to edit the post to make it less misremembered.