Is there a way to specify multiple spaces as a field delimiter with the cut command (something like a " "+ regex)? For example, what field delimiter I should specify for the following string to reach value 3744?
$ps axu | grep jboss jboss 2574 0.0 0.0 3744 1092 ? S Aug17 0:00 /bin/sh /usr/java/jboss/bin/run.sh -c example.com -b 0.0.0.0 cut -d' ' is not what I want, because it's only for a single space. awk is not what I am looking for either, so how to do this with cut?
tras shown here: stackoverflow.com/a/4483833/168143ps+grepyou could usepgrepwhich is available in most modern distros. It will return the result exactly in the form you need it.hckas a drop incutreplacement. By default it splits on all whitespace, like awk. And the key feature is that you can specify a delimiter with-dlike cut, but unlike cut that delimiter can be a regex! No more needing to pre-process withtr -sbefore passing to cut. You can findhckhere: github.com/sstadick/hck