wejofost Posted September 25, 2010 Share Posted September 25, 2010 I have over 230 files plus 39 directories ( 3.5Mb ) in my public_html directory and I am looking for where I specified/declared the contents of a variable! I can't for the life of me remember in which web page/directory I set up the contents of that run time variable. ( It was three years ago! ) Can anyone advise me how find that data variable ( Its called $depositrules )? Quote Link to comment https://forums.phpfreaks.com/topic/214373-finding-lost-data-declarations/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 25, 2010 Share Posted September 25, 2010 Most programming editors (Notepad++ for example) have a way of searching through all the files and folders within a starting folder. Quote Link to comment https://forums.phpfreaks.com/topic/214373-finding-lost-data-declarations/#findComment-1115568 Share on other sites More sharing options...
wejofost Posted September 25, 2010 Author Share Posted September 25, 2010 Thank you for your reply. I fully understand that Text Editors can search a slected file for matching data but I have not yet come across a Text Editor that can open directories and search multiple files. The old Windows 2000 professional can search a whole series of directories for data strings within a whole series of files but I can't do that in Vista and Windows 7? Quote Link to comment https://forums.phpfreaks.com/topic/214373-finding-lost-data-declarations/#findComment-1115658 Share on other sites More sharing options...
roopurt18 Posted September 26, 2010 Share Posted September 26, 2010 Since you're using Windows, go get yourself UnixTools from sourceforge and use find and grep: If myVar is the variable you're looking for: find . -type f -name "*.php" -exec grep -il myvar {} \; That will list every file that contains: myvar (case insensitive). If you want to find assignments to myvar, this might get you there: find . -type f -name "*.php" -exec grep -ilE 'myvar[ ]*=' {} \; Best of luck. Quote Link to comment https://forums.phpfreaks.com/topic/214373-finding-lost-data-declarations/#findComment-1115768 Share on other sites More sharing options...
wejofost Posted September 26, 2010 Author Share Posted September 26, 2010 Thank you roopurt18. I last used UNIX 10 years ago! but I do remember that find with grep is a cunning bit of software. I have access to a HPUX system so I'll use that. Best regards. Wej Parry Quote Link to comment https://forums.phpfreaks.com/topic/214373-finding-lost-data-declarations/#findComment-1115777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.