LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2004, 12:47 PM   #1
Axion
Member
 
Registered: Jan 2003
Location: Albany, NY
Distribution: Slackware 9.1, Gentoo 2004.1
Posts: 153

Rep: Reputation: 30
tcprobe+grep+cut


I am trying to grep/cut output from tcprobe in order to have only the framerate. i am able to do so fine to get the video length like this:

tcprobe -i /dev/dvd 2>&1 -T "1" | grep "playback" | cut -d " " -f 5
>> 00:00:28.29

but any attempt to cut the following grep results in no output whatsoever:

tcprobe -i /dev/dvd 2>&1 -T "1" | grep "rate"
>> frame rate: -f 23.976 [25.000] frc=1 (*)

I would like to have just "23.976" in the end but i cant cut it :/

Any help appreciated....thanks
 
Old 08-24-2004, 05:27 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, unless there's something you haven't mentioned, this worked for me:

t='frame rate: -f 23.976 [25.000] frc=1 (*)'
echo $t | cut -d' ' -f4
output was: 23.976

I don't have tcprobe, so I couldn't do it from scratch....
 
  


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
DVD::Rip tcprobe error while loading libquicktime secretlydead Linux - Software 0 11-27-2005 10:13 AM
grep ?? can grep us variables? DaFrEQ Linux - Software 4 09-14-2005 12:22 PM
cut , paste or grep ziox Programming 1 12-15-2004 10:51 PM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 03:11 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:11 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