Permalink
Browse files

Prog to reverse a file

  • Loading branch information...
1 parent a786f7e commit 3d0e45eeaa79c08e18fcf8be9393ad497f3c7579 @jaseemabid committed Jan 13, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 Lab2/reverse.sh
View
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Revberse print a file
+# Author : Jaseem Abid <jaseemabid@gmail.com>
+
+
+len=$(cat $1 | wc -l);
+count=$len;
+
+while [ $count -gt 0 ]
+ do
+
+ count=$(echo "$count -1 " | bc);
+ sed -n $count"p" $1
+done
+
+
+
+

0 comments on commit 3d0e45e

Please sign in to comment.