On Fri, Nov 14, 2014 at 3:45 PM, Gokan Atmaca <linux.go...@gmail.com> wrote:
> I want to conditionally output from the bash command. for example
>
> telnet localhost 25
> 220 localhost.localdomain ESMTP Postfix
>
> #! / bin / bash
> COMMAND = `telnet localhost 25`
> if ["$ COMMAND" == "220 localhost.localdomain ESMTP Postfix"]
> echo "postfix ok"
> else
> echo "postfix error"
>

You might have better luck with netcat (nc).  Something like:

COMMAND=`nc localhost 25 | head -1l`

Eric


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/cac73ar16zzgs5ur6jbhq0+rduiqjg5opdelgnczvi11u0zr...@mail.gmail.com

Reply via email to