bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read -t0 doesn't pick up waiting characters


From: Chris F.A. Johnson
Subject: read -t0 doesn't pick up waiting characters
Date: Sat, 8 Aug 2009 23:59:53 -0400 (EDT)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

     (Using 4.0.28(2)-release on Linux and 4.0.24(0)-release on FreeBSD.)

     Given this script:

delay=0
read -sn1 v
read -sn1 -t "$delay" w
read -sn1 -t "$delay" x

     if I press the up arrow, which generates '\e[A', I would have
     expected $w to contain '[' and $x to contain 'A'. However, they
     are empty. They do pick up the characters if I change delay to
     .0001.

-- 
   Chris F.A. Johnson, webmaster         <http://woodbine-gerrard.com>
   ===================================================================
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]