<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Bash:<br>
    <br>
    #!/bin/bash -x<br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 11/12/2013 10:50 AM, Jake Vath
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMeWMmhCNTKsnHi0j0DJuZZPZsNswG4eUzNUFwiOf2VToqx2cA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Are you trying to run this as a Bash script with <i>#!/bin/bash</i>
          (or some from of Bash)? <br>
          or are you trying to run this as a Bourne shell with <i>#!/bin/sh</i>
          (or some form of Borne)?<br>
          <br>
        </div>
        -> Jake<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Tue, Nov 12, 2013 at 9:01 AM,
          Raymond Norton <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:admin@lctn.org" target="_blank">admin@lctn.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">I run the
            following script to test if a host is on-line and trigger a
            back up if it's alive. Something apparently changed with the
            script and it is giving me a "unary operator expected" error
            for line 17.<br>
            <br>
            Any ideas what is triggering it?<br>
            <br>
            <br>
            <br>
            if [ -f /etc/bacula/ping_check.txt ];<br>
            then<br>
                 FILEDATE=`cat /etc/bacula/ping_check.txt`<br>
            else<br>
                 FILEDATE=0<br>
            fi<br>
            <br>
            if [ $NOWDATE -ne $FILEDATE ];<br>
            then<br>
                 if [[ $CMD_RET =~ ", 0% packet loss" ]]<br>
                 then<br>
                      echo "$HOST pinged ..."<br>
                      echo $NOWDATE > /etc/bacula/ping_check.txt<br>
                    # run backup script<br>
                     /etc/bacula/backup-host-1<br>
            <br>
                 else<br>
                      echo "$HOST did not ping ..."<br>
                 fi<br>
            fi<br>
            <br>
            exit<span class="HOEnZb"><font color="#888888"><br>
                <br>
                -- <br>
                Raymond Norton<br>
                LCTN<br>
                <a moz-do-not-send="true" href="tel:952.955.7766"
                  value="+19529557766" target="_blank">952.955.7766</a><br>
                <br>
                Sent from My Desktop<br>
                <br>
                _______________________________________________<br>
                TCLUG Mailing List - Minneapolis/St. Paul, Minnesota<br>
                <a moz-do-not-send="true"
                  href="mailto:tclug-list@mn-linux.org" target="_blank">tclug-list@mn-linux.org</a><br>
                <a moz-do-not-send="true"
                  href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list"
                  target="_blank">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a><br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
      <br>
      -- <br>
      This message has been scanned for viruses and
      <br>
      dangerous content by
      <a moz-do-not-send="true" href="http://www.mailscanner.info/"><b>MailScanner</b></a>,
      and is
      <br>
      believed to be clean.
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
<a class="moz-txt-link-abbreviated" href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Raymond Norton
LCTN
952.955.7766

Sent from My Desktop</pre>
  </body>
</html>