Isso fará isso usando o bash:
declare -i m=$(date +%m)
declare -i cq=($m-1)/3+1
declare -i cy=$(date +%Y)
declare -i py=$cy; [ $m -lt 4 ] && py=$cy-1
declare -i pq=$cq-1; [ $pq -eq 0 ] && pq=4
declare -i ny=$cy; [ $m -gt 9 ] && ny=$cy+1
declare -i nq=$cq+1; [ $nq -gt 4 ] && nq=1
echo ${py}q${pq},${cy}q${cq},${ny}q${nq}
ex por agora: 2018q1,2018q2,2018q3