On Fri, Dec 13, 2013 at 01:15:39AM -0500, Ted Unangst wrote:
> I would like to be able to ask for an infinite number of updates in
> top even in noninteractive mode. top -d 900000000 doesn't cut it.

Umm... `top -bd inf' works for me.

See atoiwi() in utils.c.

Cheers,
--patrick


> Allow -1 to specify infinity.
> 
> Index: top.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/top/top.c,v
> retrieving revision 1.80
> diff -u -p -r1.80 top.c
> --- top.c     14 Jan 2013 21:33:59 -0000      1.80
> +++ top.c     13 Dec 2013 06:09:17 -0000
> @@ -200,7 +200,10 @@ parseargs(int ac, char **av)
>                       break;
>  
>               case 'd':       /* number of displays to show */
> -                     if ((i = atoiwi(optarg)) != Invalid && i != 0) {
> +                     if (strcmp(optarg, "-1") == 0) {
> +                             displays = -1;
> +                             break;
> +                     } else if ((i = atoiwi(optarg)) != Invalid && i != 0) {
>                               displays = i;
>                               if (displays == 1)
>                                       interactive = No;
> 
> 

Reply via email to