"content":"<p>Write a bash script to calculate the frequency of each word in a text file <code>words.txt</code>.</p>\r\n\r\n<p>For simplicity sake, you may assume:</p>\r\n\r\n<ul>\r\n\t<li><code>words.txt</code> contains only lowercase characters and space <code>' '</code> characters.</li>\r\n\t<li>Each word must consist of lowercase characters only.</li>\r\n\t<li>Words are separated by one or more whitespace characters.</li>\r\n</ul>\r\n\r\n<p><strong>Example:</strong></p>\r\n\r\n<p>Assume that <code>words.txt</code> has the following content:</p>\r\n\r\n<pre>\r\nthe day is sunny the the\r\nthe sunny is is\r\n</pre>\r\n\r\n<p>Your script should output the following, sorted by descending frequency:</p>\r\n\r\n<pre>\r\nthe 4\r\nis 3\r\nsunny 2\r\nday 1\r\n</pre>\r\n\r\n<p><b>Note:</b></p>\r\n\r\n<ul>\r\n\t<li>Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.</li>\r\n\t<li>Could you write it in one-line using <a href=\"http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html\">Unix pipes</a>?</li>\r\n</ul>\r\n",