求大神,SHELL 执行SED命令替换时字符里面斜线怎么处理

2025-01-20 01:46:23
推荐回答(1个)
回答1:

bb=/opt/oracle/oradb/oradata/bbdb.db
sed -i "/aadb/s_/opt/oracle/oradata/aadb.db_$bb_" aa.sql

 

All formats below are ok.

s/A/B/

s#A#B#

s_A_B_