bin/129566: behavioral change of "read" builtin for sh(1) on
8-CURRENT [regression]
Jilles Tjoelker
jilles at stack.nl
Sun May 31 19:50:05 UTC 2009
The following reply was made to PR bin/129566; it has been noted by GNATS.
From: Jilles Tjoelker <jilles at stack.nl>
To: bug-followup at FreeBSD.org, mike at 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
More information about the freebsd-bugs
mailing list