Page 1 of 1

What's wrong with this script?

Posted: Sun Dec 20, 2020 1:02 pm
by FraSti
The idea is to add annual data to a simple txt file. The sh script:

#!/bin/sh
#
echo $1,$2,$3,$4 >> /tmp/mnt/data/export/annualDB.csv

The Service:
execution: before end of the year
script is selected
parameters: [YYYY] [th0temp-yavg.000001: ] [rain0total-yearsum.000001: ] [sol0rad-yavg.01: ]

The problem:
for any reason the output file is not updated at all


Thanks

Re: What's wrong with this script?

Posted: Mon Dec 21, 2020 6:32 pm
by admin
Problems at first look:
1) having a " " as default will kill your script as $1, $2, $3, $4 will be wrongly assigned
2) I think the echo output needs to be quoted: echo "$1, $2, $3, $4"
3) ".0000001" does not make sense to me. What do you try to achieve by this?