---
title: "shell中的特殊变量"
author: "wode66"
date: "2011-07-06T16:23:28Z"
tags: []
categories: ["编程语言"]
slug: "shell"
draft: false
lastmod: "2011-07-06T16:23:28Z"
id: 1117128
url: "https://suo.iteye.com/blog/1117128"
---

shell中的特殊变量：

 

```
变量名	含义
$0		shell或shell脚本的名字
$*		以一对双引号给出参数列表
$@		将各个参数分别加双引号返回
$#		参数的个数
$_		代表上一个命令的最后一个参数
$$		代表所在命令的PID
$!		代表最后执行的后台命令的PID
$?		代表上一个命令执行后的退出状态
```