• Problem running gnuplot in cron job

    From Chris Elvidge@21:1/5 to All on Thu May 16 14:07:32 2019
    Hi All, Can anyone explain this:

    G N U P L O T
    Version 5.2 patchlevel 6 last modified 2019-01-01

    I have a bash file and a gnuplot file viz:

    $ cat getfiles
    #!/bin/bash
    FILES=$(find /var/tmp/ -daystart -maxdepth 1 -regextype posix-awk -regex ".*_[0-9]{8}.*" -mtime -9)
    gnuplot -c /home/pi/gpts/temp_weekly.gpt $FILES

    $ cat temp_weekly.gpt
    #!/usr/bin/gnuplot
    # vim: filetype=gnuplot
    #
    if (ARGC > 0) {
    do for [j=1:ARGC] { print ARGV[j] }
    }

    On two machines, RaspberryPis running Raspbian and OSMC, when "getfiles"
    is run from the command line, temp_weekly.gpt outputs a list of files,
    one per line, as expected.
    When run from a cron job, I get an error:

    print ARGV[j]
    ^
    line 6: ':' expected

    However on another, RPi running Void Linux, both command line and cron
    job give the expected list of files.

    What am I missing here?
    Thanks.

    --

    Chris Elvidge, England

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)