Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • See What are the shell's control and redirection operators? and look at the paragraphs on "here documents" and "here strings". Commented Oct 7, 2014 at 19:24
  • 1
    Also, please do some debugging on your own before you ask for help. If you know that you have a problem at the end of your script, you should post just the part that has the problem. And explain what is going wrong. Commented Oct 7, 2014 at 19:25
  • The end of a while ...; do should be marked with done, not fi. And the loop will run infinitely, because the body never changes $#. Commented Oct 7, 2014 at 19:37
  • What is the while loop for, anyway? You already checked the arguments at the top of the script, why are you checking the number of arguments. Commented Oct 7, 2014 at 19:41
  • The cal command takes a year and month, not a day. It shows a calendar for the whole month. What are you expecting your script to show from that line? Commented Oct 7, 2014 at 19:44