#!/bin/bash
#指定要修改的文件和行号
file_path="top.v"
line_number=76
#读取文件内容并修改指定行
old_line=$(sed -n "${line_number}p" "$file_path")
new_line=".cfg3 (32'h00000000), "
set -i "${line_number}s/.*/${new_line}/" "file_path"
echo "已经修改第${line_number}行,从${old_line}改为${new_line}"
source run.tcl
matlab -nodisplay -nosplash -nodesktop -r "script;exit;"
09-20
145
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)