首页 > 系统服务 > 详细

shell for循环输出目录下的文件名

时间:2019-08-21 12:03:24      阅读:378      评论:0      收藏:0      [点我收藏+]

 

test.sh文件:
#!/bin/bash
for file in `ls`;do
        echo $file
done
输出
bogon:test macname$ chmod +x test.sh
bogon:test macname$ ./test.sh 
case
html
report
run.sh
test.sh

 

 

参考:

https://www.runoob.com/linux/linux-shell-variable.html

 

shell for循环输出目录下的文件名

原文:https://www.cnblogs.com/sea-stream/p/11387675.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!