Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One problem may be that your <code>wget</code> creates a file regardless of whether there's a source file so checking for existence will always be true.</p> <pre><code>if [ -s $TMPNAMED ] then echo "done." # file exists AND has data else echo "no new data!" exit fi </code></pre> <p>will test to see if it's empty or non-existent and exit if so. This may be an issue with your <code>if [ -e $ZONELOCATION/$ZONE.db ]</code> as well.</p> <p><code>sed</code> or <code>awk</code> could do all of this in one line:</p> <pre><code>grep "^zone" $TMPNAMED | cut -d " " -f "2" | cut -d "\"" -f 2 &gt; $TMPZONEFILE sed '1,5d' $TMPZONEFILE &gt; $TMP </code></pre> <p>but I would need to see some sample data to offer a solution.</p> <p>Simplified quoting:</p> <pre><code>echo "done. ($TMPZONEFILE)" </code></pre> <p>You're not using the <code>IGNORE</code> variable or the <code>updates</code> variable. I don't see any reason to export it. Also, if you are relying on it elsewhere, its value won't survive once the <code>while</code> loop exits since piping something (<code>grep</code> in this case) into <code>while</code> sets up a subshell. It may be better to do one of these:</p> <p>Bash:</p> <pre><code>while ... do ... done &lt;(grep -vf ignore.txt $TMPZONEFILE) </code></pre> <p>sh:</p> <pre><code>grep -vf ignore.txt $TMPZONEFILE &gt; tmp.out while ... do ... done &lt; tmp.out </code></pre> <p>I recommend using <code>mktemp</code> or <code>tempfile</code> to create temporary files, by the way.</p> <p>This might be more readable and allows you to include quotes without having to escape them:</p> <pre><code>cat &lt;&lt; EOF &gt;&gt; "$NAMED" zone "$ZONE" { type slave; file "$ZONELOCATION/$ZONE.db"; masters { 91.121.75.205; }; allow-notify { 91.121.75.205; }; }; EOF </code></pre> <p>It's always a good habit to quote variables that contain filenames.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload