shell脚本 lines=$(grep -n RIV_AT_OVER_UART ${riv_arbel_path}/Riv_Arbel_Env.mak | cut -d':' -f1)
时间: 2023-03-15 09:33:31 浏览: 71
我可以提供一些指导,但是我并不是专家。您可以参考下面的步骤:1.打开Riv_Arbel_Env.mak文件2.使用grep命令搜索RIV_AT_OVER_UART3.用cut命令将行号提取出来并存储在变量lines中。
相关问题
lines=$(grep -n RIV_AT_OVER_UART ${riv_arbel_path}/Riv_Arbel_Env.mak | cut -d':' -f1)
中文翻译:RIV_AT_OVER_UART在riv_arbel_path/Riv_Arbel_Env.mak中的行号为$(grep -n RIV_AT_OVER_UART ${riv_arbel_path}/Riv_Arbel_Env.mak | cut -d: -f1)
for nvmx in $(lsblk |grep -i disk |grep -vw $osdisk |awk {'print $1'} |grep nvme) do dir=${path}/$nvmx fio --ioengine=libaio --randrepeat=0 --norandommap --thread --direct=1 --group_reporting --name=mytest --runtime=1m --time_based --numjobs=1 --iodepth=128 --filename=/dev/${nvmx} --rw=randrw --rwmixread=70 --bs=4k --output=${dir}/fio_log/mixrandRW_${count}.log & nvme smart-log /dev/${nvmx} >${dir}/smartctl_log/${nvmx}_smart_${count} nvme intel smart-log-add /dev/${nvmx} >>${dir}/smartctl_log/${nvmx}_smart_${count} done
这段脚本的作用是,对除了 `$osdisk` 外的所有 NVMe 类型的硬盘进行性能测试和智能诊断,并将测试结果和诊断日志输出到指定的目录中。
脚本的具体流程如下:
1. 使用 `lsblk` 命令列出所有硬盘,并使用 `grep` 命令过滤出 NVMe 类型的硬盘。
2. 对每个 NVMe 硬盘,使用 `fio` 命令进行性能测试,并将测试结果输出到指定目录的日志文件中。
3. 对每个 NVMe 硬盘,使用 `nvme smart-log` 命令获取硬盘的智能诊断信息,并将诊断日志输出到指定目录的日志文件中。
4. 对每个 NVMe 硬盘,使用 `nvme intel smart-log-add` 命令获取 Intel 厂商的扩展智能诊断信息,并将诊断日志追加输出到指定目录的日志文件中。
该脚本的运行需要依赖 `fio`、`nvme` 和 `smartctl` 等工具。需要确保这些工具已经安装并配置正确。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)