[Bug 1085043] Re: empty variable after "read -t" is used

Jonas Björk jonas.bjork at gmail.com
Wed Jul 9 06:45:45 UTC 2014


This bug is still present.

$ lsb_release -rd
lsb_release -rd
Description:	Ubuntu 14.04 LTS
Release:	14.04

$ apt-cache policy bash
apt-cache policy bash
bash:
  Installed: 4.3-7ubuntu1
  Candidate: 4.3-7ubuntu1
  Version table:
 *** 4.3-7ubuntu1 0
        500 http://se.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     4.3-6ubuntu1 0
        500 http://se.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

** Tags added: bash

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1085043

Title:
  empty variable after "read -t" is used

Status in “bash” package in Ubuntu:
  New

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://se.archive.ubuntu.com/ubuntu/ precise/main amd64 Pack
  ages                                                                    
          100 /var/lib/dpkg/status

  
  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-apple-darwin12)
  Copyright (C) 2007 Free Software Foundation, Inc.

  it works as expected as:

  $ VAR="jonas"
  $ read -t 3 VAR
  $ echo ${VAR}
  jonas

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1085043/+subscriptions



More information about the foundations-bugs mailing list