Project

General

Profile

Actions

Feature #110

open

ps should support "o" option

Added by Igor Pashev about 11 years ago. Updated over 9 years ago.

Status:
New
Priority:
Low
Assignee:
-
Start date:
2013-03-28
Due date:
% Done:

0%

Estimated time:

Description

bash completion for gdb fails, because ps does not support "o" option:

# gdb /lib/inet/ipmgmtd <TAB>ps: illegal option -- o
usage: ps [ -aceglnrSuUvwx ] [ -t term ] [ num ]

From Linux man page:

       o format
              Specify user-defined format.  Identical to -o and --format.

       -o format
              User-defined format.  format is a single argument in the form of a blank-separated or comma-separated list, which offers a way to specify
              individual output columns.  The recognized keywords are described in the STANDARD FORMAT SPECIFIERS section below.  Headers may be renamed
              (ps -o pid,ruser=RealUser -o comm=Command) as desired.  If all column headers are empty (ps -o pid= -o comm=) then the header line will
              not be output.  Column width will increase as needed for wide headers; this may be used to widen up columns such as WCHAN (ps -o pid,
              wchan=WIDE-WCHAN-COLUMN -o comm).  Explicit width control (ps opid,wchan:42,cmd) is offered too.  The behavior of ps -o pid=X,comm=Y
              varies with personality; output may be one column named "X,comm=Y" or two columns named "X" and "Y".  Use multiple -o options when in
              doubt.  Use the PS_FORMAT environment variable to specify a default as desired; DefSysV and DefBSD are macros that may be used to choose
              the default UNIX or BSD columns.


Related issues 1 (1 open0 closed)

Related to Dyson - Feature #95: Add forest view to psNew2013-02-14

Actions
Actions #1

Updated by Igor Pashev about 11 years ago

From /usr/share/bash-completion/completions/gdb:

    27      elif [[ $cword -eq 2 ]]; then
    28          COMPREPLY=( $( compgen -W "$( command ps axo comm,pid | \
    29              awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}' )" -- "$cur" ) )
Actions #2

Updated by Igor Pashev about 11 years ago

"-o" and "x" options in illumos ps cannot be combined.

Actions #3

Updated by Igor Pashev about 11 years ago

  • Subject changed from bash completion for gdb fails to ps should support "o" option
Actions #4

Updated by Igor Pashev almost 10 years ago

  • Tracker changed from Bug to Feature
Actions #5

Updated by Igor Pashev over 9 years ago

Better to follow POSIX and fix bash completion.
http://pubs.opengroup.org/onlinepubs/009604499/utilities/ps.html

Actions

Also available in: Atom PDF