Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:56:33+00:00 2026-05-27T05:56:33+00:00

I am working with cal for a homework assignment and i am stuck on

  • 0

I am working with cal for a homework assignment and i am stuck on one point.

It is unlikely that anyone is really interested in getting a gregorian
calendar for a year in the first century, a time when the gregorian
calendar didn’t even exist. Use the “windowing” strategy to allow your
new cal to handle years that are not the full 4 digit year. If the
year is in the range of 0 <= year <= 50, assume the year is really
2000-2050. If the year is in the range 51 <= year <= 99, assume the
year is really 1951-1999.

file named improvedcal.sh
call the shell with sh improvedcal.sh 1 2011 for example
code

case $# in 

# rando stuff

*) m=$1; y=$2 ; # 2 ags: month and year
if ((y >= 0 && y <= 50)); then  
y+=2000
elif ((y >= 51 && y <= 99)); then
y+=1900
fi;;
esac

case $m in
jan*|Jan*) m=1 ;;
feb*|Feb*) m=2 ;;
mar*|Mar*) m=3 ;;
apr*|Apr*) m=4 ;;
may*|May*) m=5 ;;
jun*|Jun*) m=6 ;;
jul*|Jul*) m=7 ;;
aug*|Aug*) m=8 ;;
sep*|Sep*) m=9 ;;
oct*|Oct*) m=10 ;;
nov*|Nov*) m=11 ;;
dec*|Dec*) m=12 ;;
[1-9]|10|11|12) ;; # numeric month
0[1-9]|010|011|012) ;; # numeric month
# *) y=$m; m="" ;; # plain year
esac

/usr/bin/cal $m $y # run cal with new inputs

But this is not working for some reason does anyone have any pointers for me?
It just skips right over this part for some reason.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:56:33+00:00Added an answer on May 27, 2026 at 5:56 am

    Try running your script with bash -xv, it will help you understand what is happening.

    Read also Bash programming intro

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a fatal error in an application that I have been working
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a
I have microcontroler that I am working with. When debugging it is necessary to
I am working on a full calendar on a webpage. Currently, the layout of
I have a calendar application, and in that calendar application, there is a mini
I'm working on a WinCE 6.0 system with a touchscreen that stores its calibration
I am working Calendar API (Java). My specific requirement is I want to add
Ok I need to make this program to display cal 3 month(one month before
I'm working on a calendar via Python's HTMLCalendar and Django. The functions I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.