Validating date in Unix -


I have a scenario:

I am getting two dates in Start_dt and end_dt yyyyMMdd format in my As the argument of Unix script,

I must lay down every day starting from each day beginning I_dt from end_dt.

The script I wrote is below:

  start_date = $ 1 end_date = $ 2 # Confirmation dates! Date -d "$ start_date" 2 & gt; And 1> / Dev / null; Then the echo "start date is invalid"; Exit 1fi if! Date -d "$ end_date" 2 & gt; And 1> / Dev / null; Then the echo "end date is invalid"; ["$ End_dt"! = $ (Date -d "$ start_date") end_dt = $ (date -d "$ end_date +1 hour") #loop # $ Curr_dt "] on all dates $ curr_dt # increment date curr_dt = However, when I'm running, I'm getting down the error with input arguments such as 20140128 and 20140130: $ (date -d "$ curr_dt +1 hour") done  

Date: Invalid date `20140130 +1 hours 'Tuesday Jan 28 00:00:00 EST 2014 Date: Invalid Date` Sue 28 January 00:00: 00 EST 2014 +1 Hours' < / Code>


Comments