[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17816: bug in cut, doesn't work normally with -f
From: |
Pádraig Brady |
Subject: |
bug#17816: bug in cut, doesn't work normally with -f |
Date: |
Fri, 20 Jun 2014 13:40:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
tag 17816 notabug
close 17816
stop
On 06/20/2014 09:23 AM, Jim Michaels wrote:
> 1.run firefox (am using linux mint 17 in virtual machine vbox) version 28.0
>
> 2.start xterm
> 3.ps -e | grep firefox | cut -f 2
> this should be the equivalent of ps -C firefox -o pid=
> actual:
> 2366 ? 00:02:53 firefox
> expected:
> 2366
cut defaults to tab field delimiters, which you would change with -d ' '
Note the _possible_ leading space are going to be problematic there so
you'd be better with something like:
ps - e | awk '/firefox/{print $1}'
Though your already presented command is probably most efficient/accurate:
ps -C firefox -o pid=
thanks,
Pádraig.