michealespinola / syno.plexupdate

A script to automagically update Plex Media Server on Synology NAS
GNU General Public License v3.0
309 stars 24 forks source link

Error @ line 21: syntax error near unexpected token `>' and `exec > >(tee "$SrceFllPth.log") 2>"$SrceFllPth.debug"' #53

Closed cmatte closed 1 month ago

cmatte commented 1 month ago

Hi there,

Thanks for maintaining this script! For quite a while now I've been keeping it running, however I noticed just today v.4.4.0 was not auto-updating as expected, well, even if working without any issue! I pushed through 4.6.9 and unfortunately I encounter the following error I'm a bit unable to troubleshoot. Machine is a DS918+ (INTEL Celeron J3455 x86/64) with DSM 7.2.2-72803.

Any suggestion welcome!

Thanks in advance. KR, Matteo.

Task Scheduler has completed a scheduled task.

Task: Plex AutoUpdate
Start time: Wed, 11 Sep 2024 06:55:46 +0100
Stop time: Wed, 11 Sep 2024 06:55:47 +0100
Current status: 2 (Interrupted)
Standard output/error:
/volume1/homes/ErMeglio/scripts/plexupdate/[syno.plexupdate.sh](http://syno.plexupdate.sh/): line 21: syntax error near unexpected token `>'
/volume1/homes/ErMeglio/scripts/plexupdate/[syno.plexupdate.sh](http://syno.plexupdate.sh/): line 21: `exec > >(tee "$SrceFllPth.log") 2>"$SrceFllPth.debug"'

From DISKSTATION
michealespinola commented 1 month ago
  1. Are you running the script with bash or sh? It should be bash.
  2. "syntax error near unexpected" can typically be indicative of saving the script with incorrectly sequenced text:

    Bash shell scripts running on Linux must be saved as LF (Line Feed) sequenced text. Alternatively, Windows typically uses CRLF (Carriage Return Line Feed). If you inadvertently save your script with CRLF instead of LF sequencing, it will error with verbiage such as:

    • '\r': command not found
    • syntax error near unexpected

    To resolve this issue you will need to [re]save your copy of the script with LF sequencing, or download a new copy directly from GitHub.

michealespinola commented 1 month ago

Hi again! Was what I replied a resolution for you?

michealespinola commented 1 month ago

Closing due to non-reply.

cmatte commented 2 weeks ago

Thanks for your prompt help, indeed utilizing bash (vs. sh) fixed it! Appreciate your patience on the delayed reply 👍

michealespinola commented 2 weeks ago

No worries. Glad to hear it was just a matter of the shell used.