Short answer for quantal (Ubuntu 12.10): Download and install the bash package from the precise repository.
For quantal (Ubuntu 12.10), I searched for bash packages from nearby releases. I downloaded packages for raring and precise.
Before getting started, I made a backup of my existing bash package, so I could hopefully recover my system if the fresh install failed. (Requires the dpkg-repack package.)
$ dpkg-repack bash
Although probably I should have just copied the executable
/root/bash.vulnerable, since that would be easier to restore in an emergency.
First I tried the package from raring:
$ dpkg -i bash_4.2-5ubuntu3_i386.deb
But that tested as still vulnerable!
So then I tried the package from precise:
$ dpkg -i bash_4.2-2ubuntu2.6_i386.deb
That tested as safe, using the bashcheck script.
Testing /bin/bash ...
GNU bash, version 4.2.25(1)-release (i686-pc-linux-gnu)
Variable function parser pre/suffixed [%%, upstream], bugs not exploitable
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
Not vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Not vulnerable to CVE-2014-6277 (lcamtuf bug #1)
Not vulnerable to CVE-2014-6278 (lcamtuf bug #2)
But I really wish I had installed an LTS release. I still plan to do an upgrade when I have time...