12345678910111213141516171819202122232425 |
- #!/bin/bash
- # Lists all level numbers with their planet id and planet name.
- # First argument should be the path to your Jazz directory (where level0.000
- # etc are).
- if [[ "${1}" == "" ]]; then
- echo "Please give the path to your Jazz directory as first argument."
- exit 1
- fi
- (
- for file in ${1}/level*; do
- filename="$(basename ${file})"
- x="${filename##level}"
- x=(${x//./ })
- level="${x[0]}"
- planet="${x[1]}"
- planetfile="planet.${planet}"
- planetname=$(head -c19 ${1}/"${planetfile}" | tail -c16 | strings)
- echo "${planet} ${level} ${planetname} level $(( ${level} + 1 ))"
- done
- ) | sort
|