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

syntax error in bash script #21

Open
prandeamus opened this issue May 11, 2021 · 1 comment
Open

syntax error in bash script #21

prandeamus opened this issue May 11, 2021 · 1 comment
Assignees
Labels
bug Something isn't working solved Solved issue

Comments

@prandeamus
Copy link
Contributor

In flash-timonel-bootloader.sh running under Linux (it's a 64-bit Ubuntu derivative) the line following
echo "[[[ Flashing Timonel for operating @ $ARG2 MHz ]]]";
is

avrdude -c USBasp -p attiny85 -B3 -U flash:w:.\releases\$ARG1.hex:i -B 20 -U lfuse:w:$LOW_FUSE:m -U hfuse:w:$HIGH_FUSE:m -U efuse:w:$EXTENDED_FUSE:m;

This breaks my bash script. I assume you mean to use / rather than \ here?
avrdude -c USBasp -p attiny85 -B3 -U flash:w:./releases/$ARG1.hex:i -B 20 -U lfuse:w:$LOW_FUSE:m -U hfuse:w:$HIGH_FUSE:m -U efuse:w:$EXTENDED_FUSE:m;

The backslash makes me wonder that perhaps you use Windows with a bash emulation of some kind which allows \ as a path separator, but "real" Linux file systems are more fussy. I make the change and the script runs to completion without errors.

Bash version
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

uname -a reports
Linux robert-ThinkPad-S3-Yoga-14 5.4.0-72-generic #80~18.04.1-Ubuntu SMP Mon Apr 12 23:26:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

@casanovg casanovg added the bug Something isn't working label May 12, 2021
@casanovg casanovg self-assigned this May 12, 2021
@casanovg
Copy link
Owner

That's correct, thanks!

Yes, I usually use a Win10 PC with Git Bash for coding. I also check that everything builds OK on a few Linux flavors running on VMs. But I use USBasp or STK500 on Windows for flashing the actual devices, I guess that's why these backslashes sneaked out silently.

I'm correcting the flash script right now ... by the way, next time you find something like this, please feel free to fix it directly and create a PR.

@casanovg casanovg added the solved Solved issue label May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working solved Solved issue
Projects
None yet
Development

No branches or pull requests

2 participants