Don't use read to capture stdin, sed does just that.