Hi.

On Fri, 14 Nov 2014 22:45:19 +0200
Gokan Atmaca <[email protected]> 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 [email protected] 
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: 
https://lists.debian.org/[email protected]

Reply via email to