title: Get Day Of Week in bash script
body: <p>I want to have the day of week in the variable <code>DOW</code>. </p>
  
  <p>So I use the following bash-script:</p>
  
  <pre><code>DOM=$(date +%d)
  DOW=($($DOM % 7) ) | sed 's/^0*//'
  </code></pre>
  
  <p>Unfortunately there I get this error: <code>bash: 09: command not found</code>. The expected result is 2 ( 9 % 7 = 2) in the variable <code>$DOW</code>.</p>
  
  <p>How can I get this working? 
  It works for the days 1-8 but because of the C-hex, there is no number over 8 available and the following message appears: <code>bash: 09: value too great for base (error token is "09")</code>.</p>