vendredi 8 octobre 2021

Bash - if...then statement - unexpected token

I'm writing a script and want to check, that grep command found match. But all the time I receive unexpected token "else" error. Could you plese explain, where's the problem? I checked my syntax several times

I'm using Debian GNU/Linux version 8 (jessie)

#!/bin/bash
if monit status wildfly | grep -q "OK" ; then
  echo found
else
  echo not found
fi

Aucun commentaire:

Enregistrer un commentaire