0

I need to extract data from Teradata into csv files using a tool named giraffez. I have to do this one date at a time due to file size constraints. I can do this using the command:

giraffez export "sel * from container.table where date='2015-01-01'" table20150101.csv -d ','

However, I to put the above code into a loop that will iterate over each day from 2015-01-01 through 2017-06-01. How can I do this?

Gaurav Bansal
  • 5,221
  • 14
  • 45
  • 91

1 Answers1

0

A loop to generate all dates between to dates

d='2015-01-01'
while [[ $d < '2017-06-01' ]]; do
    echo "$d"
    d=$(date -d "$d +1 day" "+%Y-%m-%d")
done
Nahuel Fouilleul
  • 18,726
  • 2
  • 31
  • 36