Skip to content

Commit

Permalink
test_adrv9002.sh: fix bash warning about null bytes
Browse files Browse the repository at this point in the history
Starting with version 4.4, bash warns about discarded null bytes from
the command substitution output. That was happening when reading
'/sys/firmware/devicetree/base/model' as we have a null byte terminating
the string. Since we are just fine without that byte let's explicitly
remove it with 'tr' so bash does not warn about it.

While at it, replaced 'cat' with '<' as it's faster (not that it matters
much but...)

Signed-off-by: Nuno Sa <[email protected]>
  • Loading branch information
nunojsa committed Jul 26, 2023
1 parent 25731c2 commit f0e85ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_adrv9002_fh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ do_set_gpio_idx() {
}

do_gpios_export() {
local model=$(cat /sys/firmware/devicetree/base/model)
local model=$(tr -d \\0 </sys/firmware/devicetree/base/model)
local g=0
local gpio=0
local rx1_en=0
Expand Down

0 comments on commit f0e85ae

Please sign in to comment.