Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. read -p "enter the date in the format YYYY-MM-DD "
  2.  
  3. i=$(($(date +%Y)-${REPLY%%-*}))
  4. j=$(($(date +%m)-${REPLY:5:2}))
  5. k=$(($(date +%d)-${REPLY##*-}))
  6.  
  7. if $i > 1 then assign l=$((i*365)) and else what?? # what about leap years?
  8. Using $j somehow assign m # confused before I've started
  9. Using $k somehow assign n # just as bad
  10. echo $((l+m+n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement