write a shell script that counts a number of unique word
contained in the file and print them in alphabetical order
line by line?
Answer Posted / arup
#!/bin/csh
# Here tr -s ' ' replaces all multiple ' ' with single ' '
# next pipe the above stream to replace each ' ' with '\n'
# next pipe the above stream to get a sorted list of words
# then pipe the unique words to outfile
tr -s ' ' < $1 | tr ' ' '\n' | sort | uniq > $1.out
| Is This Answer Correct ? | 20 Yes | 11 No |
Post New Answer View All Answers
How do I run a powershell script?
what is info area how many types?
Why is a script important?
Explain how you Automate your application using Shell scripting.
What is the use of echo in shell script?
What does $$ mean in shell script?
Which is better perl or shell scripting?
What is shell and terminal?
What is @echo off?
What is the difference between bash and shell?
What does $0 mean in shell script?
What's the difference between scripting and coding?
What are the 3 standard streams in linux?
Explain about gui scripting?
Calculate a real number calculation directly from the terminal and not any shell script.