You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed with the One line install command on Raspberry Pi OS Buster
What happened
If a command is executed via RFID (or by calling the rfid_trigger_play.sh manually) the script fails with "Line 354: [: too many arguments". The command is executed though and no error is recognizable in functionality.
Non command execution works without errors.
I expected this to happen
The script runs without producing errors
Further information that might help
The "if-statement" in rfid_trigger_play.sh has an "is set" check for variable "${FOLDER+x}". The variable is unquoted what is producing an error with the subsequent inline check, if a command is executed and the "FOLDER" variable is not set.
Solution: The variable "${FOLDER+x}" must be quoted or the check can even be completly removed, as the "is empty" check should be sufficient in this case (variable cannot be "not empty" but "not set")
Software
Base image and version
2022-09-22-raspios-buster-armhf-lite.img
Branch / Release
master
Installscript
scripts/installscripts/buster-install-default.sh
Hardware
RaspberryPi version
4B
RFID Reader
Soundcard
Onboard
Other notable hardware
The text was updated successfully, but these errors were encountered:
unquoted "is set" check fails if var is not set and if-statement has a subsequent check. Further the preceding "is empty" check is sufficient in this case.
unquoted "is set" check fails if var is not set and if-statement has a subsequent check. Further the preceding "is empty" check is sufficient in this case.
AlvinSchiller
added a commit
to AlvinSchiller/RPi-Jukebox-RFID
that referenced
this issue
Dec 21, 2023
unquoted "is set" check fails if var is not set and if-statement has a subsequent check. Further the preceding "is empty" check is sufficient in this case.
Bug
What I did
I installed with the One line install command on Raspberry Pi OS Buster
What happened
If a command is executed via RFID (or by calling the rfid_trigger_play.sh manually) the script fails with "Line 354: [: too many arguments". The command is executed though and no error is recognizable in functionality.
Non command execution works without errors.
I expected this to happen
The script runs without producing errors
Further information that might help
The "if-statement" in rfid_trigger_play.sh has an "is set" check for variable "${FOLDER+x}". The variable is unquoted what is producing an error with the subsequent inline check, if a command is executed and the "FOLDER" variable is not set.
Solution: The variable "${FOLDER+x}" must be quoted or the check can even be completly removed, as the "is empty" check should be sufficient in this case (variable cannot be "not empty" but "not set")
Software
Base image and version
2022-09-22-raspios-buster-armhf-lite.img
Branch / Release
master
Installscript
scripts/installscripts/buster-install-default.sh
Hardware
RaspberryPi version
4B
RFID Reader
Soundcard
Onboard
Other notable hardware
The text was updated successfully, but these errors were encountered: