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 debug a shell script?
write a shell script to check the failed jobs?
What does $$ mean in shell script?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
What is a boot block?
How will you print the login names of all users on a system?
Explain about the slow execution speed of shells?
What is path in shell script?
Print the 10th line without using tail and head command.
is this growing field and what is average package in this?
What is the use of "$?" Sign in shell script?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
What is shell scripting used for?
Why should we use shell scripts?
Explain about login shell?