Fetch the data from a file and display data into another file in reverse order.

ls

echo -e “Enter the file name::\c”

read str

 

if [ -f $str ]

then

 

cat $str > temp

cat -n temp | sort -nr | cut -c 8-

fi

 

OUTPUT::

 

Enter the file name::marksheet

 

3       Nirva            67      67      34

45      Mayur          56      67      56

2       An                 78      67      90

1       rinka             67      45      34

rno     name           m1      m2      m3

 

 

Share

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.