View Single Post
Old Jun 10th, 2007, 10:27 AM   #7
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 630
Rep Power: 4 Jessehk is on a distinguished road
Actually, my solution in the end was to redirect the output to a different file:
rankmirrors $mirror > ${mirror}_new

and then to rename it following the sorting operations:
mv ${mirror}_new $mirror

While of course first making a ${mirror}.bak of every file first.

Thanks for all the advice. I've actually just purchased O'Reilly's "Classic Shell Scripting" which covers Awk, Sed, and Bash in detail. I figured it was about time.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote