Results 1 to 3 of 3
|
Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
-
10-26-2008 #1
- Join Date
- Oct 2008
- Posts
- 4
search file content and remove that line?
I have thousands of php scripts that need lines removed and i don't want to do this one by one.
-
10-26-2008 #2
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 747
Google is your friend.
http://www.linuxforums.org/forum/lin...tml#post577367
You should be able to do something suitable with that, although remember not to redirect the output directly back into your php file or it will get clobbered.
Let us know how you get on,
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
-
10-26-2008 #3
- Join Date
- Jun 2007
- Posts
- 318
If you have thousands of files to edit I would use the sed command with the -i option (edit files in place) within the find command. Something like this:
Code:find /path/to/files -maxdepth 1 -type f -name "*.php" -exec sed -i '/pattern/ d' {} \;