#!/bin/sh
# Runs the story's two programs and records their output beside them.
cd "$(dirname "$0")"
bash -c 'yes | head -3; echo "exit status of yes: ${PIPESTATUS[0]}, signal $(kill -l $((${PIPESTATUS[0]} - 128)))"; uname -sr' > pipe.run.txt
{ go run reader.go; go version; } > reader.run.txt
erlc mailbox.erl && { erl -noshell -s mailbox main -s init stop; erl -noshell -eval 'io:format("Erlang/OTP ~s~n",[erlang:system_info(otp_release)]), halt().'; } > mailbox.run.txt
rm -f mailbox.beam
cat pipe.run.txt reader.run.txt mailbox.run.txt
