bash: 什么是jobspec

bash: What is a jobspec

在阅读文档 [1] 时,术语 "jobspec" 出现了几次。

什么是工作规范?

[1] https://www.gnu.org/software/bash/manual/html_node/Job-Control-Builtins.html

The job control section of Greg's Bash Guide 描述如下:

A job specification or "jobspec" is a way of referring to the processes that make up a job. A jobspec may be:

  • %n to refer to job number n.
  • %str to refer to a job which was started by a command beginning with str. It is an error if there is more than one such job.
  • %?str to refer to a job which was started by a command containing str. It is an error if there is more than one such job.
  • %% or %+ to refer to the current job: the one most recently started in the background, or suspended from the foreground. fg and bg will operate on this job if no jobspec is given.
  • %- for the previous job (the job that was %% before the current one).