How to install jdk 6u17 in a prompt-less script

I came across this site while Googling for how to silently install JDK 6u17. I didn't find a solution, but I came up with this hack so I thought I'd post it here:

The trick is to just temporarily disable the "more" application:

]# chmod u+x jdk-6u17-linux-x64-rpm.bin
]# # Prevent prompts...
]# mv /bin/more /bin/moremore
]# echo "yes" | ./jdk-6u17-linux-x64-rpm.bin
]# # Restore prompts...
]# mv /bin/moremore /bin/more