title: BASH: How do you "split" the date command?
body: <p>Cygwin user here (though if there's a suitable solution I will carry it over to K/Ubuntu, which I also use).</p>
  
  <p>I have a Welcome message in my .bashrc that looks like the following:</p>
  
  <pre><code>SAD=(`date +%A-%B-%d-%Y`)
  DUB=(`date -u +%k:%M`)
  printf "Today's Date is: ${SAD}.\n"
  printf "Dublin time is now ${DUB}. (24-Hour Clock)\n"
  </code></pre>
  
  <p>After numerous attempts to use whitespaces in the variable SAD above, I gave in and used hyphens. But I am, understandably, not satisfied with this band-aid solution. The problem, as I recall, was that every time I tried using quoted space, \s or some similar escape tag, along with the variables listed in the appropriate section of the GNU manpage for <b>date</b>, the variable for Year was either ignored or returned an error. What I do'nt want to have to do is resort to the full string as returned by <b>date</b>, but rather to keep the order in which I have things in the code above.</p>
  
  <p>As I write this, it occurs to me that setting the IFS around this code for the Welcome message may work, provided I return it to defaults afterwards (the above appears at lines 13-17 of a 68-line .bashrc). However, I can't recall how to do that, nor am I sure that it would work.</p>
  
  <p>Generally-speaking, .bashrc files are in valid BASH syntax, aren't they? Mine certainly resemble the scripts I've either written myself or tested from other sources. All I'm missing, I suppose, is the code for setting and unsetting the field separators around this message block.</p>
  
  <p>No doubt anyone who comes up with a solution will be doing a favor not only to me, but to any other relative newbies on the Net taking their first (or thirteenth through seventeenth) steps in the world of shell scripting.</p>
  
  <p>BZT</p>