unix classes Task 3 20 points Write a bash program sortsh to

unix classes

Task 3 (20 points)

Write a bash program sort.sh to sort a list by frequency in descending order. Your script should take in a filename as an argument. Here is an example:>hb117@uxb4:~$ cat names.txt

Hoang

Leo

Thuy

Henry

Hoang

Leo

Henry

Hoang

Leo

Henry

Hoang

Leo

Leo

hb117@uxb4:~$ ./sort.sh names.txt

Leo

Hoang

Henry

Thuy

Solution

To sort the content in ascending order.

Sort | uniq names.txt

To sort the content in descending order.

Sort - r | uniq names.txt

unix classes Task 3 (20 points) Write a bash program sort.sh to sort a list by frequency in descending order. Your script should take in a filename as an argume

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site