#!/bin/bash
######################################################
#                                                    #
#     PLEASE DO NOT EDIT THIS SCRIPT !!!             #
#                                                    #
######################################################
#
#  $1 = path to logfile
#  $2 = maxlines (last N lines from the file)
#  $3 = line x from maxlines to show
#  $4 = nr of character to start the line with
#  $5 = length of line to show (how many characters)
#

if [ "$1" = "" ]; then
  echo -e "\n\e[31m  Can only be started from within animation.lua!\e[m\n"
  exit
fi

startnr="$4"
stopnr="$5"

line=$(cat "$1" | tail -n$3 | head -n$2 | tail -n1)
echo "${line:startnr:stopnr}" | sed 's/^[[:space:]]*//g'
