Need help in writing shell script

I have written a shell script and when i ran the script,for some point of time it is asking to press enter key manually using keyboard.So i need it the enter key in shell itself.
ex : in my shell script,i used the command ssh-keygen -t rsa so it asks the enter 3 times. can you please let me know to automate this.

Thx,

Hi

You could try

echo "\n\n\n" | ssh-keygen...

Hi,

I tried but helpless.am getting the error Your identification has been saved in \n\n\n.
Your public key has been saved in \n\n\n.pub

Thx,

Hi.

I just ran ssh-keygen (sorry I didn't have my Linux running when I answered you originally).

It needs three fields: filename, passkey and verified passkey.

You can pass these in on the command line:

echo y | ssh-keygen -N new_key -f outfile

The echo y is incase the key already exists and answers the question "overwrite?"