Write a script to reverse the contents of a file.

 


Write a script to reverse the contents of a file.

 


Program =



#!/bin/bash

echo "Utsav gohel - 91900104011"

echo -n "Enter the file name:- "

read file

 

echo "$file" | awk '{a[i++]=$0}END{for(j=i-

1;j>=0; j--)

 print a[j];}' $file

 



Output =