Find the answer to your Linux question:
Results 1 to 2 of 2
I have a script that display some text like pid=87 serial=6213 audsid=1161813 user: 102/AKSHAY Can any one please help me. I want to grep , cut and display only the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    18

    Question How to GREP, cut and display a single word


    I have a script that display some text like

    pid=87 serial=6213 audsid=1161813 user: 102/AKSHAY

    Can any one please help me. I want to grep , cut and display only the word "AKSHAY" on prompt not the whole line.

    Please help me out of this

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    678
    Code:
    chris@angua:~$ echo pid=87 serial=6213 audsid=1161813 user: 102/AKSHAY | cut -d / -f 2
    AKSHAY
    Cut splits the line on the '/' and prints the second field.

    Let us know how you get on,

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

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