Sorry if this is better suited at serverfault, but I think it learns more towards the programming side of things.
I have some code that's going into /etc/rc.local to detect what type of touch screen monitor is plugged in and changes out the xorg.conf before launching X. Here is a small snippet:
CURRENT_MONITOR=`ls /dev/usb | grep 'egalax_touch\|quanta_touch'`
case $CURRENT_MONITOR in
'')
CURRENT_MONITOR='none'
;;
esac
If one of those two touch screens is plugged in, it works just fine. If any other monitor is plugged in, it stops at the "CURRENT_MONITOR=ls /dev/usb | grep 'egalax_touch\|quanta_touch'
."
For testing I touched two files. One before creating CURRENT_MONITOR and one after CURRENT_MONITOR and only file touched before is created.
I'm not a bash programmer so this might be something very obvious.