Automatic Input to a command

Hi,
I have an issue where i run an command in a shell script.

command >/dev/null
ret=$?
echo ret

If the command returns an error i'm redirecting it to /dev/null.
The prob is if an error comes it expects the user to press return to continue.
And hence the return is not echoed. and the end user is not aware of this.

Please help me provide an automatic input incase of error.
Cant use expect and spawn due to certain limitations.

Please help.

Is this what you mean?

command <<EOF > /dev/null

EOF

The here doc acts as stdin, it always gives a return (blank line).

Does it take other inputs? You can try

yes | command

to pump it with lots of y\n s ...

My `command` doesnt always expect an input.
Only if it fails it expects an "Enter".

Not sure how EOF helps and what does EOF contain.
tried your command and got the error, cannot find or open the file.:o

Both methods would send enter no matter what. This is possibly OK since without error the command finishes, and you only send 1 enter if an error, yes?

You could try also:

echo | command
printf '\n' | command

Unless your command actually opens the terminal directly.