Interpret the Pig series
Bash, 251 246 bytes

r=$RANDOM
((r%5&lt;4))||exit
[[ $1 =~ PIG ]]||(echo "File must contain the string 'PIG'.";exit)
s=(GRUNT MOAN OINK BURP GROAN WHINE)
m=("${1#*PIG}" ${s[r%6]}
"Your pig has unfortunately died. Please try again." "$1")
echo -n "${m[r%5]}"&gt;"${1%%PIG*}"


This would be a lot shorter if deaf pigs could at least read...