Re: Bash
>
> Your bash syntax, corrected:
>
> #! /bin/bash
>
> if [ "$COMMAND" = "220 localhost.localdomain ESMTP Postfix" ]; then
> echo "ok"
> else
> echo "bad"
> fi
Thanks to everyone
@Wilko very thanks. its works.
On Sat, Nov 15, 2014 at 10:01 AM, Wilko Fokken <wfokken@web.de> wrote:
> 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
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 20141115080109.GA4544@fok02.laje.edewe.de">https://lists.debian.org/[🔎] 20141115080109.GA4544@fok02.laje.edewe.de
>
Reply to:
- References:
- Bash
- From: Gokan Atmaca <linux.gokan@gmail.com>
- Re: Bash
- From: Wilko Fokken <wfokken@web.de>