Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Unanswered: Basic shell scripting.

    Hi, I'm new to shell scripting and i'm trying to write code which contains exactly three pipe commands (e.g. A | B | C) to return a list of the users currently logged into the system. I've been told three useful commands i could use are who, grep and cut. I know 'who' return a list of the users logged in with some information about them and a combination of the other two might be able to extract the exact user name. Can anyone help me out? Thanks.

  2. #2
    Join Date
    Feb 2012
    Posts
    2
    btw im using ubuntu 11.10

  3. #3
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    I don't know why you will need grep.
    What have you done so far?

  4. #4
    Join Date
    Jun 2012
    Posts
    1
    who | cut -d " " -f1 | grep <user name that u need to display>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •