2013年8月3日
摘要: 一、分支语句语法:(多路分支) case word in patterm1) list A ;; pattern2) list B ;; patternN) list N ;; esac例子:case $ANS in yes) echo O.K ;; no) echo no go ;;esac 阅读全文
posted @ 2013-08-03 23:33 meizixiong 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1、Linux Shell参数引用$0 这个程式的执行名字$n 这个程式的第n个参数值,n=1..9$* 这个程式的所有参数$# 这个程式的参数个数$$ 这个程式的PID$! 执行上一个背景指令的PID$? 执行上一个指令的返回值$@ 跟$*类似,但是可以当作数组用2、举例[root@server tmp]# cat test.sh#!/bin/bash#test shellecho $0echo $1echo $2echo $?echo $*echo $#[root@server tmp]# ./test.sh yema Bhanv edu network./test.sh //程序名称Ye 阅读全文
posted @ 2013-08-03 11:18 meizixiong 阅读(321) 评论(0) 推荐(0) 编辑