用sed修改配置文件id = 1timeA = "2012-03-04","2012-03-05","2013-03-06" timeB = "2012-03-04","2012-03-05","2013-03-06"我想修改timeB的时间,且保留空格,我该怎么写?我默认写的sed -i "s/timeB.*=/timeB =\"2012-04-04\",\"2012-04-05

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 01:28:27
用sed修改配置文件id=1timeA="2012-03-04","2012-03-05","2013-03-06"timeB="2012-03-04","2012-03-05","2013-03-0

用sed修改配置文件id = 1timeA = "2012-03-04","2012-03-05","2013-03-06" timeB = "2012-03-04","2012-03-05","2013-03-06"我想修改timeB的时间,且保留空格,我该怎么写?我默认写的sed -i "s/timeB.*=/timeB =\"2012-04-04\",\"2012-04-05
用sed修改配置文件
id = 1
timeA = "2012-03-04","2012-03-05","2013-03-06"
timeB = "2012-03-04","2012-03-05","2013-03-06"
我想修改timeB的时间,且保留空格,我该怎么写?
我默认写的sed -i "s/timeB.*=/timeB =\"2012-04-04\",\"2012-04-05\",\"2013-04-06\"/g" file
但是我的空格丢了?有什么高招只修改 = 号后面的值?

用sed修改配置文件id = 1timeA = "2012-03-04","2012-03-05","2013-03-06" timeB = "2012-03-04","2012-03-05","2013-03-06"我想修改timeB的时间,且保留空格,我该怎么写?我默认写的sed -i "s/timeB.*=/timeB =\"2012-04-04\",\"2012-04-05
sed -i '/timeB/s/\=.*/\= \"2012-04-04\",\"2012-04-05\",\"2013-04-06\"/g' file