GNU bug report logs - #17816
bug in cut, doesn't work normally with -f

Previous Next

Package: coreutils;

Reported by: Jim Michaels <jmichae3 <at> yahoo.com>

Date: Fri, 20 Jun 2014 08:24:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 17816 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Michaels <jmichae3 <at> yahoo.com>
Cc: 17816 <at> debbugs.gnu.org
Subject: Re: bug#17816: bug in cut, doesn't work normally with -f
Date: Fri, 20 Jun 2014 13:40:32 +0100
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.





This bug report was last modified 10 years and 343 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.