shell的函数
摘要:
环境:ubuntu10.10 + bash函数定义以及传参#! /bin/shtest(){ echo $1 #打印第一个参数}a='hello,world'test $a #参数必须是定义好的变量传递两个参数#! /bin/shtest(){ echo $1 #打印第一个参数 echo $2 return 127 #只能返回整数}test 'hello,world!' 'lishujun' #传递两个参数echo $? #取得函数返回值,调用完毕立即取值取得返回值#! /bin/shtest(){ echo $1 #打印第一个参数 return 阅读全文
posted @ 2013-04-01 17:13 codestyle 阅读(201) 评论(0) 推荐(0)
浙公网安备 33010602011771号