Well, it looks like I've found the problem. It would appear that piping the information in using<doesn't give the CLI enough time to react. alertdef takes a moment to prompt for a value, and hence everything was being fed to the console before alertdef could prompt for the values, as such everything was being lost.
I'm writing a script in ruby to deal with this, and it would appear that a sleep 1 command before putting the values into alertdef solves the problem.
Now it makes sense why I was having the same problem in windows and unix alike.
Kind Regards,
-Kilka