看下面的一段程序。 #!/bin/bash if [ $# -gt 0 ]; then echo "参数个数为$#个" else echo "没有参数" fi 转载于:https://www.cnblogs.com/wangkongming/p/4221618.html