fre, 14.04.2006 kl. 22.58 skrev Petter Gundersen: > On 4/14/06, Kyrre Ness Sjobak <[EMAIL PROTECTED]> wrote: > > > > > Thanks, that has some really elegant elements, compared to my own > > solution. I think ill modyfy it (to keep the "general purposeness"), and > > place it in /usr/local/bin :) > > I'm glad to be of help. > > > > > if [ $1 = "--help" ]; then > > echo "Usage: ivtv-time filename recordtime(secounds)" > > exit > > fi > > > > cat /dev/video0 > $1 & > > catpid=$(ps -C "cat /dev/video0" -o pid=) > > This will actually return the pids of all running cat processes. ps -C > only accepts a list of executable names, not their arguments. I > recommend using catpid=$! instead. >
Yes i agree this is cleaner. But there are only one "cat /dev/video0", unless you have multiple /dev/video0 ;) > > echo "Recording, finished in " $2 " secounds" > > sleep $2 > > kill $catpid > > > > One thing: How accurate is sleep? > > I don't know how accurate sleep is, but I'm pretty sure it's accurate > enough for this purpose ;) > > Regards, > Petter > > _______________________________________________ > ivtv-users mailing list > [email protected] > http://ivtvdriver.org/mailman/listinfo/ivtv-users _______________________________________________ ivtv-users mailing list [email protected] http://ivtvdriver.org/mailman/listinfo/ivtv-users
