This is probably because sudo reads the password from /dev/tty, not standard input. Sudo 1.6.3 will include an option to force the password to be read from standard input to facilitate this kind of thing. I'll probably release 1.6.3 in a week or so. - todd