Chinaunix

标题: sed的问题 [打印本页]

作者: hantom    时间: 2010-07-30 19:59
标题: sed的问题
echo "hello" | sed '/hello/o\{5\}/'  
为什么输出为o{5}.
替换字符不能使用正则表达式吗?
作者: justlooks    时间: 2010-07-30 20:13
你想一下,如果用了正则输出会是什么
作者: welcome008    时间: 2010-07-31 00:42
呵呵,替换为所有可能的?
作者: hantom    时间: 2010-07-31 15:06
比如后面的要替换50个0,怎么办啊
作者: ly5066113    时间: 2010-07-31 17:51
  1. $ echo "hello" | sed ':a         
  2. > s/$/0/
  3. > /0\{50\}/b
  4. > ta'
  5. hello00000000000000000000000000000000000000000000000000
复制代码

作者: expert1    时间: 2010-07-31 18:39
hehe,标签用的好
作者: saintdragon    时间: 2010-07-31 20:02
都是高手。路过学习中
作者: jiwang1980    时间: 2010-07-31 22:56
ly5066113 发表于 2010-07-31 17:51



    牛人哪~~~
作者: hantom    时间: 2010-08-01 12:49
回复 5# ly5066113


    能否解释下???




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2