andre-richter/vfio-pci-bind

syntax error in shell script

ljm42 opened this issue · 2 comments

ljm42 commented

I believe this line in the shell script is incorrect:

if [[ $curr_driver -ne "vfio-pci" ]]; then

In the Bourne Shell the "-ne" operator is meant for integer operations, since this is a string operation it should use "!=" or "==", right?

Also, it looks like the logic is reversed. Based on what the script is doing, and the corresponding line in the Ruby file:

if curr_driver == 'vfio-pci'

I believe this line should be:
if [[ "$curr_driver" == "vfio-pci" ]]; then

Can you double check and see if I am off base here?

I believe this line should be:
if [[ "$curr_driver" == "vfio-pci" ]]; then

Can you double check and see if I am off base here?

Good catch. I agree with your assessment.

Solved by #2