Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2009 19:50:04 GMT
From:      Jilles Tjoelker <jilles@stack.nl>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/129566: behavioral change of "read" builtin for sh(1) on 8-CURRENT [regression]
Message-ID:  <200905311950.n4VJo4N9071714@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/129566; it has been noted by GNATS.

From: Jilles Tjoelker <jilles@stack.nl>
To: bug-followup@FreeBSD.org, mike@jellydonunt.org
Cc:  
Subject: Re: bin/129566: behavioral change of "read" builtin for sh(1) on
	8-CURRENT [regression]
Date: Sun, 31 May 2009 21:47:57 +0200

 I have committed another change. The timeout in the read builtin now
 applies to the entire read, not the first character, and the weirdness
 is gone.
 
 I suggest changing the script as follows:
 
 #!/bin/sh
 set -x
 DEFINT=vr0
 DEFIP=192.168.0.1
 DEFMASK=255.255.255.0
 if read -t 5 -p "Press Enter now if you want to configure the network: " dummy; then
 	read -p "Enter network interface [$DEFINT]: " INT
 	read -p "Enter IP address [$DEFIP]: " IP
 	read -p "Enter netmask [$DEFMASK]: " MASK
 else
 	echo 'Using defaults'
 fi
 echo ${INT:=$DEFINT} : ${IP:=$DEFIP}/${MASK:=$DEFMASK}
 
 This should work well on both 8.x and older versions.
 
 -- 
 Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905311950.n4VJo4N9071714>