This outputs the calendar dates to standard error.

test $# -eq 4||exec echo usage: $0 7 jul 20 aug;
x=$(echo $2 $4|sed -n '/[A-Z]/p');
if test "$x";then echo use lowercase;exit;fi
cal -y \
|sed -n -e "w 111" \
-e "3,10{s/\(.\{23\}\)\(.*\)/\1/w 111-a
}" -e "r 111"|sed -n \
-e "3,10{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-b
}" -e "3,10r 111"|sed -n \
-e "3,10{s/.\{46\}//w 111-c
}" -e "3,10r 111"|sed -n \
-e "11,18{s/\(.\{23\}\)\(.*\)/\1/w 111-d
}" -e "11,18r 111"|sed -n \
-e "11,18{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-e
}" -e "11,18r 111"|sed -n \
-e "11,18{s/.\{46\}//w 111-f
}" -e "11,18r 111"|sed -n \
-e "19,26{s/\(.\{23\}\)\(.*\)/\1/w 111-g
}" -e "19,26r 111"|sed -n \
-e "19,26{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-h
}" -e "19,26r 111"|sed -n \
-e "19,26{s/.\{46\}//w 111-i
}" -e "19,26r 111"|sed -n \
-e "27,34{s/\(.\{23\}\)\(.*\)/\1/w 111-j
}" -e "27,34r 111"|sed -n \
-e "27,34{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-k
}" -e "27,34r 111"|sed -n \
-e "27,34{s/.\{46\}//w 111-l
}" -e "27,34r 111"|sed '2,$d' \
|sed -e "r 111-a" -e "r 111-b" -e "r 111-c" \
-e "r 111-d" -e "r 111-e" -e "r 111-f" \
-e "r 111-g" -e "r 111-h" -e "r 111-i" \
-e "r 111-j" -e "r 111-k" -e "r 111-l" \
|sed '/^Su/d;/^ *$/d;/^ *[A-S]/s/^/@/
/Jan/,/Feb/s/$/ jan /;
/Feb/,/Mar/s/$/ feb /;
/Mar/,/Apr/s/$/ mar /;
/Apr/,/May/s/$/ apr /;
/May/,/Jun/s/$/ may /;
/Jun/,/Jul/s/$/ jun /;
/Jul/,/Aug/s/$/ jul /;
/Aug/,/Sep/s/$/ aug /;
/Sep/,/Oct/s/$/ sep /;
/Oct/,/Nov/s/$/ oct /;
/Nov/,/Dec/s/$/ nov /;
/Dec/,$s/$/ dec /;/@/d' \
|sed -n -e "/ $1 .*$2/,/ $3 .*$4/{
w /dev/stderr
/ 1 /d;p;}"|sed -n '$='

or to output the calendar dates to standard out, add another temp file, 111-z

test $# -eq 4||exec echo usage: $0 7 jul 20 aug;
x=$(echo $2 $4|sed -n '/[A-Z]/p');
if test "$x";then echo use lowercase;exit;fi
cal -y \
|sed -n -e "w 111" \
-e "3,10{s/\(.\{23\}\)\(.*\)/\1/w 111-a
}" -e "r 111"|sed -n \
-e "3,10{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-b
}" -e "3,10r 111"|sed -n \
-e "3,10{s/.\{46\}//w 111-c
}" -e "3,10r 111"|sed -n \
-e "11,18{s/\(.\{23\}\)\(.*\)/\1/w 111-d
}" -e "11,18r 111"|sed -n \
-e "11,18{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-e
}" -e "11,18r 111"|sed -n \
-e "11,18{s/.\{46\}//w 111-f
}" -e "11,18r 111"|sed -n \
-e "19,26{s/\(.\{23\}\)\(.*\)/\1/w 111-g
}" -e "19,26r 111"|sed -n \
-e "19,26{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-h
}" -e "19,26r 111"|sed -n \
-e "19,26{s/.\{46\}//w 111-i
}" -e "19,26r 111"|sed -n \
-e "27,34{s/\(.\{23\}\)\(.*\)/\1/w 111-j
}" -e "27,34r 111"|sed -n \
-e "27,34{s/\(.\{23\}\)\(.\{20\}\)\(.*\)/\2/w 111-k
}" -e "27,34r 111"|sed -n \
-e "27,34{s/.\{46\}//w 111-l
}" -e "27,34r 111"|sed '2,$d' \
|sed -e "r 111-a" -e "r 111-b" -e "r 111-c" \
-e "r 111-d" -e "r 111-e" -e "r 111-f" \
-e "r 111-g" -e "r 111-h" -e "r 111-i" \
-e "r 111-j" -e "r 111-k" -e "r 111-l" \
|sed '/^Su/d;/^ *$/d;/^ *[A-S]/s/^/@/
/Jan/,/Feb/s/$/ jan /;
/Feb/,/Mar/s/$/ feb /;
/Mar/,/Apr/s/$/ mar /;
/Apr/,/May/s/$/ apr /;
/May/,/Jun/s/$/ may /;
/Jun/,/Jul/s/$/ jun /;
/Jul/,/Aug/s/$/ jul /;
/Aug/,/Sep/s/$/ aug /;
/Sep/,/Oct/s/$/ sep /;
/Oct/,/Nov/s/$/ oct /;
/Nov/,/Dec/s/$/ nov /;
/Dec/,$s/$/ dec /;/@/d' \
|sed -n -e "/ $1 .*$2/,/ $3 .*$4/{
w 111-z
/ 1 /d;p;}"|sed -n -e '$=' -e "1r 111-z"