- Please don't call egrep and aplay -l twice. Do it once, save it in $output, and just use the variable.
- I suspect that it also greps /proc/asound/cards further down. Please move that upwards and reuse the grep result.
- echo $output -> echo "$output", to avoid automatic bash expansion
- test "$line" -> [ -n "$line" ] for clarity and safety
- readability: what should "if ! line=$() && line=$()" mean? Please don't mix tests and assignments with && and ||.
Can you please test it again with above changes and attach an updated patch? Once that still works, the change should also be submitted as a Debian bug.
Some comments:
- Please don't call egrep and aplay -l twice. Do it once, save it in $output, and just use the variable.
- I suspect that it also greps /proc/asound/cards further down. Please move that upwards and reuse the grep result.
- echo $output -> echo "$output", to avoid automatic bash expansion
- test "$line" -> [ -n "$line" ] for clarity and safety
- readability: what should "if ! line=$() && line=$()" mean? Please don't mix tests and assignments with && and ||.
Can you please test it again with above changes and attach an updated patch? Once that still works, the change should also be submitted as a Debian bug.
Thank you!