LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 07-29-2010, 03:23 PM   #16
xndd
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:
Code:
while read string1
do
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

Edit:

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

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

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Good work
 
  


Reply


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 10:09 AM
Python: replacing strings in a file tonya11en Programming 2 05-19-2009 07:52 PM
searching contents of .class file within jar (for strings) wakeboarder3780 Linux - Newbie 4 02-17-2009 02:49 PM
replacing strings in many files using tcsh mcbenus Linux - Software 5 03-03-2008 06:50 PM
Searching files for strings tmoorman Linux - Software 4 01-08-2004 02:46 PM


All times are GMT -5. The time now is 06:42 PM.

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