dotfiles/dot_config/fish/private_functions/private_last_job_id.fish

15 lines
328 B
Fish
Raw Permalink Normal View History

2021-08-10 10:50:48 +02:00
function last_job_id -d "Get the id of one or more existing jobs"
builtin jobs $argv | command awk -v FS=\t '
/[0-9]+\t/{
aJobs[++nJobs] = $1
}
END {
for (i = 1; i <= nJobs; i++) {
print(aJobs[i])
}
exit nJobs == 0
}
'
end