Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For your first question. I don't quite understand it fully, but I can see that you may be asking one of two things.</p> <ol> <li>You run things in a bash function (grep, awk, sed, etc) and because that function is long running, you are afraid that the utilities that you run are somehow remaining open.</li> <li>You are piping output from one command to another and are afraid that the command stays open after it has finished running.</li> </ol> <p>Neither 1 nor 2 will leave utility commands "open" after they are finished running. You could prove this by putting in </p> <pre><code>ps -ef | grep "command" | grep -v 'grep' </code></pre> <p>throughout the code to see just what is running by that name. or</p> <pre><code>ps -ef | grep "$$" | grep -v 'grep' </code></pre> <p>which will list out things that the current process has spawned.</p> <p><strong>UPDATE:</strong></p> <p>So, it seems that you are interested with how things run from a pipe. You can see this visually using the following command:</p> <pre><code>$ ls / | grep bin | grep bin | ps -ef | grep ls $ </code></pre> <p>compare that with something like:</p> <pre><code>$ find ~ | grep bin | ps -ef | grep find $ </code></pre> <p>Notice how the 'ls' is no longer in the process list, but the find is. You may have to add more "grep bin" commands into the pipeline to get the effect. Once the first command is finished outputting, it will close, even if the rest of the commands are not yet finished. The other commands will finish as they are done processing the output from the first (thus the pipe nature)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload