#!/bin/sh
# The page sends "number command" per line on the second serial port and gets the output
# back as @number:base64@, so checking never shows in the learner's terminal. The number
# keeps a late answer from being taken for the next one.
stty -echo
while read -r id line; do
    case $id in ''|*[!0-9]*) continue ;; esac
    printf '@%s:%s@\n' "$id" "$( (eval "$line") 2>&1 </dev/null | head -c 2000 | base64 | tr -d '\n')"
done
