Re: Bash
On Fri, Nov 14, 2014 at 10:45:19PM +0200, Gokan Atmaca 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"
Your bash syntax, corrected:
#! /bin/bash
if [ "$COMMAND" = "220 localhost.localdomain ESMTP Postfix" ]; then
echo "ok"
else
echo "bad"
fi
Reply to:
- Follow-Ups:
- Re: Bash
- From: Gokan Atmaca <linux.gokan@gmail.com>
- References:
- Bash
- From: Gokan Atmaca <linux.gokan@gmail.com>