Where can I ask a Unix/grep question?
I saw a forum for Linux, but not Unix. I have a question regarding grep. Please move me if necessary.
The grep I am using is GNU utilities for Win32 and I am using it to search my legacy ASP files for CreateObject. Most of the ASP files I've converted to .NET, but some remain. We are moving from a hosting company to our own servers and I need to make sure all the 3rd-party software that my web application interfaces with will be available for the ASP pages.
There are tons of CreateObject ADODB.Connection. I don't care about these. So can I pipe the output of grep into another grep and say exclude ADODB.Connection? I tried this,
grep CreateObject *.asp | grep -L ADODB
which returned
grep: writing output: Invalid Argument
Thanks for any help.
Re: Where can I ask a Unix/grep question?
I would post in the Linux Forum. The Grep command is in Linux too !
Re: Where can I ask a Unix/grep question?
Quote:
Originally Posted by
MMock
I saw a forum for Linux, but not Unix. I have a question regarding grep. Please move me if necessary.
The grep I am using is GNU utilities for Win32 and I am using it to search my legacy ASP files for CreateObject. Most of the ASP files I've converted to .NET, but some remain. We are moving from a hosting company to our own servers and I need to make sure all the 3rd-party software that my web application interfaces with will be available for the ASP pages.
There are tons of CreateObject ADODB.Connection. I don't care about these. So can I pipe the output of grep into another grep and say exclude ADODB.Connection? I tried this,
grep CreateObject *.asp | grep -L ADODB
which returned
grep: writing output: Invalid Argument
Thanks for any help.
I know very little about grep, but the grep on Unix does not accept an Upper case "L". :o
Re: Where can I ask a Unix/grep question?
It's not true UNIX grep. I got that switch from doing a "grep --help".
Re: Where can I ask a Unix/grep question?
Quote:
Originally Posted by
MMock
It's not true UNIX grep. I got that switch from doing a "grep --help".
In Unix, I would do this
PHP Code:
for i in $(find ./ -type f | grep sql$); do grep -l CreateObject $i; done
Logically in Windows, you would have to write a Windows Script to do this.
Another option I can suggest is using Notepad++ to search through your files, if that's what you want to do. This is a freeware utility.
Re: Where can I ask a Unix/grep question?
Re: Where can I ask a Unix/grep question?
In GNU grep, the -v parameter inverts the match...
Code:
grep "CreateObject" *.asp | grep -v "ADODB"