!/bin/bash
moh_file=~/Downloads/moh.mp3
afplay $moh_file &
pid=$!
trap "kill $pid" 2
while read line; do echo -e $line; done
kill $pid
Usage:
$ long-running-command [args] | moh_player
If you want to retain colours, run it through script:
$ script -q /dev/null long-running-command [args] | moh_player
No comments:
Post a Comment