Re: What's the difference pipe vs redirection is the following case case.



K-mart Cashier <cdalten@xxxxxxxxx> wrote:
When I execute party, it brings up a chat line. Ie

m-net% party
Welcome to PARTY! Type '?' for help:
triluda: my hero
mickeyd: are we cheech'n'chongish enough?

When I do the following
m-net% party | /dev/null
zsh: permission denied: /dev/null

I get permission denied.

But when I do something like the following
m-net% party > /dev/null
Welcome to PARTY! Type '?' for help:
e

The output from party gets redirected to /dev/null

What's the difference between the two? Ie, why do I get permission
denied when I try to pipe party to /dev/null?

Because you can pipe to another process but not a file. '|' is
for connecting the stdout of the process on the left hand side
to the stdin of the process of the right hand side. '>' is for
redirecting the stdout of the left hand side process to a file
on the right hand side. You get permission denied for

m-net% party | /dev/null

because it instructs the shell to start the program /dev/null
but, when the shell tries to do so, it finds that /dev/null
hasn't the executable bit set (which makes sense since /dev/null
isn't an executable but just a "file", not a program).

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.



Relevant Pages

  • Re: Whats the difference pipe vs redirection is the following case case.
    ... Welcome to PARTY! ... m-net% party | /dev/null ... for connecting the stdout of the process on the left hand side ... because it instructs the shell to start the program /dev/null ...
    (comp.unix.programmer)
  • Re: How do I start and restart a program via a perl script?
    ... to see if a particular person enters the party chatline. ... then the script is supposed to trigger the nope program. ... The return will be the pid of this shell. ... On unix-like systems, the shell will then exit, because & tells it not to wait for nope2. ...
    (comp.lang.perl.misc)
  • Re: How do I start and restart a program via a perl script?
    ... to see if a particular person enters the party chatline. ... then the script is supposed to trigger the nope program. ... perl will open a shell and give the shell your command ... The shell will then start nope2. ...
    (comp.lang.perl.misc)
  • WH strategy on Rush Limbaugh: he had it coming to him
    ... 'The goal is to convince Americans that the popularly known "Grand Old Party" of Abraham Lincoln is a shell of its former self and in the grip of its most narrow, right wing, in hopes of making independents and moderates think twice about switching allegiance.' ...
    (alt.politics.bush)