Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Slicing the output of a command

by marioroy (Prior)
on Jul 10, 2015 at 04:00 UTC ( [id://1134078]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Slicing the output of a command
in thread Slicing the output of a command

+1 BrowserUk. I'm not sure if the behavior is the same in Windows, but the 'cat command' receives a PIPE signal and exits once count lines have been read by the 'head command'.

Replies are listed 'Best First'.
Re^5: Slicing the output of a command
by afoken (Chancellor) on Jul 10, 2015 at 10:21 UTC

    Windows has no signals, so no SIGPIPE there.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      You're correct, however, marioroy's point holds. When head has read its 4 lines it closes the pipe and effectively prevents cat (or type or copy etc.) from reading further.

      (That doesn't stop it from be a Useless use of cat though.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1134078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-24 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found