PDA

View Full Version : [other] Command help!



alexwang32
January 8th, 2011, 08:16 AM
Hi!

I'm new to ubuntu and I need some help with a perhaps simple situation.

There this show that I enjoy listening, so I download the podcast everyday. I use the command "wget" for downloading, and it's pretty good. Since the only part of the link that changes is the date part, I want to change the date part into a variable so that I don't have to change it myself daily.

Example : wget http://www.example2011/01/08.mp3 (what I want to change is the '08')

Thanks!!!

TiBaal89
January 8th, 2011, 09:49 AM
Check out the 'date' command - you can specify the format and have it return only the day, month, or year individually. For example:


$ date +"%d"
08

This could be used to construct your wget command.

DavidG24
January 8th, 2011, 09:58 AM
Not that it solves your problem, but in case you didn't know about it gPodder is a great application for managing podcasts.

alexwang32
January 9th, 2011, 03:38 AM
Thanks for the info, but how do I 'construct it'.

Like this?

wget http://smart2011/01/"date =%d".com/

Didn't work!

thameera
January 9th, 2011, 03:52 AM
Use this:
wget http://example2011/01/$(date +"%d").com/