casanovg / timonel

ATtiny85/45/25 I2C bootloader
MIT License
110 stars 18 forks source link

syntax error in bash script #21

Open prandeamus opened 3 years ago

prandeamus commented 3 years ago

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 commented 3 years ago

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.