Find the answer to your Linux question:
Results 1 to 4 of 4
I'm trying to produce a alphabetic, non-repetitive list of all System service calls in all c files located in a folder. Here's what I got so far. grep -ow '[A-Za-z]*SYS[$][A-Za-z]*' ...
  1. #1
    Just Joined!
    Join Date
    Mar 2011
    Posts
    2

    Alphabetic, non-repetitive list

    I'm trying to produce a alphabetic, non-repetitive list of all System service calls in all c files located in a folder. Here's what I got so far.

    grep -ow '[A-Za-z]*SYS[$][A-Za-z]*' *.c | sort

    Which produces all system service calls in alphabetic order I just need to find out how to make it non-repetitive.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Google: linux man uniq

  3. #3
    Just Joined!
    Join Date
    Mar 2011
    Posts
    2
    Thanks exactly what I was looking for

  4. #4
    Linux Newbie
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    243
    Quote Originally Posted by Jon51587 View Post
    I'm trying to produce a alphabetic, non-repetitive list of all System service calls in all c files located in a folder. Here's what I got so far.

    grep -ow '[A-Za-z]*SYS[$][A-Za-z]*' *.c | sort

    Which produces all system service calls in alphabetic order I just need to find out how to make it non-repetitive.
    Try "sort -u". The "-u" flag eliminates duplicate lines as well as sorting the list alphabetically.

Posting Permissions

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