Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8286335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:43:07+00:00 2026-06-08T11:43:07+00:00

EDIT: I was chastised for being off subject. I edited out the file method

  • 0

EDIT: I was chastised for being off subject. I edited out the file method I used as an example and inserted C++ method from reality.

I am using C++ popen to issue a top command to get system information into my program, then into an xml file I can send off-system. I parse the output of top into various variables (painful bit of code) which get poled into the xml.

top very helpfully truncates it’s output’s width to fit on the screen even in batch mode where the output is redirected to a pipe.

popen( "top -b -n 1", "r" ); 

Works the same if the output is sent to a file.

Is there a way to tell top to show all its fields (in batch mode) even if they would fall off the right side of the screen?

NOTE: In my particular case, I ran my c++ top-parser on my workstation and got, say, 15 columns per PID. Then I changed to fewer characters in the line (bigger text). I completely lost the 15th field. Then I tried an in-between font and got all but one column of the 15th field back. That field ends in %st and I count on it saying that, not %s. Fixing this need to be generic, not based on individual cases.

Thanks for the help. I checked Google and it knows much about top, but just how to ask…..

NB: If you’d like to see this phenomenon, run top in your usual command window capturing the output to a file or pipe, then change the font in the window to have more characters on each line of the terminal window and rerun the command.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:43:09+00:00Added an answer on June 8, 2026 at 11:43 am

    Try setting COLUMNS environment variable:

    $ COLUMNS=10000 top
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Here is the edited control file (control.ascx): <%@ Control Language=C# AutoEventWireup=true CodeFile=Sale.ascx.cs Inherits=Enmasse.Modules.Demo_Enmasse.Sale
EDIT - I was able to fix this problem using code from 'Farray' with
EDIT: iam using ajax to load text in my content that is why onload
EDIT : It turned out that this can only be done through an external
Edit: an important piece might be that I'm calling a cfc method via ajax...
EDIT: void print(const int *v, const int size) { FILE *fpIn; fpIn = fopen(char-array.txt,
EDIT : Ok, I found out why. My getX and getY were overriding the
EDIT: I am using MS SQL server 2008 R2 as well. Well, on a
Edit: The question in one line: How to pass along context from a MenuItem
Edit: I think I figured out the solution, but I'm still interested to know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.