Haoxiang’s Blog
Skip to content
  • Home
  • Blog Posts
  • (中文)
  • (EN)
  • About
  • RSS
  • Messages

2012/03/13

There was one post published on 2012/03/13.

Use a different delimiter in sed

Think about this, you want to replace “XXX” with a path like “/path/to/YYY” in a file. Your file looks like this: XXX AAA XXX Your bash script looks like this: NEW_PATH=”/path/to/YYY” VAR=”XXX” sed -e ‘{s/$VAR/$NEW_PATH/g}’ your_file Well, it won’t work, since single quotes ‘ will force bash to keep variables as-is. Ok, we try to […]

in Blog Posts, English, Solution | 2012/03/13 | Comment
这个网站使用的主机 (我的推广链接)
Independent Publisher empowered by WordPress