DarkSideRO Posted April 13, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 3 Reputation: 0 Joined: 02/26/12 Last Seen: April 18, 2012 Share Posted April 13, 2012 Hi all, recently i had some problem with maps and I need know the Gravity map that best fit my custom map. This is a simple bash script that generate a txt file with maps sorted by width and height. I hope is usefull for someone #!/bin/bash svn co https://openkore.svn.sourceforge.net/svnroot/openkore/fieldpack/trunk/fields/ echo -e Width \\t Height \\t Map > "Maps Dimensions.tmp" for m in $(ls fields | grep fld); do name=$(basename $m ".fld") w=$(cat "fields/$m" | head -c 2 | od -d -An | tr -dc '[:alnum:],\n') h=$(cat "fields/$m" | head -c 4 | tail -c 2| od -d -An | tr -dc '[:alnum:],\n') echo -e $w \\t $h \\t $name >> "Maps Dimensions.tmp" done rm -rf fields sort -t $'\t' -k 1n -k 2n "Maps Dimensions.tmp" > "Maps Dimensions.txt" rm "Maps Dimensions.tmp" Quote Link to comment Share on other sites More sharing options...
Meroy Posted May 4, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 9 Reputation: 0 Joined: 05/04/12 Last Seen: May 23, 2012 Share Posted May 4, 2012 Hi, could you specify a little bit? what's the purpose of this 'batch' Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.