test.sh:
#!/bin/sh filelist=`ls ./` # 这里不是单引号! for file in $filelist do echo $file done
输出:
[root@localhost shell]# ./test.sh a.txt test.sh
阅读: 19981
阅读: 17114 评论:1
阅读: 16268
阅读: 16210
阅读: 15677
阅读: 15442
扫扫关注微信