Reputation: 644
I am using curl to get an information of eurobasket2017 this works correct but I launch this curl everyday with a cron.
curl -o dailyGameCode http://live.fibaeurope.com/www/KeyFacts.ashx?acc=0&lng=en&full=1
How can I pass the following format to a name of the file ?
date +%d-%m-%y
Regards !
Upvotes: 0
Views: 28
Reputation: 26667
You can do shell substitution to get the date and then append it to the file name.
Example
$ today=$(date +%d-%m-%y)
$ curl -o "dailyGameCode-$today" http://live.fibaeurope.com/www/KeyFacts.ashx?acc=0&lng=en&full=1
$ ls
dailyGameCode-01-09-17
Upvotes: 3