homepage Welcome to WebmasterWorld Guest from 54.204.128.190
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
How to search All .php files for <?=//
Im tyring to do a server wide search for occourences of <?=//
gcarn




msg:3677031
 8:21 pm on Jun 17, 2008 (gmt 0)

I have just recently upgraded from php 4 to 5, and now have a syntax error, when i commented code after a start php echo..

All i want to do is search my /home dir for any file that has "<?=//" in it.

I thought that
grep -l -R "<?=//" /home > out.txt

would work, but it just hangs...

Any thoughts on howto accomplish this?

 

physics




msg:3677108
 9:31 pm on Jun 17, 2008 (gmt 0)

Maybe it's just taking too long?

Try


find ./ -name "*.php" xargs grep "<?=//" tee out.txt

Or better yet maybe fix it all in one go with perl (back up first, use at your own risk)


find ./ -name "*.php" xargs perl -i~ -wpe 's@\<\?=//@<?php //@g'

(repeat for .inc files)

physics




msg:3677160
 11:23 pm on Jun 17, 2008 (gmt 0)

Note that the pipe characters shown above are not actually pipes (they are changed by the WebmasterWorld software). To use the commands you need to copy and paste and then go back and put in real pipes.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved