Closed TnTBass closed 1 year ago
@TnTBass does it work if you change the line to: echo "Real Power: ${ups_realpowernominal}W" '(nominal)'
?
Different error now.
./report.sh: line 1931: syntax error near unexpected token `<'
./report.sh: line 1931: ` echo "<br><br>" >> "${logfile}"'
Can you give me the output of the following ps -p "$$"
type -aP bash
and ls -l /bin/bash
; also just to be sure you are not invoking the script though sh
like sh ./report.sh
.
Also try changing the line to echo '<br><br>' >> "${logfile}"
.
# ps -p "$$"
PID TT STAT TIME COMMAND
58882 0 Ss 0:00.14 -csh (csh)
# type -aP bash
bash is /bin/bash
-aP: not found
# ls -l /bin/bash
lrwxr-xr-x 1 root wheel 19 Mar 26 2022 /bin/bash -> /usr/local/bin/bash
Nope, not invoking through sh report.sh. Just ./report.sh.
# ./report.sh
./report.sh: line 1931: syntax error near unexpected token `<'
./report.sh: line 1931: ` echo "<br><br>" >> "${logfile}"'
New error changing that line.
# ./report.sh
./report.sh: line 2072: syntax error near unexpected token `('
./report.sh: line 2072: ` echo "If you are on scale see https://ixsystems.atlassian.net/browse/NAS-115175 and https://github.com/dak180/FreeNAS-Report/pull/6#issuecomment-1422618352 for updates on when bc will be included in scale and how to add it in the meantime (this will need to be redone each upgrade)." >&2'
@TnTBass does it work if you explicitly invoke it through bash: bash ./report.sh
?
@dak180 - No, same error as above. I also get the same errors when it runs through cron.
@TnTBass what does bash --version
get you?
@dak180
# bash --version
GNU bash, version 5.0.16(0)-release (amd64-portbld-freebsd12.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@TnTBass how far does d78d46137a1 get you?
@dak180
Different error.
# ./report.sh
./report.sh: line 2336: unexpected EOF while looking for matching `"'
./report.sh: line 2338: syntax error: unexpected end of file
@TnTBass are there any more errors after 0a026cf9e9882?
Script runs! Thanks!
Getting an error on TrueNAS-12.0-U8
I ran this manually with ./report.sh because the config file was not being created when it was setup via cron.