linux sed\n引用模式问题问题

lantian510 2017-09-13 01:44:30

dome1.txt:This is a long string
我输入 sed 's,\(This\)\(is\)\(a\)\(string\),\2\1\4\3/,g' dome1.txt
期盼结果为 :is This long a string
但实际结果为:This is a long string
请问为什么?
...全文
233 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
exuxu 2017-09-15
  • 打赏
  • 举报
回复
echo "This is a string" | sed 's;\(This.\)\(is.\)\(a.\)\(string.\);\2\1\4\3;'
exuxu 2017-09-15
  • 打赏
  • 举报
回复
echo "Thisisastring" | sed 's;\(This\)\(is\)\(a\)\(string\);\2\1\4\3;'

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧