bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

^A ^? IFS issues


From: Grisha Levit
Subject: ^A ^? IFS issues
Date: Tue, 5 Mar 2019 04:54:53 -0500

Perhaps too unlikely to be encountered to be worth looking into but
here's a collection of issues encountered with IFS set to \001 or
\177:

n() { (($#)) && printf '<%q>' "$@"; echo; }

#                   expected      observed             changed in
IFS=$'\001'
set -- x
n "address@hidden"            # <x>         <''><''><x>          bash-4.0
n ${0+"$*"}         # <x>         <''><x>              bash-3.3
n "$@"""            # <x>         <''><''><x>          bash-3.3
n "address@hidden"         # <x>         <''><''><x>          bash-3.3
n ${0+"$@"}         # <x>         <$'\177'><x>         bash-3.3

set -- x x
n "address@hidden"            # <x><x>      <''><''><$'x\177'><''><x>

set -- '' ''
n $*""              # <''><''>    <$'\177'>            bash-4.2
n ${0+$*""}         # ??          <$'\177'>            bash-20190220

IFS=$'\177'
set --
n ""$*""            # <''>        <''><''>             bash-4.2
n ${0+""$*""}       # <''>        <''><''>             bash-20190220

set -- x
n ${0+"""$*"}       # <x>         <''><x>              bash-20190220

set -- "$IFS"
n """$@"            # <$'\177'>  <''><$'\177'>         bash-4.2
n ${0+"""$@"}       # <$'\177'>  <''><''><$'\177'>     bash-20190220

set -- "x$IFS"
n ""$*              # <x>         <''><x>              bash-4.2
n ${0+""$*}         # <x>         <''><x>              bash-20190220

set -- '' ''
n "address@hidden"            # <''><''>    <''><''><''><''><''>
n "$@"""            # <''><''>    <''><''><''><''><''><''>
n ${0+"$@"}         # <''><''>    <''><''><''><''><''><''><''><''><''>
n "address@hidden"         # <''><''>    <''><''><''><''><''><''><''><''><''>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]