Weltraumrennen in Bash

pos=40 width=80
 * 1) !/bin/bash
 * 2) "Weltraumrennen" in Bash - Linux Magazin 03/11 Listing 2 - S.113

while true; do read -t1 -s -n1 x case "$x" in       g) pos=$(($pos - 1)) ;;        h) pos=$(($pos +1 )); esac

for ((i=0; i < $width; i++)) do if [ $i -eq $pos ]; then echo -n 'V'       elif [ $(($RANDOM % 9)) -eq 0 ]; then echo -n '*' else echo -n ' ' fi done

echo done