#!/bin/sh
# Extracts jobspecs (%#) from (possibly filtered) `jobs` output
# Usage: self
sedEreFlag="$(test "$(uname)" = Darwin && echo E || echo r)"
sed () { "$(which sed)" -"$sedEreFlag" "$@";}
sed -n 's/^\[([0-9]+)\].*$/%\1/p'