LP #1103705: pt-stalk top -bn1 causes an error on CentOS

Description

**Reported in Launchpad by Fernando Ipar last update 03-05-2013 15:49:34

At least on CentOS, the following command as included in pt-stalk:

top -bn1

Causes this error:

top: invalid option – 1

top -bn 1

(with a space in the middle) works as expected:

last pid: 10426; load avg: 0.01, 0.01, 0.00; up 12+22:07:54 21:40:17
371 processes: 1 running, 370 sleeping
CPU states: 0.0% user, 0.0% nice, 0.0% system, 100% idle, 0.0% iowait
Kernel: 166 ctxsw, 1048 intr
Memory: 18G used, 171G free, 338M buffers, 6403M cached
Swap: 3148K used, 1291M free, 1484K cached

PID USERNAME THR PRI NICE SIZE RES SHR STATE TIME CPU COMMAND
2147 root 1 10 -5 0K 0K 0K sleep 15:10 0.00% kswapd0
(...)

This is on:

CentOS release 5.6 (Final)

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 7:15 PM

**Comment from Launchpad by: Fernando Ipar on: 01-02-2013 21:09:09

Daniel,

I realized this happens with top 3.8 beta. It works fine on CentOS with top 3.2.7
You can just close, I'll patch the version used by this customer but I don't think this will affects others.

Thanks,
Fernando.

lpjirasync January 24, 2018 at 7:15 PM

**Comment from Launchpad by: Daniel Nichter on: 01-02-2013 18:26:55

I can't reproduce this:

[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS release 5.6 (Final)

[vagrant@localhost ~]$ cat foo.sh
#!/usr/bin/env bash

top -bn1

[vagrant@localhost ~]$ ./foo.sh
top - 11:26:20 up 7 min, 1 user, load average: 0.42, 0.35, 0.19
...

lpjirasync January 24, 2018 at 7:15 PM

**Comment from Launchpad by: Daniel Nichter on: 01-02-2013 18:20:07

It works on CentOS 5.8 for the record.

Not a Bug

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 7:15 PM
Updated February 4, 2018 at 12:02 AM
Resolved January 24, 2018 at 7:15 PM