What's wrong with this script?

This section covers the Meteobridge PRO, PRO2, NANO SD, Raspberry Pi and VM platforms exclusively

Moderator: Mattk

Post Reply
FraSti
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sat Feb 01, 2020 9:43 am

What's wrong with this script?

Post 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
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: What's wrong with this script?

Post 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?
Post Reply