Write a script to display all words of a file in ascending order.

echo -n “Enter File Name: ”

read file

if [ -f $file ]

then

for i in cat $file

do

echo $i >> t

done

else

echo “File Does Not Exist…”

fi

sort t

rm t

 

OUTPUT::

Enter File Name: abc

hello

hi

how

mca

r

student

u?

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.