``read -N n -t timeout'' saves partial input only when EOF is seen?

2016-11-23 Thread Clark Wang
See following example:

# echo $BASH_VERSION
4.4.5(2)-release
# ( printf 12345 ) | ( read -t 1 -N 10 v; echo "<$v>" )
<12345>
# ( printf 12345; sleep 2 ) | ( read -t 1 -N 10 v; echo "<$v>" )
<>
#

The second "read" did not save "12345" to "v". Is this a bug?

-clark


Re: Command or process substitution resets alias name tracking during alias expansion?

2016-11-23 Thread Dan Douglas
On Wed, Nov 23, 2016 at 1:25 PM, Chet Ramey  wrote:
> On 11/22/16 5:46 PM, Dan Douglas wrote:
>> Hi. Here's a change between bash 4.1 and 4.2 that persists in 4.4.
>> (Added the counter to make it stop).
>
> Thanks for the incredibly obscure report.  This will be fixed in the next
> push to the devel branch.

There's an incredibly obscure ksh flavour too :-)

 $ ksh -c $'alias @=\'echo test >&2; )$( @ \'\n$( @ )' 2>&1 | head -n3
test
test
test

Ok I'm done. (unless maybe backticks...)



Re: Command or process substitution resets alias name tracking during alias expansion?

2016-11-23 Thread Chet Ramey
On 11/22/16 5:46 PM, Dan Douglas wrote:
> Hi. Here's a change between bash 4.1 and 4.2 that persists in 4.4.
> (Added the counter to make it stop).

Thanks for the incredibly obscure report.  This will be fixed in the next
push to the devel branch.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/