-- *****************************************************************************
-- ** Storage group name = IBMSTOGROUP
-- ** Storage group ID = 0
-- ** Data tag = None
-- *****************************************************************************
-- SET STOGROUP PATHS FOR IBMSTOGROUP
-- ON '/udb/ss/DI10'
-- , '/udb/ss/DI9'
-- , '/udb/ss/DI8'
-- , '/udb/ss/DI7'
-- , '/udb/ss/DI6'
-- , '/udb/ss/DI5'
-- , '/udb/ss/DI4'
-- , '/udb/ss/DI3'
-- , '/udb/ss/DI2'
-- , '/udb/ss/DI1'
-- ;
需要更换--
为''
.
我使用了 sed 命令,但它显示了两次。
sed -n "/-- ON/,/DI1.*$/c\ON '/udb/ss/DI1','/udb/ss/DI2','/udb/ss/DI3'/" file
需要将 -- 替换为 ''。
预期输出:
-- *****************************************************************************
-- ** Storage group name = IBMSTOGROUP
-- ** Storage group ID = 0
-- ** Data tag = None
-- *****************************************************************************
SET STOGROUP PATHS FOR IBMSTOGROUP
ON '/udb/ss/DI10'
, '/udb/ss/DI9'
, '/udb/ss/DI8'
, '/udb/ss/DI7'
, '/udb/ss/DI6'
, '/udb/ss/DI5'
, '/udb/ss/DI4'
, '/udb/ss/DI3'
, '/udb/ss/DI2'
, '/udb/ss/DI1'
;