I observe a problem (see testcase below) with ksh's read -n.
(Version 93t 2008-11-04 on Cygwin).
Bash's behaviour would be what I expect.
Ksh doesn't read the second line and doesn't terminate output.
(Maybe an old bug fixed in newer versions? Or am I missing something?)

--snip--

$ cat readtest
while IFS= read -n16 -r line
do
  printf "'%s'\n" "$line"
done <<EOT
ABCDEFGHIJ1234567890
abcdefghij1234567890
EOT

$ bash readtest | head
'ABCDEFGHIJ123456'
'7890'
'abcdefghij123456'
'7890'

$ ksh readtest | head
'ABCDEFGHIJ123456'
'7890'
''
''
''
''
''
''
''
''

$ ksh --version
  version         sh (AT&T Research) 93t 2008-11-04

--snip--

                                          
_______________________________________________
ast-users mailing list
ast-users@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to