title: Bash generic "ps aux" process by strict name
body: <p>I'm trying to have a ps aux command listing only real ssh-agent process. I've noticed that on some distros, I have unwanted process showing up, like command colors and such. I need to do this because I need to ensure the real ssh-agent process is running in a script (don't bother, I already have a loop for it...).</p>
  
  <p>So I figured out I need to use something like that in my test routine:</p>
  
  <pre><code>#!/bin/bash
  ps aux | grep ssh-agent | grep -v grep | awk '{print $12}'
  </code></pre>
  
  <p><strong>My question is: Would the awk $12 work on any unix/linux env using bash with any bash versions?</strong></p>
  
  <p>Also, if I remove "grep -v grep" and do this:</p>
  
  <pre><code>ps aux | grep ssh-agent | awk '{print $12}'
  </code></pre>
  
  <p>output is:</p>
  
  <pre><code>ssh-agent
  ssh-agent
  </code></pre>
  
  <p>Now:</p>
  
  <pre><code>ps aux | grep ssh-agent
  </code></pre>
  
  <p>output is:</p>
  
  <pre><code>foo 18153478  0.0  0.0  536  844      - A      Apr 25  0:00 ssh-agent
  foo 31260886  0.0  0.0  252  264  pts/0 A    22:38:41  0:00 grep ssh-agent
  </code></pre>
  
  <p>That means, the space between "grep ssh-agent" is interpreted as a delimiter by the awk command. Aynthing possible to overcome that? I already tried using tab delimiter but that's not it. It seems the delimiter of the command are simple "space" characters. Is it possible to enforce tab delimiters for "ps" command output?</p>
  
  <p>Any idea?</p>