Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    chris@angua:~$ echo pid=87 serial=6213 audsid=1161813 user: 102/AKSHAY | cut -d / -f 2
    Cut splits the line on the '/' and prints the second field.

    Let us know how you get on,

    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