Bash variable kills script execution
Posted
by Kyle Terry
on Stack Overflow
See other posts from Stack Overflow
or by Kyle Terry
Published on 2010-04-08T18:04:19Z
Indexed on
2010/04/08
19:23 UTC
Read the original article
Hit count: 243
bash
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.
© Stack Overflow or respective owner