bash:什么是工作规范
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35026395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
bash: What is a jobspec
提问by american-ninja-warrior
While reading documentation [1], the term "jobspec" appears a few times.
在阅读文档 [1] 时,术语“jobspec”出现了几次。
What is a jobspec?
什么是工作规范?
[1] https://www.gnu.org/software/bash/manual/html_node/Job-Control-Builtins.html
[1] https://www.gnu.org/software/bash/manual/html_node/Job-Control-Builtins.html
回答by Rany Albeg Wein
The job control section of Greg's Bash Guidedescribes this as follows:
Greg 的 Bash 指南的作业控制部分对此进行了如下描述:
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 numbern
.%str
to refer to a job which was started by a command beginning withstr
. It is an error if there is more than one such job.%?str
to refer to a job which was started by a command containingstr
. 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).
作业规范或“作业规范”是指构成作业的流程的一种方式。工作规范可能是:
%n
参考工作编号n
。%str
引用由以 开头的命令启动的作业str
。如果有多个这样的工作,这是一个错误。%?str
引用由包含str
. 如果有多个这样的工作,这是一个错误。%%
或%+
引用当前作业:最近在后台启动或从前台暂停的作业。如果没有提供 jobspec,fg 和 bg 将在此作业上运行。%-
上一份工作(当前工作%%
之前的工作)。