pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Fri 2nd Jul 2010 11:47
raw | new post

  1. #!/bin/sh
  2.  
  3. centena() {
  4.         if [ $1 -lt 100 ]; then
  5.                 echo 0
  6.         else
  7.                 echo $1 | cut -c1
  8.         fi
  9. }
  10.  
  11. k0=0
  12. timestamp=$(date +%c)
  13.  
  14. sed -n -e 's,.*\[village\]\([0-9]\+\)|\([0-9]\+\)\[/village.*,\1 \2,p' -e 's,|, ,' |
  15.         while read x y; do
  16.  
  17.         k="$(centena $y)$(centena $x)"
  18.  
  19.         echo $k $x $y
  20. done | sort -n | while read k x y; do
  21.         if [ $k0 -ne $k ]; then
  22.                 echo ""
  23.                 echo "[b]Reservas |S.C| K$k[/b] [i]($timestamp)[/i]"
  24.                 k0=$k
  25.         fi
  26.  
  27.         echo "[village]$x|$y[/village]"
  28. done

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at