【发布时间】:2019-05-02 07:57:58
【问题描述】:
我有.h 文件如下
//Structure
typedef struct VIN_oFDCAN8_8d836e25_In
{
vbittype unused31 : 8;
vbittype unused30 : 8;
vbittype unused29 : 8;
vbittype unused28 : 8;
vbittype unused27 : 8;
vbittype unused26 : 8;
vbittype unused25 : 8;
vbittype unused24 : 8;
vbittype unused23 : 8;
vbittype unused22 : 8;
vbittype unused21 : 8;
vbittype unused20 : 8;
vbittype unused19 : 8;
vbittype unused18 : 8;
vbittype unused17 : 8;
vbittype VIN_DATA_AH_C : 56;
vbittype unused9_0 : 2;
vbittype VIN_MSG_AH_C : 2;
vbittype unused9_1 : 4;
vbittype unused8 : 8;
vbittype unused7 : 8;
vbittype unused6 : 8;
vbittype unused5 : 8;
vbittype unused4 : 8;
vbittype unused3 : 8;
vbittype unused2 : 8;
vbittype unused1 : 8;
vbittype unused0 : 8;
}__attribute__((packed))_c_VIN_oFDCAN8_8d836e25_In_msgType;
//union
typedef union _c_VIN_oFDCAN8_8d836e25_In_bufTag
{
vuint8 _c[32];
_c_VIN_oFDCAN8_8d836e25_In_msgType VIN_oFDCAN8_8d836e25_In;
} _c_VIN_oFDCAN8_8d836e25_In_buf;
//Declaration
_c_VIN_oFDCAN8_8d836e25_In_buf VIN_oFDCAN8_8d836e25_In_data;
如您所见,所有类型名称都以_c_ 开头。
_c_VIN_oFDCAN8_8d836e25_In_msgType
_c_VIN_oFDCAN8_8d836e25_In_bufTag
_c_VIN_oFDCAN8_8d836e25_In_buf
我想为它们添加_Moto_标签,如下所示。
_c_VIN_oFDCAN8_8d836e25_In_Moto_msgType
_c_VIN_oFDCAN8_8d836e25_In_Moto_bufTag
_c_VIN_oFDCAN8_8d836e25_In_Moto_buf
我有很多这样的定义,我可以在这样的定义中找到常见的标签是_c_。
您能帮我用sed 命令一次性替换所有这些吗?
【问题讨论】:
-
我是
sed命令的新手,我没有得到任何关于添加字符串的信息,而是有很多关于替换现有字符串的主题。