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
What does chmod do?
What does $@ mean bash?
Why should we use shell scripts?
How are shells born?
What exactly is a shell?
How can you find out how long the system has been running?
How to redirect both standard output and standard error to the same location?
Why are there shells on the beach?
What is shell chemistry?
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
Explore about environment variables?
what is info area how many types?
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.
How do I stop script errors?
What is $1 in shell scripting?