Live data from Hacker News

The Mighty Named Pipe

vincebuffalo.com

21–30 of 99 posts

Re: The Mighty Named Pipe

#21

Does anyone have a working link to Gary Bernhardt's The Unix Chainsaw, as mentioned in the article?

That's the kind of video I might have downloaded. At least I hope so. Gonna check my backups.

update 1 : found it, time to upload.

Re: The Mighty Named Pipe

#22
post #3

I've used *nix for ~15 years and never used a named pipe or process substitution before. Great to know about!

Named pipes have been rare for me, but simple process substitution is every day.

Very often I do something like this in quick succession. Command line editing makes this trivial.

  $ find . -name "*blarg*.cpp"
  # Some output that looks like what I'm looking for.
  
  # Run the same find again in a process, and grep for something.
  $ grep -i "blooey" $(find . -name "*blarg*.cpp")
  
  # Yep, those are the files I'm looking for, so dig in.
  # Note the additional -l in grep, and the nested processes.
  $ vim $(grep -il "blooey" $(find . -name "*blarg*.cpp"))

Re: The Mighty Named Pipe

#23
post #5

Nice article. Really easy to follow introduction. I only discovered process substitution a few months ago but it's already become a frequently used tool in my kit. One thing that I find a little annoying about unix commands sometimes is how hard it can be to google for them. ' Unless you know to look for "Process Substitution" it can be hard to find information on these things. And that's once you even know these thi…

For this in particular, try the Advanced Bash Scripting doc, http://www.tldp.org/LDP/abs/html/

There's a bunch of interesting constructs there. Most of them also apply to improved shells such as zsh, though some are just pointless there.

Re: The Mighty Named Pipe

#24
post #22
post #3

I've used *nix for ~15 years and never used a named pipe or process substitution before. Great to know about!

Named pipes have been rare for me, but simple process substitution is every day. Very often I do something like this in quick succession. Command line editing makes this trivial. $ find . -name "*blarg*.cpp" # Some output that looks like what I'm looking for. # Run the same find again in a process, and grep for something. $ grep -i "blooey" $(find . -name "*blarg*.cpp") # Yep, those are the files I'm looking for, so…

That's actually command substitution, not process substitution :)

Re: The Mighty Named Pipe

#25
post #22
post #3

I've used *nix for ~15 years and never used a named pipe or process substitution before. Great to know about!

Named pipes have been rare for me, but simple process substitution is every day. Very often I do something like this in quick succession. Command line editing makes this trivial. $ find . -name "*blarg*.cpp" # Some output that looks like what I'm looking for. # Run the same find again in a process, and grep for something. $ grep -i "blooey" $(find . -name "*blarg*.cpp") # Yep, those are the files I'm looking for, so…

You could just use a pipe here though, which would also make it more easy to read. e.g.:

    $ find . -name '*blarg*.cpp' | grep -li blooey | vi -

Re: The Mighty Named Pipe

#26
post #22

Earlier quoted context omitted.

Named pipes have been rare for me, but simple process substitution is every day. Very often I do something like this in quick succession. Command line editing makes this trivial. $ find . -name "*blarg*.cpp" # Some output that looks like what I'm looking for. # Run the same find again in a process, and grep for something. $ grep -i "blooey" $(find . -name "*blarg*.cpp") # Yep, those are the files I'm looking for, so…

You could just use a pipe here though, which would also make it more easy to read. e.g.: $ find . -name '*blarg*.cpp' | grep -li blooey | vi -

Your version searches for blooey in the filenames, not in the files themselves.

Re: The Mighty Named Pipe

#27
post #5

Nice article. Really easy to follow introduction. I only discovered process substitution a few months ago but it's already become a frequently used tool in my kit. One thing that I find a little annoying about unix commands sometimes is how hard it can be to google for them. ' Unless you know to look for "Process Substitution" it can be hard to find information on these things. And that's once you even know these thi…

A bit OT but I don't understand why Google doesn't supply a way to do strict searches where everything you input is interpreted literally.

Re: The Mighty Named Pipe

#28

Does anyone have a working link to Gary Bernhardt's The Unix Chainsaw, as mentioned in the article?

That's the kind of video I might have downloaded. At least I hope so. Gonna check my backups. update 1 : found it, time to upload.

Thank you kind sir. Waiting for a link

Re: The Mighty Named Pipe

#29
post #22
post #3

I've used *nix for ~15 years and never used a named pipe or process substitution before. Great to know about!

Named pipes have been rare for me, but simple process substitution is every day. Very often I do something like this in quick succession. Command line editing makes this trivial. $ find . -name "*blarg*.cpp" # Some output that looks like what I'm looking for. # Run the same find again in a process, and grep for something. $ grep -i "blooey" $(find . -name "*blarg*.cpp") # Yep, those are the files I'm looking for, so…

[deleted]

Re: The Mighty Named Pipe

#30
post #27
post #5

Nice article. Really easy to follow introduction. I only discovered process substitution a few months ago but it's already become a frequently used tool in my kit. One thing that I find a little annoying about unix commands sometimes is how hard it can be to google for them. ' Unless you know to look for "Process Substitution" it can be hard to find information on these things. And that's once you even know these thi…

A bit OT but I don't understand why Google doesn't supply a way to do strict searches where everything you input is interpreted literally.

They have, I have complained loudly about this[1], never hard anything back (this is SOP I understand), but I have seen improvements last year.

Double quotes around part of a query means make sure this part is actually matched in the index. (I think they still annoy me be including sites that are linked to using this phrase[2], but that is understandable.)

Then there is the "verbatim" setting that you can activate under search tools > "All results" dropdown.

[1]:And the reason they annoyed me was because they would still fuzz my queries despite me doublequoting and choosing verbatim.

[2]: To verify this you could open the cached version and on top of the page you'd see something along the lines of: "the following terms exist only in links pointing to this page."

Post reply on HN