#!/bin/sh
#
# This is an example of a useful executable mission
# I recommend you stay away from using shells other than 'sh' just to make
# sure that you can give this to someone else.  I would prefer to use tcsh
# but we don't have that on some of our SGI's here.
# - Aaron Hightower
#
# $$.temp evaluate to <processid>.temp (it should be unique)
cat > /tmp/$$.temp  << EOF
level = {
  author = "Aaron Hightower"
  name = #name
  numlives = #numlives
  rock = {
    count = #count
    scale = .2
    geometry = "#rock"
    points = 20
    sfxid = 0
    rock = {
      count = 2
      scale = .15
      geometry = "#rock"
      points = 20
      sfxid = 0
      rock = {
	count = 2
	scale = .1
	geometry = "#rock"
	points = ##00
	sfxid = 0
      }
    }
  }
}
EOF
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
  name="weird level $i" ;
  count="${i}" ;
  numlives=1
  case "$i" in
    '1') numlives="5" ; rock="weird" ;;
    '2') rock="weird 100 40 0.02 1" ;;
    '3') rock="weird 100 10 0.02 0.5" ;;
    *)
       rock="weird"
  esac
  cat /tmp/$$.temp | sed "s/#name/$name/;s/#count/$count/;s/##/$i/;s/#rock/$rock/;s/#numlives/$numlives/"
done
# Make sure if you use this to remove these temporary files
rm -f /tmp/$$.temp
