Re: Finding the number of UIDs on unix - Unix

This is a discussion on Re: Finding the number of UIDs on unix - Unix ; frikk wrote: > Hey everyone, > (Sorry about the first message if it made it - i got cut off > early). I have a homework problem for my Operating Systems class. I > am supposed to use a command ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: Finding the number of UIDs on unix

  1. Re: Finding the number of UIDs on unix

    frikk wrote:

    > Hey everyone,
    > (Sorry about the first message if it made it - i got cut off
    > early). I have a homework problem for my Operating Systems class. I
    > am supposed to use a command such as "ps -aux" and return "N number of
    > users, M number of processes". How am I to go about doing this? I am
    > not very familiar with string parsing in c++, is this the only way? I
    > am talking about getting the output from "ps -aux" and parsing it to
    > retrieve the number of unique UIDs.


    Sounds like you're working on a UNIX system. As such, the newsgroup
    comp.unix.programmer is likely the best one for your question.

    Some hints along the way, ps is a user command. You'll need to find a
    way to capture the output that would normally be displayed by the
    shell. Perhaps something like popen() will right for you. They can help
    you with that there.

    I've gone ahead and crossposted this to comp.unix.programmer and set
    followups.

    Once you solve the problem of reading the output, you may have some
    programming questions that would be appropriate for this newsgroup.




    Brian

  2. Re: Finding the number of UIDs on unix

    Default User wrote:
    > frikk wrote:
    >
    >
    >>Hey everyone,
    >> (Sorry about the first message if it made it - i got cut off
    >>early). I have a homework problem for my Operating Systems class. I
    >>am supposed to use a command such as "ps -aux" and return "N number of
    >>users, M number of processes". How am I to go about doing this? I am
    >>not very familiar with string parsing in c++, is this the only way? I
    >>am talking about getting the output from "ps -aux" and parsing it to
    >>retrieve the number of unique UIDs.


    UID = User ID. Most unicies support 2^15 at least.

    To you want to restate your question ?

    >
    >
    > Sounds like you're working on a UNIX system. As such, the newsgroup
    > comp.unix.programmer is likely the best one for your question.
    >
    > Some hints along the way, ps is a user command. You'll need to find a
    > way to capture the output that would normally be displayed by the
    > shell. Perhaps something like popen() will right for you. They can help
    > you with that there.
    >
    > I've gone ahead and crossposted this to comp.unix.programmer and set
    > followups.
    >
    > Once you solve the problem of reading the output, you may have some
    > programming questions that would be appropriate for this newsgroup.
    >
    >
    >
    >
    > Brian


  3. Re: Finding the number of UIDs on unix

    Gianni Mariani wrote:
    > Default User wrote:
    >> frikk wrote:
    >>> I have a homework problem for my Operating Systems class. I
    >>> am supposed to use a command such as "ps -aux" and return "N number of
    >>> users, M number of processes". How am I to go about doing this? I am
    >>> not very familiar with string parsing in c++, is this the only way? I
    >>> am talking about getting the output from "ps -aux" and parsing it to
    >>> retrieve the number of unique UIDs.

    >
    > UID = User ID. Most unicies support 2^15 at least.
    >
    > To you want to restate your question ?


    It was pretty clear to me. They are concerned with the number of
    unique users (or UIDs) *that occur in the "ps -aux" output*.

    - Logan

+ Reply to Thread