#!/bin/bash tail -f mc.out & while true; do read input if [ "$input" == "quitd" ]; then kill %1 exit fi echo $input >> mc.in done