This morning, I posted M Tang`s funny experiment in feeding the Unix "yes" command to itself. Now, Seth David Schoen writes in to correct and expand upon the principles therein:
M. Tang`s business about the Unix command
yes `yes no`
is based on a bit of a misconception. The problem is _not_ about
combining one yes command with another yes command. Whenever you use
the backtick syntax `, like in a hypothetical command
the shell will first run the command bar (to completion) before it even
tries to start foo. The shell will also save the complete output of bar
in memory, and then present it as a set of command-line arguments to
In this case, the shell is trying to run the command "yes no" to
completion, saving its output in memory, before even starting the other
yes command. Of course, "yes no" never finishes, but it does use up
an arbitrarily large amount of memory.
To see that the problem is with the use of `yes` rather than with the
combination of two yes commands, just try
echo `yes no`
true `yes no`
Both of these forms have exactly the same memory-consumption problem as
the original command, and for exactly the same reason! So, Tang is
wrong to think that he is somehow creating a problem by combining
multiple yesses. The problem is in asking the shell to remember an
infinite amount of output.
As other people have mentioned in comments, the ` syntax is also not
piping. Piping is done with |, while ` refers to substitution. The
distinction is whether the output of program A appears as input to
program B (piping) or as command-line arguments to program B
(substitution). For example,
echo foo bar | wc -w
outputs the number 2 (that`s the total number of words in the text
"foo bar"), while
wc -w `echo foo bar`
counts the number of words in the files foo and bar.
Lindy West is one of those web-writers who’s done consistently great work over the years, whether it’s talking about boobs or talking about trolls, and so I expected to like her memoir Shrill: Notes From a Loud Woman, but I didn’t expect to find myself laughing aloud over and over, nor did I expect to end up crying — and having done both in great measure, now I can’t get that most excellent book out of my head.
The winner of Saturday’s College World Series game between the Coastal Carolina Chanticleers and the Texas Christian University Frogs was decidedly this kid.
Sometimes, publicity and editorial photos don’t quite match the tone and relationship of the show’s characters. Case in point: the plethora of X-Files shots in which Scully and Mulder look like a couple instead of coworkers.
The realm of web development is constantly evolving. New platforms, languages, and processes materialize all the time, so staying on top of all that innovation is a tall order.Whether you’re brushing up on new tricks, starting from scratch, or just looking to make your own website a little jazzier, Rob Percival’s new Complete Web Developer Course 2.0 (now […]
Folks used to rely on alarms to protect their home – and before that, the family dog. Now, anyone looking to guard their homes can choose from some high-tech options, including the Amaryllo iCamPRO FHD Home Security Camera (now just $219 in the Boing Boing Store).In fact, this 2015 CES “Best of Innovation” award-winner boasts so many features, it’s […]
If you want a quality vaping experience, it’s usually going to cost you. Vaporizers that deliver a fast, controlled burn will set you back up to $300, which is why the FEZ Vaporizer (now just $99) is an absolute steal.The FEZ dry herb pen does everything that more expensive models handle at a reduced price. It heats up […]