I'm trying to overcome a limitation on our file structure. I want to grep a whole series of files in a known location. If I do a standard grep from command line
(grep -i searchpattern known_dir/s*.sql)
I get the following error:
ksh: /usr/bin/grep: 0403-027 The parameter list is too long.
so I have a little for loop that looks like:
searchfor=$1
for i in /$ENV_VAR_DIR/s*.sql
do
grep -i $searchfor $i
done
When I execute this I get a couple problems:
- it gives me the line of code but no file name I need both
-l
obviously gives me just the path/filename I want to trim the path off I am just executing from my home directory.