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 8760107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:57:47+00:00 2026-06-13T14:57:47+00:00

I need to know, at any given time, how many unique users are connected

  • 0

I need to know, at any given time, how many unique users are connected to a redhat server. The following commands accomplish this easily:

who | awk '{ print $1 }' | sort -ud | wc -l

However, I need this functionality within a perl script, so that a network monitoring utility can run it at scheduled times, and track the number of unique connections over time.

While I would like to learn scripting with perl, I have no idea how long it would take to learn to script this myself, and I don’t have enough time to dedicate to learning perl at the moment. Any assistance in creating a perl script with the above functionality would be greatly appreciated.

  • 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-13T14:57:49+00:00Added an answer on June 13, 2026 at 2:57 pm

    To easily wrap this into a perl script, do this:

    #!/usr/bin/perl
    
    $result = `who | awk '{ print \$1 }' | sort -ud | wc -l`;
    print $result;
    

    Be sure to escape $1, or else it will be interpolated by Perl.

    What you do with $result after that depends on what exactly you’re trying to do. You could average it over time, store every result in a file or database…it really depends on what you want to do with the result once you have it. If you’d care to provide more details I can offer some advice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know if any JSON implementations can handle sparse arrays to my
Hey, I'm really stuck with my project here... I need to know when any
I need to know if there's any way (or another distinct approach) to an
I need to know how to use a Dialog class in J2me. Any example.
I know there has to be a way: I need help getting any hot
Need to know this so that i could send DTMF and that is going
I'm having this problem right now: given a month and a year, I'd need
I need to allow users to choose/input authors associated with a given publication and
Need to know which event triggered after text selection done in Apple iPad. It
I need to know how to change background of expanded list item when it

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.