Actually if the strings you mentioned in the file are literal strings, you can use:
sed "s/abdfggg/opsmsdd/g" file_1 > file2 sed will output every line of file_1 into file_2 and if it finds abdfggg, changing every occurrence of abdfggg with opsmsddd. The command reads something like "substitute abdfggg with opsmsddd globally" the "globally" part means every occurrence within the line. If you leave the "g" off, it will only change the first occurrence it finds in each line. The thing to note is that it will output every line regardless of whether or not it contains abdfggg, and if it does, it will change it. There are ways to change this behavior, but that requires reading the man page or other books on sed. Thanks, Rick Carroll Operations Engineer SocketWare 404-815-1998 ext. 23 [EMAIL PROTECTED] -----Original Message----- From: Jianping Zhu [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 8:46 AM To: [EMAIL PROTECTED] Subject: RE: how to substutue string in a text file Thanks. but a little confused by your advice can u give more detail? Thanks On Mon, 13 Jan 2003, Rick Carroll wrote: > Use back-ticks `` (like single quotes in the opposite direction) around your >command. > Example MYVAR=`grep foo bar` > > This redirects the standard out of a command into a variable. > > > Rick > > -----Original Message----- > From: Jianping Zhu [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 13, 2003 8:22 AM > To: [EMAIL PROTECTED] > Subject: how to substutue string in a text file > > > how to substutue string in a text file by using "gerp" or "find"? > > I have a text file, lof of "abdfggg" in that text file, i need to change > it to " opsmsdd ", is there a simple way to do that? > > Thanks > > > -------------------------------- > Jianping Zhu > Department of Computer Science > Univerity of Georgia > Athens, GA 30602 > Tel 706 5423900 > -------------------------------- > > > > -- > redhat-list mailing list > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe > https://listman.redhat.com/mailman/listinfo/redhat-list > > > > > -- > redhat-list mailing list > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe > https://listman.redhat.com/mailman/listinfo/redhat-list > -------------------------------- Jianping Zhu Department of Computer Science Univerity of Georgia Athens, GA 30602 Tel 706 5423900 -------------------------------- -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list