In a shell (bash) How can I execute more than one command in a pipeline? -


I am trying to output a pipe through more than one command at a time in a box shell, After my knowledge, I am coming with it:

  awk '$ 13 ~ / type / {print $ 15}' filename.txt | (Wc -l || sort -u)  

I have to do the sequence of awk command to count and sort, how can I complete this? Even & amp; Amp; The command does not work, it executes the first command and then exits. I think this is my knowledge which is failing.

Thank you in advance.

If you want to send output to two different commands in a row, you have to do process subcategories Will happen.

Try this:

  awk $ 13 ~ / type / {print $ 15} 'filename.txt | T & gt; (Wc-l & gt; & amp; 2). Sort -u  

It outputs the sorted calculations on stderr and sorted on stdout. If you need line count on standout, you can do that by & gt; 2 & amp; Nbsp; , but then it will be passed on the sorted call and (most likely) it will be sorted upwards.

Edit: The correct explanation of what happens based on further testing.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -