Send the "ENTER" from a bash script

Posted by Smat on Stack Overflow See other posts from Stack Overflow or by Smat
Published on 2014-06-06T14:09:46Z Indexed on 2014/06/06 15:25 UTC
Read the original article Hit count: 159

Filed under:
|
|
|
|

I am trying to create a bash script to simulate a mail attack to our mailserver. For this reason i want to create a bash script to send hundred of mails to our server, but when i launch the command:

$telnet 192.168.12.1 25 <-- where 192.168.12.1 is the ip of our server

The telnet session start and all the commands that i write later aren't executed. I also tried to create a second script to launch command on the telnet session after that this one are been created, but when i write from the second script:

$echo -ne "EHLO domain.com\r\f" It print the command but doesn't do the ENTER so the command is not taken. Any idea?

© Stack Overflow or respective owner

Related posts about linux

Related posts about bash