Skip to content

Commit 2e6dd32

Browse files
jackonellicreativcoder
authored andcommitted
Robuster string parsing in bash script
In the `avrdude` call the elf-file input argument is used: "... -Uflash:w:$1:e". On some systems the "$1:e" is interpreted as the extension of this argument, i.e. only producing "elf" instead of the full "<path-to_elf.elf>" Adding curly braces "${1]:e" ensures robust parsing.
1 parent 522bfe7 commit 2e6dd32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flash.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ if [ "$#" -lt 1 ]; then
1313
fi
1414

1515
sudo -u $USER cargo build
16-
avrdude -q -C/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyACM0 -D "-Uflash:w:$1:e"
16+
avrdude -q -C/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyACM0 -D "-Uflash:w:${1}:e"

0 commit comments

Comments
 (0)