pi-scripts icon indicating copy to clipboard operation
pi-scripts copied to clipboard

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

Open hb9dum opened this issue 3 years ago • 0 comments

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

hb9dum avatar Jan 09 '22 22:01 hb9dum