May i install zextras by script?

(
echo Y
echo Y
echo Y
echo
echo Y
echo Y
echo Y
echo
) | ./install.sh all

My script wont go...