编写一个shell程序,改程序的功能是:检测位置参数个数是否等于0,若等于0,则列出当前目录本身的内容,否则,对于每个位置参数,以长格式显示其所包含的文件和子目录
#!/bin/bash
if [ $# -gt 0 ]; then
for i in $*; do
ls $i
done
else
ls
fi
if [ $# -gt 0 ]; then
for i in $*; do
ls $i
done
else
ls
fi
温馨提示:答案为网友推荐,仅供参考