← Back to team overview

touch-packages team mailing list archive

[Bug 1381567] [NEW] Bash returns unexpected character \001 on string operation

 

Public bug reported:

There has been some change between Precise and Trusty that lets this code snippet behave differently:

Precise:
$ unset f ; f=abcd ; first_char=${f[@]:0:1} ; echo $first_char
a

Trusty
$ unset f ; f=abcd ; first_char=${f[@]:0:1} ; echo $first_char
\001


The solution is to use ${f:0:1} but nevertheless the result on Trusty seems completely wrong. Where does the \001 even come from?!

** Affects: bash (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: trusty

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1381567

Title:
  Bash returns unexpected character \001 on string operation

Status in “bash” package in Ubuntu:
  New

Bug description:
  There has been some change between Precise and Trusty that lets this code snippet behave differently:
  
  Precise:
  $ unset f ; f=abcd ; first_char=${f[@]:0:1} ; echo $first_char
  a

  Trusty
  $ unset f ; f=abcd ; first_char=${f[@]:0:1} ; echo $first_char
  \001

  
  The solution is to use ${f:0:1} but nevertheless the result on Trusty seems completely wrong. Where does the \001 even come from?!

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


Follow ups

References