Doesn't yum have a "-y" option? Avoid the question entirely.
In reply to Re: Getting user input with STDOUT tee to file by gmargo in thread Getting user input with STDOUT tee to file by xjlittle