• 收集路径下的html并写到根目录index.html


    我们可以用简单的脚本生成一个简单的导航页。

    用于查看当前路径下所有的html。

    1. #!/bin/bash
    2. index_root="/root/test/"
    3. cd ${index_root}
    4. echo "" > index.html
    5. echo "Test Report Index

      Test Report Index

        " >> index.html
    6. echo "

      Part 1:

        " >> index.html
    7. find ./part1 -type f -name "*.html" | while read ITEM; do
    8. echo "
    9. $ITEM>$ITEM
    10. " >> index.html
  • done
  • echo "
" >> index.html
  • echo "

    Part 2:

      " >> index.html
  • find ./part2 -type f -name "*.html" | while read ITEM; do
  • echo "
  • $ITEM>$ITEM
  • " >> index.html
  • done
  • echo "" >> ${index_root}/index.html
  • # 完成列表后添加 HTML 尾部
  • echo "" >> index.html
  • echo "Index has been created."
  • 如上脚本会分别扫描/root/test目录下的part1和part2目录,并写入index.html。

    可以结合网站服务tomcat,apache使用,用于展示。

  • 相关阅读:
    【深入浅出Java并发编程指南】「源码分析篇」透析ThreadLocal线程私有区域的运作机制和源码体系
    Django-入门
    【无人机】基于RRT算法实现四旋翼无人机的安全和最小能量轨迹规划附matlab代码和报告
    【一起学Rust | 设计模式】习惯语法——使用借用类型作为参数、格式化拼接字符串、构造函数
    如何系统地自学 Python
    git入门到精通
    机器学习笔记之隐马尔可夫模型(五)学习问题——EM算法
    leetcodetop100(18) 螺旋矩阵
    二分查找算法
    函数式编程01
  • 原文地址:https://blog.csdn.net/zhulianseu/article/details/140355305