Skip to content

IC2ACTIVE=$(ls /dev/*i2c*)->IC2ACTIVE=$(ls /dev/i2c-1)#31

Open
hb9dum wants to merge 1 commit intokm4ack:masterfrom
hb9dum:hb9dum-patch-1
Open

IC2ACTIVE=$(ls /dev/*i2c*)->IC2ACTIVE=$(ls /dev/i2c-1)#31
hb9dum wants to merge 1 commit intokm4ack:masterfrom
hb9dum:hb9dum-patch-1

Conversation

@hb9dum
Copy link

@hb9dum hb9dum commented Jan 9, 2022

If IC2ACTIVE=$(ls /dev/i2c) is used the subsequent if statement if [ $IC2ACTIVE = "/dev/i2c-1" ] will be false if more than one i2c devices exists even if one of them is i2c-1
e. g. if the following devices exist /dev/i2c-1 /dev/i2c-20 /dev/i2c-21
the test will fail when it should succeed

If IC2ACTIVE=$(ls /dev/*i2c*)  is used the subsequent if statement if [ $IC2ACTIVE = "/dev/i2c-1" ] will be false if more than one i2c devices exists even if one of them is i2c-1
e. g. if the following devices exist /dev/i2c-1  /dev/i2c-20  /dev/i2c-21
the test will fail when it should succeed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant