4256 shaares
In a nutshell:
SUN=$SAUCE_USERNAME; SAK=$SAUCE_ACCESSKEY
curl -u $SUN:$SAAK https://saucelabs.com/rest/v1/$SUN/jobs?format=csv \
| perl -wpe 's/\r$//' \
| xargs -I{} curl -u $SUN:$SAK -X DELETE "https://saucelabs.com/rest/v1/$SUN/jobs/{}"