From: Rainer Weikusat on
K-mart Cashier <cdalten(a)gmail.com> writes:
> On Jun 21, 6:33�pm, j...(a)toerring.de (Jens Thoms Toerring) wrote:

[...]

>> 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).
>
> Maybe I'm overcomplicated this a bit, but what's the difference
> between an executable, a "file", and a program? I thought an
> executable was a program.

For this particular case: /dev/null will usually be character device
node referring to an virtual device which is being simulated by some
kernel code. The behaviour is such that calling write with a file
descriptor refering to the null device will unconditionally result in
a success without any further side effects and calling read with such
a file descriptor will alyways yield and EOF-indication, ie return '0
bytes were read'. Attempting to execute a device makes no sense, eg
what behaviour would you expect on 'executing' the device
corresponding with your mouse?