in reply to Re: Reversing A File
in thread Reversing A File
Call it much like tac,#!/bin/sh file=$1; i=1 max=`wc -l $file | cut -d' ' -f1,1 ` while [ $i -le $max ]; do tail -$i $file | head -1 i=$((i+1)) done
It's not as fast as tac obviously, but if you don't have 'tac' and want to reverse a file it does work.$ ./reverse your.file > reverse.file
---
s;;:<).>|\;\;_>?\\^0<|=!]=,|{\$/.'>|<?.|/"&?=#!>%\$|#/\$%{};;y;,'} -/:-@[-`{-};,'}`-{/" -;;s;;$_;see;
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.
|
|---|