Abort the use of read, it simply doesn't work when piping script directly into bash.