zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: greps pipes and eval bad patterns
Date: Mon, 26 Oct 2015 06:36:01 -0700	[thread overview]
Message-ID: <562E2C41.8040907@eastlink.ca> (raw)
In-Reply-To: <1413271445864647@web24g.yandex.ru>

On 10/26/2015 06:04 AM, ZyX wrote:
> Specifically this I would write as
>
>      local -a gcmd
>      gcmd=( cat )
>      if [[ $1 == ,f ]] ; then
>          gcmd=( grep '\[01;34m' )
>          shift
>      endif
>      integer levels=$(( ($1 + 1) * 4 ))
>      tree --du -haC | grep -Ev '^[^\[]{'"$levels"'\[* ' | $gcmd
That is better.  The pipe  shouldn't be in the variable.  But because 
you can't have nothing on the right side of the pipe, I had been using ' 
grep .* ' as the default for '$gcmd' which seemed rather clumsy.

Question: Why can't we have nothing on the right side?  Why not just 
ignore the pipe in that case?  It would obviate this situation. Logic 
being that a pipe to nowhere is a null command thus ignored. Or is there 
some other syntactic use for a pipe to nowhere?


  reply	other threads:[~2015-10-26 13:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25 19:47 Ray Andrews
2015-10-26  1:02 ` Bart Schaefer
2015-10-26  1:17   ` Kurtis Rader
2015-10-26  3:39     ` Ray Andrews
2015-10-26  3:31   ` Ray Andrews
2015-10-26 13:04     ` ZyX
2015-10-26 13:36       ` Ray Andrews [this message]
2015-10-26 14:30         ` Bart Schaefer
2015-10-26 14:49           ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562E2C41.8040907@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).