First, I don't think the * is doing what you think it is. 'ruby -
pi.bak' is probably what you want. Second, it's more efficient to use
one regex when you don't really need two.

ruby -pi.bak -e 'gsub(/VAR_(TYP|FREQ)/,'\1')' file.dat