由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - question about sed
相关主题
UNIX command to双面打印
What's the quickest way to change various filenames with same format under unix?help on job control commands
question about lprwait on line: simple question
求平均值--unix commandHow to use the command history in SUN?
what's the use of "ta"group permission
my script Re: how would you do this?怎样用mail把某一文本文件发送给一个email地址?
bourne shell program Questionwhat is the problem? what can I do?
再次急问: *.tgz 文件怎么解?how to contral tar-ed file size?
相关话题的讨论汇总
话题: sed话题: oldstr话题: newstr话题: file话题: string
进入Unix版参与讨论
1 (共1页)
e****e
发帖数: 179
1
when I use sed to replace a string in a file, it only shows on the screen that
string has been changed, but when I open that file, it is still the same as
before.
the command I used is:
sed -e 's,oldstr,newstr,' filename
thanks.
c******r
发帖数: 38
2
You need output it to another file like:
sed -e 's,oldstr,newstr,' filename >filename1

【在 e****e 的大作中提到】
: when I use sed to replace a string in a file, it only shows on the screen that
: string has been changed, but when I open that file, it is still the same as
: before.
: the command I used is:
: sed -e 's,oldstr,newstr,' filename
: thanks.

t******q
发帖数: 117
3
sed -e 's/old/new/g'$nameold > $namenew
mv $namenew $namenew

【在 c******r 的大作中提到】
: You need output it to another file like:
: sed -e 's,oldstr,newstr,' filename >filename1

1 (共1页)
进入Unix版参与讨论
相关主题
how to contral tar-ed file size?what's the use of "ta"
HELP.my script Re: how would you do this?
Re: What's the quickest way to change various filenames with same formbourne shell program Question
what's wrong with gcc?再次急问: *.tgz 文件怎么解?
UNIX command to双面打印
What's the quickest way to change various filenames with same format under unix?help on job control commands
question about lprwait on line: simple question
求平均值--unix commandHow to use the command history in SUN?
相关话题的讨论汇总
话题: sed话题: oldstr话题: newstr话题: file话题: string