I have a shell pipeline for generating 10 characters password at random:
cat /dev/urandom | base64 | head -c 10
My question is cat /dev/urandom | base64
is an infinite output stream which will not exit by itself. But why does appending head -c 10
make the whole pipeline exit? I assume cat
, base64
and head
are 3 separated processes, how can head
make the cat
process exit?