title: output two commands on same line
body: <p>I have seen this question a few times, but the solutions I cannot get to work.</p>
  
  <p>I have the following command:</p>
  
  <pre><code>printf '%s\n' "${fa[@]}" | xargs -n 3 bash -c 'cat *-$2.ss | sed -n 11,1p ; echo $0 $1 $2;'
  </code></pre>
  
  <p>where</p>
  
  <pre><code>printf '%s\n' "${fa[@]}"
  
  O00238 115 03
  O00238 126 04
  </code></pre>
  
  <p>and <code>cat *-$2.ss</code> gives:</p>
  
  <pre><code>   1 D C   0.999  0.000  0.000
     2 L C   0.940  0.034  0.012
     3 H C   0.971  0.005  0.015
     4 P C   0.977  0.005  0.009
     5 T C   0.970  0.009  0.018
     6 L C   0.977  0.006  0.011
     7 P C   0.864  0.027  0.014
     8 P C   0.966  0.018  0.011
     9 L C   0.920  0.038  0.039
    10 K C   0.924  0.043  0.039
    11 D C   0.935  0.036  0.035
    12 R C   0.934  0.023  0.053
    13 D C   0.932  0.022  0.046
    14 F C   0.878  0.041  0.088
    15 V C   0.805  0.031  0.198
    16 D C   0.834  0.039  0.108
    17 G C   0.882  0.019  0.071
    18 P C   0.800  0.031  0.132
    19 I C   0.893  0.039  0.070
    20 H C   0.823  0.024  0.179
    21 H C   0.920  0.026  0.070
    22 R C   0.996  0.001  0.002
  </code></pre>
  
  <p>running the command then produces</p>
  
  <pre><code>  11 D C   0.935  0.036  0.035
  O00238 115 03
    11 K C   0.449  0.252  0.270
  O00238 126 04
  </code></pre>
  
  <p>Even lines are the output of <code>sed -n 11,1p</code>, odd lines the output of echo <code>$0 $1 $2</code></p>
  
  <p>How do I pair the output on the same line i.e.</p>
  
  <pre><code>  11 D C   0.935  0.036  0.035 O00238 115 03
    11 K C   0.449  0.252  0.270 O00238 126 04
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>printf '%s\n' "${fa[@]}" | xargs -n 3 bash -c 'cat *-$2.ss | {sed -n 11,1p ; echo $0 $1 $2;} | tr "\n" " "'
  </code></pre>
  
  <p>as suggested here: <a href="https://stackoverflow.com/questions/20871534/concatenate-in-bash-the-output-of-two-commands-without-newline-character">Concatenate in bash the output of two commands without newline character</a></p>
  
  <p>however I get</p>
  
  <pre><code>O00238: -c: line 0: syntax error near unexpected token `}'
  O00238: -c: line 0: `cat *-$2.ss | {sed -n 11,1p ; echo $0 $1 $2;} | tr "\n" " "'
  </code></pre>
  
  <p>What is the problem?</p>