LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2012, 12:34 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,719

Rep: Reputation: 155Reputation: 155
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.
 
Old 08-11-2012, 01:14 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,047

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
Code:
if [ -e /dev/video ]  ; then echo "found" ; else echo "missing" ; fi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'v41:/dev/video0' Mark Myatt Linux - Hardware 5 02-02-2011 05:05 AM
[SOLVED] V4L - 2 capture cards result in fuzzy /dev/video0 and /dev/video1 output d_t_baker Linux - Software 1 10-03-2010 07:50 PM
webcam not found under /dev/video or /dev/video0/.. superevilspacemonkey Linux - Hardware 1 11-14-2008 04:56 PM
/dev/video0 Tuttle Slackware 10 07-23-2003 04:39 AM
Two Video Devices - /dev/video0 & /dev/video1 liguorir Linux - Software 1 07-21-2003 09:20 PM


All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration