Apparently you can't do this without writing it to a file.

Shell programming is the worst thing.