Hi list, Could someone tell me why the following works in zsh but not in bash/posh/dash?
benjo[3]:~% echo foo bar baz | read a b c benjo[4]:~% echo $a $b $c foo bar baz If I try the same with bash (or other sh-compatible shells), the variables $a $b and $c are unset. From the bash man page: > read [-ers] [-u fd] [-t timeout] [-a aname] [-p prompt] [-n nchars] [-d > delim] [name ...] > One line is read from the standard input, or from the file > descriptor fd supplied as an argument to the -u option, and the > first word is assigned to the first name, the second word to the > second name, and so on, with leftover words and their intervenā > ing separators assigned to the last name. So "read" claims to read from the standard input, but it doesn't actually seem to happen when a pipe is involved. Posh and dash behave like bash in this respect, so I guess that this is not a bug, and that what zsh does is actually an extension. So, what is the correct POSIX-compatible way to get "read" to work as I want? Thanks in advance, -- Kevin B. McCarty <[EMAIL PROTECTED]> Physics Department WWW: http://www.princeton.edu/~kmccarty/ Princeton University GPG: public key ID 4F83C751 Princeton, NJ 08544 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]