Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generateForDay.sh: upload message fix #868

Merged
merged 1 commit into from
Dec 28, 2021

Conversation

EricClaeys
Copy link
Collaborator

Only show the "upload" message if file creation worked, i.e., $EXIT_CODE = 0.

Only show the "upload" message if file creation worked, i.e., $EXIT_CODE = 0.
@EricClaeys EricClaeys added the bug needs software change label Dec 25, 2021
@@ -214,7 +214,7 @@ if [ "${DO_TIMELAPSE}" = "true" ] ; then
fi


if [ "${TYPE}" = "GENERATE" -a ${SILENT} = "false" ]; then
if [ "${TYPE}" = "GENERATE" -a ${SILENT} = "false" -a ${EXIT_CODE} -eq 0 ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXIT_CODE generation is a little bit confusing and result is maybe wrong - but not critical

pi@allsky:~/allsky $ A=0
pi@allsky:~/allsky $ B=1
pi@allsky:~/allsky $ C=-1
pi@allsky:~/allsky $ echo $((${A}+${B}+${C}))
0

-a is depricated (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html)

The XSI extensions specifying the -a and -o binary primaries and the '(' and ')' operators have been marked obsolescent. (Many expressions using them are ambiguously defined by the grammar depending on the specific expressions being evaluated.) Scripts using these expressions should be converted to the forms given below. Even though many implementations will continue to support these obsolescent forms, scripts should be extremely careful when dealing with user-supplied input that could be confused with these and other primaries and operators. Unless the application developer knows all the cases that produce input to the script, invocations like:

test "$1" -a "$2"

should be written as:

test "$1" && test "$2"

to avoid problems if a user supplied values such as $1 set to '!' and $2 set to the null string. That is, in cases where maximal portability is of concern, replace:

test expr1 -a expr2

@EricClaeys EricClaeys merged commit a3895bc into master Dec 28, 2021
@EricClaeys EricClaeys deleted the generateForDay.sh-upload-message branch December 28, 2021 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs software change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants