@gnomon so i ended up doing curl -s -D - -o /dev/null "$url" | grep -Po '(?<=link\: \<).+(?=\>\; rel\=\"next\")' which I'm sure is terrible and non-portable but it works for me lmao