commit 5ebf6ccc27149bd2cf7b34e3c34da2844c55e11e (HEAD -> ryandesign-echo-n-printf) Author: Ryan Schmidt Date: Mon Mar 6 16:05:49 2023 -0600 Use printf instead of echo -n echo -n is not portable; printf is. On some systems (e.g. macOS) in some situations, echo -n literally prints the "-n" and does not suppress the newline. Signed-off-by: Ryan Schmidt diff --git a/Makefile b/Makefile index 6038faf2..72126457 100644 --- a/Makefile +++ b/Makefile @@ -966,7 +966,7 @@ endif config: @echo Building flashrom version $(VERSION) - @echo -n "C compiler found: " + @printf "C compiler found: " @if [ $(CC_WORKING) = yes ]; \ then $(CC) --version 2>/dev/null | head -1; \ else echo no; echo Aborting.; exit 1; fi diff --git a/util/flashrom_partial_write_test.sh b/util/flashrom_partial_write_test.sh index 8e30fc63..ae174f4c 100755 --- a/util/flashrom_partial_write_test.sh +++ b/util/flashrom_partial_write_test.sh @@ -161,7 +161,7 @@ echo " cp "$BIOS" "$TESTFILE" i=0 while [ $i -lt $NUM_REGIONS ] ; do - echo -n "aligned region ${i} test: " + printf "aligned region %d test: " "${i}" offset=$((${i} * 8192)) dd if=${ZERO_4K} of=${TESTFILE} bs=1 conv=notrunc seek=${offset} 2> /dev/null dd if=${FF_4K} of=${TESTFILE} bs=1 conv=notrunc seek=$((${offset} + 4096)) 2> /dev/null @@ -252,7 +252,7 @@ cp "$BIOS" "$TESTFILE" i=0 while [ $i -lt $NUM_REGIONS ] ; do - echo -n "unaligned region ${i} test: " + printf "unaligned region %d test: " "${i}" offset=$(($((${i} * 8192)) + 2048)) # Protect against too long write