- 论坛徽章:
- 0
|
我有个软件的配置文件,里面是分不同场景的,但是不同场景中有相同的字段,我想某个场景下的字段值,但是其他场景中也有相同的字段,这样导致所有场景中相同的字段都被替换,想问问大家有没有什么好办法。
配置文件如下
[场景1]
ProcessCount = 1
MKMThreadCount = 32
FolderNum = 32
lev2FolderNum = 512
lev3FolderNum = 64
WriteFilePath = /home/hms/data/c/vod_pub_d/400k/
TsFileNum = 50
MediaFileType = mdn123ts
WriteMediaFileSize = 409600
[场景2]
ProcessCount = 1
MKMThreadCount = 4500
FolderNum = 32
lev2FolderNum = 16
lev3FolderNum = 64
ReadFilePath =/home/hms/data/c/vod_pub_d/400k/
ReadUserCaps = 18
ReadKBitRate = 2000
ReadvKbs = 2048
TsFileNum = 50
MediaFileType = mdn123ts
WriteChannelNum = 200
WriteFilePath = /home/hms/data/d/rec_pub_d/CDN_2/
WriteUserCaps = 18
WriteKBitRate = 2000
WriteMediaFileSize = 409600
WriteDIOFlag = true
其中把WriteMediaFileSize = 409600 替换成 WriteMediaFileSize = 2097152
sed -i 's/WriteMediaFileSize = 409600/WriteMediaFileSize = 2097152/g',但是这样一来两个场景的这个字段就都被替换了,我只想替换场景1中的这个字段。 |
|