shell read built-in

Eugene Grosbein eugen at grosbein.net
Mon Oct 22 12:09:12 UTC 2018


Hi!

$ echo test | read line; echo $?
0
$ echo -n test | read line; echo $?
1

Is it right behavior for /bin/sh?
This makes it hard for "while read line ... < file"
to process last line if it is not followed by new line character.

Eugene


More information about the freebsd-hackers mailing list