• AMDOCS:Power of UNIX

    It was asked in interview to write a program in C to calculate the frequency of each word in a given file.
    It is a difficult program  and requires 10k LOC. but you can do it in unix with the help of just 4 to 5 commands.
    That is called the power of unix. sorting , Pipelining and unique can do it all for you


    Solution is :

    tr ' ' '\n' < copy.txt |sort |uniq -c | sort -n -r

2 comments:

  1. aman1991 said...

    how we do this in windows......

  2. Unknown said...

    Not possible. Thats why Unix is Unix and used by professionals.
    Windows is good for graphics only :P :P

Post a Comment