Blogger Information
Blog 110
fans 0
comment 0
visits 112326
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Linux中变量#,@,0,1,2,*,$,$?的含义描述
Coco
Original
1142 people have browsed it

  Linux中变量#,@,0,1,2,*,$$,$的含义

  我们先写一个简单的脚本,执行以后再解释手游买卖平台各个变量的意义# touch variable# vi variable脚本内容如下:#!/bin/shecho "number:#"

  echo"scname:0"

  echo "first :1"echo"second:2"

  echo "argume:$@"

  echo "show parm list:$*"

  echo "show process id:$$"

  echo "show precomm stat: $"

  保存退出赋予脚本执行权限# chmod +x variable执行脚本# ./variable aa bbnumber:2

  scname:./variable

  first:aa

  second:bb

  argume:aa bbshow parm list:aa bb

  show process id:24544show precomm stat:0

  通过显示结果可以看到:$# 是传给脚本的参数个数$0 是脚本本身的名字$1 是传递给该shell脚本的第一个参数$2 是传递给该shell脚本的第二个参数$@ 是传给脚本的所有参数的列表$* 是以一个单字符串显示所有向脚本传递的参数,与位置变量不同,参数可超过9个$$ 是脚本运行的当前进程ID号$ 是显示最后命令的退出状态,0表示没有错误,其他表示有错误

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post