赞
踩
test.sh
#!/bin/sh
echo "hello"
echo "filename:$0"
echo "last result:$?"
echo "all parameters:$*"
echo "all parameters:$@"
echo "count parameters:$#"
echo "pid:$$"
echo "first para:$1"
echo "second para:$2"
修改文件权限:所有用户添加执行权限
chmod a+x test.sh
执行shell脚本
./test.sh 1 “para2”
hello
filename:./test.sh
last result:0
all parameters:1 para2
all parameters:1 para2
count parameters:2
pid:214
first para:1
second para:para2
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。