什么并不意味着$$或$!在bash? [英] What does mean $$ or $! in bash?

查看:162
本文介绍了什么并不意味着$$或$!在bash?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一种简单的问题,但我没有找到任何信息。什么并不意味着 $! $ 在bash?

It's kind of easy question but I didn't find any information. What does mean $! or $$ in bash?

例如:<?code> PS -p $ 或 pstree $$

推荐答案

其实,这些变量从Bourne shell的bash的继承。

Actually, these variables were inherited by bash from the Bourne shell.

$$是指当前PID。

$!是最后一个节目你的shell在后台运行的PID(例如,MYPROG&安培;)

"$!" is the PID of the last program your shell ran in the background (e.g. "myprog &")

下面是shell变量的列表:

Here is a list of shell variables:

这篇关于什么并不意味着$$或$!在bash?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆