shell脚本 for循环迭代文件

分手后的思念是犯贱 2022-07-15 01:55 351阅读 0赞
  1. test -d dir
  2. echo $?
  3. for A in `ls`
  4. do
  5. test -d $A
  6. if [ $? -eq 0 ]
  7. then
  8. echo director is $A
  9. else
  10. echo file is $A
  11. fi
  12. done

发表评论

表情:
评论列表 (有 0 条评论,351人围观)

还没有评论,来说两句吧...

相关阅读