Write a linux shell program to perform Read 10 names from a file and sort in Ascending order Descending order

Read 10 names from a file and sort in  Ascending order and Descending order

Code:

clear 
echo --------------------------------------------- 
echo '\t Ascending and Descending Order' 
echo --------------------------------------------- 
echo Enter the file name containing names 
read name 
sort -g $name > name_asce 
sort -g -r $name > name_desc 
echo The Ascending order names are 
cat name_asce 
echo The Descending order names are 
cat name_desc

Output:

No comments

Powered by Blogger.