Let's say I send two jobs to the background.
$ sleep 77 &
$ sleep 99 &
Then I check my jobs
$ jobs
> [1] - running sleep 77
> [2] + running sleep 99
Can I control what job number gets assigned to these jobs? I'm not sure if I'm using the right terminology here, I'm talking about the numbers denoted as [1]
and [2]
in the example before.
The use case is the following: I need a job that renews my credentials every now and then, but most of the time it is asleep. I wrote a function that is automatically sent to the background if called. I do this deliberately since I want to have control over this process, i.e. I explicitly want to have it as a job.
when I call the function and there are no other jobs, it gets the job number [2]
. (I assume [1]
would be the subprocess calling the function.) This is confusing, since when I later send job1
to the background, it gets the job number [1]
, but job2
gets the job number [3]
. I would prefer if I could assign a large number to my sleeping function by hand, e.g. something like [99]
. Is this possible? Either in bash
or zsh
?