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 / trenton g. twining
rm /tmp/$$; \
cat <file> \
| awk '{ for(i=1;i<=NF;i++){ printf("%s\n",$i); }; }' \
| sort -du \
| tee /tmp/$$; \
wc -w /tmp/$$ \
| sed -e "s=/tmp/$$=unique words="
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How do I start a shell script?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
What are the default permissions of a file when it is created?
Explain about sourcing commands?
How do we delete all blank lines in a file?
How to set an array in linux?
What is the command to find out users on the system?
How does ls command work?
is this growing field and what is average package in this?
wats the deinitions for shell utility and filter?
How to print all the arguments provided to the script?
What are the different commands available to check the disk usage?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
What is k shell?
How would you compare the strings in a shell script?