bash - 如何从 lcov --summary 命令中仅读取行覆盖率并存储在某些 shell 脚本变量中?
问题描述
当我运行命令时lcov --summary coverage/lcov.info
我在控制台中得到如下输出
Summary coverage rate:
lines......: 80.5% (4900 of 6090 lines)
functions..: no data found
branches...: no data found
我只想将线路覆盖率 80.5 保存在某个变量中。于是写了一个bash脚本UTreport.sh
文件
#!/usr/bin/env bash
report = "$(lcov --summary coverage/lcov.info)"
echo The value of the report $report
但是这个脚本文件会引发错误。
UTreport.sh: line 2: report: command not found
The value of the report
有没有办法获得这个值?
解决方案
推荐阅读
- jboss - 使用第三方 jdbc jar 与 jboss_redirected 冲突。_DocumentBuilderfactory
- java - 我可以将 Spring bean 自动装配到 MapStruct 接口中吗?
- android - Android Studio 中的 Firebase 后端代码安排
- wordpress - 请求关于创建新闻数据库的 SQL 想法
- ms-access - Microsoft Access 的 On Format 事件中的详细信息部分中的存储过程结果
- python - 如何在管理员中忽略自定义模型管理器和覆盖的删除方法?
- node.js - 未找到 Ng 命令
- r - 如何在 R 中将 for 循环保存为 Gif 文件?
- javascript - 前端 API 引导表
- java - 使用java进行屏幕共享