View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Thu Apr 29, 2004 10:30 am 
Offline
Joined: Fri Mar 26, 2004 9:00 am
Posts: 239
Hi everyone,

I just posted this message to the MythTV users list, but as I'm a KnoppMyth user and it was integral to getting my home spun grabber working, I thought I'd pass it along here too:

Its not often that I discover something very cool and easy on Unix, but this one is too good not to share. And two of my favorite hard core Unix people didn't know about it, so I thought I'd pass it along. Of course I only found it because I haven't graduated past shell scripting yet...

I have discovered that the date command can do forward and reverse date calculations for you, right on the command line. Given that there are whole perl modules devoted to this, I was happy to see it is easier than I thought.

I'm running debian so YMMV but:

mythtv@mythtv:~ $ date "+%Y%m%d"
20040429
mythtv@mythtv:~ $ date "+%Y%m%d" --date=3D"9 days"
20040508
mythtv@mythtv:~ $ date "+%Y%m%d" --date=3D"9 days ago"
20040420
mythtv@mythtv:~ $

This is especially useful when you don't have a native grabber for XMLTV and you are trying to compile from different sources and using tv_split and tv_sort and so forth and you need to be able to ID the correct output file from tv_split.

Hope that saves someone some else time too.

-Jeff


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 71 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu