From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id fe34b2ee for ; Sun, 19 May 2019 18:15:10 +0000 (UTC) Received: (qmail 12872 invoked by alias); 19 May 2019 18:15:00 -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: List-Unsubscribe: X-Seq: 44326 Received: (qmail 885 invoked by uid 1010); 19 May 2019 18:15:00 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f173.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25454. spamassassin: 3.4.2. Clear:RC:0(209.85.166.173):SA:0(-2.0/5.0):. Processed in 1.647398 secs); 19 May 2019 18:15:00 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.173 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ErW1mo8Lfl55A1QTMqnXgDl9/o9NoqoVaaBh12dhyPY=; b=R+SfMPP5IYqHHRrCfovoEaWsY75FXkxxwmRly+/d4C2bAgdLEQCehIvzjblc1qf2zE fd3m1vtBDjU59F/eV55PjIbsTSqFAGPiAiCkgDIVg3qWFlcliHdO+hYvvOOCx4d9Yowh tOruB9ssSe+alQ+x8UzPFfx7vRZuhLuofhDQNQv1yVVHy99zf/9JNRQLgobKXK1wJs57 BE4icmtwqGmFXc1+H5JV8fapdk+eTbRqI44yPtzXk17GxZCG3203VDqkGUsbBjW3iIcE LZptda3lQWXkrm2jKBUDWEMYDfAWRHJw/LSzVPtNlQ7qqgdlekEpshr9C0mfm/erMSgd jDXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ErW1mo8Lfl55A1QTMqnXgDl9/o9NoqoVaaBh12dhyPY=; b=ejg6nXxJ07L8zt8gLZ0BqVoVpG4iKYuwMKrvYTjc/gDIFrQdkoBOFQ2j2wKu18YToH 32lek6IZTS01vkTgqTRNJx21sK9bcvSYmazQHsYJ12xcDWj0i/4jaiFuSe2qSL71oVZM 9JbnFBjeBJv7902cGSoAk5JhrO9xBZIendn0pJLZMBcQqZ5AicGjqJiuDuKoDKl8IEjO JZ4rIr6MqpUqN3V99OOvnSU6c4NFAkyiSjw7q+XdX58dnIMVfXtzeI7WnLQfT4A3ufqI UVY1+YdorywRugcb+TqQ0aEqL6+s+C+A2AnP7RGsN4OpN10I3YsO4VcWWX87Serg/EOM ltrg== X-Gm-Message-State: APjAAAUtshLkvnKDb/l4DIsnk2QzqYHCxH+qrlD+D37vTH3gMQ0TwXpv rrRkuOMYVXelc30rDC3r7xDfIKUoK/Fk1YThbRs= X-Google-Smtp-Source: APXvYqxR/iojfm0UvHQZTWayVJnErIMhTTu1dhpQB6wNyLnVPwXpPfHh/x3LBR4C9n0qD4ENB/8E225qHRn31JcNx2g= X-Received: by 2002:a02:a596:: with SMTP id b22mr3094346jam.33.1558289666228; Sun, 19 May 2019 11:14:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sun, 19 May 2019 20:14:15 +0200 Message-ID: Subject: Re: Git grep command not interpreting flags correctly when an argument To: Sam Houston Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000034598058941967e" --000000000000034598058941967e Content-Type: text/plain; charset="UTF-8" ZSH doesn't perform word splitting by default, so `git grep $FLAGS pattern` in ZSH is equivalent to `git grep "$FLAGS" pattern` in bash. You can explicitly request word-slitting via `$=FLAGS`. There is also an option to do this automatically but it's not a good idea to turn it on. Most of the time you really don't want word splitting when you type $FOO. Roman. On Sun, May 19, 2019 at 8:10 PM Sam Houston wrote: > In a `bash` shell, in some empty directory, I can run the commands: > > ```bash > git init > echo "pattern" > file.txt > FLAGS="--untracked --color" > git grep $FLAGS pattern > ``` > > And see the output: > > ``` > file.txt:pattern > ``` > > But in a `zsh` shell, when I run the same commands, I get the following > error: > > ``` > error: unknown option `untracked --color' > ``` > > The error only seems to occur when I pass in with more than one `--` in the > `FLAGS` variable. > > My `zsh --version` is `zsh 5.3 (x86_64-apple-darwin18.0)`. > > Let me know if I am doing something wrong, or if you need more information. > > Thanks, > > Sam > --000000000000034598058941967e--