I'm trying to write a utility script errpipe with a simple api that runs stderr through a filter. At first I tried to implement it using bash's process substitution feature.  #!/bin/bash  com="$1" errpipe="$2"  $com 2&gt; &gt;(1&gt;&amp;2 $errpipe)   The problem with this is that the output looks strange when com does not exist.  If I type  sh-3.2$ ./errpipe foo cat   I get  sh-3.2$ ./errpipe foo cat sh-3.2$ ./errpipe: line 6: foo: command not found @   with @ representing the cursor. In other words, the shell prompt was printed too early. I suspect this is because the main shell script is not waiting for the process substitution process to complete. Throwing in a wait at the end of the script doesn't seem to fix the problem.  I'm open to a solution that uses bash, ksh, zsh or possibly some crazy awk feature. I think I know how to wire this together using something like C or Perl that exposes a richer API for manipulating processes and file descriptors, but I'd like to avoid using it unless there isn't an alternative.    One solution that "almost works" is to use the fact that $$ is not changed when the shell forks and to lob a signal at the parent when errpipe is finished.  #!/bin/bash  com="$1" errpipe="$2"  $com 2&gt; &gt;(1&gt;&amp;2 $errpipe; kill -SIGUSR1 $$)  while true; do     sleep 60 done   This fixes the original problem but a) is ugly and b) prints User defined signal 1: 30 before terminating even if I have a signal handler for SIGUSR1 and c) will loop forever if the process responsible for sending a SIGUSR to the parent dies somehow.
The   echo one; echo two &gt; &gt;(cat); echo three;    command gives unexpected output.  I read this:  and many other articles about process substitution on the internet, but don't understand why it behaves this way.  Expected output:  one two three   Real output:  prompt$ echo one; echo two &gt; &gt;(cat); echo three; one three prompt$ two   Also, this two commands should be equivalent from my point of view, but they don't:  ##### first command - the pipe is used. prompt$ seq 1 5 | cat 1 2 3 4 5 ##### second command - the process substitution and redirection are used. prompt$ seq 1 5 &gt; &gt;(cat) prompt$ 1 2 3 4 5   Why I think, they should be the same? Because, both connects the seq output to the cat input through the anonymous pipe - .  Question: Why it behaves this way? Where is my error? The comprehensive answer is desired (with explanation of how the bash does it under the hood).
I have seen in American Sniper, Dead-7 and Carrie that when someone is killed, they are laying on the ground with blood leaking out of their back or somewhere else on the body.  The puddle continuously grows with few signs of slowing down. This is obviously not CGI because it is a real liquid (may not be real blood as that would spark an emergency in real life).   I have seen in American Sniper that when the protagonist kills yet another enemy, they are filmed hitting the ground and blood starts pooling around their body.  In Carrie: In the dance room where Carrie sets her powers loose and kills a lot of teenagers in the process, there are a few that hit the ground with blood pooling under their bodies. Sometimes they would be on their side with blood coming out.  In Dead 7: Kimono and the other six killed lots of zombies. Some of the six were killed in the process as well before they came to Apocalypta to kill her. They were filmed hitting the ground dead with blood pooling around them.  I am not sure how they film this as they are wearing thin shirts for these scenes, and not only that, but the characters also have blood (obviously fake) only just dripping out of the side of their mouths (an indicator they have a ruptured and wounded stomach or lung (in this case the blood would be pink and frothy).  What is the film technique that allows this to happen? How to Straighten Curved UVs into Straight Belt Showing the actual 3D model of a curving ramp.  Shows the UVs of that model that blender did automatically. Shows the UV image that I need.   I am going put a road texture on it., but round faces are not helping me at all. All I need is straight belt kind of UV. Seemingly random reputation gain of 1 Generate dynamic XY coordinate labels for dataframe corners in ArcGIS layout I need to label the four corners of a dataframe as shown in the image. Can this be done with dynamic text scripts? Making all row sums and column sums non-negative by a sequence of moves How old is SpongeBob? How old is SpongeBob? I don't mean how old is the series, I mean what is SpongeBob's age if he were a real person. I ask because his age seems to be ambiguous in the show.   He has a full-time job He has his own house He is always referred to as a kid (especially in the movie) He acts childish and immature In one episode, he was pretending to be an adult/grown-up Cannot dismiss scrollbar in code box, blocks view This question is a duplicate of  (but this question can't be marked as a duplicate because that question is on meta.stackoverflow.com, and this question is on meta.stackexchange.com).  I'm seeing a bug on stackoverflow.com. I'm not sure if the culprit is Stack Overflow, Google Chrome, or macOS.  (Below I refer to a "code box". By that I mean some text that begins with 4 spaces when editing a question or answer.)  When I hover over a code box that contains one long line of code, a horizontal scrollbar appears. When I stop hovering over the code box, very frequently (maybe 3 out of 4 times) the scrollbar does not disappear. Clicking elsewhere on the page also does not dismiss the scrollbar. The only way to dismiss it is to refresh the page.  ...After experimenting more, it appears to always happen if I enter the box from below, but not always when I enter from above. It seems to be triggered by hovering over the lower half of the box.  Also if I enter from the top and scroll to the right, then until I refresh the page again that scrollbox will behave normally (only show a scrollbar when scrolling, and disappear after). In that case the scrollbar also has a different appearance, being much less tall (maybe a quarter of the height of the code box rather than half as tall).  Further, if I get a box and scrollbar into that functional state and then hover over the lower part of the box for a bit, then sometimes eventually it will break and stay broken until refresh again.  And in any case hovering over the lower part of the box causes the scrollbar to get taller.  Here is a screenshot of the issue:        Google Chrome 71.0.3578.98 (Official Build) (64-bit)  macOS High Sierra 10.13.6  Here is a code box that repros the issue for me:  fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo   Here is another:  foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo I get the following error in my log files every time I try to upload a large file.  a client request body is buffered to a temporary file /var/lib/nginx/body/0000000001   Although the file uploads successfully, I always get the above error.  I increased the client_body_buffer_size to 1000m which is what I expect the largest file uploaded to be. However, this is was just a guess and although I don't get that error anymore I am wondering if this is an appropriate value to set for the client_body_buffer_size?  I would appreciate it if anyone can shed some light on this directive and how it should be used. is a one-by-one-matrix just a number (scalar)? I was wondering. Clearly, we cannot multiply a (1x1)-matrix with a (4x3)-matrix; However, we can multiply a scalar with a matrix. This suggests a difference.  On the other hand, I was, for example, in an econometrics lecture today, where we had for a (Tx1)-vector $\underline{û}=\left( \begin{array}{c} û_1\\ \vdots\\ û_T\end{array}\right)$:     $S_{ûû}:= \sum_{i=1}^T û_i^2$ shall be minimized. We see see that   $S_{ûû}=\underline{û}^T\underline{û}$.   Well, formally, shouldn't it be $(S_{ûû})=\underline{û}^T\underline{û}$ or $S_{ûû}=\det(\underline{û}^T\underline{û})$, to ensure that we stay in the space of matrices and not suddenly go to the space of scalars? So here, the professor (physicist) not only treats $\underline{û}^T\underline{û}$ like a scalar, but also calls it a scalar. Is this formally legit or a wrong simplification (though it does not seem to have any impact, and surely makes life easier)? Error-Handling in Swift-Language I'm trying to simulate a media key press using a custom shortcut.  So far, I've been able to achieve the simulation I need using the command:  xdotool key XF86AudioPlay   It works perfectly, it pauses or starts the music player every time it is run.  The problem comes when trying to run it as a shortcut.  First I tried to run an alias with a custom shortcut, but it did not work.  As explained on :     The commands run by keyboard bindings are not parsed via a shell. Your best bet is to create a directory bin in your homedir.   Next I created the suggested script and named it simplay:  #!/bin/sh xdotool key XF86AudioPlay   It is located inside a bin folder which is part of the PATH, this works fine and can be run from any location.  When trying to create the Custom Shortcut, I was unable to get it to execute, the configuration is the following:  Name: test Command: simplay  Shortcut: Ctrl+Alt+R   After searching a bit more I found another way to execute the shortcut:  gnome-terminal -e simplay   I tried it on a terminal and noticed that when executing it it would rapidly open a new terminal window, execute the child process, pausing the music and immediately close the window.  I changed the command on the shortcut and when hitting it I noticed the same behavior opening a terminal and immediately being closed but this time the child process did not pause the music, which makes me think that the script has been called on all my previous attempts but it is somehow not being able to execute.  How can I solve this problem according to your knowledge? find a $\int_{x}^{g(x)} f(t)\,dt = 1$ Is $\int_a^b f(x) dx = \int_{f(a)}^{f(b)} f^{-1}(x) dx$? Separate long math text under sum symbol into different lines? Why do my LED lights stay on, even when the switch is off? I have two LED lamps in my corridor, and when I switch them off, they keep emitting light (not very strong, but it's annoying at night).  What can it be? How can I fix it? Your last flag was declined - no it wasn't Add new alias to Gmail without SMTP (forwarding-only address) Prevent browser caching of AJAX call result It looks like if I load dynamic content using $.get(), the result is cached in browser.  Adding some random string in QueryString seems to solve this issue (I use new Date().toString()), but this feels like a hack.   Is there any other way to achieve this? Or, if unique string is the only way to achieve this, any suggestions other than new Date()? Eclipse: How to build an executable jar with external jar? I am trying to build an executable jar program which depends on external jar downloaded. In my project, I included them in the build path and can be run and debug within eclipse.  When I tried to export it to a jar, I can run the program but I can't when I try to press a button which includes function calls and classes from the external jar. I have edited the environment variables (Windows XP) CLASSPATH to include paths of all the external jar, but it doesn't work.  A point to note is that I got compile warnings while exporting my executable jar, but it doesn't show up any description about the warnings.  Would someone kindly provide a thorough guide on how to include an external jar program using eclipse? Correlations with unordered categorical variables