The Problem =========== Sorting in reverse order with short options didn't work. Also, sorting in unreversed order didn't work if the optional '+' was specified. Example: generate a list of processes sorted in order by pid. The following two commands should generate identical results, but didn't. ps auxOp ps auxO+p The Solution ============ Fix one file, proc/compare.c, as follows, to remove the offending line. Of course, you can just delete the offending line rather than comment it out as I've done here. mystic:/usr/src/redhat/BUILD/procps-1.2.9/proc $ diff -u compare_old.c compare.c --- compare_old.c Mon Dec 7 00:09:23 1998 +++ compare.c Sun Dec 6 23:44:37 1998 @@ -226,7 +226,15 @@ if (*opt == '-' || *opt == '+') { if (*opt == '-') next_dir = -1; + /* [prince] Sun Dec 6 23:38:15 PST 1998 + The commands "ps -auxOp" and "ps -auxO+p" should produce + identical results, but they don't because this function + incorrectly skips the character after the '-' or '+' in + short option lists. The '++opt' in the for () statement will + skip past the '-' or '+' anyway. + Old Code: opt++; + End Old Code */ continue; } for (i = 0; cmp[i].letter; i++)
Will be fixed in procps 1.2.10 or procps 2.0.x, whichever comes first.