Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin)

From: Cyrille Lefevre (root_at_gits.dyndns.org)
Date: 03/27/04

  • Next message: Poul-Henning Kamp: "Re: Where should devctl notifications be sent from?"
    To: "Albert Cahalan" <albert@users.sourceforge.net>
    Date: Sat, 27 Mar 2004 09:56:49 +0100
    
    

    "Albert Cahalan" <albert@users.sourceforge.net> wrote:
    > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote:
    > > "Albert Cahalan" <albert@users.sourceforge.net> wrote:
    > > > Cyrille Lefevre writes:
    [snip]
    > Oh, OK. It's kind of weird, since "ps -o pid,help,comm"
    > would seem to be something for 3 columns, but suit yourself.
    > I didn't bother, thinking "ps L" and "man ps" would do.
    >
    > I suppose the -X has to be the first option...?

    not necesserally, but usually :)
    I prefer the env var use.

    [snip]
    > Eh, "-ww" plus turning on argument display, right?
    > It's the opposite of BSD "c" AFAIK, and implied by "-f".

    not exactly, -f is a sort of -w, and -fx is a true -ww.
    another solution would be to double -f, say -ff, but
    nobody seems to implement that AFAIK.

    > > > BTW, I have a regression test suite that you might find useful.
    > >
    > > yes, of course. for instance, I'm trying to resolve header's naming,
    > > say user is USER or UID depending of the personality... etc.
    >
    > First of all, perfection is the enemy of good.

    I know, but I'm like that... perfectionist.

    > Part of my solution:
    > {"uid_hack", "UID", pr_euser, sr_nop, 8, USR, XXX, ET|USER},

    well, for instacance, I keyword aliases w/ personalities :

            ALIAS("user", "UID", "user", _SUSV3|_HPUX|_SOLARIS),
            SIZE("user", "USER", LJUST, uname, s_uname, USER,
                _BSD44|_FREE|_NET|_OPEN|_SUNOS|_IRIX|_TRU64),

    but that part is not completed and has not been validated, yet.
    ALIAS and SIZE (aka CALL w/ DSIZ) are macros which greatly
    improve the readability of the keywords array.

    > > > > -M from irix
    > > >
    > > > Do you have documentation or examples for this?
    > >
    > > irix -M is freebsd -Z, so, simple to implement :)
    >
    > It's never that simple.

    reading the manual page, yes. but I have no testing machine for that.

    [snip]
    > The bsd43reno/bsd44/freebsd distinction is interesting.
    > I hope you'll add "linux" to your list. :-)

    at last, since the linux manual page is really poor and the code ir really
    unreadable.

    > I was hoping that your syntax covered fall-back choices.

    please, explain your mind by fall-back choices ?
    for instance, -X unknown gives up w/ an error message
    and the list of choices.

    > Then I could ask for "unixware" as a first choice, and
    > for "posix" if "unixware" is unknown.

    unixware could be an alias on plain susv3.
    in my mind, posix just say posix syntax.

    > > possible switches
    > > bsd : bsd syntax
    > > extended : allow enhanced options and keywords.
    > > pedantic : be strict about the syntax (-p pid instead of -p pidlist)
    >
    > It's normal to allow a list. The list is either the remaining
    > part of the current argument ("ps -p42,45,16") or the next one.
    > I ban crud like "ps -p 42,,7" and "ps -p ,42,91,".

    no problem for that, empty values are ignored.

    > > > The name isn't so good. Tru64 uses CMD_ENV for this, affecting
    > > > more than just ps. I made PS_PERSONALITY take priority so that
    > > > you could change ps behavior without changing other behaviors.
    > >
    > > PS_PERSONALITY is the name that linux uses. this may conflict in
    > > .profiles since the syntax is different. to complete what you say :
    > > irix uses _XPG=1 and hpux uses UNIX95=1
    > > of course, all of them could be tested for more and more compatobility :)
    >
    > Heh. I do in fact check _XPG=1 and UNIX95=1.
    >
    > > > You forgot the "-F" from DYNIX/ptx. It's really nice.
    > >
    > > any pointer ?
    >
    > It's a friendly format, kind of along the lines of BSD "u".
    >
    > $ ps -F
    > UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
    > albert 21666 21665 1 770 1672 0 19:11 pts/14 00:00:00 bash
    > albert 21674 21666 0 744 880 0 19:11 pts/14 00:00:00 ps -F

    well, a kind of solaris ps -clPy but shorter :)
       S UID PID PPID CLS PSR PRI RSS SZ WCHAN TTY TIME CMD

    Cyrille Lefevre.

    -- 
    home: mailto:cyrille.lefevre@laposte.net
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Poul-Henning Kamp: "Re: Where should devctl notifications be sent from?"

    Relevant Pages

    • Re: Why are my posts
      ... for a 10/6d Jetex 50 - less than half the price of a piston motor. ... 10/6d would have been the best part of 3 months' pocket money when I was ... You could go into a sweet shop and get change from 1d, mind you. ...
      (uk.people.support.depression)
    • Re: Why are my posts
      ... control surfaces and ballast is a lot simpler. ... need patched wings after a barbed wire landing one day, as I recall. ... it's a lesson that's useful to bear in mind - lets you ...
      (uk.people.support.depression)
    • Re: Why are my posts
      ... You could go into a sweet shop and get change from 1d, mind you. ... That kind of German ... Count von Stauffenburg was too badly handicapped by his war wounds to ...
      (uk.people.support.depression)
    • Re: Regroup.
      ... regarding your views on the notion of physicality. ... >> everything is an abstraction and a free invention of the human mind. ...
      (sci.physics.relativity)
    • Re: specialization momentum
      ... much snip ... listen to an effort by you to communicate something outside the box ... For your sake, even if you have shut your mind to my mind, before ... Oh, what about the supervisor. ...
      (sci.bio.evolution)