Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-29-2010, 02:23 PM   #16
LQ Newbie
Registered: Jul 2010
Posts: 13

Original Poster
Rep: Reputation: 0

Can you look at all the code pls. Because it gives same error again:
while read string1
find /path -type f -exec sed -i "s/${string1}|string2|/string2/g" '{}' \;
done < string1.txt
All i want to do is searching the path, and if the files contains the expression (expressions in string1.txt) then replace them with string2


Oh silly me, just replaced this
find /path -type f -exec sed -i "s|${string1}|string2|" '{}'\;
and worked fine. Everybody thanx all

Last edited by xndd; 07-29-2010 at 02:34 PM.
Old 07-29-2010, 02:40 PM   #17
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Good work


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching .txt file for (specific) strings and printing them to new file Hb_Kai Linux - General 7 02-18-2010 09:09 AM
Python: replacing strings in a file tonya11en Programming 2 05-19-2009 06:52 PM
searching contents of .class file within jar (for strings) wakeboarder3780 Linux - Newbie 4 02-17-2009 01:49 PM
replacing strings in many files using tcsh mcbenus Linux - Software 5 03-03-2008 05:50 PM
Searching files for strings tmoorman Linux - Software 4 01-08-2004 01:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration