From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11780 invoked by alias); 14 Jun 2015 22:50:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35468 Received: (qmail 19090 invoked from network); 14 Jun 2015 22:50:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=yswHUNOwvIqnRJ3talJGUk/Dn3/0NWQbmkHWjbNAfAw=; b=e/wi2eAdnbR0jVWnWvXOq+oafFYMRu85IYujiqVorJdNbTrlsCLzN9qQZsQ/n7drFI 9pD7glhX696O2aWvn1q980lp9W6ri7L7vcTtLi85KOQggof1vvB1slFDlbUwsLcQvyMD Jy6B9+vB8H4HdfHnDy1d5QU3YRHWN/etgqZ4Kc/TRaF3jkcqdcFSu+0kHv5ivPfdnZlI EBIYhHk4Z9xvLRjbphPSK6qPmDEQHG7+sh7pwq8d8tzLjsnLYiVRlgeKpA8wf9nux1HM VGrQzxGVmpPXk5KbtIn3IOrbW/cyq15gSEXRQHrk6BZ8Bh3RDmj0t9irIihDjBOm86Y4 psfA== X-Received: by 10.52.135.50 with SMTP id pp18mr736870vdb.73.1434322231453; Sun, 14 Jun 2015 15:50:31 -0700 (PDT) MIME-Version: 1.0 From: Daniel Miranda Date: Sun, 14 Jun 2015 19:50:10 -0300 Message-ID: Subject: Weird behavior of conditionals with exclamations (ZSH 5.0.7) To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 I've recently encountered a bug in Fedora 22 where I get error messages when browsing a folder that contains exclamation signs in it's name in GNOME Terminal with ZSH. I tracked it down to a profile.d script shipped by the VTE terminal emulation library. The __vte_urlencode function triggers a "too many arguments" error in the case I mentioned. You can see the code at the GNOME miirror in Github [1]. The error happens at line 31: while [ -n "$str" ]; do If and only if the value of "$str" is '!', a string containing a single exclamation. It seems the test command somehow attempts to parse it as a modifier, instead of an actual string to be tested. The same *does not* happen in Bash. It seems incorrect, or at least strange, to me. Somehow using [[ ]] works correctly. I don't know why that is the case. Is that expected or have I ran into an issue? Thanks, Daniel [1] https://github.com/GNOME/vte/blob/master/src/vte.sh#L26