I cannot do anything but agree with whatever was being said - means except; except is not an adverb
Likewise "I cannot only agree" - unless you mean you must do something else as well; so changing the meaning.
That needs punctuation to make sense so not the same.I cannot do anything only agree with whatever was being said.
Sort of.Indeed - so are you saying that both versions are 'correct'? - i.e. ...
When 'but' IS preceded by 'not', it effectively means 'not' ..
so "I can not but agree" = I can not not agree" = "I agree"
I don't think "I can but agree" makes sense.When 'but' IS NOT preceded by 'not', it means something like 'only' ...
so "I can but agree" = "I can only agree" = "I agree" [perhaps implying something slightly stronger, such as "I definitely agree"]
Likewise "I cannot only agree" - unless you mean you must do something else as well; so changing the meaning.