Hi.

On Fri, 14 Nov 2014 22:45:19 +0200
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"

Replace the telnet command with a netcat like this:

nc localhost 25 < /dev/null

And, btw, a correct spelling of shebang is

#!/bin/bash

Reco


-- 
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/20141114235634.92d75437e15b622470aa5...@gmail.com

Reply via email to