是否可以举例,谢谢
追答[root@master ~]# cat test.sh
#!/bin/bash
echo "the argument amount \$# is:$#"
echo "the argument list are: $@"
echo "excecute date command"
date
if [ $? -eq 0 ];then
echo " \$? is $?,execute status is sucessful"
fi
[root@master ~]#
[root@master ~]# ./test.sh aa bb cc
the argument amount $# is:3 //参数个数
the argument list are: aa bb cc //参数列表
excecute date command
Tue May 14 02:47:46 EDT 2013 //date 执行结果
$? is 0,execute status is sucessful //$?状态码为0.表示上一个命令date执行成功
[root@master ~]#