zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: detect pipe
Date: Thu, 28 Jan 2021 18:50:50 -0800	[thread overview]
Message-ID: <CAH+w=7Ywfd9zRZdu4WWO-xBXp0OW3sNUbtccWQWMmQ2YV-eoow@mail.gmail.com> (raw)
In-Reply-To: <bef43e79-1d3d-6a63-1dfa-9f33ff4407c6@eastlink.ca>

On Thu, Jan 28, 2021 at 5:17 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> Debian stable.

Hm.  That doesn't explain anything, then; if you'd said "Cygwin", for
example, I'd have speculated that pipes were only simulated and then
it could make sense that having one get closed early would mean that
[[ -p ... ]] became false.

> Tidbit: when I try 'tabs; noglob _g' it works.  The tab command fails
> for lack of an argument  and it seems the pipe then goes to '_g':
>
> $ . test; echo "Now is the time for all good men" | test2 'the time'
> PIPES ARE AS BAD AS CIGARETTES
> Now is the time for all good men

Hang on, that's not going to work either.

If you're defining the alias "test2" inside the file "test", you can't
run it all together on one line like that.

% . =(echo "alias test2='cat -'"); echo this | test2
zsh: command not found: test2
% alias test2
test2='cat -'

NOW the test2 alias exists, so if I repeat that:

% . =(echo "alias test2='cat -'"); echo this | test2
this

So the FIRST time you tried ". test; ...", if you DID NOT get an
error, there was some previous thing named "test2" lying around, which
probably behaved differently.

You can't define an alias and use it both in the same single line command.


  reply	other threads:[~2021-01-29  2:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 16:45 Ray Andrews
2021-01-27 23:59 ` Bart Schaefer
2021-01-28  4:57   ` Ray Andrews
2021-01-28  6:16     ` Bart Schaefer
2021-01-28 10:08     ` Vincent Lefevre
2021-01-28 10:28       ` Vincent Lefevre
2021-01-28 15:05         ` Ray Andrews
2021-01-28 15:45           ` Ray Andrews
2021-01-28 20:58             ` Bart Schaefer
2021-01-28 20:59               ` Bart Schaefer
2021-01-29  1:17               ` Ray Andrews
2021-01-29  2:50                 ` Bart Schaefer [this message]
2021-01-29  3:21                   ` Ray Andrews
2021-01-30  0:29                     ` Bart Schaefer
2021-01-30 14:26                       ` Ray Andrews
2021-01-30 19:00                         ` Bart Schaefer
2021-01-30 19:19                           ` Ray Andrews
2021-01-31 19:12                             ` Ray Andrews
2021-01-31 21:28                               ` Bart Schaefer
2021-02-14 17:31                           ` Vincent Lefevre
2021-02-14 19:33                             ` Bart Schaefer
2021-02-14 20:33                               ` Ray Andrews
2021-02-14 21:20                                 ` Bart Schaefer
2021-02-14 22:25                                   ` Ray Andrews
2021-02-14 21:24                                 ` Vincent Lefevre
2021-02-14 21:19                               ` Vincent Lefevre
2021-02-14 21:24                                 ` Bart Schaefer
2021-02-14 21:38                                 ` Bart Schaefer

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='CAH+w=7Ywfd9zRZdu4WWO-xBXp0OW3sNUbtccWQWMmQ2YV-eoow@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=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).