title: Differentiate between 2 and 02 in bash script
body: <p>I have a bash script that takes the date, month and year as separate arguments. Using that, a url is constructed which then uses <code>wget</code> to fetch content and store it in an html file (say t.html). Now, the user may enter a 2 digit month/date (as in 02 instead of just 2 and vice-versa). How do I distinguish between the above two formats and correct for this from within the script?  </p>
  
  <p>The url works as follows:<br>
  <strong>Date</strong>: a 2 digit input is needed. So a 7 must be supplied as 07 for the url to be constructed properly. Here I am looking for a check that would append a zero to the date in case it is less than 10 and does not already have a zero in front. So, 7 should become 07 for the date field before the url is constructed.<br>
  <strong>Month</strong>: a 2 digit input is needed, but here the url automatically appends the 0 in case month &lt; 10. So, if the user enters 2, then the url forms 02, but if the user enters 02, the url forms 002. Here, the 0 may need to be appended or removed.  </p>
  
  <p>P.S: I know this method followed by the url s*c&amp;s, but I just need to work with it.</p>
  
  <p>Thanks,<br>
  Sriram</p>