LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Check if /dev/video0 is present? (https://www.linuxquestions.org/questions/linux-newbie-8/check-if-dev-video0-is-present-4175421518/)

Xeratul 08-11-2012 12:34 AM

Check if /dev/video0 is present?
 
Hi,

I would like to know how to realiably check if /dev/video0 is there?

Code:

devch=`ls -1 /dev/video0 `
if [ "$devch" != ""  ]  ; then
echo "dev available"
then
echo "dev not found"
fi

This example above is really not good. ls -1 must be prohibited.

syg00 08-11-2012 01:14 AM

Code:

if [ -e /dev/video ]  ; then echo "found" ; else echo "missing" ; fi


All times are GMT -5. The time now is 03:23 PM.