太乙是什么意思| 蜘蛛的血是什么颜色的| 起伏跌宕什么意思| 满五唯一的房子要交什么税| 合欢是什么意思| 亢是什么意思| 男人鼻子大代表什么| 鼻子流水是什么原因| 一什么金光| 国资委主任是什么级别| 肺ca是什么病| 沁什么意思| 双鱼座和什么星座最配| 尿胆原弱阳性什么意思| 抽动症是什么引起的| 地米是什么药| 音译是什么意思| 黑色的屎是什么原因| 天牛长什么样子| 柯什么意思| 高血脂是什么原因造成的| 白细胞偏低是什么意思| 鸡拉绿色粪便吃什么药| 男性囊肿是什么引起的| 盛世美颜是什么意思| 腋下看什么科| 气虚血瘀吃什么中成药| 什么叫市级以上医院| 木人石心是什么意思| 腿弯疼是什么原因| 没脑子是什么意思| 五险一金和社保有什么区别| 什么化痰效果最好最快| 什么药治便秘效果最好最快| 塑料是什么材料| 蝉联什么意思| 井盖为什么是圆的| 红细胞高是什么意思| 低温烫伤是什么意思| choker是什么意思| 物以类聚形容什么动物| 泌尿外科看什么病| 什么老什么老| 母公司是什么意思| 右脸突然肿了是什么原因| 君子兰什么时候开花| 晚上睡觉阴部外面为什么会痒| 救赎是什么意思| 补体c3偏高说明什么| 高丽参适合什么人吃| 威士忌是什么酒| 大学211和985是什么意思| 85年的属什么| 心脏供血不足吃什么| 宽宽的什么填空| 11月16是什么星座| 切克闹是什么意思| 什么是肺部腺性肿瘤| 蜻蜓点水是什么生肖| 男人阴虱用什么药| 绿豆和什么一起煮好| 黄芪加陈皮有什么功效| 自主神经功能紊乱吃什么药| 洗面奶什么时候用最好| 睡觉后腰疼是什么原因引起的| 结婚 为什么| 脂蛋白高是什么意思| 毒龙是什么意思| 什么茶不能喝脑筋急转弯| 头上汗多是什么原因| 520是什么节日| 不放屁是什么原因| 二级b超是检查什么| 物是人非什么意思| 大年初一是什么生肖| 经常拉肚子什么原因| 1996年属什么生肖| 公关是干什么的| 文联主席是什么级别| 西米是什么| 早上口干口苦是什么原因| 尿检蛋白质弱阳性是什么意思| 爱情是什么样子的| 梦见一个人说明什么| 狗到家里是什么预兆| 左眼跳什么| 早搏是什么| 1984年属鼠的是什么命| 玛瑙什么颜色最贵| 肚子疼吐了是什么原因| 高血压头晕吃什么药| 优甲乐是治什么病的| 下山虎是什么意思| 举牌是什么意思| 病符是什么意思| 西米是用什么做的| 甲状腺肿是什么意思| 监测是什么意思| 肝炎是什么| 胃结石有什么症状表现| 绞股蓝有什么功效| 女性胆囊炎有什么症状| 嗜是什么意思| 鸡犬不宁是什么意思| 路人皆知的上一句歇后语是什么| 用激素药有什么副作用| 什么是双修| 第一次见面送女生什么花| 什么时候普及高中| 高密度脂蛋白偏低是什么意思| 小腿抽筋什么原因| 膀胱壁毛糙是什么意思| 尿ph值高是什么意思| 头上爱出汗是什么原因| 一颗什么| 什么茶不能喝脑筋急转弯| 什么是周边| 雷是什么生肖| 养生吃什么最好| 经期吃凉的东西有什么影响| s925是什么意思| 免疫缺陷是什么意思| 先期是什么意思| 附件炎有什么症状| 无脑儿是什么意思| 梦见捉黄鳝是什么意思| 颈椎轻度退行性变是什么意思| 症瘕痞块是什么意思| 窝沟封闭什么意思| 丑未相冲的结果是什么| 六月十一是什么日子| 肛瘘是什么症状| 什么啊| 什么是幽门螺杆菌感染| 今年21岁属什么生肖| 胰腺炎适合吃什么食物| 什么东西有脚却不能走路| cvd是什么意思| 白血球低是什么原因| 干咳吃什么药好| 蛲虫吃什么药| 什么是滑脉| 胰腺炎的症状是什么| 工勤人员是什么意思| 三世诸佛是什么意思| 怀孕吃什么水果比较好| 肋骨突出是什么原因| 格列本脲和格列美脲有什么区别| strange是什么意思| 两个菱形是什么牌子| 呕心沥血是什么意思| 梦见小牛犊是什么预兆| 做完人流可以吃什么| 职务是什么意思| 窦骁的父母是干什么的| 走路不稳是什么原因| 九二年属什么生肖| 梅核气吃什么药能除根| 两弹一星指什么| 男生做爱什么感觉| 论坛是什么| 喉咙发炎吃什么药| 小腿肿是什么原因| 肺有小结节要注意什么| 布加综合征是什么病| 财不外露什么意思| 房性早搏吃什么药最好| 清心寡欲什么意思| 结膜出血是什么原因| 阴囊上长了几根白毛是什么原因| 什么是伤官| 白发是什么原因引起的| 人体七大营养素是什么| 马蹄是什么| hba是什么意思| 心机重的人弱点是什么| 明年属什么生肖| 乙肝不能吃什么东西| 手抖是什么症状| 寻麻疹不能吃什么| 大片是什么意思| cra是什么| penis是什么意思| xyz是什么意思| 六月是什么夏| 陕西什么面| 梦见血是什么预兆解梦| 枸杞是补什么的| 嫁妆是什么意思| 中国的国菜是什么| 晚上睡觉脚抽筋是什么原因引起的| 七夕送老婆什么| 吐黄水是什么原因| 黄体酮吃了有什么副作用| 胡萝卜炒什么| 马英九是什么生肖| 李亚男为什么选王祖蓝| 全身大面积湿疹暗示着什么| 牙齿根部发黑是什么原因| 靥是什么意思| 懒羊羊的什么| 奇脉见于什么病| 梦见戴帽子是什么预兆| 5.11什么星座| 八月一日是什么节日| 11月18日什么星座| 拔罐为什么会起水泡| 迪士尼是什么意思| 晚字五行属什么| 投诉医生打什么电话| 牛和什么属相最配| 吃什么东西对肾好| 刀郎和那英是什么关系| 我操是什么意思| 虎落平阳被犬欺是什么生肖| 梦见手抓屎是什么意思| 蛋白石是什么| 拉屎是绿色的是什么原因| 10a是什么意思| 备孕吃什么水果| 18kgp是什么金| 吃得什么| 唱歌有什么好处| 中国精神是什么| 血热吃什么| 高铁列车长是什么级别| 谝是什么意思| 区局长是什么级别| 2是什么生肖| 未融资是什么意思| 热闹对什么| 叶酸有什么作用和功效| zorro是什么牌子的打火机| 秋千为什么叫秋千| 轻断食什么意思| 前列腺炎不能吃什么| luxury是什么牌子| 寿司是什么| 金骏眉属于什么茶| 铠字五行属什么| 怀孕吃什么有营养| 什么是嗳气有何症状| 蜜饯是什么东西| 什么叫托特包| 捐精有什么要求| 穿小鞋什么意思| 圆脸适合什么发型短发| 向日葵什么时候种| 什么是教育| 舌苔红是什么原因| 人为什么会做梦科学解释| mic是什么意思| 百合不能和什么一起吃| 梦见自己杀人了是什么意思| 低血糖吃什么| 中性粒细胞数目偏高是什么意思| 看乳腺应该挂什么科| 梦游的人为什么不能叫醒| 骏字五行属什么| 护照需要什么材料| 取环后吃什么恢复子宫| 应届生是什么意思| 为什么会长脂肪粒| 头昏吃什么药效果最好| 百度Jump to content

全区第三届老年人运动会在赤峰开幕 2000余人参赛

From Wikipedia, the free encyclopedia
百度 第二节两队继续陷入胶着状态,洛瑞三分飙射得手,戈登空接暴扣命中,猛龙打出28-26的比分,以52-51反超一分。

In a Unix or Unix-like operating system, job control refers to controlling a process group as a job via a shell.[1] Control features include suspend, resume, and terminate, and more advanced features can be performed by sending a signal to a job. Job control allows a user to manage processing in the Unix-based multiprocessing environment, and is distinct from general computing job control.

Job control was first implemented in the C shell by Jim Kulp,[2] then at IIASA in Austria, making use of features of the 4.1BSD kernel. The KornShell, developed at Bell Labs, adopted it and it was later incorporated into the SVR4 version of the Bourne shell, and exists in most modern Unix shells.

Job

[edit]

A job encompasses all of the processes that start for the handling of a shell command line. A simple command line may start just one process, but a command line may result in multiple processes since a process can create child processes, and a command line can specify a pipeline of multiple commands. For example, the following command line selects lines containing the text "title", sorts them alphabetically, and displays the result in a terminal pager: grep title somefile.txt | sort | less. This creates at least three processes: one for grep, one for sort, and one for less. Job control allows the shell to control these processes as one entity.

Job ID

[edit]

A job is identified by a numeric job ID, a.k.a. job number which is classified as a handle since it is an abstract reference to a resource (a process group). An ID value, prefixed with %, can be used with a job control command to specify a job. The special references %% and %+ refer to the default job; the one that would be selected if none specified.[3] Bash documentation refers to a reference (starting with %) as a jobspec (short for job specification).[4]

Job control ID values are typically only used in an interactive shell. In scripting, PGID values are used instead, as they are more precise and robust, and indeed job control is disabled by default in a bash script.

Foreground/background

[edit]

By default, a job runs in the foreground where it uses interactive input and output. The user enters a command line and interacts with the processes but cannot issue another command until the current job terminates. Many operations (i.e. listing files) are relatively quick so the user can wait for a response with little down time and some operations (i.e. editing) require interaction that is only possible via a foreground job. But, if interaction is not required and the operation prevents access to the shell for a long time, the user may want to run it in the background – where the processes cannot access interactive input but the user can perform other foreground operations while the background job runs concurrently. By default background jobs output to the interactive output stream which results in the interleaving of output from the foreground and background jobs although a user may redirect output for a background job to prevent this.

Control

[edit]

POSIX specifies the user interface to job control – modeled on the Korn shell.[5]. The commands are typically implemented as shell builtins; not separate programs.

Start in background

If a command line ends with &, then the job starts in the background.

Pause foreground job

The foreground job can be paused by pressing Ctrl+ Z. In this state, a job can be resumed in the background via bg or resumed in the foreground via fg.

Command fg

Command fg (short for foreground) moves background job to the foreground; either the job specified or the one most recently added to the background if none specified. When the foreground job is paused (via Ctrl+ Z), then this command resumes that job.

Command wait

Command wait pauses the interactive session until the specified background jobs complete or for all background jobs of the active shell if none specified.[6]

Command bg

Command bg (short for background) moves the paused foreground job to the background and resumes it.

Command jobs

Command jobs reports information about each background job including ID, command line and running status (stopped or running).

Signals

[edit]

The interprocess communication of job control is implemented via signals.

Typically, a shell maintains information about background jobs in a job table. When an interactive session ends (i.e. user logs out), the shell sends signal SIGHUP to all jobs, and waits for the process groups to exit before terminating itself. Some shells provide a non-POSIX command disown that removes a job from the job table. The process group becomes an orphan. The shell will not send it SIGHUP, nor wait for it to terminate. This is one technique for enabling a process as a daemon; owned direclty by the root process init. The POSIX command nohup provides an alternate way to prevent a job from being terminated by the shell.

Suspending the foreground job (via Ctrl +Z) sends signal SIGTSTP (terminal stop) to the processes of the group. By default, this signal causes a process to pause so that the shell can resume. However, a process can ignore the signal. A process can also be paused via signal SIGSTOP (stop), which cannot be ignored.

When the user presses Ctrl +C, the shell sends signal SIGINT (interrupt) to each foreground job process, which defaults to terminating it, though a process can ignore the signal.

When a stopped job is resumed (via bg or fg), the shell redirects Input/output and resumes it by sending signal SIGCONT to it.

A background process that attempts to read from or write to its controlling terminal is sent signal SIGTTIN (for input) or SIGTTOU (for output). These signals stop the process by default, but they may also be handled in other ways. Shells often override the default stop action of SIGTTOU so that background processes deliver their output to the controlling terminal by default.

In bash, the kill builtin (not /bin/kill) can signal jobs by ID as well as by process group ID. Sending a signal to a job sends it to each process of the group. kill can send any signal to a job; however, if the intent is to rid the system of the processes, the signals SIGKILL and SIGTERM (the default) are probably the most applicable.

References

[edit]
  1. ^ IEEE Std 1003.1-2001, Section 3.201, Job
  2. ^ Foreword by Bill Joy in Anderson, Gail; Paul Anderson (1986). The UNIX C Shell Field Guide. Prentice-Hall. p. xvii. ISBN 0-13-937468-X.
  3. ^ IEEE Std 1003.1-2001, Section 3.203, Job Control Job ID
  4. ^ 7.1 Job Control Basics
  5. ^ bg – Shell and Utilities Reference, The Single UNIX Specification, Version 5 from The Open Group; fg – Shell and Utilities Reference, The Single UNIX Specification, Version 5 from The Open Group.
  6. ^ Kerrisk, Michael (Feb 2, 2025). "wait(1p) — Linux manual page". man7.org. Retrieved May 13, 2025.

Further reading

[edit]
[edit]
prada什么牌子 烧心什么感觉 bacardi是什么酒 病毒的遗传物质是什么 茶氨酸是什么
镰刀菌用什么杀菌剂 菜心又叫什么菜 黄体功能不足吃什么药 吹牛皮是什么意思 无致病菌生长是什么意思
油腻是什么意思 骨显像主要检查什么 属兔与什么属相相克 清真不吃什么肉 朱元璋为什么杀蓝玉
什么是肺磨玻璃结节 胸口正中间疼痛是什么病症 暴饮暴食会得什么病 胃反酸水吃什么药 泥鳅吃什么饲料
什么是高危性行为hcv9jop0ns2r.cn 冯字五行属什么yanzhenzixun.com 痔疮的初期症状是什么hcv8jop8ns5r.cn 组织液是什么hcv9jop8ns1r.cn 血小板高是什么原因hcv9jop7ns4r.cn
安分守己什么意思hcv9jop3ns7r.cn 兔子跟什么生肖最配对hcv9jop0ns6r.cn 光谱是什么hcv9jop0ns9r.cn 茄子有什么营养hcv9jop0ns0r.cn 提拉米苏是什么wuhaiwuya.com
有因必有果什么意思hcv9jop4ns3r.cn 梦见丢了一只鞋是什么意思hcv9jop1ns4r.cn 4月27日是什么星座gangsutong.com 胆结石吃什么hcv8jop6ns6r.cn 屁股疼是什么原因引起的hcv9jop4ns1r.cn
结核杆菌是什么hcv8jop1ns1r.cn 道德经适合什么人看hcv8jop1ns8r.cn 小狗感冒症状是什么样的wzqsfys.com 疥疮是什么原因造成的hcv8jop8ns8r.cn 草木皆兵是什么意思hcv9jop5ns4r.cn
百度