[GH-ISSUE #65] Synology_HDD_db v2.2.42 syntax error when using the script #28

Closed
opened 2026-03-07 19:14:11 +03:00 by kerem · 10 comments
Owner

Originally created by @p1ranha on GitHub (Apr 24, 2023).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/65

Using the script on my Syno 723+ DSM 7.2-64216 Beta

Using options: -nr
syno_hdd_db.sh: line 612: syntax error near unexpected token <' syno_hdd_db.sh: line 612: done < <(printf "%s\0" "${hdlist[@]}" | sort -uz)

Originally created by @p1ranha on GitHub (Apr 24, 2023). Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/65 Using the script on my Syno 723+ DSM 7.2-64216 Beta Using options: -nr syno_hdd_db.sh: line 612: syntax error near unexpected token `<' syno_hdd_db.sh: line 612: ` done < <(printf "%s\0" "${hdlist[@]}" | sort -uz)
kerem closed this issue 2026-03-07 19:14:11 +03:00
Author
Owner

@007revad commented on GitHub (Apr 24, 2023):

I'm also using DMS 7.2-63216 Beta (on a DS1821+) and I'm not getting that error message. That section of code has been all 42 versions of the script, so I'm not sure why it is causing an issue now.

Can you try the previous script version and report back if it gives the same error for you?
https://github.com/007revad/Synology_HDD_db/releases/tag/v2.1.38

<!-- gh-comment-id:1519712077 --> @007revad commented on GitHub (Apr 24, 2023): I'm also using DMS 7.2-63216 Beta (on a DS1821+) and I'm not getting that error message. That section of code has been all 42 versions of the script, so I'm not sure why it is causing an issue now. Can you try the previous script version and report back if it gives the same error for you? https://github.com/007revad/Synology_HDD_db/releases/tag/v2.1.38
Author
Owner

@p1ranha commented on GitHub (Apr 24, 2023):

I have the same error with that version.

<!-- gh-comment-id:1519715055 --> @p1ranha commented on GitHub (Apr 24, 2023): I have the same error with that version.
Author
Owner

@007revad commented on GitHub (Apr 24, 2023):

Have you got 1 or 2 HDDs in the DS723+? And what brand are they?

<!-- gh-comment-id:1519840824 --> @007revad commented on GitHub (Apr 24, 2023): Have you got 1 or 2 HDDs in the DS723+? And what brand are they?
Author
Owner

@p1ranha commented on GitHub (Apr 24, 2023):

I have 2HDD slots, only one is occupied by Seagate ST6000VN001-2BB186

SSDs:
M.2 Drive 1 - Micron (SSD) - NOT joined yet (not supported)
M.2 Drive 2 - Toshiba KBG30ZMS128G NVMe TOSHIBA 128.. (cache)

<!-- gh-comment-id:1519848491 --> @p1ranha commented on GitHub (Apr 24, 2023): I have 2HDD slots, only one is occupied by Seagate ST6000VN001-2BB186 SSDs: M.2 Drive 1 - Micron (SSD) - NOT joined yet (not supported) M.2 Drive 2 - Toshiba KBG30ZMS128G NVMe TOSHIBA 128.. (cache)
Author
Owner

@007revad commented on GitHub (Apr 24, 2023):

That error is occurring in a section of the script that sorts the HDD list to remove duplicates. I wonder if the bug only occurs when there's only 1 HDD. I'll run some tests and see if I can reproduce the error.

<!-- gh-comment-id:1519863532 --> @007revad commented on GitHub (Apr 24, 2023): That error is occurring in a section of the script that sorts the HDD list to remove duplicates. I wonder if the bug only occurs when there's only 1 HDD. I'll run some tests and see if I can reproduce the error.
Author
Owner

@007revad commented on GitHub (Apr 25, 2023):

I can't reproduce the error. I've even tried with just 1 HDD.

Can you try this short test script to see if it gives you the same error:
https://gist.github.com/007revad/e7ca1c185f593b2d93cccf5bd0ccd0c2

If it does give you the same error can you run it with --debug then reply with the output.
/<path-to-script>/test.sh --debug

<!-- gh-comment-id:1520996606 --> @007revad commented on GitHub (Apr 25, 2023): I can't reproduce the error. I've even tried with just 1 HDD. Can you try this short test script to see if it gives you the same error: https://gist.github.com/007revad/e7ca1c185f593b2d93cccf5bd0ccd0c2 If it does give you the same error can you run it with --debug then reply with the output. `/<path-to-script>/test.sh --debug`
Author
Owner

@007revad commented on GitHub (Apr 25, 2023):

Okay, I have been able to reproduce the error by running the script in sh instead of bash.

It seem like you are trying to run the script with:
sh sudo -i /<path-to-script>/syno_hdd_db.sh

Instead run it with:
sudo -i /<path-to-script>/syno_hdd_db.sh

<!-- gh-comment-id:1521103341 --> @007revad commented on GitHub (Apr 25, 2023): Okay, I have been able to reproduce the error by running the script in sh instead of bash. It seem like you are trying to run the script with: `sh sudo -i /<path-to-script>/syno_hdd_db.sh` Instead run it with: `sudo -i /<path-to-script>/syno_hdd_db.sh`
Author
Owner

@p1ranha commented on GitHub (Apr 25, 2023):

I have executed it as you said, still with error:
piranha@nas:~$ sudo -i syno_hdd_db.sh
-ash: syno_hdd_db.sh: command not found

Then I did sudo mc and executed it using mc. That worked.

<!-- gh-comment-id:1521445053 --> @p1ranha commented on GitHub (Apr 25, 2023): I have executed it as you said, still with error: piranha@nas:~$ sudo -i syno_hdd_db.sh -ash: syno_hdd_db.sh: command not found Then I did sudo mc and executed it using mc. That worked.
Author
Owner

@007revad commented on GitHub (Apr 25, 2023):

I'm glad you got it working.

The "syno_hdd_db.sh: command not found" error would have been because you didn't include the path to where the file is located. Like sudo i /volume1/homes/p1ranha/syno_hdd_db.sh

<!-- gh-comment-id:1521571420 --> @007revad commented on GitHub (Apr 25, 2023): I'm glad you got it working. The "syno_hdd_db.sh: command not found" error would have been because you didn't include the path to where the file is located. Like `sudo i /volume1/homes/p1ranha/syno_hdd_db.sh`
Author
Owner

@p1ranha commented on GitHub (Apr 25, 2023):

thanks for all the help!

<!-- gh-comment-id:1521576531 --> @p1ranha commented on GitHub (Apr 25, 2023): thanks for all the help!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_HDD_db#28
No description provided.