empty variable after "read -t" is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
$ lsb_release -rd
Description: Ubuntu 12.04.1 LTS
Release: 12.04
$ apt-cache policy bash
bash:
Installed: 4.2-2ubuntu2
Candidate: 4.2-2ubuntu2
Version table:
*** 4.2-2ubuntu2 0
500 http://
ages
100 /var/lib/
When using "read -t" in bash script predefined variable becomes empty. Example:
VAR="jonas"
read -t 3 VAR
echo ${VAR}
When user does not input anything and timeout is passed (3 secs) variable VAR becomes empty. When doing the same in Mac OSX with:
$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-
Copyright (C) 2007 Free Software Foundation, Inc.
it works as expected as:
$ VAR="jonas"
$ read -t 3 VAR
$ echo ${VAR}
jonas
This bug is still present.
$ lsb_release -rd
lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04
$ apt-cache policy bash se.archive. ubuntu. com/ubuntu/ trusty-updates/main amd64 Packages dpkg/status se.archive. ubuntu. com/ubuntu/ trusty/main amd64 Packages
apt-cache policy bash
bash:
Installed: 4.3-7ubuntu1
Candidate: 4.3-7ubuntu1
Version table:
*** 4.3-7ubuntu1 0
500 http://
100 /var/lib/
4.3-6ubuntu1 0
500 http://