LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-10-2012, 11:34 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Rep: Reputation: 255Reputation: 255Reputation: 255
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, 12:14 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

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


Reply



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 04: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 06:50 PM
webcam not found under /dev/video or /dev/video0/.. superevilspacemonkey Linux - Hardware 1 11-14-2008 03:56 PM
/dev/video0 Tuttle Slackware 10 07-23-2003 03:39 AM
Two Video Devices - /dev/video0 & /dev/video1 liguorir Linux - Software 1 07-21-2003 08:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:31 AM.

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
Open Source Consulting | Domain Registration