When the script is run, I don't see an error message, but the file is not changed. I think the "#" characters are noted as comment characters by Ruby. Does that make sense?
jhass: So you're telling me the line should execute properly? The weird thing is, there are side effects both before and after this in the script, and they all are done, but not from this line. I then later tried running the line manually as root, and it performs the change.
So I looked in some docs and noted that the "#" can start variable interpolation, so I tried changing my heredoc terminator, adding single quotes around it, which is supposed to disable interpolation. That worked.
The funny thing is, I'm definitely not doing variable interpolation here. Is Ruby somehow "swallowing" the backslash as an attempt to determine if there is variable interpolation happening?