Find the answer to your Linux question:
Results 1 to 7 of 7
i am getting following data and want to print only few System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER250 2x SPARC64 V System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER650 1-slot 6x ...
  1. #1
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114

    How to use awk/sed ???

    i am getting following data and want to print only few

    System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER250 2x SPARC64 V
    System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER650 1-slot 6x SPARC64 IV 675MHz
    System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER250 2x SPARC64 V
    System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER250 2x SPARC64 V
    System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER650 1-slot 4x SPARC64 V
    System Configuration: Sun Microsystems sun4us Fujitsu PRIMEPOWER 200 2x SPARC64 IV 702MHz
    System Configuration: Sun Microsystems sun4u Sun Enterprise 450 (3 X UltraSPARC-II 480MHz)

    i want output after the sun4us or sun4u

    any idea??
    Switched to Scripting

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    after 104 posts there's really no excuse for not trying.

  3. #3
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114


    Ha ha ha.....I have already tried but forgot to inform you...

    I am able to get the output.. but the problem is not in desired format
    Switched to Scripting

  4. #4
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114
    Ok.. is there any way to remove more than on field in awk

    I know about awk '{$1=""";print}' but how can I delte more than one fields??
    Switched to Scripting

  5. #5
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    Quote Originally Posted by jaigs_27 View Post
    Ok.. is there any way to remove more than on field in awk

    I know about awk '{$1=""";print}' but how can I delte more than one fields??
    if you can do $1="", you can do the rest of the fields

  6. #6
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114
    I have tried may options but I am not able to find right syntax..

    Any idea??
    Switched to Scripting

  7. #7
    Just Joined!
    Join Date
    Apr 2008
    Posts
    19
    apply this

    awk -F":" '{for(i=9; i<=NF; i++)print $i}'

Posting Permissions

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