Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Denys Vlasenko Newsgroups: gnu.bash.bug Subject: Empty ""s in ARG in ${x:+ARG} expand to no words instead of the empty word if prepended/appended with space Date: Fri, 20 Jul 2018 16:43:10 +0200 Lines: 31 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1532097806 18892 208.118.235.17 (20 Jul 2018 14:43:26 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 20 Jul 2018 14:43:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 20 Jul 2018 14:43:11 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dvlasenk@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14372 $ f() { for i; do echo "|$i|"; done; } $ x=x $ e= $ f ${x:+""} || ^^^^^^^^^^^ correct $ f ${x:+ ""} ^^^^^^^^^^^ prints nothing, bug? $ ${x:+"" } ^^^^^^^^^^^ prints nothing, bug? $ f ${x:+"$e"} || ^^^^^^^^^^^ correct $ f ${x:+ "$e"} ^^^^^^^^^^^ prints nothing, bug? $ f ${x:+"$e""$e"""} || ^^^^^^^^^^^ correct $ f ${x:+"$e""$e"""} ^^^^^^^^^^^ prints nothing, bug? Similarly with: f ${x:+"`echo`" } etc...