---
title: "SHELL 参数"
author: "weiruan85"
date: "2009-03-21T17:06:25Z"
tags: []
slug: "shell"
draft: false
lastmod: "2009-03-21T17:06:25Z"
id: 352801
url: "https://weiruan85.iteye.com/blog/352801"
---

 位置参数 ：
   $N   N 是从0 开始，1是向shell传递的参数。


 内部参数：
   $#   传递给程序的总的参数数目。
   $?   上一个代码或者shell程序在shell中退出的情况，如果正常退出则返回0 ,否
         则返回非0值。

   $*    传递给程序的所有参数组成的字符串
   $@    -"以参数1" "参数2"  形式保存任何参数。
   $$    本程序的PID
   $!    上一个程序的PID
   