Skip to content

Commit

Permalink
Prog to reverse a file
Browse files Browse the repository at this point in the history
  • Loading branch information
jaseemabid committed Jan 13, 2012
1 parent a786f7e commit 3d0e45e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Lab2/reverse.sh
@@ -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.