Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

piping stdout of cat to kill's stdin

Name: Anonymous 2008-01-29 23:52

If I have the pid of some process stored in a text file, let's call it program.pid, and I want to end that process via the kill command, how come I can't do this:

bash:$ cat program.pid | kill

But if cat program.pid, and just type the output into the kill command, it works and I stop the process.  Why can't I pipe the output from cat to kill?

Name: Anonymous 2008-02-19 19:07

>>40
Congratulations, you've mastered man cat like a champ.
Now see if you can figure out how filesystems work, and why ext3 only requires that you update x - 1 blocks to concatenate files, where x is the number of files you're concatenating, whereas your little cat strategy requires that you read all of the files in their entirety, and then write them all to disk again in their entirety.

tl;dr: Your script sucks balls, Ubantoofag.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List