shell编程 遍历目录文件

1.当前目录下有文件 1.txt 2.txt 3.txt

2.

#!/bin/sh

for filelist in $(ls *.txt)

do

echo $filelist

done

输出结果:

1.txt

2.txt

3.txt

 

posted @ 2017-07-04 11:25  wssw  阅读(220)  评论(0编辑  收藏  举报