Eu descobri um método que não depende da sintaxe arcana da entrada para:
date -d
Esta função resolve o problema:
function calculateTargetDay {
# Calculates the day in the month of the nth. weekday in month
# $1 is the current date stored in an array as yy mm dd integers
# $2 is the day of the week as an integer, Monday = 1
# $3 is the week of the month as an integer - first week = 1
# Returns the day of month in the $daymonth variable which should be defined in the main-line
daymonth=$(( $(date -d "${1[0]}-${1[1]}-1" +%u) - 1 )) # Get relative day in week of 1st. of month
# Calculate release day within month
daymonth=$(( $daymonth - $2 + 7 + (( $3 - 1) * 7 ) ))} # Gives day in month of nth weekday in month
Isso encapsula o cálculo de maneira compacta.